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C,EAAO,KAAK,KAAM,EAAK,EAC3B,CACA,OANA,UAAU,EAAgB,GAMnB,CACX,CARqB,CAQnB,EAAI,KAAK,eACX,EAAI,eAAiB,EAmBrB,IAAI,EAAa,SAAU,GAEvB,SAAS,EAAU,EAAK,QACR,IAAR,IAAkB,EAAM,QACX,IAAb,IAAuB,EAAW,MACtC,EAAO,KAAK,KAAM,EAAK,EAC3B,CACA,OANA,UAAU,EAAW,GAMd,CACX,CARgB,CAQd,EAAI,KAAK,eACX,EAAI,UAAY,CACnB,CAnLD,CAmLG,MAAQ,IAAM,CAAC","file":"/npm/ts-stl@0.9.3/lib/ts-stl.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/ts-stl@0.9.3/lib/ts-stl.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","var __extends = (this && this.__extends) || function (d, b) {\r\n    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\r\n    function __() { this.constructor = d; }\r\n    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n};\r\nvar std;\r\n(function (std) {\r\n    var base;\r\n    (function (base) {\r\n        /**\r\n         * <p> Bi-directional iterator. </p>\r\n         *\r\n         * <p> {@link Iterator Bidirectional iterators} are iterators that can be used to access the sequence of elements\r\n         * in a range in both directions (towards the end and towards the beginning). </p>\r\n         *\r\n         * <p> All {@link IArrayIterator random-access iterators} are also valid {@link Iterrator bidirectional iterators}.\r\n         * </p>\r\n         *\r\n         * <p> There is not a single type of {@link Iterator bidirectional iterator}: {@link IContainer Each container}\r\n         * may define its own specific iterator type able to iterate through it and access its elements. </p>\r\n         *\r\n         * <ul>\r\n         *\t<li> Reference: http://www.cplusplus.com/reference/iterator/BidirectionalIterator/ </li>\r\n         * </ul>\r\n         *\r\n         * @author Jeongho Nam <http://samchon.org>\r\n         */\r\n        var Iterator = (function () {\r\n            /* ---------------------------------------------------------\r\n                CONSTRUCTORS\r\n            --------------------------------------------------------- */\r\n            /**\r\n             * Construct from the source {@link IContainer container}.\r\n             *\r\n             * @param source The source\r\n             */\r\n            function Iterator(source) {\r\n                this.source_ = source;\r\n            }\r\n            /**\r\n             * Advances the {@link Iterator} by <i>n</i> element positions.\r\n             *\r\n             * @param n Number of element positions to advance.\r\n             * @return An advanced iterator.\r\n             */\r\n            Iterator.prototype.advance = function (n) {\r\n                var it = this;\r\n                var i;\r\n                if (n >= 0) {\r\n                    for (i = 0; i < n; i++)\r\n                        if (it.equal_to(this.source_.end()))\r\n                            return this.source_.end();\r\n                        else\r\n                            it = it.next();\r\n                }\r\n                else {\r\n                    n = n * -1;\r\n                    for (i = 0; i < n; i++)\r\n                        if (it.equal_to(this.source_.end()))\r\n                            return this.source_.end();\r\n                        else\r\n                            it = it.prev();\r\n                }\r\n                return it;\r\n            };\r\n            /* ---------------------------------------------------------\r\n                ACCESSORS\r\n            --------------------------------------------------------- */\r\n            /**\r\n             * Get source\r\n             */\r\n            Iterator.prototype.get_source = function () {\r\n                return this.source_;\r\n            };\r\n            /**\r\n             * <p> Whether an iterator is equal with the iterator. </p>\r\n             *\r\n             * <p> Compare two iterators and returns whether they are equal or not. </p>\r\n             *\r\n             * <h4> Note </h4>\r\n             * <p> Iterator's equal_to() only compare souce container and index number. </p>\r\n             *\r\n             * <p> Although elements in a pair, key and value are equal_to, if the source map or\r\n             * index number is different, then the {@link equal_to equal_to()} will return false. If you want to\r\n             * compare the elements of a pair, compare them directly by yourself. </p>\r\n             *\r\n             * @param obj An iterator to compare\r\n             * @return Indicates whether equal or not.\r\n             */\r\n            Iterator.prototype.equal_to = function (obj) {\r\n                return this.source_ == obj.source_;\r\n            };\r\n            Object.defineProperty(Iterator.prototype, \"value\", {\r\n                /**\r\n                 * <p> Get value of the iterator is pointing. </p>\r\n                 *\r\n                 * @return A value of the iterator.\r\n                 */\r\n                get: function () {\r\n                    throw new std.LogicError(\"Have to be overriden.\");\r\n                },\r\n                enumerable: true,\r\n                configurable: true\r\n            });\r\n            return Iterator;\r\n        }());\r\n        base.Iterator = Iterator;\r\n    })(base = std.base || (std.base = {}));\r\n})(std || (std = {}));\r\n/// <reference path=\"Iterator.ts\" />\r\nvar std;\r\n(function (std) {\r\n    var base;\r\n    (function (base) {\r\n        /**\r\n         * A reverse and bi-directional iterator. </p>\r\n         *\r\n         * @author Jeongho Nam <http://samchon.org>\r\n         */\r\n        var ReverseIterator = (function (_super) {\r\n            __extends(ReverseIterator, _super);\r\n            /* ---------------------------------------------------------------\r\n                CONSTRUCTORS\r\n            --------------------------------------------------------------- */\r\n            function ReverseIterator(iterator) {\r\n                _super.call(this, iterator.get_source());\r\n                this.iterator_ = iterator;\r\n            }\r\n            ReverseIterator.prototype.equal_to = function (obj) {\r\n                if (obj instanceof ReverseIterator) {\r\n                    return this.iterator_.equal_to(obj.iterator_);\r\n                }\r\n                else\r\n                    return this.iterator_.equal_to(obj);\r\n            };\r\n            Object.defineProperty(ReverseIterator.prototype, \"value\", {\r\n                /**\r\n                 * @inheritdoc\r\n                 */\r\n                get: function () {\r\n                    return this.iterator_.value;\r\n                },\r\n                enumerable: true,\r\n                configurable: true\r\n            });\r\n            ReverseIterator.prototype.swap = function (obj) {\r\n                if (obj instanceof ReverseIterator)\r\n                    this.iterator_.swap(obj.iterator_);\r\n                else\r\n                    this.iterator_.swap(obj);\r\n            };\r\n            return ReverseIterator;\r\n        }(base.Iterator));\r\n        base.ReverseIterator = ReverseIterator;\r\n    })(base = std.base || (std.base = {}));\r\n})(std || (std = {}));\r\n/// <reference path=\"base/Iterator.ts\" />\r\n/// <reference path=\"base/ReverseIterator.ts\" />\r\nvar std;\r\n(function (std) {\r\n    /**\r\n     * <p> Vector, the dynamic array. </p>\r\n     *\r\n     * <p> {@link Vector}s are sequence containers representing arrays that can change in size. </p>\r\n     *\r\n     * <p> Just like arrays, {@link Vector}s use contiguous storage locations for their elements, which means that\r\n     * their elements can also be accessed using offsets on regular pointers to its elements, and just as efficiently\r\n     * as in arrays. But unlike arrays, their size can change dynamically, with their storage being handled\r\n     * automatically by the  </p>\r\n     *\r\n     * <p> Internally, {@link Vector}s use a dynamically allocated array to store their elements. This array may need\r\n     * to be reallocated in order to grow in size when new elements are inserted, which implies allocating a new\r\n     * array and moving all elements to it. This is a relatively expensive task in terms of processing time, and\r\n     * thus, {@link Vector}s do not reallocate each time an element is added to the  </p>\r\n     *\r\n     * <p> Instead, {@link Vector} containers may allocate some extra storage to accommodate for possible growth, and\r\n     * thus the container may have an actual {@link capacity} greater than the storage strictly needed to contain its\r\n     * elements (i.e., its {@link size}). Libraries can implement different strategies for growth to balance between\r\n     * memory usage and reallocations, but in any case, reallocations should only happen at logarithmically growing\r\n     * intervals of {@link size} so that the insertion of individual elements at the end of the {@link Vector} can be\r\n     * provided with amortized constant time complexity (see {@link push_back push_back()}). </p>\r\n     *\r\n     * <p> Therefore, compared to arrays, {@link Vector}s consume more memory in exchange for the ability to manage\r\n     * storage and grow dynamically in an efficient way. </p>\r\n     *\r\n     * <p> Compared to the other dynamic sequence containers ({@link Deque}s, {@link List}s), {@link Vector Vectors}\r\n     * are very efficient accessing its elements (just like arrays) and relatively efficient adding or removing\r\n     * elements from its end. For operations that involve inserting or removing elements at positions other than the\r\n     * end, they perform worse than the others, and have less consistent iterators and references than {@link List}s.\r\n     * </p>\r\n     *\r\n     * <h3> Container properties </h3>\r\n     * <dl>\r\n     *\t<dt> Sequence </dt>\r\n     *\t<dd>\r\n     *\t\tElements in sequence containers are ordered in a strict linear sequence. Individual elements are\r\n     *\t\taccessed by their position in this sequence.\r\n     *\t</dd>\r\n     *\r\n     *\t<dt> Dynamic array </dt>\r\n     *\t<dd>\r\n     *\t\tAllows direct access to any element in the sequence, even through pointer arithmetics, and provides\r\n     *\t\trelatively fast addition/removal of elements at the end of the sequence.\r\n     *\t</dd>\r\n     * </dl>\r\n     *\r\n     * <ul>\r\n     *  <li> Reference: http://www.cplusplus.com/reference/vector/vector/\r\n     * </ul>\r\n     *\r\n     * @param <T> Type of the elements.\r\n     *\r\n     * @author Jeongho Nam <http://samchon.org>\r\n     */\r\n    var Vector = (function (_super) {\r\n        __extends(Vector, _super);\r\n        function Vector() {\r\n            var args = [];\r\n            for (var _i = 0; _i < arguments.length; _i++) {\r\n                args[_i - 0] = arguments[_i];\r\n            }\r\n            _super.call(this);\r\n            if (args.length == 0) {\r\n            }\r\n            if (args.length == 1 && args[0] instanceof Array) {\r\n                // CONSTRUCT FROM AN ARRAY OF ITEMS\r\n                var array = args[0];\r\n                this.push.apply(this, array);\r\n            }\r\n            else if (args.length == 1 && typeof args[0] == \"number\") {\r\n                // CONSTRUCT FROM SIZE\r\n                var size = args[0];\r\n                this.length = size;\r\n            }\r\n            else if (args.length == 2 && typeof args[0] == \"number\") {\r\n                // CONSTRUCT FROM SIZE AND REPEATING VALUE\r\n                var size = args[0];\r\n                var val = args[1];\r\n                this.assign(size, val);\r\n            }\r\n            else if (args.length == 1 && (args[0] instanceof Vector || args[0] instanceof std.base.Container)) {\r\n                // COPY CONSTRUCTOR\r\n                var container = args[0];\r\n                this.assign(container.begin(), container.end());\r\n            }\r\n            else if (args.length == 2 && args[0] instanceof std.base.Iterator && args[1] instanceof std.base.Iterator) {\r\n                // CONSTRUCT FROM INPUT ITERATORS\r\n                var begin = args[0];\r\n                var end = args[1];\r\n                this.assign(begin, end);\r\n            }\r\n        }\r\n        Object.defineProperty(Vector, \"iterator\", {\r\n            /**\r\n             * Type definition of {@link Vector}'s {@link VectorIterator iterator}.\r\n             */\r\n            get: function () { return VectorIterator; },\r\n            enumerable: true,\r\n            configurable: true\r\n        });\r\n        Vector.prototype.assign = function (first, second) {\r\n            this.clear();\r\n            if (first instanceof std.base.Iterator && second instanceof std.base.Iterator) {\r\n                var begin = first;\r\n                var end = second;\r\n                for (var it = begin; it.equal_to(end) == false; it = it.next())\r\n                    this.push(it.value);\r\n            }\r\n            else if (typeof first == \"number\") {\r\n                var size = first;\r\n                var val = second;\r\n                this.length = size;\r\n                for (var i = 0; i < size; i++)\r\n                    this[i] = val;\r\n            }\r\n        };\r\n        /**\r\n         * @inheritdoc\r\n         */\r\n        Vector.prototype.reserve = function (size) {\r\n        };\r\n        /**\r\n         * @inheritdoc\r\n         */\r\n        Vector.prototype.clear = function () {\r\n            this.erase(this.begin(), this.end());\r\n        };\r\n        /* =========================================================\r\n            ACCESSORS\r\n        ========================================================= */\r\n        /**\r\n         * @inheritdoc\r\n         */\r\n        Vector.prototype.begin = function () {\r\n            if (this.empty() == true)\r\n                return this.end();\r\n            else\r\n                return new VectorIterator(this, 0);\r\n        };\r\n        /**\r\n         * @inheritdoc\r\n         */\r\n        Vector.prototype.end = function () {\r\n            return new VectorIterator(this, -1);\r\n        };\r\n        /**\r\n         * @inheritdoc\r\n         */\r\n        Vector.prototype.rbegin = function () {\r\n            if (this.empty() == true)\r\n                return this.rend();\r\n            else\r\n                return new VectorReverseIterator(this.end().prev());\r\n        };\r\n        /**\r\n         * @inheritdoc\r\n         */\r\n        Vector.prototype.rend = function () {\r\n            return new VectorReverseIterator(this.end());\r\n        };\r\n        /**\r\n         * @inheritdoc\r\n         */\r\n        Vector.prototype.size = function () {\r\n            return this.length;\r\n        };\r\n        /**\r\n         * @inheritdoc\r\n         */\r\n        Vector.prototype.capacity = function () {\r\n            return this.length;\r\n        };\r\n        /**\r\n         * @inheritdoc\r\n         */\r\n        Vector.prototype.empty = function () {\r\n            return this.length == 0;\r\n        };\r\n        /**\r\n         * @inheritdoc\r\n         */\r\n        Vector.prototype.at = function (index) {\r\n            if (index < this.size())\r\n                return this[index];\r\n            else\r\n                throw new std.OutOfRange(\"Target index is greater than Vector's size.\");\r\n        };\r\n        /**\r\n         * @inheritdoc\r\n         */\r\n        Vector.prototype.set = function (index, val) {\r\n            if (index > this.length)\r\n                throw new std.OutOfRange(\"Target index is greater than Vector's size.\");\r\n            var prev = this[index];\r\n            this[index] = val;\r\n            return prev;\r\n        };\r\n        /**\r\n         * @inheritdoc\r\n         */\r\n        Vector.prototype.front = function () {\r\n            return this.at(0);\r\n        };\r\n        /**\r\n         * @inheritdoc\r\n         */\r\n        Vector.prototype.back = function () {\r\n            return this.at(this.length - 1);\r\n        };\r\n        /* ---------------------------------------------------------\r\n            ELEMENTS I/O\r\n        --------------------------------------------------------- */\r\n        /**\r\n         * @inheritdoc\r\n         */\r\n        Vector.prototype.push_back = function (val) {\r\n            this.push(val);\r\n        };\r\n        /**\r\n         * @inheritdoc\r\n         */\r\n        Vector.prototype.pop_back = function () {\r\n            this.erase(this.end().prev());\r\n        };\r\n        Vector.prototype.insert = function () {\r\n            var args = [];\r\n            for (var _i = 0; _i < arguments.length; _i++) {\r\n                args[_i - 0] = arguments[_i];\r\n            }\r\n            var position = args[0];\r\n            if (args.length == 2 && args[1] instanceof std.base.Iterator == false) {\r\n                var val = args[1];\r\n                return this.insert(position, 1, val);\r\n            }\r\n            else if (args.length == 3 && typeof args[1] == \"number\") {\r\n                var size = args[1];\r\n                var val = args[2];\r\n                var spliced = this.splice(position.index);\r\n                var inserts = [];\r\n                for (var i = 0; i < size; i++)\r\n                    inserts.push(val);\r\n                this.push.apply(this, inserts);\r\n                this.push.apply(this, spliced);\r\n                return new VectorIterator(this, position.index + inserts.length - 1);\r\n            }\r\n            else if (args.length == 3 && args[1] instanceof std.base.Iterator && args[2] instanceof std.base.Iterator) {\r\n                var myEnd = args[0];\r\n                var begin = args[1];\r\n                var end = args[2];\r\n                var spliced = this.splice(position.index);\r\n                var inserts = [];\r\n                for (var it = begin; it.equal_to(end) == false; it = it.next())\r\n                    inserts.push(it.value);\r\n                this.push.apply(this, spliced);\r\n                this.push.apply(this, inserts);\r\n                return new VectorIterator(this, myEnd.index + inserts.length - 1);\r\n            }\r\n            else\r\n                throw new std.InvalidArgument(\"invalid parameters.\");\r\n        };\r\n        Vector.prototype.erase = function (begin, end) {\r\n            if (end === void 0) { end = null; }\r\n            var startIndex = begin.index;\r\n            if (end == null)\r\n                this.splice(startIndex, 1);\r\n            else if (end.index == -1) {\r\n                this.splice(startIndex);\r\n                return this.end();\r\n            }\r\n            else\r\n                this.splice(startIndex, end.index - startIndex);\r\n            return new VectorIterator(this, startIndex);\r\n        };\r\n        /* ===============================================================\r\n            UTILITIES\r\n        =============================================================== */\r\n        /**\r\n         * @inheritdoc\r\n         */\r\n        Vector.prototype.swap = function (obj) {\r\n            var supplement = new Vector(this.begin(), this.end());\r\n            this.assign(obj.begin(), obj.end());\r\n            obj.assign(supplement.begin(), supplement.end());\r\n        };\r\n        return Vector;\r\n    }(Array));\r\n    std.Vector = Vector;\r\n    /**\r\n     * <p> An iterator of Vector. </p>\r\n     *\r\n     * @param <T> Type of the elements.\r\n     *\r\n     * @author Jeongho Nam <http://samchon.org>\r\n     */\r\n    var VectorIterator = (function (_super) {\r\n        __extends(VectorIterator, _super);\r\n        /* ---------------------------------------------------------\r\n            CONSTRUCTORS\r\n        --------------------------------------------------------- */\r\n        /**\r\n         * <p> Construct from the source {@link Vector container}. </p>\r\n         *\r\n         * <h4> Note </h4>\r\n         * <p> Do not create the iterator directly, by yourself. </p>\r\n         * <p> Use {@link Vector.begin begin()}, {@link Vector.end end()} in {@link Vector container} instead. </p>\r\n         *\r\n         * @param source The source {@link Vector container} to reference.\r\n         * @param index Sequence number of the element in the source {@link Vector}.\r\n         */\r\n        function VectorIterator(source, index) {\r\n            _super.call(this, source);\r\n            this.index_ = index;\r\n        }\r\n        Object.defineProperty(VectorIterator.prototype, \"vector\", {\r\n            /* ---------------------------------------------------------\r\n                ACCESSORS\r\n            --------------------------------------------------------- */\r\n            /**\r\n             * @hidden\r\n             */\r\n            get: function () {\r\n                return this.source_;\r\n            },\r\n            enumerable: true,\r\n            configurable: true\r\n        });\r\n        Object.defineProperty(VectorIterator.prototype, \"value\", {\r\n            /**\r\n             * @inheritdoc\r\n             */\r\n            get: function () {\r\n                return this.vector.at(this.index_);\r\n            },\r\n            /**\r\n             * Set value.\r\n             */\r\n            set: function (val) {\r\n                this.vector.set(this.index_, val);\r\n            },\r\n            enumerable: true,\r\n            configurable: true\r\n        });\r\n        /**\r\n         * <p> Whether an iterator is equal with the iterator. </p>\r\n         *\r\n         * <p> Compare two iterators and returns whether they are equal or not. </p>\r\n         *\r\n         * <h4> Note </h4>\r\n         * <p> Iterator's equal_to() only compare souce container and index number. </p>\r\n         *\r\n         * <p> Although elements in a pair, key and value are equal_to, if the source map or\r\n         * index number is different, then the {@link equal_to equal_to()} will return false. If you want to\r\n         * compare the elements of a pair, compare them directly by yourself. </p>\r\n         *\r\n         * @param obj An iterator to compare\r\n         * @return Indicates whether equal or not.\r\n         */\r\n        VectorIterator.prototype.equal_to = function (obj) {\r\n            return _super.prototype.equal_to.call(this, obj) && this.index_ == obj.index_;\r\n        };\r\n        Object.defineProperty(VectorIterator.prototype, \"index\", {\r\n            get: function () {\r\n                return this.index_;\r\n            },\r\n            enumerable: true,\r\n            configurable: true\r\n        });\r\n        /* ---------------------------------------------------------\r\n            MOVERS\r\n        --------------------------------------------------------- */\r\n        /**\r\n         * @inheritdoc\r\n         */\r\n        VectorIterator.prototype.prev = function () {\r\n            if (this.index_ == -1)\r\n                return new VectorIterator(this.vector, this.vector.size() - 1);\r\n            else if (this.index_ - 1 < 0)\r\n                return this.vector.end();\r\n            else\r\n                return new VectorIterator(this.vector, this.index_ - 1);\r\n        };\r\n        /**\r\n         * @inheritdoc\r\n         */\r\n        VectorIterator.prototype.next = function () {\r\n            if (this.index_ >= this.source_.size() - 1)\r\n                return this.vector.end();\r\n            else\r\n                return new VectorIterator(this.vector, this.index_ + 1);\r\n        };\r\n        /**\r\n         * @inheritdoc\r\n         */\r\n        VectorIterator.prototype.advance = function (n) {\r\n            var newIndex = this.index_ + n;\r\n            if (newIndex < 0 || newIndex >= this.vector.size())\r\n                return this.vector.end();\r\n            else\r\n                return new VectorIterator(this.vector, newIndex);\r\n        };\r\n        /**\r\n         * @inheritdoc\r\n         */\r\n        VectorIterator.prototype.swap = function (obj) {\r\n            _a = [obj.value, this.value], this.value = _a[0], obj.value = _a[1];\r\n            var _a;\r\n        };\r\n        return VectorIterator;\r\n    }(std.base.Iterator));\r\n    std.VectorIterator = VectorIterator;\r\n    /**\r\n     * <p> A reverse-iterator of Vector. </p>\r\n     *\r\n     * @param <T> Type of the elements.\r\n     *\r\n     * @author Jeongho Nam <http://samchon.org>\r\n     */\r\n    var VectorReverseIterator = (function (_super) {\r\n        __extends(VectorReverseIterator, _super);\r\n        /* ---------------------------------------------------------\r\n            CONSTRUCTORS\r\n        --------------------------------------------------------- */\r\n        function VectorReverseIterator(iterator) {\r\n            _super.call(this, iterator);\r\n        }\r\n        Object.defineProperty(VectorReverseIterator.prototype, \"vector_iterator\", {\r\n            /* ---------------------------------------------------------\r\n                ACCESSORS\r\n            --------------------------------------------------------- */\r\n            /**\r\n             * @hidden\r\n             */\r\n            get: function () {\r\n                return this.iterator_;\r\n            },\r\n            enumerable: true,\r\n            configurable: true\r\n        });\r\n        Object.defineProperty(VectorReverseIterator.prototype, \"index\", {\r\n            get: function () {\r\n                return this.vector_iterator.index;\r\n            },\r\n            enumerable: true,\r\n            configurable: true\r\n        });\r\n        Object.defineProperty(VectorReverseIterator.prototype, \"value\", {\r\n            set: function (val) {\r\n                this.vector_iterator.value = val;\r\n            },\r\n            enumerable: true,\r\n            configurable: true\r\n        });\r\n        /* ---------------------------------------------------------\r\n            MOVERS\r\n        --------------------------------------------------------- */\r\n        /**\r\n         * @inheritdoc\r\n         */\r\n        VectorReverseIterator.prototype.prev = function () {\r\n            return new VectorReverseIterator(this.vector_iterator.next());\r\n        };\r\n        /**\r\n         * @inheritdoc\r\n         */\r\n        VectorReverseIterator.prototype.next = function () {\r\n            return new VectorReverseIterator(this.vector_iterator.prev());\r\n        };\r\n        /**\r\n         * @inheritdoc\r\n         */\r\n        VectorReverseIterator.prototype.advance = function (n) {\r\n            var iterator = this.vector_iterator.advance(-1 * n);\r\n            return new VectorReverseIterator(iterator);\r\n        };\r\n        return VectorReverseIterator;\r\n    }(std.base.ReverseIterator));\r\n    std.VectorReverseIterator = VectorReverseIterator;\r\n})(std || (std = {}));\r\nvar std;\r\n(function (std) {\r\n    var base;\r\n    (function (base) {\r\n        /**\r\n         * <p> An abstract  </p>\r\n         *\r\n         * <h3> Container properties </h3>\r\n         * <dl>\r\n         * \t<dt> Sequence </dt>\r\n         * \t<dd> Elements in sequence containers are ordered in a strict linear sequence. Individual elements are\r\n         *\t\t accessed by their position in this sequence. </dd>\r\n         *\r\n         * \t<dt> Doubly-linked list </dt>\r\n         *\t<dd> Each element keeps information on how to locate the next and the previous elements, allowing\r\n         *\t\t constant time insert and erase operations before or after a specific element (even of entire ranges),\r\n         *\t\t but no direct random access. </dd>\r\n         * </dl>\r\n         *\r\n         * @param <T> Type of elements.\r\n         *\r\n         * @author Jeongho Nam <http://samchon.org>\r\n         */\r\n        var Container = (function () {\r\n            function Container() {\r\n                var args = [];\r\n                for (var _i = 0; _i < arguments.length; _i++) {\r\n                    args[_i - 0] = arguments[_i];\r\n                }\r\n                // THIS IS ABSTRACT CLASS\r\n                // NOTHING TO DO ESPECIALLY\r\n            }\r\n            /**\r\n             * @inheritdoc\r\n             */\r\n            Container.prototype.clear = function () {\r\n                this.erase(this.begin(), this.end());\r\n            };\r\n            /**\r\n             * @inheritdoc\r\n             */\r\n            Container.prototype.empty = function () {\r\n                return this.size() == 0;\r\n            };\r\n            /* ===============================================================\r\n                UTILITIES\r\n            =============================================================== */\r\n            /**\r\n             * @inheritdoc\r\n             */\r\n            Container.prototype.swap = function (obj) {\r\n                var supplement = new std.Vector(this.begin(), this.end());\r\n                this.assign(obj.begin(), obj.end());\r\n                obj.assign(supplement.begin(), supplement.end());\r\n            };\r\n            return Container;\r\n        }());\r\n        base.Container = Container;\r\n    })(base = std.base || (std.base = {}));\r\n})(std || (std = {}));\r\n/// <reference path=\"base/Container.ts\" />\r\n/// <reference path=\"base/Iterator.ts\" />\r\n/// <reference path=\"base/ReverseIterator.ts\" />\r\nvar std;\r\n(function (std) {\r\n    /**\r\n     * <p> Double ended queue. </p>\r\n     *\r\n     * <p> {@link Deque} (usually pronounced like \"<i>deck</i>\") is an irregular acronym of\r\n     * <b>d</b>ouble-<b>e</b>nded <b>q</b>ueue. Double-ended queues are sequence containers with dynamic\r\n     * sizes that can be expanded or contracted on both ends (either its front or its back). </p>\r\n     *\r\n     * <p> Specific libraries may implement deques in different ways, generally as some form of dynamic\r\n     * array. But in any case, they allow for the individual elements to be accessed directly through\r\n     * random access iterators, with storage handled automatically by expanding and contracting the\r\n     * container as needed. </p>\r\n     *\r\n     * <p> Therefore, they provide a functionality similar to vectors, but with efficient insertion and\r\n     * deletion of elements also at the beginning of the sequence, and not only at its end. But, unlike\r\n     * {@link Vector}s, {@link Deque}s are not guaranteed to store all its elements in contiguous storage\r\n     * locations: accessing elements in a <u>deque</u> by offsetting a pointer to another element causes\r\n     * undefined behavior. </p>\r\n     *\r\n     * <p> Both {@link Vector}s and {@link Deque}s provide a very similar interface and can be used for\r\n     * similar purposes, but internally both work in quite different ways: While {@link Vector}s use a\r\n     * single array that needs to be occasionally reallocated for growth, the elements of a {@link Deque}\r\n     * can be scattered in different chunks of storage, with the container keeping the necessary information\r\n     * internally to provide direct access to any of its elements in constant time and with a uniform\r\n     * sequential interface (through iterators). Therefore, {@link Deque}s are a little more complex\r\n     * internally than {@link Vector}s, but this allows them to grow more efficiently under certain\r\n     * circumstances, especially with very long sequences, where reallocations become more expensive. </p>\r\n     *\r\n     * <p> For operations that involve frequent insertion or removals of elements at positions other than\r\n     * the beginning or the end, {@link Deque}s perform worse and have less consistent iterators and\r\n     * references than {@link List}s. </p>\r\n     *\r\n     * <h3> Container properties </h3>\r\n     * <dl>\r\n     *\t<dt> Sequence </dt>\r\n     *\t<dd> Elements in sequence containers are ordered in a strict linear sequence. Individual elements\r\n     *\t\t are accessed by their position in this sequence. </dd>\r\n     *\r\n     *\t<dt> Dynamic array </dt>\r\n     *\t<dd> Generally implemented as a dynamic array, it allows direct access to any element in the\r\n     *\t\t sequence and provides relatively fast addition/removal of elements at the beginning or the end\r\n     *\t\t of the sequence. </dd>\r\n     * </dl>\r\n     *\r\n     * <ul>\r\n     *  <li> Reference: http://www.cplusplus.com/reference/deque/deque/ </li>\r\n     * </ul>\r\n     *\r\n     * @param <T> Type of the elements.\r\n     *\r\n     * @author Jeongho Nam <http://samchon.org>\r\n     */\r\n    var Deque = (function (_super) {\r\n        __extends(Deque, _super);\r\n        function Deque() {\r\n            var args = [];\r\n            for (var _i = 0; _i < arguments.length; _i++) {\r\n                args[_i - 0] = arguments[_i];\r\n            }\r\n            _super.call(this);\r\n            if (args.length == 0) {\r\n                this.clear();\r\n            }\r\n            if (args.length == 1 && args[0] instanceof Array) {\r\n                var array = args[0];\r\n                this.clear();\r\n                this.push.apply(this, array);\r\n            }\r\n            else if (args.length == 1 && args[0] instanceof std.base.Container) {\r\n                var container = args[0];\r\n                this.assign(container.begin(), container.end());\r\n            }\r\n            else if (args.length == 2 &&\r\n                args[0] instanceof std.base.Iterator && args[1] instanceof std.base.Iterator) {\r\n                var begin = args[0];\r\n                var end = args[1];\r\n                this.assign(begin, end);\r\n            }\r\n        }\r\n        Object.defineProperty(Deque, \"iterator\", {\r\n            /**\r\n             * Type definition of {@link Deque}'s {@link DequeIterator iterator}.\r\n             */\r\n            get: function () { return DequeIterator; },\r\n            enumerable: true,\r\n            configurable: true\r\n        });\r\n        Object.defineProperty(Deque, \"ROW\", {\r\n            /**\r\n             * <p> Row size of the {@link matrix_ matrix} which contains elements. </p>\r\n             *\r\n             * <p> Note that the {@link ROW} affects on time complexity of accessing and inserting element.\r\n             * Accessing element is {@link ROW} times slower than ordinary {@link Vector} and inserting element\r\n             * in middle position is {@link ROW} times faster than ordinary {@link Vector}. </p>\r\n             *\r\n             * <p> When the {@link ROW} returns 8, time complexity of accessing element is O(8) and inserting\r\n             * element in middle position is O(N/8). ({@link Vector}'s time complexity of accessement is O(1)\r\n             * and inserting element is O(N)). </p>\r\n             */\r\n            get: function () { return 8; },\r\n            enumerable: true,\r\n            configurable: true\r\n        });\r\n        Object.defineProperty(Deque, \"MIN_CAPACITY\", {\r\n            /**\r\n             * <p> Minimum {@link capacity}. </p>\r\n             *\r\n             * <p> Although a {@link Deque} has few elements, even no element is belonged to, the {@link Deque}\r\n             * keeps the minimum {@link capacity} at least. </p>\r\n             */\r\n            get: function () { return 100; },\r\n            enumerable: true,\r\n            configurable: true\r\n        });\r\n        /**\r\n         * Get column size; {@link capacity_ capacity} / {@link ROW row}.\r\n         */\r\n        Deque.prototype.get_col_size = function () {\r\n            return Math.floor(this.capacity_ / Deque.ROW);\r\n        };\r\n        Deque.prototype.assign = function (first, second) {\r\n            // CLEAR PREVIOUS CONTENTS\r\n            this.clear();\r\n            if (first instanceof std.base.Iterator && second instanceof std.base.Iterator) {\r\n                var begin = first;\r\n                var end = second;\r\n                var size = 0;\r\n                for (var it = begin; !it.equal_to(end); it = it.next())\r\n                    size++;\r\n                // RESERVE\r\n                this.reserve(size);\r\n                this.size_ = size;\r\n                // ASSIGN CONTENTS\r\n                var array = this.matrix_[0];\r\n                for (var it = begin; !it.equal_to(end); it = it.next()) {\r\n                    if (array.length >= this.get_col_size()) {\r\n                        array = new Array();\r\n                        this.matrix_.push(array);\r\n                    }\r\n                    array.push(it.value);\r\n                }\r\n            }\r\n            else {\r\n                var size = first;\r\n                var val = second;\r\n                // RESERVE\r\n                this.reserve(size);\r\n                this.size_ = size;\r\n                // ASSIGN CONTENTS\r\n                var array = this.matrix_[0];\r\n                for (var i = 0; i < size; i++) {\r\n                    if (array.length >= this.get_col_size()) {\r\n                        array = new Array();\r\n                        this.matrix_.push(array);\r\n                    }\r\n                    array.push(val);\r\n                }\r\n            }\r\n        };\r\n        /**\r\n         * @inheritdoc\r\n         */\r\n        Deque.prototype.reserve = function (capacity) {\r\n            var prevMatrix = this.matrix_;\r\n            var prevSize = this.size_;\r\n            this.clear();\r\n            // RESERVE\r\n            this.size_ = prevSize;\r\n            var array = this.matrix_[0];\r\n            for (var i = 0; i < prevMatrix.length; i++)\r\n                for (var j = 0; j < prevMatrix[i].length; j++) {\r\n                    if (array.length >= this.get_col_size()) {\r\n                        array = new Array();\r\n                        this.matrix_.push(array);\r\n                    }\r\n                    array.push(prevMatrix[i][j]);\r\n                }\r\n        };\r\n        /**\r\n         * @inheritdoc\r\n         */\r\n        Deque.prototype.clear = function () {\r\n            this.matrix_ = new Array();\r\n            this.matrix_.push(new Array());\r\n            this.size_ = 0;\r\n            this.capacity_ = Deque.MIN_CAPACITY;\r\n        };\r\n        /* =========================================================\r\n            ACCESSORS\r\n                - GETTERS & SETTERS\r\n                - ITERATORS\r\n        ========================================================= */\r\n        /**\r\n         * @inheritdoc\r\n         */\r\n        Deque.prototype.begin = function () {\r\n            if (this.empty() == true)\r\n                return this.end();\r\n            else\r\n                return new DequeIterator(this, 0);\r\n        };\r\n        /**\r\n         * @inheritdoc\r\n         */\r\n        Deque.prototype.end = function () {\r\n            return new DequeIterator(this, -1);\r\n        };\r\n        /**\r\n         * @inheritdoc\r\n         */\r\n        Deque.prototype.rbegin = function () {\r\n            if (this.empty() == true)\r\n                return this.rend();\r\n            else\r\n                return new DequeReverseIterator(this.end().prev());\r\n        };\r\n        /**\r\n         * @inheritdoc\r\n         */\r\n        Deque.prototype.rend = function () {\r\n            return new DequeReverseIterator(this.end());\r\n        };\r\n        /**\r\n         * @inheritdoc\r\n         */\r\n        Deque.prototype.size = function () {\r\n            return this.size_;\r\n        };\r\n        /**\r\n         * @inheritdoc\r\n         */\r\n        Deque.prototype.capacity = function () {\r\n            return this.capacity_;\r\n        };\r\n        /**\r\n         * @inheritdoc\r\n         */\r\n        Deque.prototype.at = function (index) {\r\n            if (index > this.size())\r\n                throw new std.OutOfRange(\"Target index is greater than Deque's size.\");\r\n            var indexPair = this.fetch_index(index);\r\n            return this.matrix_[indexPair.first][indexPair.second];\r\n        };\r\n        /**\r\n         * @inheritdoc\r\n         */\r\n        Deque.prototype.set = function (index, val) {\r\n            if (index > this.size())\r\n                throw new std.OutOfRange(\"Target index is greater than Deque's size.\");\r\n            var indexPair = this.fetch_index(index);\r\n            this.matrix_[indexPair.first][indexPair.second] = val;\r\n        };\r\n        /**\r\n         * @inheritdoc\r\n         */\r\n        Deque.prototype.front = function () {\r\n            return this.matrix_[0][0];\r\n        };\r\n        /**\r\n         * @inheritdoc\r\n         */\r\n        Deque.prototype.back = function () {\r\n            var lastArray = this.matrix_[this.matrix_.length - 1];\r\n            return lastArray[lastArray.length - 1];\r\n        };\r\n        /**\r\n         * <p> Fetch row and column's index. </p>\r\n         *\r\n         * <p> Fetches index of row and column of {@link matrix_} from sequence number. </p>\r\n         *\r\n         * @param index Sequence number\r\n         */\r\n        Deque.prototype.fetch_index = function (index) {\r\n            var row;\r\n            for (row = 0; row < this.matrix_.length; row++) {\r\n                var array = this.matrix_[row];\r\n                if (index < array.length)\r\n                    break;\r\n                index -= array.length;\r\n            }\r\n            if (row == this.matrix_.length)\r\n                row--;\r\n            return new std.Pair(row, index);\r\n        };\r\n        /* =========================================================\r\n            ELEMENTS I/O\r\n                - PUSH & POP\r\n                - INSERT\r\n                - ERASE\r\n        ============================================================\r\n            PUSH & POP\r\n        --------------------------------------------------------- */\r\n        /**\r\n         * @inheritdoc\r\n         */\r\n        Deque.prototype.push = function () {\r\n            var items = [];\r\n            for (var _i = 0; _i < arguments.length; _i++) {\r\n                items[_i - 0] = arguments[_i];\r\n            }\r\n            if (this.size_ + items.length > this.capacity_)\r\n                this.reserve(this.size_ + items.length);\r\n            var array = this.matrix_[this.matrix_.length - 1];\r\n            for (var i = 0; i < items.length; i++) {\r\n                if (array.length >= this.get_col_size()) {\r\n                    array = new Array();\r\n                    this.matrix_.push(array);\r\n                }\r\n                array.push(items[i]);\r\n            }\r\n            this.size_ += items.length;\r\n            return this.size_;\r\n        };\r\n        /**\r\n         * @inheritdoc\r\n         */\r\n        Deque.prototype.push_front = function (val) {\r\n            // INSERT TO THE FRONT\r\n            this.matrix_[0].unshift(val);\r\n            this.size_++;\r\n            if (this.size_ > this.capacity_)\r\n                this.reserve(this.size_ * 2);\r\n        };\r\n        /**\r\n         * @inheritdoc\r\n         */\r\n        Deque.prototype.push_back = function (val) {\r\n            var lastArray = this.matrix_[this.matrix_.length - 1];\r\n            if (lastArray.length >= this.get_col_size() && this.matrix_.length < Deque.ROW) {\r\n                lastArray = new Array();\r\n                this.matrix_.push(lastArray);\r\n            }\r\n            lastArray.push(val);\r\n            this.size_++;\r\n            if (this.size_ > this.capacity_)\r\n                this.reserve(this.size_ * 2);\r\n        };\r\n        /**\r\n         * @inheritdoc\r\n         */\r\n        Deque.prototype.pop_front = function () {\r\n            if (this.empty() == true)\r\n                return; // SOMEWHERE PLACE TO THROW EXCEPTION\r\n            this.matrix_[0].shift();\r\n            this.size_--;\r\n            if (this.matrix_[0].length == 0)\r\n                this.matrix_.shift();\r\n        };\r\n        /**\r\n         * @inheritdoc\r\n         */\r\n        Deque.prototype.pop_back = function () {\r\n            if (this.empty() == true)\r\n                return; // SOMEWHERE PLACE TO THROW EXCEPTION\r\n            var lastArray = this.matrix_[this.matrix_.length - 1];\r\n            lastArray.splice(lastArray.length - 1, 1);\r\n            this.size_--;\r\n            if (lastArray.length == 0)\r\n                this.matrix_.splice(this.matrix_.length - 1, 1);\r\n        };\r\n        Deque.prototype.insert = function (position) {\r\n            var args = [];\r\n            for (var _i = 1; _i < arguments.length; _i++) {\r\n                args[_i - 1] = arguments[_i];\r\n            }\r\n            var items = [];\r\n            if (args.length == 1) {\r\n                var val = args[0];\r\n                items.push(val);\r\n            }\r\n            else if (args.length == 2 && typeof args[0] == \"number\") {\r\n                var n = args[0];\r\n                var val = args[1];\r\n                for (var i = 0; i < n; i++)\r\n                    items.push(val);\r\n            }\r\n            else if (args.length == 2 && args[0] instanceof std.base.Iterator && args[1] instanceof std.base.Iterator) {\r\n                var begin = args[0];\r\n                var end = args[1];\r\n                for (var it = begin; !it.equal_to(end); it = it.next())\r\n                    items.push(it.value);\r\n            }\r\n            // -----------------------------------------------------\r\n            // INSERT ITEMS\r\n            // -----------------------------------------------------\r\n            // INSERTS CAREFULLY\r\n            if (position.equal_to(this.end()) == true) {\r\n                // WHEN INSERTS TO THE BACK SIDE\r\n                this.push.apply(this, items);\r\n                return;\r\n            }\r\n            this.size_ += items.length;\r\n            if (this.size_ <= this.capacity_) {\r\n                // ------------------------------------------------------\r\n                // WHEN FITTING INTO RESERVED CAPACITY IS POSSIBLE\r\n                // ------------------------------------------------------\r\n                // INSERTS CAREFULLY CONSIDERING THE COL_SIZE\r\n                var indexPair = this.fetch_index(position.index);\r\n                var index = indexPair.first;\r\n                var splicedValues = this.matrix_[index].splice(indexPair.second);\r\n                if (splicedValues.length != 0)\r\n                    items = items.concat.apply(items, splicedValues);\r\n                if (this.matrix_[index].length < Deque.ROW) {\r\n                    this.matrix_[index] =\r\n                        (_a = this.matrix_[index]).concat.apply(_a, items.splice(0, Deque.ROW - this.matrix_[index].length));\r\n                }\r\n                var splicedArray = this.matrix_.splice(index + 1);\r\n                // INSERTS\r\n                while (items.length != 0)\r\n                    this.matrix_.push(items.splice(0, Math.min(Deque.ROW, items.length)));\r\n                // CONCAT WITH BACKS\r\n                this.matrix_ = (_b = this.matrix_).concat.apply(_b, splicedArray);\r\n            }\r\n            else {\r\n                // -----------------------------------------------------\r\n                // WHEN CANNOT BE FIT INTO THE RESERVED CAPACITY\r\n                // -----------------------------------------------------\r\n                // JUST INSERT CARELESSLY\r\n                // AND KEEP BLANACE BY THE RESERVE() METHOD\r\n                if (position.equal_to(this.end()) == true) {\r\n                    this.matrix_.push(items); // ALL TO THE LAST\r\n                }\r\n                else {\r\n                    var indexPair = this.fetch_index(position.index);\r\n                    var index = indexPair.first;\r\n                    var splicedValues = this.matrix_[index].splice(indexPair.second);\r\n                    if (splicedValues.length != 0)\r\n                        items = items.concat.apply(items, splicedValues);\r\n                    // ALL TO THE MIDDLE\r\n                    this.matrix_[index] = (_c = this.matrix_[index]).concat.apply(_c, items);\r\n                }\r\n                // AND KEEP BALANCE BY RESERVE()\r\n                this.reserve(this.size_);\r\n            }\r\n            return position;\r\n            var _a, _b, _c;\r\n        };\r\n        Deque.prototype.erase = function (begin, end) {\r\n            if (end === void 0) { end = null; }\r\n            if (end == null)\r\n                end = begin.next();\r\n            var index = begin.index;\r\n            var size = end.index - index;\r\n            this.size_ -= size;\r\n            while (size != 0) {\r\n                var indexPair = this.fetch_index(index);\r\n                var array = this.matrix_[indexPair.first];\r\n                var myDeleteSize = Math.min(size, array.length - indexPair.second);\r\n                array.splice(indexPair.second, myDeleteSize);\r\n                if (array.length == 0)\r\n                    this.matrix_.splice(indexPair.first, 1);\r\n                size -= myDeleteSize;\r\n            }\r\n            return begin;\r\n        };\r\n        /* ===============================================================\r\n            UTILITIES\r\n        =============================================================== */\r\n        /**\r\n         * @inheritdoc\r\n         */\r\n        Deque.prototype.swap = function (obj) {\r\n            if (obj instanceof Deque)\r\n                this.swap_deque(obj);\r\n            else\r\n                _super.prototype.swap.call(this, obj);\r\n        };\r\n        /**\r\n         * @hidden\r\n         */\r\n        Deque.prototype.swap_deque = function (obj) {\r\n            _a = [obj.matrix_, this.matrix_], this.matrix_ = _a[0], obj.matrix_ = _a[1];\r\n            _b = [obj.size_, this.size_], this.size_ = _b[0], obj.size_ = _b[1];\r\n            _c = [obj.capacity_, this.capacity_], this.capacity_ = _c[0], obj.capacity_ = _c[1];\r\n            var _a, _b, _c;\r\n        };\r\n        return Deque;\r\n    }(std.base.Container));\r\n    std.Deque = Deque;\r\n    /**\r\n     * An iterator of {@link Deque}.\r\n     *\r\n     * @author Jeongho Nam <http://samchon.org>\r\n     */\r\n    var DequeIterator = (function (_super) {\r\n        __extends(DequeIterator, _super);\r\n        /* ---------------------------------------------------------\r\n            CONSTRUCTORS\r\n        --------------------------------------------------------- */\r\n        /**\r\n         * <p> Construct from the source {@link Deque container}. </p>\r\n         *\r\n         * <h4> Note </h4>\r\n         * <p> Do not create the iterator directly, by yourself. </p>\r\n         * <p> Use {@link Deque.begin begin()}, {@link Deque.end end()} in {@link Deque container} instead. </p>\r\n         *\r\n         * @param source The source {@link Deque container} to reference.\r\n         * @param index Sequence number of the element in the source {@link Deque}.\r\n         */\r\n        function DequeIterator(source, index) {\r\n            _super.call(this, source);\r\n            this.index_ = index;\r\n        }\r\n        Object.defineProperty(DequeIterator.prototype, \"deque\", {\r\n            get: function () { return this.source_; },\r\n            enumerable: true,\r\n            configurable: true\r\n        });\r\n        Object.defineProperty(DequeIterator.prototype, \"value\", {\r\n            /* ---------------------------------------------------------\r\n                ACCESSORS\r\n            --------------------------------------------------------- */\r\n            /**\r\n             * @inheritdoc\r\n             */\r\n            get: function () {\r\n                return this.deque.at(this.index_);\r\n            },\r\n            set: function (val) {\r\n                this.deque.set(this.index_, val);\r\n            },\r\n            enumerable: true,\r\n            configurable: true\r\n        });\r\n        /**\r\n         * <p> Whether an iterator is equal with the iterator. </p>\r\n         *\r\n         * <p> Compare two iterators and returns whether they are equal or not. </p>\r\n         *\r\n         * <h4> Note </h4>\r\n         * <p> Iterator's equal_to() only compare souce container and index number. </p>\r\n         *\r\n         * <p> Although elements in a pair, key and value are equal_to, if the source map or\r\n         * index number is different, then the {@link equal_to equal_to()} will return false. If you want to\r\n         * compare the elements of a pair, compare them directly by yourself. </p>\r\n         *\r\n         * @param obj An iterator to compare\r\n         * @return Indicates whether equal or not.\r\n         */\r\n        DequeIterator.prototype.equal_to = function (obj) {\r\n            return _super.prototype.equal_to.call(this, obj) && this.index_ == obj.index_;\r\n        };\r\n        Object.defineProperty(DequeIterator.prototype, \"index\", {\r\n            /**\r\n             * @inheritdoc\r\n             */\r\n            get: function () {\r\n                return this.index_;\r\n            },\r\n            enumerable: true,\r\n            configurable: true\r\n        });\r\n        /* ---------------------------------------------------------\r\n            MOVERS\r\n        --------------------------------------------------------- */\r\n        /**\r\n         * @inheritdoc\r\n         */\r\n        DequeIterator.prototype.prev = function () {\r\n            if (this.index_ == -1)\r\n                return new DequeIterator(this.deque, this.deque.size() - 1);\r\n            else if (this.index_ - 1 < 0)\r\n                return this.deque.end();\r\n            else\r\n                return new DequeIterator(this.deque, this.index_ - 1);\r\n        };\r\n        /**\r\n         * @inheritdoc\r\n         */\r\n        DequeIterator.prototype.next = function () {\r\n            if (this.index_ >= this.source_.size() - 1)\r\n                return this.deque.end();\r\n            else\r\n                return new DequeIterator(this.deque, this.index_ + 1);\r\n        };\r\n        /**\r\n         * @inheritdoc\r\n         */\r\n        DequeIterator.prototype.advance = function (n) {\r\n            var new_index = this.index_ + n;\r\n            if (new_index < 0 || new_index >= this.deque.size())\r\n                return this.deque.end();\r\n            else\r\n                return new DequeIterator(this.deque, new_index);\r\n        };\r\n        /**\r\n         * @inheritdoc\r\n         */\r\n        DequeIterator.prototype.swap = function (obj) {\r\n            _a = [obj.value, this.value], this.value = _a[0], obj.value = _a[1];\r\n            var _a;\r\n        };\r\n        return DequeIterator;\r\n    }(std.base.Iterator));\r\n    std.DequeIterator = DequeIterator;\r\n    /**\r\n     * <p> A reverse-iterator of Deque. </p>\r\n     *\r\n     * @param <T> Type of the elements.\r\n     *\r\n     * @author Jeongho Nam <http://samchon.org>\r\n     */\r\n    var DequeReverseIterator = (function (_super) {\r\n        __extends(DequeReverseIterator, _super);\r\n        /* ---------------------------------------------------------\r\n            CONSTRUCTORS\r\n        --------------------------------------------------------- */\r\n        function DequeReverseIterator(iterator) {\r\n            _super.call(this, iterator);\r\n        }\r\n        Object.defineProperty(DequeReverseIterator.prototype, \"deque_iterator\", {\r\n            /* ---------------------------------------------------------\r\n                ACCESSORS\r\n            --------------------------------------------------------- */\r\n            /**\r\n             * @hidden\r\n             */\r\n            get: function () {\r\n                return this.iterator_;\r\n            },\r\n            enumerable: true,\r\n            configurable: true\r\n        });\r\n        Object.defineProperty(DequeReverseIterator.prototype, \"index\", {\r\n            get: function () {\r\n                return this.deque_iterator.index;\r\n            },\r\n            enumerable: true,\r\n            configurable: true\r\n        });\r\n        Object.defineProperty(DequeReverseIterator.prototype, \"value\", {\r\n            set: function (val) {\r\n                this.deque_iterator.value = val;\r\n            },\r\n            enumerable: true,\r\n            configurable: true\r\n        });\r\n        /* ---------------------------------------------------------\r\n            MOVERS\r\n        --------------------------------------------------------- */\r\n        /**\r\n         * @inheritdoc\r\n         */\r\n        DequeReverseIterator.prototype.prev = function () {\r\n            return new DequeReverseIterator(this.deque_iterator.next());\r\n        };\r\n        /**\r\n         * @inheritdoc\r\n         */\r\n        DequeReverseIterator.prototype.next = function () {\r\n            return new DequeReverseIterator(this.deque_iterator.prev());\r\n        };\r\n        /**\r\n         * @inheritdoc\r\n         */\r\n        DequeReverseIterator.prototype.advance = function (n) {\r\n            var iterator = this.deque_iterator.advance(-1 * n);\r\n            return new DequeReverseIterator(iterator);\r\n        };\r\n        return DequeReverseIterator;\r\n    }(std.base.ReverseIterator));\r\n    std.DequeReverseIterator = DequeReverseIterator;\r\n})(std || (std = {}));\r\n/// <reference path=\"base/Container.ts\" />\r\n/// <reference path=\"base/Iterator.ts\" />\r\n/// <reference path=\"base/ReverseIterator.ts\" />\r\nvar std;\r\n(function (std) {\r\n    /**\r\n     * <p> Doubly linked list. </p>\r\n     *\r\n     * <p> {@link List}s are sequence containers that allow constant time insert and erase operations anywhere\r\n     * within the sequence, and iteration in both directions. </p>\r\n     *\r\n     * <p> List containers are implemented as doubly-linked lists; Doubly linked lists can store each of the elements\r\n     * they contain in different and unrelated storage locations. The ordering is kept internally by the association\r\n     * to each element of a link to the element preceding it and a link to the element following it. </p>\r\n     *\r\n     * <p> They are very similar to forward_list: The main difference being that forward_list objects are\r\n     * single-linked lists, and thus they can only be iterated forwards, in exchange for being somewhat smaller and\r\n     * more efficient. </p>\r\n     *\r\n     * <p> Compared to other base standard sequence containers (array, vector and deque), lists perform generally\r\n     * better in inserting, extracting and moving elements in any position within the container for which an iterator\r\n     * has already been obtained, and therefore also in algorithms that make intensive use of these, like sorting\r\n     * algorithms. </p>\r\n     *\r\n     * <p> The main drawback of lists and forward_lists compared to these other sequence containers is that they lack\r\n     * direct access to the elements by their position; For example, to access the sixth element in a list, one has\r\n     * to iterate from a known position (like the beginning or the end) to that position, which takes linear time in\r\n     * the distance between these. They also consume some extra memory to keep the linking information associated to\r\n     * each element (which may be an important factor for large lists of small-sized elements). </p>\r\n     *\r\n     * <h3> Container properties </h3>\r\n     * <dl>\r\n     * \t<dt> Sequence </dt>\r\n     * \t<dd> Elements in sequence containers are ordered in a strict linear sequence. Individual elements are\r\n     *\t\t accessed by their position in this sequence. </dd>\r\n     *\r\n     * \t<dt> Doubly-linked list </dt>\r\n     *\t<dd> Each element keeps information on how to locate the next and the previous elements, allowing constant\r\n     *\t\t time insert and erase operations before or after a specific element (even of entire ranges), but no\r\n     *\t\t direct random access. </dd>\r\n     * </dl>\r\n     *\r\n     * <ul>\r\n     *  <li> Reference: http://www.cplusplus.com/reference/list/list/\r\n     * </ul>\r\n     *\r\n     * @param <T> Type of the elements.\r\n     *\r\n     * @author Jeongho Nam <http://samchon.org>\r\n     */\r\n    var List = (function (_super) {\r\n        __extends(List, _super);\r\n        function List() {\r\n            var args = [];\r\n            for (var _i = 0; _i < arguments.length; _i++) {\r\n                args[_i - 0] = arguments[_i];\r\n            }\r\n            _super.call(this);\r\n            if (args.length == 0) {\r\n                this.clear();\r\n            }\r\n            else if (args.length == 1 && args[0] instanceof Array) {\r\n                var array = args[0];\r\n                this.clear();\r\n                this.push.apply(this, array);\r\n            }\r\n            else if (args.length == 1 && (args[0] instanceof std.Vector || args[0] instanceof std.base.Container)) {\r\n                var container = args[0];\r\n                this.assign(container.begin(), container.end());\r\n            }\r\n            else if (args.length == 2 && args[0] instanceof std.base.Iterator && args[1] instanceof std.base.Iterator) {\r\n                var begin = args[0];\r\n                var end = args[1];\r\n                this.assign(begin, end);\r\n            }\r\n            else if (args.length == 2 && typeof args[0] == \"number\") {\r\n                var size = args[0];\r\n                var val = args[1];\r\n                this.assign(size, val);\r\n            }\r\n        }\r\n        List.prototype.assign = function (par1, par2) {\r\n            if (par1 instanceof std.base.Iterator && par2 instanceof std.base.Iterator) {\r\n                // PARAMETERS\r\n                var begin = par1;\r\n                var end = par2;\r\n                // BODY\r\n                var prev = null;\r\n                var item = void 0;\r\n                var it = begin;\r\n                while (true) {\r\n                    // CONSTRUCT ELEMENT ITEM\r\n                    item = new ListIterator(this, prev, null, (it != end ? it.value : null));\r\n                    // SET PREVIOUS NEXT POINTER\r\n                    if (prev != null)\r\n                        prev.setNext(item);\r\n                    // CONSTRUCT BEGIN AND END\r\n                    if (it == begin)\r\n                        this.begin_ = item;\r\n                    else if (it == end) {\r\n                        this.end_ = item;\r\n                        break;\r\n                    }\r\n                    // ADD COUNTS AND STEP TO THE NEXT\r\n                    this.size_++;\r\n                    it = it.next();\r\n                }\r\n            }\r\n        };\r\n        /**\r\n         * @inheritdoc\r\n         */\r\n        List.prototype.clear = function () {\r\n            var it = new ListIterator(this, null, null, null);\r\n            it.setPrev(it);\r\n            it.setNext(it);\r\n            this.begin_ = it;\r\n            this.end_ = it;\r\n            this.size_ = 0;\r\n        };\r\n        /* =========================================================\r\n            ACCESSORS\r\n        ========================================================= */\r\n        /**\r\n         * @inheritdoc\r\n         */\r\n        List.prototype.begin = function () {\r\n            return this.begin_;\r\n        };\r\n        /**\r\n         * @inheritdoc\r\n         */\r\n        List.prototype.end = function () {\r\n            return this.end_;\r\n        };\r\n        /**\r\n         * @inheritdoc\r\n         */\r\n        List.prototype.rbegin = function () {\r\n            if (this.empty() == true)\r\n                return this.rend();\r\n            else\r\n                return new ListReverseIterator(this.end().prev());\r\n        };\r\n        /**\r\n         * @inheritdoc\r\n         */\r\n        List.prototype.rend = function () {\r\n            return new ListReverseIterator(this.end());\r\n        };\r\n        /**\r\n         * @inheritdoc\r\n         */\r\n        List.prototype.size = function () {\r\n            return this.size_;\r\n        };\r\n        /**\r\n         * @inheritdoc\r\n         */\r\n        List.prototype.front = function () {\r\n            return this.begin_.value;\r\n        };\r\n        /**\r\n         * @inheritdoc\r\n         */\r\n        List.prototype.back = function () {\r\n            return this.end_.prev().value;\r\n        };\r\n        /* =========================================================\r\n            ELEMENTS I/O\r\n                - ITERATOR FACTORY\r\n                - PUSH & POP\r\n                - INSERT\r\n                - ERASE\r\n        ============================================================\r\n            PUSH & POP\r\n        --------------------------------------------------------- */\r\n        /**\r\n         * @inheritdoc\r\n         */\r\n        List.prototype.push = function () {\r\n            var items = [];\r\n            for (var _i = 0; _i < arguments.length; _i++) {\r\n                items[_i - 0] = arguments[_i];\r\n            }\r\n            for (var i = 0; i < items.length; i++)\r\n                this.push_back(items[i]);\r\n            return this.size();\r\n        };\r\n        /**\r\n         * @inheritdoc\r\n         */\r\n        List.prototype.push_front = function (val) {\r\n            var item = new ListIterator(this, null, this.begin_, val);\r\n            // CONFIGURE BEGIN AND NEXT\r\n            this.begin_.setPrev(item);\r\n            if (this.size_ == 0) {\r\n                // IT WAS EMPTY\r\n                this.end_ = new ListIterator(this, item, item, null);\r\n                item.setNext(this.end_);\r\n            }\r\n            else\r\n                this.end_.setNext(item);\r\n            // SET\r\n            this.begin_ = item;\r\n            this.size_++;\r\n        };\r\n        /**\r\n         * @inheritdoc\r\n         */\r\n        List.prototype.push_back = function (val) {\r\n            var prev = this.end_.prev();\r\n            var item = new ListIterator(this, this.end_.prev(), this.end_, val);\r\n            prev.setNext(item);\r\n            this.end_.setPrev(item);\r\n            if (this.empty() == true) {\r\n                this.begin_ = item;\r\n                item.setPrev(this.end_);\r\n            }\r\n            this.size_++;\r\n        };\r\n        /**\r\n         * @inheritdoc\r\n         */\r\n        List.prototype.pop_front = function () {\r\n            this.erase(this.begin_);\r\n        };\r\n        /**\r\n         * @inheritdoc\r\n         */\r\n        List.prototype.pop_back = function () {\r\n            this.erase(this.end_.prev());\r\n        };\r\n        List.prototype.insert = function () {\r\n            var args = [];\r\n            for (var _i = 0; _i < arguments.length; _i++) {\r\n                args[_i - 0] = arguments[_i];\r\n            }\r\n            if (args.length == 2)\r\n                return this.insert_by_val(args[0], args[1]);\r\n            else if (args.length == 3 && typeof args[1] == \"number\") {\r\n                return this.insertByRepeatingVal(args[0], args[1], args[2]);\r\n            }\r\n            else\r\n                return this.insert_by_range(args[0], args[1], args[2]);\r\n        };\r\n        /**\r\n         * @hidden\r\n         */\r\n        List.prototype.insert_by_val = function (position, val) {\r\n            // SHIFT TO INSERT OF THE REPEATING VAL\r\n            return this.insertByRepeatingVal(position, 1, val);\r\n        };\r\n        /**\r\n         * @hidden\r\n         */\r\n        List.prototype.insertByRepeatingVal = function (position, size, val) {\r\n            if (this != position.get_source())\r\n                throw new std.InvalidArgument(\"Parametric iterator is not this container's own.\");\r\n            var prev = position.prev();\r\n            var first = null;\r\n            for (var i = 0; i < size; i++) {\r\n                // CONSTRUCT ITEM, THE NEW ELEMENT\r\n                var item = new ListIterator(this, prev, null, val);\r\n                if (i == 0)\r\n                    first = item;\r\n                prev.setNext(item);\r\n                // SHIFT ITEM LEFT TO BE PREV\r\n                prev = item;\r\n            }\r\n            // IF WAS EMPTY, VAL IS THE BEGIN\r\n            if (this.empty() == true || first.prev().equal_to(this.end()) == true)\r\n                this.begin_ = first;\r\n            // CONNECT BETWEEN LAST INSERTED ITEM AND POSITION\r\n            prev.setNext(position);\r\n            position.setPrev(prev);\r\n            this.size_ += size;\r\n            return first;\r\n        };\r\n        /**\r\n         * @hidden\r\n         */\r\n        List.prototype.insert_by_range = function (position, begin, end) {\r\n            if (this != position.get_source())\r\n                throw new std.InvalidArgument(\"Parametric iterator is not this container's own.\");\r\n            var prev = position.prev();\r\n            var first = null;\r\n            var size = 0;\r\n            for (var it = begin; it.equal_to(end) == false; it = it.next()) {\r\n                // CONSTRUCT ITEM, THE NEW ELEMENT\r\n                var item = new ListIterator(this, prev, null, it.value);\r\n                if (size == 0)\r\n                    first = item;\r\n                if (prev != null)\r\n                    prev.setNext(item);\r\n                // SHIFT CURRENT ITEM TO PREVIOUS\r\n                prev = item;\r\n                size++;\r\n            }\r\n            // IF WAS EMPTY, FIRST ELEMENT IS THE BEGIN\r\n            if (this.empty() == true)\r\n                this.begin_ = first;\r\n            // CONNECT BETWEEN LAST AND POSITION\r\n            prev.setNext(position);\r\n            position.setPrev(prev);\r\n            this.size_ += size;\r\n            return first;\r\n        };\r\n        List.prototype.erase = function () {\r\n            var args = [];\r\n            for (var _i = 0; _i < arguments.length; _i++) {\r\n                args[_i - 0] = arguments[_i];\r\n            }\r\n            if (args.length == 1)\r\n                return this.erase_by_iterator(args[0]);\r\n            else if (args.length == 2)\r\n                return this.erase_by_range(args[0], args[1]);\r\n        };\r\n        /**\r\n         * @hidden\r\n         */\r\n        List.prototype.erase_by_iterator = function (it) {\r\n            if (it.equal_to(this.end_))\r\n                throw new std.LogicError(\"Unable to erase end iterator.\");\r\n            return this.erase_by_range(it, it.next());\r\n        };\r\n        /**\r\n         * @hidden\r\n         */\r\n        List.prototype.erase_by_range = function (begin, end) {\r\n            if (this != begin.get_source() || begin.get_source() != end.get_source())\r\n                throw new std.InvalidArgument(\"Parametric iterator is not this container's own.\");\r\n            // FIND PREV AND NEXT\r\n            var prev = begin.prev();\r\n            // CALCULATE THE SIZE\r\n            var size = 0;\r\n            for (var it = begin; it.equal_to(end) == false; it = it.next())\r\n                size++;\r\n            // SHRINK\r\n            prev.setNext(end);\r\n            end.setPrev(prev);\r\n            this.size_ -= size;\r\n            if (this.size_ == 0)\r\n                this.begin_ = end;\r\n            return end;\r\n        };\r\n        List.prototype.unique = function (binary_pred) {\r\n            if (binary_pred === void 0) { binary_pred = std.equal_to; }\r\n            var it = this.begin().next();\r\n            while (!it.equal_to(this.end())) {\r\n                if (std.equal_to(it.value, it.prev().value) == true)\r\n                    it = this.erase(it);\r\n                else\r\n                    it = it.next();\r\n            }\r\n        };\r\n        /**\r\n         * <p> Remove elements with specific value. </p>\r\n         *\r\n         * <p> Removes from the container all the elements that compare equal to <i>val</i>. This calls the\r\n         * destructor of these objects and reduces the container {@link size} by the number of elements removed. </p>\r\n         *\r\n         * <p> Unlike member function {@link List.erase}, which erases elements by their position (using an\r\n         * iterator), this function ({@link List.remove}) removes elements by their value. </p>\r\n         *\r\n         * <p> A similar function, {@link List.remove_if}, exists, which allows for a condition other than an\r\n         * equality comparison to determine whether an element is removed. </p>\r\n         *\r\n         * @param val Value of the elements to be removed.\r\n         */\r\n        List.prototype.remove = function (val) {\r\n            var it = this.begin();\r\n            while (!it.equal_to(this.end())) {\r\n                if (std.equal_to(it.value, val) == true)\r\n                    it = this.erase(it);\r\n                else\r\n                    it = it.next();\r\n            }\r\n        };\r\n        /**\r\n         * <p> Remove elements fulfilling condition. </p>\r\n         *\r\n         * <p> Removes from the container all the elements for which <i>pred</i> returns <code>true</code>. This\r\n         * calls the destructor of these objects and reduces the container {@link size} by the number of elements\r\n         * removed. </p>\r\n         *\r\n         * <p> The function calls <code>pred(it.value)</code> for each element (where <code>it</code> is an iterator\r\n         * to that element). Any of the elements in the list for which this returns <code>true</code>, are removed\r\n         * from the  </p>\r\n         *\r\n         * @param pred Unary predicate that, taking a value of the same type as those contained in the forward_list\r\n         *\t\t\t   object, returns <code>true</code> for those values to be removed from the container, and\r\n         *\t\t\t   <code>false</code> for those remaining. This can either be a function pointer or a function\r\n         *\t\t\t   object.\r\n         */\r\n        List.prototype.remove_if = function (pred) {\r\n            var it = this.begin();\r\n            while (!it.equal_to(this.end())) {\r\n                if (pred(it.value) == true)\r\n                    it = this.erase(it);\r\n                else\r\n                    it = it.next();\r\n            }\r\n        };\r\n        List.prototype.merge = function (obj, compare) {\r\n            if (compare === void 0) { compare = std.less; }\r\n            if (this == obj)\r\n                return;\r\n            var it = this.begin();\r\n            while (obj.empty() == false) {\r\n                var begin = obj.begin();\r\n                while (!it.equal_to(this.end()) && compare(it.value, begin.value) == true)\r\n                    it = it.next();\r\n                this.splice(it, obj, begin);\r\n            }\r\n        };\r\n        List.prototype.splice = function (position, obj, begin, end) {\r\n            if (begin === void 0) { begin = null; }\r\n            if (end === void 0) { end = null; }\r\n            if (begin == null) {\r\n                begin = obj.begin();\r\n                end = obj.end();\r\n            }\r\n            else if (end == null) {\r\n                end = begin.next();\r\n            }\r\n            this.insert(position, begin, end);\r\n            obj.erase(begin, end);\r\n        };\r\n        List.prototype.sort = function (compare) {\r\n            //let whole: Vector<T> = new Vector<T>(this);\r\n            //let part: Vector<T> = new Vector<T>(this);\r\n            if (compare === void 0) { compare = std.less; }\r\n            //this.msort(whole, part, 0, this.size(), compare);\r\n            //this.assign(whole.begin(), whole.end());\r\n            var vector = new std.Vector(this.begin(), this.end());\r\n            std.sort(vector.begin(), vector.end());\r\n            this.assign(vector.begin(), vector.end());\r\n        };\r\n        ///**\r\n        // * @hidden\r\n        // */\r\n        //private msort\r\n        //\t(\r\n        //\t\twhole: Array<T>, part: Array<T>, \r\n        //\t\tbegin: number, end: number, compare: (left: T, right: T) => boolean\r\n        //\t): void\r\n        //{\r\n        //\tif (begin >= end - 1)\r\n        //\t\treturn;\r\n        //\tlet mid = begin + Math.floor((end - begin) / 2);\r\n        //\tthis.msort(whole, part, begin, mid, compare);\r\n        //\tthis.msort(whole, part, mid, end, compare);\r\n        //\tthis.msort_merge(whole, part, begin, mid, end, compare);\r\n        //}\r\n        ///**\r\n        // * @hidden\r\n        // */\r\n        //private msort_merge\r\n        //\t(\r\n        //\t\twhole: Array<T>, part: Array<T>, \r\n        //\t\tbegin: number, mid: number, end: number, \r\n        //\t\tcompare: (left: T, right: T) => boolean\r\n        //\t): void\r\n        //{\r\n        //\tfor (let i: number = begin; i < end; i++)\r\n        //\t\tpart[i] = whole[i];\r\n        //\tlet x: number = begin;\r\n        //\tlet y: number = mid;\r\n        //\tfor (let i: number = mid; i < end; i++)\r\n        //\t{\r\n        //\t\tif (x >= mid)\r\n        //\t\t\twhole[i] = part[y++];\r\n        //\t\telse if (y >= end)\r\n        //\t\t\twhole[i] = part[x++];\r\n        //\t\telse if (part[x] < part[y])\r\n        //\t\t\twhole[i] = part[y++];\r\n        //\t\telse\r\n        //\t\t\twhole[i] = part[x++];\r\n        //\t}\r\n        //}\r\n        /* ---------------------------------------------------------\r\n            SWAP\r\n        --------------------------------------------------------- */\r\n        /**\r\n         * @inheritdoc\r\n         */\r\n        List.prototype.swap = function (obj) {\r\n            if (obj instanceof List)\r\n                this.swap_list(obj);\r\n            else\r\n                _super.prototype.swap.call(this, obj);\r\n        };\r\n        /**\r\n         * @hidden\r\n         */\r\n        List.prototype.swap_list = function (obj) {\r\n            _a = [obj.begin_, this.begin_], this.begin_ = _a[0], obj.begin_ = _a[1];\r\n            _b = [obj.end_, this.end_], this.end_ = _b[0], obj.end_ = _b[1];\r\n            _c = [obj.size_, this.size_], this.size_ = _c[0], obj.size_ = _c[1];\r\n            var _a, _b, _c;\r\n        };\r\n        return List;\r\n    }(std.base.Container));\r\n    std.List = List;\r\n    /**\r\n     * An iterator, node of a List.\r\n     */\r\n    var ListIterator = (function (_super) {\r\n        __extends(ListIterator, _super);\r\n        /* ---------------------------------------------------------------\r\n            CONSTRUCTORS\r\n        --------------------------------------------------------------- */\r\n        /**\r\n         * <p> Construct from the source {@link List container}. </p>\r\n         *\r\n         * <h4> Note </h4>\r\n         * <p> Do not create the iterator directly, by yourself. </p>\r\n         * <p> Use {@link List.begin begin()}, {@link List.end end()} in {@link List container} instead. </p>\r\n         *\r\n         * @param source The source {@link List container} to reference.\r\n         * @param prev A refenrece of previous node ({@link ListIterator iterator}).\r\n         * @param next A refenrece of next node ({@link ListIterator iterator}).\r\n         * @param value Value to be stored in the node (iterator).\r\n         */\r\n        function ListIterator(source, prev, next, value) {\r\n            _super.call(this, source);\r\n            this.prev_ = prev;\r\n            this.next_ = next;\r\n            this.value_ = value;\r\n        }\r\n        /**\r\n         * @inheritdoc\r\n         */\r\n        ListIterator.prototype.setPrev = function (prev) {\r\n            this.prev_ = prev;\r\n        };\r\n        /**\r\n         * @inheritdoc\r\n         */\r\n        ListIterator.prototype.setNext = function (next) {\r\n            this.next_ = next;\r\n        };\r\n        /* ---------------------------------------------------------------\r\n            ACCESSORS\r\n        --------------------------------------------------------------- */\r\n        /**\r\n         * @inheritdoc\r\n         */\r\n        ListIterator.prototype.equal_to = function (obj) {\r\n            return this == obj;\r\n        };\r\n        /**\r\n         * @inheritdoc\r\n         */\r\n        ListIterator.prototype.prev = function () {\r\n            return this.prev_;\r\n        };\r\n        /**\r\n         * @inheritdoc\r\n         */\r\n        ListIterator.prototype.next = function () {\r\n            return this.next_;\r\n        };\r\n        /**\r\n         * @inheritdoc\r\n         */\r\n        ListIterator.prototype.advance = function (step) {\r\n            var it = this;\r\n            if (step >= 0) {\r\n                for (var i = 0; i < step; i++) {\r\n                    it = it.next();\r\n                    if (it.equal_to(this.source_.end()))\r\n                        return it;\r\n                }\r\n            }\r\n            else {\r\n                for (var i = 0; i < step; i++) {\r\n                    it = it.prev();\r\n                    if (it.equal_to(this.source_.end()))\r\n                        return it;\r\n                }\r\n            }\r\n            return it;\r\n        };\r\n        Object.defineProperty(ListIterator.prototype, \"value\", {\r\n            /**\r\n             * @inheritdoc\r\n             */\r\n            get: function () {\r\n                return this.value_;\r\n            },\r\n            set: function (val) {\r\n                this.value_ = val;\r\n            },\r\n            enumerable: true,\r\n            configurable: true\r\n        });\r\n        /**\r\n         * @inheritdoc\r\n         */\r\n        ListIterator.prototype.swap = function (obj) {\r\n            var supp_prev = this.prev_;\r\n            var supp_next = this.next_;\r\n            this.prev_ = obj.prev_;\r\n            this.next_ = obj.next_;\r\n            obj.prev_ = supp_prev;\r\n            obj.next_ = supp_next;\r\n            if (this.source_.end() == this)\r\n                this.source_.end_ = obj;\r\n            else if (this.source_.end() == obj)\r\n                this.source_.end_ = this;\r\n            if (this.source_.begin() == this)\r\n                this.source_.begin_ = obj;\r\n            else if (this.source_.begin() == obj)\r\n                this.source_.begin_ = this;\r\n        };\r\n        return ListIterator;\r\n    }(std.base.Iterator));\r\n    std.ListIterator = ListIterator;\r\n    /**\r\n     * <p> A reverse-iterator of List. </p>\r\n     *\r\n     * @param <T> Type of the elements.\r\n     *\r\n     * @author Jeongho Nam <http://samchon.org>\r\n     */\r\n    var ListReverseIterator = (function (_super) {\r\n        __extends(ListReverseIterator, _super);\r\n        /* ---------------------------------------------------------------\r\n            CONSTRUCTORS\r\n        --------------------------------------------------------------- */\r\n        function ListReverseIterator(iterator) {\r\n            _super.call(this, iterator);\r\n        }\r\n        Object.defineProperty(ListReverseIterator.prototype, \"list_iterator\", {\r\n            /* ---------------------------------------------------------\r\n                ACCESSORS\r\n            --------------------------------------------------------- */\r\n            /**\r\n             * @hidden\r\n             */\r\n            get: function () {\r\n                return this.iterator_;\r\n            },\r\n            enumerable: true,\r\n            configurable: true\r\n        });\r\n        Object.defineProperty(ListReverseIterator.prototype, \"value\", {\r\n            set: function (val) {\r\n                this.list_iterator.value = val;\r\n            },\r\n            enumerable: true,\r\n            configurable: true\r\n        });\r\n        /* ---------------------------------------------------------\r\n            MOVERS\r\n        --------------------------------------------------------- */\r\n        /**\r\n         * @inheritdoc\r\n         */\r\n        ListReverseIterator.prototype.prev = function () {\r\n            return new ListReverseIterator(this.list_iterator.next());\r\n        };\r\n        /**\r\n         * @inheritdoc\r\n         */\r\n        ListReverseIterator.prototype.next = function () {\r\n            return new ListReverseIterator(this.list_iterator.prev());\r\n        };\r\n        /**\r\n         * @inheritdoc\r\n         */\r\n        ListReverseIterator.prototype.advance = function (n) {\r\n            return new ListReverseIterator(this.list_iterator.advance(-1 * n));\r\n        };\r\n        return ListReverseIterator;\r\n    }(std.base.ReverseIterator));\r\n    std.ListReverseIterator = ListReverseIterator;\r\n})(std || (std = {}));\r\nvar std;\r\n(function (std) {\r\n    /**\r\n     * <p> FIFO queue. </p>\r\n     *\r\n     * <p> {@link Queue}s are a type of container adaptor, specifically designed to operate in a FIFO context\r\n     * (first-in first-out), where elements are inserted into one end of the container and extracted from the other.\r\n     * </p>\r\n     *\r\n     * <p> {@link Queue}s are implemented as containers adaptors, which are classes that use an encapsulated object of\r\n     * a specific container class as its underlying container, providing a specific set of member functions to access\r\n     * its elements. Elements are pushed into the {@link IDeque.back back()} of the specific container and popped from\r\n     * its {@link IDeque.front front()}. </p>\r\n     *\r\n     * <p> {@link container_ The underlying container} may be one of the standard container class template or some\r\n     * other specifically designed container class. This underlying container shall support at least the following\r\n     * operations: </p>\r\n     *\r\n     * <ul>\r\n     *\t<li> empty </li>\r\n     *\t<li> size </li>\r\n     *\t<li> front </li>\r\n     *\t<li> back </li>\r\n     *\t<li> push_back </li>\r\n     *\t<li> pop_front </li>\r\n     * </ul>\r\n     *\r\n     * <p> The standard container classes {@link Deque} and {@link List} fulfill these requirements.\r\n     * By default, if no container class is specified for a particular {@link Queue} class instantiation, the standard\r\n     * container {@link List} is used. </p>\r\n     *\r\n     * <ul>\r\n     *\t<li> Reference: http://www.cplusplus.com/reference/queue/queue/ </li>\r\n     * </ul>\r\n     *\r\n     * @param <T> Type of elements.\r\n     *\r\n     * @author Jeongho Nam <http://samchon.org>\r\n     */\r\n    var Queue = (function () {\r\n        function Queue(queue) {\r\n            if (queue === void 0) { queue = null; }\r\n            this.container_ = new std.List();\r\n            if (queue != null)\r\n                this.container_.assign(queue.container_.begin(), queue.container_.end());\r\n        }\r\n        /* ---------------------------------------------------------\r\n            ACCESSORS\r\n        --------------------------------------------------------- */\r\n        /**\r\n         * <p> Return size. </p>\r\n         * <p> Returns the number of elements in the {@link Queue}. </p>\r\n         *\r\n         * <p> This member function effectively calls member {@link IDeque.size size()} of the\r\n         * {@link container_ underlying container} object. </p>\r\n         *\r\n         * @return The number of elements in the {@link container_ underlying container}.\r\n         */\r\n        Queue.prototype.size = function () {\r\n            return this.container_.size();\r\n        };\r\n        /**\r\n         * <p> Test whether container is empty. </p>\r\n         * <p> returns whether the {@link Queue} is empty: i.e. whether its <i>size</i> is zero. </p>\r\n         *\r\n         * <p> This member function efeectively calls member {@link IDeque.empty empty()} of the\r\n         * {@link container_ underlying container} object. </p>\r\n         *\r\n         * @return <code>true</code> if the {@link container_ underlying container}'s size is 0,\r\n         *\t\t   <code>false</code> otherwise. </p>\r\n         */\r\n        Queue.prototype.empty = function () {\r\n            return this.container_.empty();\r\n        };\r\n        /**\r\n         * <p> Access next element. </p>\r\n         * <p> Returns a value of the next element in the {@link Queue}. </p>\r\n         *\r\n         * <p> The next element is the \"oldest\" element in the {@link Queue} and the same element that is popped out\r\n         * from the queue when {@link pop Queue.pop()} is called. </p>\r\n         *\r\n         * <p> This member function effectively calls member {@link IDeque.front front()} of the\r\n         * {@link container_ underlying container} object. </p>\r\n         *\r\n         * @return A value of the next element in the {@link Queue}.\r\n         */\r\n        Queue.prototype.front = function () {\r\n            return this.container_.front();\r\n        };\r\n        /**\r\n         * <p> Access last element. </p>\r\n         *\r\n         * <p> Returns a vaue of the last element in the queue. This is the \"newest\" element in the queue (i.e. the\r\n         * last element pushed into the queue). </p>\r\n         *\r\n         * <p> This member function effectively calls the member function {@link IDeque.back back()} of the\r\n         * {@link container_ underlying container} object. </p>\r\n         *\r\n         * @return A value of the last element in the {@link Queue}.\r\n         */\r\n        Queue.prototype.back = function () {\r\n            return this.container_.back();\r\n        };\r\n        /* ---------------------------------------------------------\r\n            ELEMENTS I/O\r\n        --------------------------------------------------------- */\r\n        /**\r\n         * <p> Insert element. </p>\r\n         *\r\n         * <p> Inserts a new element at the end of the {@link Queue}, after its current last element.\r\n         * The content of this new element is initialized to <i>val</i>. </p>\r\n         *\r\n         * <p> This member function effectively calls the member function {@link IDeque.push_back push_back()} of the\r\n         * {@link container_ underlying container} object. </p>\r\n         *\r\n         * @param val Value to which the inserted element is initialized.\r\n         */\r\n        Queue.prototype.push = function (val) {\r\n            this.container_.push_back(val);\r\n        };\r\n        /**\r\n         * <p> Remove next element. </p>\r\n         *\r\n         * <p> Removes the next element in the {@link Queue}, effectively reducing its size by one. </p>\r\n         *\r\n         * <p> The element removed is the \"oldest\" element in the {@link Queue} whose value can be retrieved by calling\r\n         * member {@link front Queue.front()} </p>.\r\n         *\r\n         * <p> This member function effectively calls the member function {@link IDeque.pop_front pop_front()} of the\r\n         * {@link container_ underlying container} object. </p>\r\n         */\r\n        Queue.prototype.pop = function () {\r\n            this.container_.pop_front();\r\n        };\r\n        /**\r\n         * <p> Swap contents. </p>\r\n         *\r\n         * <p> Exchanges the contents of the container adaptor (<i>this</i>) by those of <i>obj</i>. </p>\r\n         *\r\n         * <p> This member function calls the non-member function {@link IContainer.swap swap} (unqualified) to swap\r\n         * the {@link container_ underlying containers}. </p>\r\n         *\r\n         * @param obj Another {@link Queue} container adaptor of the same type (i.e., instantiated with the same\r\n         *\t\t\t  template parameter, <b>T</b>). Sizes may differ. </p>\r\n         */\r\n        Queue.prototype.swap = function (obj) {\r\n            this.container_.swap(obj.container_);\r\n        };\r\n        return Queue;\r\n    }());\r\n    std.Queue = Queue;\r\n})(std || (std = {}));\r\nvar std;\r\n(function (std) {\r\n    /**\r\n     * <p> LIFO stack. </p>\r\n     *\r\n     * <p> {@link Stack}s are a type of container adaptor, specifically designed to operate in a LIFO context\r\n     * (last-in first-out), where elements are inserted and extracted only from one end of the  </p>\r\n     *\r\n     * <p> {@link Stack}s are implemented as containers adaptors, which are classes that use an encapsulated object of\r\n     * a specific container class as its <i>underlying container</i>, providing a specific set of member functions to\r\n     * access its elements. Elements are pushed/popped from the {@link ILinearContainer.back back()} of the\r\n     * {@link ILinearContainer specific container}, which is known as the top of the {@link Stack}. </p>\r\n     *\r\n     * <p> {@link container_ The underlying container} may be any of the standard container class templates or some\r\n     * other specifically designed container class. The container shall support the following operations: </p>\r\n     *\r\n     * <ul>\r\n     *\t<li> empty </li>\r\n     *\t<li> size </li>\r\n     *\t<li> front </li>\r\n     *\t<li> back </li>\r\n     *\t<li> push_back </li>\r\n     *\t<li> pop_back </li>\r\n     * </ul>\r\n     *\r\n     * <p> The standard container classes {@link Vector}, {@link Deque} and {@link List} fulfill these requirements.\r\n     * By default, if no container class is specified for a particular {@link Stack} class instantiation, the standard\r\n     * container {@link List} is used. </p>\r\n     *\r\n     * <ul>\r\n     *\t<li> Reference: http://www.cplusplus.com/reference/stack/stack/ </li>\r\n     * </ul>\r\n     *\r\n     * @param <T> Type of elements.\r\n     *\r\n     * @author Jeongho Nam <http://samchon.org>\r\n     */\r\n    var Stack = (function () {\r\n        function Stack(stack) {\r\n            if (stack === void 0) { stack = null; }\r\n            this.container_ = new std.List();\r\n            if (stack != null)\r\n                this.container_.assign(stack.container_.begin(), stack.container_.end());\r\n        }\r\n        /* ---------------------------------------------------------\r\n            ACCESSORS\r\n        --------------------------------------------------------- */\r\n        /**\r\n         * <p> Return size. </p>\r\n         *\r\n         * <p> Returns the number of elements in the {@link Stack}. </p>\r\n         *\r\n         * <p> This member function effectively calls member {@link ILinearContainer.size size()} of the\r\n         * {@link container_ underlying container} object. </p>\r\n         *\r\n         * @return The number of elements in the {@link container_ underlying container}.\r\n         */\r\n        Stack.prototype.size = function () {\r\n            return this.container_.size();\r\n        };\r\n        /**\r\n         * <p> Test whether container is empty. </p>\r\n         *\r\n         * <p> returns whether the {@link Stack} is empty: i.e. whether its <i>size</i> is zero. </p>\r\n         *\r\n         * <p> This member function effectively calls member {@link ILinearContainer.empty empty()} of the\r\n         * {@link container_ underlying container} object. </p>\r\n         *\r\n         * @return <code>true</code> if the <i>underlying container</i>'s size is 0,\r\n         *\t\t   <code>false</code> otherwise. </p>\r\n         */\r\n        Stack.prototype.empty = function () {\r\n            return this.container_.empty();\r\n        };\r\n        /**\r\n         * <p> Access next element. </p>\r\n         *\r\n         * <p> Returns a value of the top element in the {@link Stack} </p>.\r\n         *\r\n         * <p> Since {@link Stack}s are last-in first-out containers, the top element is the last element inserted into\r\n         * the {@link Stack}. </p>\r\n         *\r\n         * <p> This member function effectively calls member {@link ILinearContainer.back back()} of the\r\n         * {@link container_ underlying container} object. </p>\r\n         *\r\n         * @return A value of the top element in the {@link Stack}.\r\n         */\r\n        Stack.prototype.top = function () {\r\n            return this.container_.back();\r\n        };\r\n        /* ---------------------------------------------------------\r\n            ELEMENTS I/O\r\n        --------------------------------------------------------- */\r\n        /**\r\n         * <p> Insert element. </p>\r\n         *\r\n         * <p> Inserts a new element at the top of the {@link Stack}, above its current top element. </p>\r\n         *\r\n         * <p> This member function effectively calls the member function\r\n         * {@link ILinearContainer.push_back push_back()} of the {@link container_ underlying container} object. </p>\r\n         *\r\n         * @param val Value to which the inserted element is initialized.\r\n         */\r\n        Stack.prototype.push = function (val) {\r\n            this.container_.push_back(val);\r\n        };\r\n        /**\r\n         * <p> Remove top element. </p>\r\n         *\r\n         * <p> Removes the element on top of the {@link Stack}, effectively reducing its size by one. </p>\r\n         *\r\n         * <p> The element removed is the latest element inserted into the {@link Stack}, whose value can be retrieved\r\n         * by calling member {@link top Stack.top()} </p>.\r\n         *\r\n         * <p> This member function effectively calls the member function {@link ILinearContainer.pop_back pop_back()}\r\n         * of the {@link container_ underlying container} object. </p>\r\n         */\r\n        Stack.prototype.pop = function () {\r\n            this.container_.pop_back();\r\n        };\r\n        /**\r\n         * <p> Swap contents. </p>\r\n         *\r\n         * <p> Exchanges the contents of the container adaptor (<i>this</i>) by those of <i>obj</i>. </p>\r\n         *\r\n         * <p> This member function calls the non-member function {@link IContainer.swap swap} (unqualified) to swap\r\n         * the {@link container_ underlying containers}. </p>\r\n         *\r\n         * @param obj Another {@link Stack} container adaptor of the same type (i.e., instantiated with the same\r\n         *\t\t\t  template parameter, <b>T</b>). Sizes may differ. </p>\r\n         */\r\n        Stack.prototype.swap = function (obj) {\r\n            this.container_.swap(obj.container_);\r\n        };\r\n        return Stack;\r\n    }());\r\n    std.Stack = Stack;\r\n})(std || (std = {}));\r\n/// <reference path=\"Container.ts\" />\r\n/// <reference path=\"Iterator.ts\" />\r\n/// <reference path=\"ReverseIterator.ts\" />\r\nvar std;\r\n(function (std) {\r\n    var base;\r\n    (function (base) {\r\n        /**\r\n         * <p> An abstract set. </p>\r\n         *\r\n         * <p> {@link SetContainer SetContainers} are containers that store elements allowing fast retrieval of\r\n         * individual elements based on their value. </p>\r\n         *\r\n         * <p> In an {@link SetContainer}, the value of an element is at the same time its <i>key</i>, used to\r\n         * identify it. <i>Keys</i> are immutable, therefore, the elements in an {@link SetContainer} cannot be\r\n         * modified once in the container - they can be inserted and removed, though. </p>\r\n         *\r\n         * <p> {@link SetContainer} stores elements, keeps sequence and enables indexing by inserting elements into a\r\n         * {@link List} and registering {@link ListIterator iterators} of the {@link data_ list container} to an index\r\n         * table like {@link RBTree tree} or {@link HashBuckets hash-table}. </p>\r\n         *\r\n         * <h3> Container properties </h3>\r\n         * <dl>\r\n         *\t<dt> Associative </dt>\r\n         *\t<dd>\r\n         *\t\tElements in associative containers are referenced by their <i>key</i> and not by their absolute\r\n         *\t\tposition in the\r\n         *\t</dd>\r\n         *\r\n         *\t<dt> Set </dt>\r\n         *\t<dd> The value of an element is also the <i>key</i> used to identify it. </dd>\r\n         * </dl>\r\n         *\r\n         * @param <T> Type of the elements. Each element in a {@link SetContainer} container is also identified\r\n         *\t\t\t  by this value (each value is itself also the element's <i>key</i>).\r\n         *\r\n         * @author Jeongho Nam <http://samchon.org>\r\n         */\r\n        var SetContainer = (function (_super) {\r\n            __extends(SetContainer, _super);\r\n            function SetContainer() {\r\n                var args = [];\r\n                for (var _i = 0; _i < arguments.length; _i++) {\r\n                    args[_i - 0] = arguments[_i];\r\n                }\r\n                _super.call(this);\r\n                // INITIALIZATION\r\n                this.data_ = new std.List();\r\n                // OVERLOADINGS\r\n                //if (args.length == 1 && args[0] instanceof Array && args[0] instanceof Vector == false)\r\n                //{\r\n                //\tthis.construct_from_array(args[0]);\r\n                //}\r\n                //else if (args.length == 1 && args[0] instanceof Container)\r\n                //{\r\n                //\tthis.construct_from_container(args[0]);\r\n                //}\r\n                //else if (args.length == 2 && args[0] instanceof Iterator && args[1] instanceof Iterator)\r\n                //{\r\n                //\tthis.construct_from_range(args[0], args[1]);\r\n                //}\r\n            }\r\n            Object.defineProperty(SetContainer, \"iterator\", {\r\n                /**\r\n                 * Type definition of {@link SetContainer}'s {@link SetIterator iterator}.\r\n                 */\r\n                get: function () { return std.SetIterator; },\r\n                enumerable: true,\r\n                configurable: true\r\n            });\r\n            /**\r\n             * @hidden\r\n             */\r\n            SetContainer.prototype.construct_from_array = function (items) {\r\n                for (var i = 0; i < items.length; i++)\r\n                    this.insert_by_val(items[i]);\r\n            };\r\n            /**\r\n             * @hidden\r\n             */\r\n            SetContainer.prototype.construct_from_container = function (container) {\r\n                this.construct_from_range(container.begin(), container.end());\r\n            };\r\n            /**\r\n             * @hidden\r\n             */\r\n            SetContainer.prototype.construct_from_range = function (begin, end) {\r\n                this.assign(begin, end);\r\n            };\r\n            /* ---------------------------------------------------------\r\n                ASSIGN & CLEAR\r\n            --------------------------------------------------------- */\r\n            /**\r\n             * @inheritdoc\r\n             */\r\n            SetContainer.prototype.assign = function (begin, end) {\r\n                // INSERT\r\n                for (var it = begin; it.equal_to(end) == false; it = it.next())\r\n                    this.insert_by_val(it.value);\r\n            };\r\n            /**\r\n             * @inheritdoc\r\n             */\r\n            SetContainer.prototype.clear = function () {\r\n                this.data_.clear();\r\n            };\r\n            /**\r\n             * @inheritdoc\r\n             */\r\n            SetContainer.prototype.begin = function () {\r\n                return new std.SetIterator(this, this.data_.begin());\r\n            };\r\n            /**\r\n             * @inheritdoc\r\n             */\r\n            SetContainer.prototype.end = function () {\r\n                return new std.SetIterator(this, this.data_.end());\r\n            };\r\n            /**\r\n             * @inheritdoc\r\n             */\r\n            SetContainer.prototype.rbegin = function () {\r\n                if (this.empty() == true)\r\n                    return this.rend();\r\n                else\r\n                    return new std.SetReverseIterator(this.end().prev());\r\n            };\r\n            /**\r\n             * @inheritdoc\r\n             */\r\n            SetContainer.prototype.rend = function () {\r\n                return new std.SetReverseIterator(this.end());\r\n            };\r\n            /* ---------------------------------------------------------\r\n                ELEMENTS\r\n            --------------------------------------------------------- */\r\n            /**\r\n             * <p> Whether have the item or not. </p>\r\n             *\r\n             * <p> Indicates whether a set has an item having the specified identifier. </p>\r\n             *\r\n             * @param key Key value of the element whose mapped value is accessed.\r\n             *\r\n             * @return Whether the set has an item having the specified identifier.\r\n             */\r\n            SetContainer.prototype.has = function (val) {\r\n                return this.count(val) != 0;\r\n            };\r\n            /**\r\n             * @inheritdoc\r\n             */\r\n            SetContainer.prototype.size = function () {\r\n                return this.data_.size();\r\n            };\r\n            /* =========================================================\r\n                ELEMENTS I/O\r\n                    - INSERT\r\n                    - ERASE\r\n                    - POST-PROCESS\r\n            ============================================================\r\n                INSERT\r\n            --------------------------------------------------------- */\r\n            /**\r\n             * @inheritdoc\r\n             */\r\n            SetContainer.prototype.push = function () {\r\n                var args = [];\r\n                for (var _i = 0; _i < arguments.length; _i++) {\r\n                    args[_i - 0] = arguments[_i];\r\n                }\r\n                for (var i = 0; i < args.length; i++)\r\n                    this.insert_by_val(args[i]);\r\n                return this.size();\r\n            };\r\n            SetContainer.prototype.insert = function () {\r\n                var args = [];\r\n                for (var _i = 0; _i < arguments.length; _i++) {\r\n                    args[_i - 0] = arguments[_i];\r\n                }\r\n                if (args.length == 1)\r\n                    return this.insert_by_val(args[0]);\r\n                else if (args.length == 2 && args[0] instanceof base.Iterator) {\r\n                    if (args[1] instanceof base.Iterator && args[0].get_source() != this && args[1].get_source() != this)\r\n                        return this.insert_by_range(args[0], args[1]);\r\n                    else\r\n                        return this.insert_by_hint(args[0], args[1]);\r\n                }\r\n            };\r\n            /**\r\n             * @hidden\r\n             */\r\n            SetContainer.prototype.insert_by_hint = function (hint, val) {\r\n                // INSERT\r\n                var list_iterator = this.data_.insert(hint.get_list_iterator(), val);\r\n                // POST-PROCESS\r\n                var it = new std.SetIterator(this, list_iterator);\r\n                this.handle_insert(it);\r\n                return it;\r\n            };\r\n            /**\r\n             * @hidden\r\n             */\r\n            SetContainer.prototype.insert_by_range = function (begin, end) {\r\n                for (var it = begin; it.equal_to(end) == false; it = it.next())\r\n                    this.insert_by_val(it.value);\r\n            };\r\n            SetContainer.prototype.erase = function () {\r\n                var args = [];\r\n                for (var _i = 0; _i < arguments.length; _i++) {\r\n                    args[_i - 0] = arguments[_i];\r\n                }\r\n                if (args.length == 1) {\r\n                    if (args[0] instanceof base.Iterator && args[0].get_source() == this)\r\n                        return this.erase_by_iterator(args[0]);\r\n                    else\r\n                        return this.erase_by_val(args[0]);\r\n                }\r\n                else if (args.length == 2 && args[0] instanceof base.Iterator && args[1] instanceof base.Iterator)\r\n                    return this.erase_by_range(args[0], args[1]);\r\n            };\r\n            /**\r\n             * @hidden\r\n             */\r\n            SetContainer.prototype.erase_by_val = function (val) {\r\n                // TEST WHETHER EXISTS\r\n                var it = this.find(val);\r\n                if (it.equal_to(this.end()) == true)\r\n                    return 0;\r\n                // ERASE\r\n                this.erase_by_iterator(it);\r\n                return 1;\r\n            };\r\n            /**\r\n             * @hidden\r\n             */\r\n            SetContainer.prototype.erase_by_iterator = function (it) {\r\n                // ERASE\r\n                var list_iterator = this.data_.erase(it.get_list_iterator());\r\n                // POST-PROCESS\r\n                this.handle_erase(it);\r\n                return new std.SetIterator(this, list_iterator);\r\n            };\r\n            /**\r\n             * @hidden\r\n             */\r\n            SetContainer.prototype.erase_by_range = function (begin, end) {\r\n                // ERASE\r\n                var list_iterator = this.data_.erase(begin.get_list_iterator(), end.get_list_iterator());\r\n                // POST-PROCESS\r\n                for (var it = begin; !it.equal_to(end); it = it.next())\r\n                    this.handle_erase(it);\r\n                return new std.SetIterator(this, list_iterator); //begin.prev();\r\n            };\r\n            return SetContainer;\r\n        }(base.Container));\r\n        base.SetContainer = SetContainer;\r\n    })(base = std.base || (std.base = {}));\r\n})(std || (std = {}));\r\nvar std;\r\n(function (std) {\r\n    /**\r\n     * <p> An iterator of a Set. </p>\r\n     *\r\n     * @author Jeongho Nam <http://samchon.org>\r\n     */\r\n    var SetIterator = (function (_super) {\r\n        __extends(SetIterator, _super);\r\n        /**\r\n         * <p> Construct from source and index number. </p>\r\n         *\r\n         * <h4> Note </h4>\r\n         * <p> Do not create iterator directly. </p>\r\n         * <p> Use begin(), find() or end() in Map instead. </p>\r\n         *\r\n         * @param map The source Set to reference.\r\n         * @param index Sequence number of the element in the source Set.\r\n         */\r\n        function SetIterator(source, it) {\r\n            _super.call(this, source);\r\n            this.list_iterator_ = it;\r\n        }\r\n        /* ---------------------------------------------------------\r\n            MOVERS\r\n        --------------------------------------------------------- */\r\n        /**\r\n         * @inheritdoc\r\n         */\r\n        SetIterator.prototype.prev = function () {\r\n            return new SetIterator(this.set, this.list_iterator_.prev());\r\n        };\r\n        /**\r\n         * @inheritdoc\r\n         */\r\n        SetIterator.prototype.next = function () {\r\n            return new SetIterator(this.set, this.list_iterator_.next());\r\n        };\r\n        /**\r\n         * @inheritdoc\r\n         */\r\n        SetIterator.prototype.advance = function (size) {\r\n            return new SetIterator(this.set, this.list_iterator_.advance(size));\r\n        };\r\n        Object.defineProperty(SetIterator.prototype, \"set\", {\r\n            /* ---------------------------------------------------------\r\n                ACCESSORS\r\n            --------------------------------------------------------- */\r\n            /**\r\n             * @hidden\r\n             */\r\n            get: function () {\r\n                return this.source_;\r\n            },\r\n            enumerable: true,\r\n            configurable: true\r\n        });\r\n        SetIterator.prototype.get_list_iterator = function () {\r\n            return this.list_iterator_;\r\n        };\r\n        Object.defineProperty(SetIterator.prototype, \"value\", {\r\n            /**\r\n             * @inheritdoc\r\n             */\r\n            get: function () {\r\n                return this.list_iterator_.value;\r\n            },\r\n            enumerable: true,\r\n            configurable: true\r\n        });\r\n        /* ---------------------------------------------------------\r\n            COMPARISONS\r\n        --------------------------------------------------------- */\r\n        /**\r\n         * @inheritdoc\r\n         */\r\n        SetIterator.prototype.equal_to = function (obj) {\r\n            return _super.prototype.equal_to.call(this, obj) && this.list_iterator_ == obj.list_iterator_;\r\n        };\r\n        /**\r\n         * @inheritdoc\r\n         */\r\n        SetIterator.prototype.less = function (obj) {\r\n            return std.less(this.value, obj.value);\r\n        };\r\n        /**\r\n         * @inheritdoc\r\n         */\r\n        SetIterator.prototype.hash = function () {\r\n            return std.base.code(this.value);\r\n        };\r\n        /**\r\n         * @inheritdoc\r\n         */\r\n        SetIterator.prototype.swap = function (obj) {\r\n            this.list_iterator_.swap(obj.list_iterator_);\r\n        };\r\n        return SetIterator;\r\n    }(std.base.Iterator));\r\n    std.SetIterator = SetIterator;\r\n    /**\r\n     * <p> A reverse-iterator of Set. </p>\r\n     *\r\n     * @param <T> Type of the elements.\r\n     *\r\n     * @author Jeongho Nam <http://samchon.org>\r\n     */\r\n    var SetReverseIterator = (function (_super) {\r\n        __extends(SetReverseIterator, _super);\r\n        /* ---------------------------------------------------------------\r\n            CONSTRUCTORS\r\n        --------------------------------------------------------------- */\r\n        function SetReverseIterator(iterator) {\r\n            _super.call(this, iterator);\r\n        }\r\n        Object.defineProperty(SetReverseIterator.prototype, \"set_iterator\", {\r\n            /* ---------------------------------------------------------------\r\n                ACCESSORS\r\n            --------------------------------------------------------------- */\r\n            /**\r\n             * @hidden\r\n             */\r\n            get: function () {\r\n                return this.iterator_;\r\n            },\r\n            enumerable: true,\r\n            configurable: true\r\n        });\r\n        /* ---------------------------------------------------------\r\n            MOVERS\r\n        --------------------------------------------------------- */\r\n        /**\r\n         * @inheritdoc\r\n         */\r\n        SetReverseIterator.prototype.prev = function () {\r\n            return new SetReverseIterator(this.set_iterator.next());\r\n        };\r\n        /**\r\n         * @inheritdoc\r\n         */\r\n        SetReverseIterator.prototype.next = function () {\r\n            return new SetReverseIterator(this.set_iterator.prev());\r\n        };\r\n        /**\r\n         * @inheritdoc\r\n         */\r\n        SetReverseIterator.prototype.advance = function (n) {\r\n            return new SetReverseIterator(this.set_iterator.advance(-1 * n));\r\n        };\r\n        return SetReverseIterator;\r\n    }(std.base.ReverseIterator));\r\n    std.SetReverseIterator = SetReverseIterator;\r\n})(std || (std = {}));\r\n/// <reference path=\"SetContainer.ts\" />\r\nvar std;\r\n(function (std) {\r\n    var base;\r\n    (function (base) {\r\n        /**\r\n         * <p> An abstract set. </p>\r\n         *\r\n         * <p> {@link SetContainer SetContainers} are containers that store elements allowing fast retrieval of\r\n         * individual elements based on their value. </p>\r\n         *\r\n         * <p> In an {@link SetContainer}, the value of an element is at the same time its <i>key</i>, used to uniquely\r\n         * identify it. <i>Keys</i> are immutable, therefore, the elements in an {@link SetContainer} cannot be modified\r\n         * once in the container - they can be inserted and removed, though. </p>\r\n         *\r\n         * <p> {@link SetContainer} stores elements, keeps sequence and enables indexing by inserting elements into a\r\n         * {@link List} and registering {@link ListIterator iterators} of the {@link data_ list container} to an index\r\n         * table like {@link RBTree tree} or {@link HashBuckets hash-table}. </p>\r\n         *\r\n         * <h3> Container properties </h3>\r\n         * <dl>\r\n         *\t<dt> Associative </dt>\r\n         *\t<dd>\r\n         *\t\tElements in associative containers are referenced by their <i>key</i> and not by their absolute\r\n         *\t\tposition in the\r\n         *\t</dd>\r\n         *\r\n         *\t<dt> Set </dt>\r\n         *\t<dd> The value of an element is also the <i>key</i> used to identify it. </dd>\r\n         *\r\n         *\t<dt> Unique keys </dt>\r\n         *\t<dd> No two elements in the container can have equivalent <i>keys</i>. </dd>\r\n         * </dl>\r\n         *\r\n         * @param <T> Type of the elements. Each element in a {@link SetContainer} container is also identified\r\n         *\t\t\t  by this value (each value is itself also the element's <i>key</i>).\r\n         *\r\n         * @author Jeongho Nam <http://samchon.org>\r\n         */\r\n        var UniqueSet = (function (_super) {\r\n            __extends(UniqueSet, _super);\r\n            /* =========================================================\r\n                CONSTRUCTORS\r\n            ========================================================= */\r\n            /**\r\n             * Default Constructor.\r\n             */\r\n            function UniqueSet() {\r\n                _super.call(this);\r\n            }\r\n            /**\r\n             * @inheritdoc\r\n             */\r\n            UniqueSet.prototype.count = function (key) {\r\n                return this.find(key).equal_to(this.end()) ? 0 : 1;\r\n            };\r\n            UniqueSet.prototype.insert = function () {\r\n                var args = [];\r\n                for (var _i = 0; _i < arguments.length; _i++) {\r\n                    args[_i - 0] = arguments[_i];\r\n                }\r\n                return _super.prototype.insert.apply(this, args);\r\n            };\r\n            return UniqueSet;\r\n        }(base.SetContainer));\r\n        base.UniqueSet = UniqueSet;\r\n    })(base = std.base || (std.base = {}));\r\n})(std || (std = {}));\r\n/// <reference path=\"SetContainer.ts\" />\r\nvar std;\r\n(function (std) {\r\n    var base;\r\n    (function (base) {\r\n        /**\r\n         * <p> An abstract set. </p>\r\n         *\r\n         * <p> {@link SetContainer SetContainers} are containers that store elements allowing fast retrieval of\r\n         * individual elements based on their value. </p>\r\n         *\r\n         * <p> In an {@link SetContainer}, the value of an element is at the same time its <i>key</i>, used to\r\n         * identify it. <i>Keys</i> are immutable, therefore, the elements in an {@link SetContainer} cannot be\r\n         * modified once in the container - they can be inserted and removed, though. </p>\r\n         *\r\n         * <p> {@link SetContainer} stores elements, keeps sequence and enables indexing by inserting elements into a\r\n         * {@link List} and registering {@link ListIterator iterators} of the {@link data_ list container} to an index\r\n         * table like {@link RBTree tree} or {@link HashBuckets hash-table}. </p>\r\n         *\r\n         * <h3> Container properties </h3>\r\n         * <dl>\r\n         *\t<dt> Associative </dt>\r\n         *\t<dd>\r\n         *\t\tElements in associative containers are referenced by their <i>key</i> and not by their absolute\r\n         *\t\tposition in the\r\n         *\t</dd>\r\n         *\r\n         *\t<dt> Set </dt>\r\n         *\t<dd> The value of an element is also the <i>key</i> used to identify it. </dd>\r\n         *\r\n         *\t<dt> Multiple equivalent keys </dt>\r\n         *\t<dd> Multiple elements in the container can have equivalent <i>keys</i>. </dd>\r\n         * </dl>\r\n         *\r\n         * @param <T> Type of the elements. Each element in a {@link SetContainer} container is also identified\r\n         *\t\t\t  by this value (each value is itself also the element's <i>key</i>).\r\n         *\r\n         * @author Jeongho Nam <http://samchon.org>\r\n         */\r\n        var MultiSet = (function (_super) {\r\n            __extends(MultiSet, _super);\r\n            /* ---------------------------------------------------------\r\n                CONSTRUCTORS\r\n            --------------------------------------------------------- */\r\n            /**\r\n             * Default Constructor.\r\n             */\r\n            function MultiSet() {\r\n                _super.call(this);\r\n            }\r\n            /**\r\n             * @inheritdoc\r\n             */\r\n            MultiSet.prototype.count = function (val) {\r\n                var myIt = this.find(val);\r\n                if (myIt.equal_to(this.end()))\r\n                    return 0;\r\n                var size = 0;\r\n                for (var it = myIt; !it.equal_to(this.end()) && std.equal_to(val, it.value); it = it.next())\r\n                    size++;\r\n                return size;\r\n            };\r\n            MultiSet.prototype.insert = function () {\r\n                var args = [];\r\n                for (var _i = 0; _i < arguments.length; _i++) {\r\n                    args[_i - 0] = arguments[_i];\r\n                }\r\n                return _super.prototype.insert.apply(this, args);\r\n            };\r\n            return MultiSet;\r\n        }(base.SetContainer));\r\n        base.MultiSet = MultiSet;\r\n    })(base = std.base || (std.base = {}));\r\n})(std || (std = {}));\r\n/// <reference path=\"base/UniqueSet.ts\" />\r\n/// <reference path=\"base/MultiSet.ts\" />\r\nvar std;\r\n(function (std) {\r\n    /**\r\n     * <p> Hashed, unordered set. </p>\r\n     *\r\n     * <p> {@link HashSet}s are containers that store unique elements in no particular order, and which\r\n     * allow for fast retrieval of individual elements based on their value. </p>\r\n     *\r\n     * <p> In an {@link HashSet}, the value of an element is at the same time its <i>key</i>, that\r\n     * identifies it uniquely. Keys are immutable, therefore, the elements in an {@link HashSet} cannot be\r\n     * modified once in the container - they can be inserted and removed, though. </p>\r\n     *\r\n     * <p> Internally, the elements in the {@link HashSet} are not sorted in any particular order, but\r\n     * organized into buckets depending on their hash values to allow for fast access to individual elements\r\n     * directly by their <i>values</i> (with a constant average time complexity on average). </p>\r\n     *\r\n     * <p> {@link HashSet} containers are faster than {@link TreeSet} containers to access individual\r\n     * elements by their <i>key</i>, although they are generally less efficient for range iteration through a\r\n     * subset of their elements. </p>\r\n     *\r\n     * <h3> Container properties </h3>\r\n     * <dl>\r\n     *\t<dt> Associative </dt>\r\n     *\t<dd> Elements in associative containers are referenced by their <i>key</i> and not by their absolute\r\n     *\t\t position in the  </dd>\r\n     *\r\n     *\t<dt> Hashed </dt>\r\n     *\t<dd> Hashed containers organize their elements using hash tables that allow for fast access to elements\r\n     *\t\t by their <i>key</i>. </dd>\r\n     *\r\n     *\t<dt> Set </dt>\r\n     *\t<dd> The value of an element is also the <i>key</i> used to identify it. </dd>\r\n     *\r\n     *\t<dt> Unique keys </dt>\r\n     *\t<dd> No two elements in the container can have equivalent <i>keys</i>. </dd>\r\n     * </dl>\r\n     *\r\n     * <ul>\r\n     *  <li> Reference: http://www.cplusplus.com/reference/unordered_set/unordered_set/ </li>\r\n     * </ul>\r\n     *\r\n     * @param <T> Type of the elements.\r\n     *\t\t\t  Each element in an {@link HashSet} is also uniquely identified by this value.\r\n     *\r\n     * @author Jeongho Nam <http://samchon.org>\r\n     */\r\n    var HashSet = (function (_super) {\r\n        __extends(HashSet, _super);\r\n        function HashSet() {\r\n            var args = [];\r\n            for (var _i = 0; _i < arguments.length; _i++) {\r\n                args[_i - 0] = arguments[_i];\r\n            }\r\n            _super.call(this);\r\n            // BUCKET\r\n            this.hash_buckets_ = new std.base.SetHashBuckets(this);\r\n            // OVERLOADINGS\r\n            if (args.length == 1 && args[0] instanceof Array && args[0] instanceof std.Vector == false) {\r\n                this.construct_from_array(args[0]);\r\n            }\r\n            else if (args.length == 1 && args[0] instanceof std.base.Container) {\r\n                this.construct_from_container(args[0]);\r\n            }\r\n            else if (args.length == 2 && args[0] instanceof std.base.Iterator && args[1] instanceof std.base.Iterator) {\r\n                this.construct_from_range(args[0], args[1]);\r\n            }\r\n        }\r\n        /**\r\n         * @hidden\r\n         */\r\n        HashSet.prototype.construct_from_array = function (items) {\r\n            this.hash_buckets_.reserve(items.length * std.base.RATIO);\r\n            _super.prototype.construct_from_array.call(this, items);\r\n        };\r\n        /* ---------------------------------------------------------\r\n            ASSIGN & CLEAR\r\n        --------------------------------------------------------- */\r\n        /**\r\n         * @inheritdoc\r\n         */\r\n        HashSet.prototype.assign = function (begin, end) {\r\n            var it;\r\n            var size = 0;\r\n            // RESERVE HASH_BUCKET SIZE\r\n            for (it = begin; it.equal_to(end) == false; it = it.next())\r\n                size++;\r\n            this.hash_buckets_.clear();\r\n            this.hash_buckets_.reserve(size * std.base.RATIO);\r\n            // SUPER; INSERT\r\n            _super.prototype.assign.call(this, begin, end);\r\n        };\r\n        /**\r\n         * @inheritdoc\r\n         */\r\n        HashSet.prototype.clear = function () {\r\n            _super.prototype.clear.call(this);\r\n            this.hash_buckets_.clear();\r\n        };\r\n        /* =========================================================\r\n            ACCESSORS\r\n        ========================================================= */\r\n        /**\r\n         * @inheritdoc\r\n         */\r\n        HashSet.prototype.find = function (val) {\r\n            return this.hash_buckets_.find(val);\r\n        };\r\n        /* =========================================================\r\n            ELEMENTS I/O\r\n                - INSERT\r\n                - POST-PROCESS\r\n        ============================================================\r\n            INSERT\r\n        --------------------------------------------------------- */\r\n        /**\r\n         * @hidden\r\n         */\r\n        HashSet.prototype.insert_by_val = function (val) {\r\n            // TEST WHETHER EXIST\r\n            var it = this.find(val);\r\n            if (it.equal_to(this.end()) == false)\r\n                return new std.Pair(it, false);\r\n            // INSERT\r\n            this.data_.push_back(val);\r\n            it = it.prev();\r\n            // POST-PROCESS\r\n            this.handle_insert(it);\r\n            return new std.Pair(it, true);\r\n        };\r\n        /**\r\n         * @hidden\r\n         */\r\n        HashSet.prototype.insert_by_range = function (begin, end) {\r\n            // CALCULATE INSERTING SIZE\r\n            var size = 0;\r\n            for (var it = begin; it.equal_to(end) == false; it = it.next())\r\n                size++;\r\n            // IF NEEDED, HASH_BUCKET TO HAVE SUITABLE SIZE\r\n            if (this.size() + size > this.hash_buckets_.size() * std.base.MAX_RATIO)\r\n                this.hash_buckets_.reserve((this.size() + size) * std.base.RATIO);\r\n            // INSERTS\r\n            _super.prototype.insert_by_range.call(this, begin, end);\r\n        };\r\n        /* ---------------------------------------------------------\r\n            POST-PROCESS\r\n        --------------------------------------------------------- */\r\n        /**\r\n         * @inheritdoc\r\n         */\r\n        HashSet.prototype.handle_insert = function (item) {\r\n            this.hash_buckets_.insert(item);\r\n        };\r\n        /**\r\n         * @inheritdoc\r\n         */\r\n        HashSet.prototype.handle_erase = function (item) {\r\n            this.hash_buckets_.erase(item);\r\n        };\r\n        /* ===============================================================\r\n            UTILITIES\r\n        =============================================================== */\r\n        /**\r\n         * @inheritdoc\r\n         */\r\n        HashSet.prototype.swap = function (obj) {\r\n            if (obj instanceof HashSet)\r\n                this.swap_tree_set(obj);\r\n            else\r\n                _super.prototype.swap.call(this, obj);\r\n        };\r\n        /**\r\n         * @hidden\r\n         */\r\n        HashSet.prototype.swap_tree_set = function (obj) {\r\n            _a = [obj.data_, this.data_], this.data_ = _a[0], obj.data_ = _a[1];\r\n            _b = [obj.hash_buckets_, this.hash_buckets_], this.hash_buckets_ = _b[0], obj.hash_buckets_ = _b[1];\r\n            var _a, _b;\r\n        };\r\n        return HashSet;\r\n    }(std.base.UniqueSet));\r\n    std.HashSet = HashSet;\r\n    /**\r\n     * <p> Hashed, unordered Multiset. </p>\r\n     *\r\n     * <p> {@link HashMultiSet HashMultiSets} are containers that store elements in no particular order, allowing fast\r\n     * retrieval of individual elements based on their value, much like {@link HashSet} containers,\r\n     * but allowing different elements to have equivalent values. </p>\r\n     *\r\n     * <p> In an {@link HashMultiSet}, the value of an element is at the same time its <i>key</i>, used to\r\n     * identify it. <i>Keys</i> are immutable, therefore, the elements in an {@link HashMultiSet} cannot be\r\n     * modified once in the container - they can be inserted and removed, though. </p>\r\n     *\r\n     * <p> Internally, the elements in the {@link HashMultiSet} are not sorted in any particular, but\r\n     * organized into <i>buckets</i> depending on their hash values to allow for fast access to individual\r\n     * elements directly by their <i>values</i> (with a constant average time complexity on average). </p>\r\n     *\r\n     * <p> Elements with equivalent values are grouped together in the same bucket and in such a way that an\r\n     * iterator can iterate through all of them. Iterators in the container are doubly linked iterators. </p>\r\n     *\r\n     * <h3> Container properties </h3>\r\n     * <dl>\r\n     *\t<dt> Associative </dt>\r\n     *\t<dd> Elements in associative containers are referenced by their <i>key</i> and not by their absolute\r\n     *\t\t position in the  </dd>\r\n     *\r\n     *\t<dt> Hashed </dt>\r\n     *\t<dd> Hashed containers organize their elements using hash tables that allow for fast access to elements\r\n     *\t\t by their <i>key</i>. </dd>\r\n     *\r\n     *\t<dt> Set </dt>\r\n     *\t<dd> The value of an element is also the <i>key</i> used to identify it. </dd>\r\n     *\r\n     *\t<dt> Multiple equivalent keys </dt>\r\n     *\t<dd> The container can hold multiple elements with equivalent <i>keys</i>. </dd>\r\n     * </dl>\r\n     *\r\n     * <ul>\r\n     *  <li> Reference: http://www.cplusplus.com/reference/unordered_set/unordered_multiset/ </li>\r\n     * </ul>\r\n     *\r\n     * @param <T> Type of the elements.\r\n     *\t\t   Each element in an {@link UnorderedMultiSet} is also identified by this value..\r\n     *\r\n     * @author Jeongho Nam <http://samchon.org>\r\n     */\r\n    var HashMultiSet = (function (_super) {\r\n        __extends(HashMultiSet, _super);\r\n        function HashMultiSet() {\r\n            var args = [];\r\n            for (var _i = 0; _i < arguments.length; _i++) {\r\n                args[_i - 0] = arguments[_i];\r\n            }\r\n            _super.call(this);\r\n            // BUCKET\r\n            this.hash_buckets_ = new std.base.SetHashBuckets(this);\r\n            // OVERLOADINGS\r\n            if (args.length == 1 && args[0] instanceof Array && args[0] instanceof std.Vector == false) {\r\n                this.construct_from_array(args[0]);\r\n            }\r\n            else if (args.length == 1 && args[0] instanceof std.base.Container) {\r\n                this.construct_from_container(args[0]);\r\n            }\r\n            else if (args.length == 2 && args[0] instanceof std.base.Iterator && args[1] instanceof std.base.Iterator) {\r\n                this.construct_from_range(args[0], args[1]);\r\n            }\r\n        }\r\n        /**\r\n         * @hidden\r\n         */\r\n        HashMultiSet.prototype.construct_from_array = function (items) {\r\n            this.hash_buckets_.reserve(items.length * std.base.RATIO);\r\n            _super.prototype.construct_from_array.call(this, items);\r\n        };\r\n        /* ---------------------------------------------------------\r\n            ASSIGN & CLEAR\r\n        --------------------------------------------------------- */\r\n        /**\r\n         * @inheritdoc\r\n         */\r\n        HashMultiSet.prototype.assign = function (begin, end) {\r\n            var it;\r\n            var size = 0;\r\n            // RESERVE HASH_BUCKET SIZE\r\n            for (it = begin; it.equal_to(end) == false; it = it.next())\r\n                size++;\r\n            this.hash_buckets_.clear();\r\n            this.hash_buckets_.reserve(size * std.base.RATIO);\r\n            // SUPER; INSERT\r\n            _super.prototype.assign.call(this, begin, end);\r\n        };\r\n        /**\r\n         * @inheritdoc\r\n         */\r\n        HashMultiSet.prototype.clear = function () {\r\n            _super.prototype.clear.call(this);\r\n            this.hash_buckets_.clear();\r\n        };\r\n        /* =========================================================\r\n            ACCESSORS\r\n        ========================================================= */\r\n        /**\r\n         * @inheritdoc\r\n         */\r\n        HashMultiSet.prototype.find = function (val) {\r\n            return this.hash_buckets_.find(val);\r\n        };\r\n        /* =========================================================\r\n            ELEMENTS I/O\r\n                - INSERT\r\n                - POST-PROCESS\r\n        ============================================================\r\n            INSERT\r\n        --------------------------------------------------------- */\r\n        /**\r\n         * @hidden\r\n         */\r\n        HashMultiSet.prototype.insert_by_val = function (val) {\r\n            // INSERT\r\n            var listIterator = this.data_.insert(this.data_.end(), val);\r\n            var it = new std.SetIterator(this, listIterator);\r\n            // POST-PROCESS\r\n            this.handle_insert(it);\r\n            return it;\r\n        };\r\n        /**\r\n         * @hidden\r\n         */\r\n        HashMultiSet.prototype.insert_by_range = function (begin, end) {\r\n            // CALCULATE INSERTING SIZE\r\n            var size = 0;\r\n            for (var it = begin; it.equal_to(end) == false; it = it.next())\r\n                size++;\r\n            // IF NEEDED, HASH_BUCKET TO HAVE SUITABLE SIZE\r\n            if (this.size() + size > this.hash_buckets_.item_size() * std.base.MAX_RATIO)\r\n                this.hash_buckets_.reserve((this.size() + size) * std.base.RATIO);\r\n            // INSERTS\r\n            _super.prototype.insert_by_range.call(this, begin, end);\r\n        };\r\n        /* ---------------------------------------------------------\r\n            POST-PROCESS\r\n        --------------------------------------------------------- */\r\n        /**\r\n         * @inheritdoc\r\n         */\r\n        HashMultiSet.prototype.handle_insert = function (it) {\r\n            this.hash_buckets_.insert(it);\r\n        };\r\n        /**\r\n         * @inheritdoc\r\n         */\r\n        HashMultiSet.prototype.handle_erase = function (it) {\r\n            this.hash_buckets_.erase(it);\r\n        };\r\n        /* ===============================================================\r\n            UTILITIES\r\n        =============================================================== */\r\n        /**\r\n         * @inheritdoc\r\n         */\r\n        HashMultiSet.prototype.swap = function (obj) {\r\n            if (obj instanceof HashMultiSet)\r\n                this.swap_tree_set(obj);\r\n            else\r\n                _super.prototype.swap.call(this, obj);\r\n        };\r\n        /**\r\n         * @hidden\r\n         */\r\n        HashMultiSet.prototype.swap_tree_set = function (obj) {\r\n            _a = [obj.data_, this.data_], this.data_ = _a[0], obj.data_ = _a[1];\r\n            _b = [obj.hash_buckets_, this.hash_buckets_], this.hash_buckets_ = _b[0], obj.hash_buckets_ = _b[1];\r\n            var _a, _b;\r\n        };\r\n        return HashMultiSet;\r\n    }(std.base.MultiSet));\r\n    std.HashMultiSet = HashMultiSet;\r\n})(std || (std = {}));\r\nvar std;\r\n(function (std) {\r\n    var base;\r\n    (function (base) {\r\n        /**\r\n         * <p> An abstract map. </p>\r\n         *\r\n         * <p> {@link MapContainer MapContainers} are associative containers that store elements formed by a combination\r\n         * of a <i>key value</i> (<i>Key</i>) and a <i>mapped value</i> (<i>T</i>), and which allows for fast retrieval\r\n         * of individual elements based on their keys. </p>\r\n         *\r\n         * <p> In a {@link MapContainer}, the <i>key values</i> are generally used to identify the elements, while the\r\n         * <i>mapped values</i> store the content associated to this key. The types of <i>key</i> and\r\n         * <i>mapped value</i> may differ, and are grouped together in member type <i>value_type</i>, which is a\r\n         * {@link Pair} type combining both: </p>\r\n         *\r\n         * <p> <code>typedef pair<const Key, T> value_type;</code> </p>\r\n         *\r\n         * <p> {@link MapContainer} stores elements, keeps sequence and enables indexing by inserting elements into a\r\n         * {@link List} and registering {@link ListIterator iterators} of the {@link data_ list container} to an index\r\n         * table like {@link RBTree tree} or {@link HashBuckets hash-table}. </p>\r\n         *\r\n         * <h3> Container properties </h3>\r\n         * <dl>\r\n         *\t<dt> Associative </dt>\r\n         *\t<dd>\r\n         *\t\tElements in associative containers are referenced by their <i>key</i> and not by their absolute position\r\n         *\t\tin the\r\n         *\t</dd>\r\n         *\r\n         *\t<dt> Map </dt>\r\n         *\t<dd>\r\n         *\t\tEach element associates a <i>key</i> to a <i>mapped value</i>:\r\n         *\t\t<i>Keys</i> are meant to identify the elements whose main content is the <i>mapped value</i>.\r\n         *\t</dd>\r\n         * </dl>\r\n         *\r\n         * @param <Key> Type of the keys. Each element in a map is identified by its key value.\r\n         * @param <T> Type of the mapped value. Each element in a map stores some data as its mapped value.\r\n         *\r\n         * @author Jeongho Nam <http://samchon.org>\r\n         */\r\n        var MapContainer = (function () {\r\n            function MapContainer() {\r\n                var args = [];\r\n                for (var _i = 0; _i < arguments.length; _i++) {\r\n                    args[_i - 0] = arguments[_i];\r\n                }\r\n                this.data_ = new std.List();\r\n                // THIS IS ABSTRACT CLASS\r\n                // NOTHING TO DO ESPECIALLY\r\n            }\r\n            Object.defineProperty(MapContainer, \"iterator\", {\r\n                /**\r\n                 * Type definition of {@link MapContainer}'s {@link MapIterator iterator}.\r\n                 */\r\n                get: function () { return std.MapIterator; },\r\n                enumerable: true,\r\n                configurable: true\r\n            });\r\n            /**\r\n             * @hidden\r\n             */\r\n            MapContainer.prototype.construct_from_array = function (items) {\r\n                for (var i = 0; i < items.length; i++)\r\n                    if (items[i] instanceof std.Pair)\r\n                        this.insert_by_pair(items[i]);\r\n                    else\r\n                        this.insert_by_tuple(items[i]);\r\n            };\r\n            /**\r\n             * @hidden\r\n             */\r\n            MapContainer.prototype.construct_from_container = function (container) {\r\n                this.construct_from_range(container.begin(), container.end());\r\n            };\r\n            /**\r\n             * @hidden\r\n             */\r\n            MapContainer.prototype.construct_from_range = function (begin, end) {\r\n                this.assign(begin, end);\r\n            };\r\n            /* ---------------------------------------------------------\r\n                ASSIGN & CLEAR\r\n            --------------------------------------------------------- */\r\n            /**\r\n             * <p> Assign new content to content. </p>\r\n             *\r\n             * <p> Assigns new contents to the container, replacing its current contents, and modifying its {@link size}\r\n             * accordingly. </p>\r\n             *\r\n             * @param begin Input interator of the initial position in a sequence.\r\n             * @param end Input interator of the final position in a sequence.\r\n             */\r\n            MapContainer.prototype.assign = function (begin, end) {\r\n                // INSERT\r\n                for (var it = begin; it.equal_to(end) == false; it = it.next())\r\n                    this.insert_by_pair(new std.Pair(it.first, it.second));\r\n            };\r\n            /**\r\n             * <p> Clear content. </p>\r\n             *\r\n             * <p> Removes all elements from the container, leaving the container with a size of 0. </p>\r\n             */\r\n            MapContainer.prototype.clear = function () {\r\n                this.data_.clear();\r\n            };\r\n            /**\r\n             * <p> Return iterator to beginning. </p>\r\n             *\r\n             * <p> Returns an iterator referring the first element in the  </p>\r\n             *\r\n             * <h4> Note </h4>\r\n             * <p> If the container is {@link empty}, the returned iterator is same with {@link end end()}. </p>\r\n             *\r\n             * @return An iterator to the first element in the  The iterator containes the first element's value.\r\n             */\r\n            MapContainer.prototype.begin = function () {\r\n                return new std.MapIterator(this, this.data_.begin());\r\n            };\r\n            /**\r\n             * <p> Return iterator to end. </p>\r\n             * <p> Returns an iterator referring to the past-the-end element in the  </p>\r\n             *\r\n             * <p> The past-the-end element is the theoretical element that would follow the last element in the\r\n             *  It does not point to any element, and thus shall not be dereferenced. </p>\r\n             *\r\n             * <p> Because the ranges used by functions of the container do not include the element reference by their\r\n             * closing iterator, this function is often used in combination with {@link MapContainer}.{@link begin} to\r\n             * specify a range including all the elements in the  </p>\r\n             *\r\n             * <h4> Note </h4>\r\n             * <p> Returned iterator from {@link MapContainer}.{@link end} does not refer any element. Trying to accessing\r\n             * element by the iterator will cause throwing exception ({@link OutOfRange}). </p>\r\n             *\r\n             * <p> If the container is {@link empty}, this function returns the same as {@link begin}. </p>\r\n             *\r\n             * @return An iterator to the end element in the\r\n             */\r\n            MapContainer.prototype.end = function () {\r\n                return new std.MapIterator(this, this.data_.end());\r\n            };\r\n            /**\r\n             * <p> Return {@link MapReverseIterator reverse iterator} to <i>reverse beginning</i>. </p>\r\n             *\r\n             * <p> Returns a {@link MapReverseIterator reverse iterator} pointing to the last element in the container\r\n             * (i.e., its <i>reverse beginning</i>). </p>\r\n             *\r\n             * {@link MapReverseIterator Reverse iterators} iterate backwards: increasing them moves them towards the\r\n             * beginning of the  </p>\r\n             *\r\n             * <p> {@link rbegin} points to the element preceding the one that would be pointed to by member {@link end}.\r\n             * </p>\r\n             *\r\n             * @return A {@link MapReverseIterator reverse iterator} to the <i>reverse beginning</i> of the sequence\r\n             *\r\n             */\r\n            MapContainer.prototype.rbegin = function () {\r\n                if (this.empty() == true)\r\n                    return this.rend();\r\n                else\r\n                    return new std.MapReverseIterator(this, this.data_.end().prev());\r\n            };\r\n            /**\r\n             * <p> Return {@link MapReverseIterator reverse iterator} to <i>reverse end</i>. </p>\r\n             *\r\n             * <p> Returns a {@link MapReverseIterator reverse iterator} pointing to the theoretical element right before\r\n             * the first element in the {@link MapContainer map container} (which is considered its <i>reverse end</i>).\r\n             * </p>\r\n             *\r\n             * <p> The range between {@link MapContainer}.{@link rbegin} and {@link MapContainer}.{@link rend} contains\r\n             * all the elements of the container (in reverse order). </p>\r\n             *\r\n             * @return A {@link MapReverseIterator reverse iterator} to the <i>reverse end</i> of the sequence\r\n             */\r\n            MapContainer.prototype.rend = function () {\r\n                return new std.MapReverseIterator(this, this.data_.end());\r\n            };\r\n            /* ---------------------------------------------------------\r\n                ELEMENTS\r\n            --------------------------------------------------------- */\r\n            /**\r\n             * <p> Whether have the item or not. </p>\r\n             *\r\n             * <p> Indicates whether a map has an item having the specified identifier. </p>\r\n             *\r\n             * @param key Key value of the element whose mapped value is accessed.\r\n             *\r\n             * @return Whether the map has an item having the specified identifier.\r\n             */\r\n            MapContainer.prototype.has = function (key) {\r\n                return this.count(key) != 0;\r\n            };\r\n            /**\r\n             * Return the number of elements in the map.\r\n             */\r\n            MapContainer.prototype.size = function () {\r\n                return this.data_.size();\r\n            };\r\n            /**\r\n             * Test whether the container is empty.\r\n             */\r\n            MapContainer.prototype.empty = function () {\r\n                return this.size() == 0;\r\n            };\r\n            MapContainer.prototype.insert = function () {\r\n                var args = [];\r\n                for (var _i = 0; _i < arguments.length; _i++) {\r\n                    args[_i - 0] = arguments[_i];\r\n                }\r\n                if (args.length == 1 && args[0] instanceof std.Pair) {\r\n                    return this.insert_by_pair(args[0]);\r\n                }\r\n                else if (args.length == 1 && args[0] instanceof Array) {\r\n                    return this.insert_by_tuple(args[0]);\r\n                }\r\n                else if (args.length == 2 && args[0] instanceof std.MapIterator && args[1] instanceof std.Pair) {\r\n                    return this.insert_by_hint(args[0], args[1]);\r\n                }\r\n                else if (args.length == 2 && args[0] instanceof std.MapIterator && args[1] instanceof Array) {\r\n                    return this.insert_by_hint_with_tuple(args[0], args[1]);\r\n                }\r\n                else if (args.length == 2 && args[0] instanceof std.MapIterator && args[1] instanceof std.MapIterator) {\r\n                    return this.insert_by_range(args[0], args[1]);\r\n                }\r\n            };\r\n            /**\r\n             * @hidden\r\n             */\r\n            MapContainer.prototype.insert_by_tuple = function (tuple) {\r\n                return this.insert_by_pair(new std.Pair(tuple[0], tuple[1]));\r\n            };\r\n            /**\r\n             * @hidden\r\n             */\r\n            MapContainer.prototype.insert_by_hint = function (hint, pair) {\r\n                // INSERT\r\n                var list_it = this.data_.insert(hint.get_list_iterator(), pair);\r\n                // POST-PROCESS\r\n                var it = new std.MapIterator(this, list_it);\r\n                this.handle_insert(it);\r\n                return it;\r\n            };\r\n            /**\r\n             * @hidden\r\n             */\r\n            MapContainer.prototype.insert_by_hint_with_tuple = function (hint, tuple) {\r\n                return this.insert_by_hint(hint, new std.Pair(tuple[0], tuple[1]));\r\n            };\r\n            /**\r\n             * @hidden\r\n             */\r\n            MapContainer.prototype.insert_by_range = function (begin, end) {\r\n                for (var it = begin; it.equal_to(end) == false; it = it.next())\r\n                    this.insert_by_pair(new std.Pair(it.first, it.second));\r\n            };\r\n            MapContainer.prototype.erase = function () {\r\n                var args = [];\r\n                for (var _i = 0; _i < arguments.length; _i++) {\r\n                    args[_i - 0] = arguments[_i];\r\n                }\r\n                if (args.length == 1) {\r\n                    if (args[0] instanceof std.MapIterator && args[0].get_source() == this)\r\n                        return this.erase_by_iterator(args[0]);\r\n                    else\r\n                        return this.erase_by_key(args[0]);\r\n                }\r\n                else if (args.length == 2 && args[0] instanceof std.MapIterator && args[1] instanceof std.MapIterator)\r\n                    return this.erase_by_range(args[0], args[1]);\r\n            };\r\n            /**\r\n             * @hidden\r\n             */\r\n            MapContainer.prototype.erase_by_key = function (key) {\r\n                var it = this.find(key);\r\n                if (it.equal_to(this.end()) == true)\r\n                    return 0;\r\n                this.erase_by_iterator(it);\r\n                return 1;\r\n            };\r\n            /**\r\n             * @hidden\r\n             */\r\n            MapContainer.prototype.erase_by_iterator = function (it) {\r\n                // ERASE\r\n                var listIterator = this.data_.erase(it.get_list_iterator());\r\n                // POST-PROCESS\r\n                this.handle_erase(it);\r\n                return new std.MapIterator(this, listIterator);\r\n                ;\r\n            };\r\n            /**\r\n             * @hidden\r\n             */\r\n            MapContainer.prototype.erase_by_range = function (begin, end) {\r\n                // ERASE\r\n                var listIterator = this.data_.erase(begin.get_list_iterator(), end.get_list_iterator());\r\n                // POST-PROCESS\r\n                for (var it = begin; !it.equal_to(end); it = it.next())\r\n                    this.handle_erase(it);\r\n                return new std.MapIterator(this, listIterator);\r\n            };\r\n            /* ===============================================================\r\n                UTILITIES\r\n            =============================================================== */\r\n            /**\r\n             * <p> Swap content. </p>\r\n             *\r\n             * <p> Exchanges the content of the container by the content of <i>obj</i>, which is another\r\n             * {@link MapContainer map} of the same type. Sizes abd container type may differ. </p>\r\n             *\r\n             * <p> After the call to this member function, the elements in this container are those which were\r\n             * in <i>obj</i> before the call, and the elements of <i>obj</i> are those which were in this. All\r\n             * iterators, references and pointers remain valid for the swapped objects. </p>\r\n             *\r\n             * <p> Notice that a non-member function exists with the same name, {@link std.swap swap}, overloading that\r\n             * algorithm with an optimization that behaves like this member function. </p>\r\n             *\r\n             * @param obj Another {@link MapContainer map container} of the same type of elements as this (i.e.,\r\n             *\t\t\t  with the same template parameters, <b>Key</b> and <b>T</b>) whose content is swapped\r\n             *\t\t\t  with that of this {@link MapContaier container}.\r\n             */\r\n            MapContainer.prototype.swap = function (obj) {\r\n                var supplement = new std.HashMultiMap(this.begin(), this.end());\r\n                this.assign(obj.begin(), obj.end());\r\n                obj.assign(supplement.begin(), supplement.end());\r\n            };\r\n            return MapContainer;\r\n        }());\r\n        base.MapContainer = MapContainer;\r\n    })(base = std.base || (std.base = {}));\r\n})(std || (std = {}));\r\nvar std;\r\n(function (std) {\r\n    /**\r\n     * An iterator of {@link MapColntainer map container}.\r\n     *\r\n     * @author Jeongho Nam <http://samchon.org>\r\n     */\r\n    var MapIterator = (function () {\r\n        /* ---------------------------------------------------------\r\n            CONSTRUCTORS\r\n        --------------------------------------------------------- */\r\n        /**\r\n         * Construct from the {@link MapContainer source map} and {@link ListIterator list iterator}.\r\n         *\r\n         * @param source The source {@link MapContainer}.\r\n         * @param list_iterator A {@link ListIterator} pointing {@link Pair} of <i>key</i> and <i>value</i>.\r\n         */\r\n        function MapIterator(source, list_iterator) {\r\n            this.source_ = source;\r\n            this.list_iterator_ = list_iterator;\r\n        }\r\n        /* ---------------------------------------------------------\r\n            MOVERS\r\n        --------------------------------------------------------- */\r\n        /**\r\n         * Get iterator to previous element.\r\n         */\r\n        MapIterator.prototype.prev = function () {\r\n            return new MapIterator(this.source_, this.list_iterator_.prev());\r\n        };\r\n        /**\r\n         * Get iterator to next element.\r\n         */\r\n        MapIterator.prototype.next = function () {\r\n            return new MapIterator(this.source_, this.list_iterator_.next());\r\n        };\r\n        /**\r\n         * Advances the Iterator by n element positions.\r\n         *\r\n         * @param step Number of element positions to advance.\r\n         * @return An advanced Iterator.\r\n         */\r\n        MapIterator.prototype.advance = function (step) {\r\n            return new MapIterator(this.source_, this.list_iterator_.advance(step));\r\n        };\r\n        /* ---------------------------------------------------------\r\n            ACCESSORS\r\n        --------------------------------------------------------- */\r\n        /**\r\n         * Get source.\r\n         */\r\n        MapIterator.prototype.get_source = function () {\r\n            return this.source_;\r\n        };\r\n        /**\r\n         * Get ListIterator.\r\n         */\r\n        MapIterator.prototype.get_list_iterator = function () {\r\n            return this.list_iterator_;\r\n        };\r\n        Object.defineProperty(MapIterator.prototype, \"first\", {\r\n            /**\r\n             * Get first, key element.\r\n             */\r\n            get: function () {\r\n                return this.list_iterator_.value.first;\r\n            },\r\n            enumerable: true,\r\n            configurable: true\r\n        });\r\n        Object.defineProperty(MapIterator.prototype, \"second\", {\r\n            /**\r\n             * Get second, value element.\r\n             */\r\n            get: function () {\r\n                return this.list_iterator_.value.second;\r\n            },\r\n            /**\r\n             * Set second value.\r\n             */\r\n            set: function (val) {\r\n                this.list_iterator_.value.second = val;\r\n            },\r\n            enumerable: true,\r\n            configurable: true\r\n        });\r\n        /* ---------------------------------------------------------\r\n            COMPARISONS\r\n        --------------------------------------------------------- */\r\n        /**\r\n         * <p> Whether an iterator is equal with the iterator. </p>\r\n         *\r\n         * <p> Compare two iterators and returns whether they are equal or not. </p>\r\n         *\r\n         * @param obj An iterator to compare\r\n         * @return Indicates whether equal or not.\r\n         */\r\n        MapIterator.prototype.equal_to = function (obj) {\r\n            return this.source_ == obj.source_ && this.list_iterator_.equal_to(obj.list_iterator_);\r\n        };\r\n        MapIterator.prototype.less = function (obj) {\r\n            return std.less(this.first, obj.first);\r\n        };\r\n        MapIterator.prototype.hash = function () {\r\n            return std.hash(this.first);\r\n        };\r\n        MapIterator.prototype.swap = function (obj) {\r\n            this.list_iterator_.swap(obj.list_iterator_);\r\n        };\r\n        return MapIterator;\r\n    }());\r\n    std.MapIterator = MapIterator;\r\n    /**\r\n     * A reverse-iterator of {@link MapColntainer map container}.\r\n     *\r\n     * @author Jeongho Nam <http://samchon.org>\r\n     */\r\n    var MapReverseIterator = (function (_super) {\r\n        __extends(MapReverseIterator, _super);\r\n        /* ---------------------------------------------------------\r\n            CONSTRUCTORS\r\n        --------------------------------------------------------- */\r\n        /**\r\n         * Construct from the {@link MapContainer source map} and {@link ListIterator list iterator}.\r\n         *\r\n         * @param source The source {@link MapContainer}.\r\n         * @param list_iterator A {@link ListIterator} pointing {@link Pair} of <i>key</i> and <i>value</i>.\r\n         */\r\n        function MapReverseIterator(source, list_iterator) {\r\n            _super.call(this, source, list_iterator);\r\n        }\r\n        /* ---------------------------------------------------------\r\n            MOVERS\r\n        --------------------------------------------------------- */\r\n        /**\r\n         * @inheritdoc\r\n         */\r\n        MapReverseIterator.prototype.prev = function () {\r\n            return new MapReverseIterator(this.source_, this.list_iterator_.next());\r\n        };\r\n        /**\r\n         * @inheritdoc\r\n         */\r\n        MapReverseIterator.prototype.next = function () {\r\n            return new MapReverseIterator(this.source_, this.list_iterator_.next());\r\n        };\r\n        /**\r\n         * @inheritdoc\r\n         */\r\n        MapReverseIterator.prototype.advance = function (step) {\r\n            return new MapReverseIterator(this.source_, this.list_iterator_.advance(-1 * step));\r\n        };\r\n        return MapReverseIterator;\r\n    }(MapIterator));\r\n    std.MapReverseIterator = MapReverseIterator;\r\n})(std || (std = {}));\r\n/// <reference path=\"MapContainer.ts\" />\r\nvar std;\r\n(function (std) {\r\n    var base;\r\n    (function (base) {\r\n        /**\r\n         * <p> An abstract unique-map. </p>\r\n         *\r\n         * <p> {@link UniqueMap UniqueMaps} are associative containers that store elements formed by a combination of a\r\n         * <i>key value</i> (<i>Key</i>) and a <i>mapped value</i> (<i>T</i>), and which allows for fast retrieval of\r\n         * individual elements based on their keys. </p>\r\n         *\r\n         * <p> In a {@link MapContainer}, the <i>key values</i> are generally used to uniquely identify the elements,\r\n         * while the <i>mapped values</i> store the content associated to this key. The types of <i>key</i> and\r\n         * <i>mapped value</i> may differ, and are grouped together in member type <i>value_type</i>, which is a\r\n         * {@link Pair} type combining both: </p>\r\n         *\r\n         * <p> <code>typedef pair<const Key, T> value_type;</code> </p>\r\n         *\r\n         * <p> {@link UniqueMap} stores elements, keeps sequence and enables indexing by inserting elements into a\r\n         * {@link List} and registering {@link ListIterator iterators} of the {@link data_ list container} to an index\r\n         * table like {@link RBTree tree} or {@link HashBuckets hash-table}. </p>\r\n         *\r\n         * <h3> Container properties </h3>\r\n         * <dl>\r\n         *\t<dt> Associative </dt>\r\n         *\t<dd>\r\n         *\t\tElements in associative containers are referenced by their <i>key</i> and not by their absolute position\r\n         *\t\tin the\r\n         *\t</dd>\r\n         *\r\n         *\t<dt> Map </dt>\r\n         *\t<dd>\r\n         *\t\tEach element associates a <i>key</i> to a <i>mapped value</i>:\r\n         *\t\t<i>Keys</i> are meant to identify the elements whose main content is the <i>mapped value</i>.\r\n         *\t</dd>\r\n         *\r\n         *\t<dt> Unique keys </dt>\r\n         *\t<dd> No two elements in the container can have equivalent <i>keys</i>. </dd>\r\n         * </dl>\r\n         *\r\n         * @param <Key> Type of the keys. Each element in a map is uniquely identified by its key value.\r\n         * @param <T> Type of the mapped value. Each element in a map stores some data as its mapped value.\r\n         *\r\n         * @author Jeongho Nam <http://samchon.org>\r\n         */\r\n        var UniqueMap = (function (_super) {\r\n            __extends(UniqueMap, _super);\r\n            /**\r\n             * Default Constructor.\r\n             */\r\n            function UniqueMap() {\r\n                _super.call(this);\r\n                // THIS IS ABSTRACT CLASS\r\n                // NOTHING TO DO ESPECIALLY\r\n            }\r\n            /* ---------------------------------------------------------\r\n                ACCESSORS\r\n            --------------------------------------------------------- */\r\n            /**\r\n             * @inheritdoc\r\n             */\r\n            UniqueMap.prototype.count = function (key) {\r\n                return this.find(key).equal_to(this.end()) ? 0 : 1;\r\n            };\r\n            /**\r\n             * <p> Get an element </p>\r\n             *\r\n             * <p> Returns a reference to the mapped value of the element identified with <i>key</i>. </p>\r\n             *\r\n             * @param key Key value of the element whose mapped value is accessed.\r\n             *\r\n             * @throw exception out of range\r\n             *\r\n             * @return A reference object of the mapped value (_Ty)\r\n             */\r\n            UniqueMap.prototype.get = function (key) {\r\n                var it = this.find(key);\r\n                if (it.equal_to(this.end()) == true)\r\n                    throw new std.OutOfRange(\"unable to find the matched key.\");\r\n                return it.second;\r\n            };\r\n            /**\r\n             * <p> Set an item as the specified identifier. </p>\r\n             *\r\n             * <p>If the identifier is already in map, change value of the identifier. If not, then insert the object\r\n             * with the identifier. </p>\r\n             *\r\n             * @param key Key value of the element whose mapped value is accessed.\r\n             * @param val Value, the item.\r\n             */\r\n            UniqueMap.prototype.set = function (key, val) {\r\n                var it = this.find(key);\r\n                if (it.equal_to(this.end()) == true)\r\n                    this.insert(new std.Pair(key, val));\r\n                else\r\n                    it.second = val;\r\n            };\r\n            UniqueMap.prototype.insert = function () {\r\n                var args = [];\r\n                for (var _i = 0; _i < arguments.length; _i++) {\r\n                    args[_i - 0] = arguments[_i];\r\n                }\r\n                return _super.prototype.insert.apply(this, args);\r\n            };\r\n            return UniqueMap;\r\n        }(base.MapContainer));\r\n        base.UniqueMap = UniqueMap;\r\n    })(base = std.base || (std.base = {}));\r\n})(std || (std = {}));\r\n/// <reference path=\"MapContainer.ts\" />\r\nvar std;\r\n(function (std) {\r\n    var base;\r\n    (function (base) {\r\n        /**\r\n         * <p> An abstract multi-map. </p>\r\n         *\r\n         * <p> {@link MultiMap MultiMaps} are associative containers that store elements formed by a combination of a\r\n         * <i>key value</i> (<i>Key</i>) and a <i>mapped value</i> (<i>T</i>), and which allows for fast retrieval of\r\n         * individual elements based on their keys. </p>\r\n         *\r\n         * <p> In a {@link MapContainer}, the <i>key values</i> are generally used to identify the elements, while the\r\n         * <i>mapped values</i> store the content associated to this <i>key</i>. The types of <i>key</i> and\r\n         * <i>mapped value</i> may differ, and are grouped together in member type <i>value_type</i>, which is a\r\n         * {@link Pair} type combining both: </p>\r\n         *\r\n         * <p> <code>typedef pair<const Key, T> value_type;</code> </p>\r\n         *\r\n         * <p> {@link UniqueMap} stores elements, keeps sequence and enables indexing by inserting elements into a\r\n         * {@link List} and registering {@link ListIterator iterators} of the {@link data_ list container} to an index\r\n         * table like {@link RBTree tree} or {@link HashBuckets hash-table}. </p>\r\n         *\r\n         * <h3> Container properties </h3>\r\n         * <dl>\r\n         *\t<dt> Associative </dt>\r\n         *\t<dd>\r\n         *\t\tElements in associative containers are referenced by their <i>key</i> and not by their absolute position\r\n         *\t\tin the\r\n         *\t</dd>\r\n         *\r\n         *\t<dt> Map </dt>\r\n         *\t<dd>\r\n         *\t\tEach element associates a <i>key</i> to a <i>mapped value</i>:\r\n         *\t\t<i>Keys</i> are meant to identify the elements whose main content is the <i>mapped value</i>.\r\n         *\t</dd>\r\n         *\r\n         *\t<dt> Multiple equivalent keys </dt>\r\n         *\t<dd> Multiple elements in the container can have equivalent <i>keys</i>. </dd>\r\n         * </dl>\r\n         *\r\n         * @param <Key> Type of the keys. Each element in a map is identified by its key value.\r\n         * @param <T> Type of the mapped value. Each element in a map stores some data as its mapped value.\r\n         *\r\n         * @author Jeongho Nam <http://samchon.org>\r\n         */\r\n        var MultiMap = (function (_super) {\r\n            __extends(MultiMap, _super);\r\n            /**\r\n             * Default Constructor.\r\n             */\r\n            function MultiMap() {\r\n                _super.call(this);\r\n                // THIS IS ABSTRACT CLASS\r\n                // NOTHING TO DO ESPECIALLY\r\n            }\r\n            /**\r\n             * @inheritdoc\r\n             */\r\n            MultiMap.prototype.count = function (key) {\r\n                var myIt = this.find(key);\r\n                if (myIt.equal_to(this.end()))\r\n                    return 0;\r\n                var size = 0;\r\n                for (var it = myIt.next(); !it.equal_to(this.end()) && std.equal_to(key, it.first); it = it.next())\r\n                    size++;\r\n                return size;\r\n            };\r\n            MultiMap.prototype.insert = function () {\r\n                var args = [];\r\n                for (var _i = 0; _i < arguments.length; _i++) {\r\n                    args[_i - 0] = arguments[_i];\r\n                }\r\n                return _super.prototype.insert.apply(this, args);\r\n            };\r\n            return MultiMap;\r\n        }(base.MapContainer));\r\n        base.MultiMap = MultiMap;\r\n    })(base = std.base || (std.base = {}));\r\n})(std || (std = {}));\r\n/// <reference path=\"base/UniqueMap.ts\" />\r\n/// <reference path=\"base/MultiMap.ts\" />\r\nvar std;\r\n(function (std) {\r\n    /**\r\n     * <p> Hashed, unordered map. </p>\r\n     *\r\n     * <p> {@link HashMap}s are associative containers that store elements formed by the\r\n     * combination of a <i>key value</i> and a <i>mapped value</i>, and which allows for fast\r\n     * retrieval of individual elements based on their <i>keys</i>. </p>\r\n     *\r\n     * <p> In an {@link HashMap}, the <i>key value</i> is generally used to uniquely identify\r\n     * the element, while the <i>mapped value</i> is an object with the content associated to this\r\n     * <i>key</i>. Types of <i>key</i> and <i>mapped value</i> may differ. </p>\r\n     *\r\n     * <p> Internally, the elements in the {@link HashMap} are not sorted in any particular order\r\n     * with respect to either their <i>key</i> or <i>mapped values</i>, but organized into <i>buckets</i>\r\n     * depending on their hash values to allow for fast access to individual elements directly by\r\n     * their <i>key values</i> (with a constant average time complexity on average). </p>\r\n     *\r\n     * <p> {@link HashMap} containers are faster than {@link TreeMap} containers to access\r\n     * individual elements by their <i>key</i>, although they are generally less efficient for range\r\n     * iteration through a subset of their elements. </p>\r\n     *\r\n     * <h3> Container properties </h3>\r\n     * <dl>\r\n     * \t<dt> Associative </dt>\r\n     * \t<dd> Elements in associative containers are referenced by their <i>key</i> and not by their absolute\r\n     *\t\t position in the  </dd>\r\n     *\r\n     * \t<dt> Hashed </dt>\r\n     * \t<dd> Hashed containers organize their elements using hash tables that allow for fast access to elements\r\n     *\t\t by their <i>key</i>. </dd>\r\n     *\r\n     * \t<dt> Map </dt>\r\n     * \t<dd> Each element associates a <i>key</i> to a <i>mapped value</i>:\r\n     *\t\t <i>Keys</i> are meant to identify the elements whose main content is the <i>mapped value</i>. </dd>\r\n     *\r\n     * \t<dt> Unique keys </dt>\r\n     * \t<dd> No two elements in the container can have equivalent keys. </dd>\r\n     * </dl>\r\n     *\r\n     * <ul>\r\n     *  <li> Reference: http://www.cplusplus.com/reference/unordered_map/unordered_map/ </li>\r\n     * </ul>\r\n     *\r\n     * @param <Key> Type of the key values.\r\n     *\t\t\t\tEach element in an {@link HashMap} is uniquely identified by its key value.\r\n     * @param <T> Type of the mapped value.\r\n     *\t\t\t  Each element in an {@link HashMap} is used to store some data as its mapped value.\r\n     *\r\n     * @author Jeongho Nam <http://samchon.org>\r\n     */\r\n    var HashMap = (function (_super) {\r\n        __extends(HashMap, _super);\r\n        function HashMap() {\r\n            var args = [];\r\n            for (var _i = 0; _i < arguments.length; _i++) {\r\n                args[_i - 0] = arguments[_i];\r\n            }\r\n            _super.call(this);\r\n            // HASH_BUCKET\r\n            this.hash_buckets_ = new std.base.MapHashBuckets(this);\r\n            // OVERLOADINGS\r\n            if (args.length == 1 && args[0] instanceof Array) {\r\n                this.construct_from_array(args[0]);\r\n            }\r\n            else if (args.length == 1 && args[0] instanceof std.base.MapContainer) {\r\n                this.construct_from_container(args[0]);\r\n            }\r\n            else if (args.length == 2 && args[0] instanceof std.MapIterator && args[1] instanceof std.MapIterator) {\r\n                this.construct_from_range(args[0], args[1]);\r\n            }\r\n        }\r\n        /**\r\n         * @hidden\r\n         */\r\n        HashMap.prototype.construct_from_array = function (items) {\r\n            this.hash_buckets_.reserve(items.length * std.base.RATIO);\r\n            _super.prototype.construct_from_array.call(this, items);\r\n        };\r\n        /* ---------------------------------------------------------\r\n            ASSIGN & CLEAR\r\n        --------------------------------------------------------- */\r\n        /**\r\n         * @inheritdoc\r\n         */\r\n        HashMap.prototype.assign = function (begin, end) {\r\n            var it;\r\n            var size = 0;\r\n            // RESERVE HASH_BUCKET SIZE\r\n            for (it = begin; it.equal_to(end) == false; it = it.next())\r\n                size++;\r\n            this.hash_buckets_.clear();\r\n            this.hash_buckets_.reserve(size * std.base.RATIO);\r\n            // SUPER; INSERT\r\n            _super.prototype.assign.call(this, begin, end);\r\n        };\r\n        /**\r\n         * @inheritdoc\r\n         */\r\n        HashMap.prototype.clear = function () {\r\n            _super.prototype.clear.call(this);\r\n            this.hash_buckets_.clear();\r\n        };\r\n        /* =========================================================\r\n            ACCESSORS\r\n        ========================================================= */\r\n        /**\r\n         * @inheritdoc\r\n         */\r\n        HashMap.prototype.find = function (key) {\r\n            return this.hash_buckets_.find(key);\r\n        };\r\n        /* =========================================================\r\n            ELEMENTS I/O\r\n                - INSERT\r\n                - POST-PROCESS\r\n        ============================================================\r\n            INSERT\r\n        --------------------------------------------------------- */\r\n        /**\r\n         * @hidden\r\n         */\r\n        HashMap.prototype.insert_by_pair = function (pair) {\r\n            // TEST WHETHER EXIST\r\n            var it = this.find(pair.first);\r\n            if (it.equal_to(this.end()) == false)\r\n                return new std.Pair(it, false);\r\n            // INSERT\r\n            this.data_.push_back(pair);\r\n            it = it.prev();\r\n            // POST-PROCESS\r\n            this.handle_insert(it);\r\n            return new std.Pair(it, true);\r\n        };\r\n        /**\r\n         * @hidden\r\n         */\r\n        HashMap.prototype.insert_by_range = function (begin, end) {\r\n            // CALCULATE INSERTING SIZE\r\n            var size = 0;\r\n            for (var it = begin; it.equal_to(end) == false; it = it.next())\r\n                size++;\r\n            // IF NEEDED, HASH_BUCKET TO HAVE SUITABLE SIZE\r\n            if (this.size() + size > this.hash_buckets_.item_size() * std.base.MAX_RATIO)\r\n                this.hash_buckets_.reserve((this.size() + size) * std.base.RATIO);\r\n            // INSERTS\r\n            _super.prototype.insert_by_range.call(this, begin, end);\r\n        };\r\n        /* ---------------------------------------------------------\r\n            POST-PROCESS\r\n        --------------------------------------------------------- */\r\n        /**\r\n         * @inheritdoc\r\n         */\r\n        HashMap.prototype.handle_insert = function (it) {\r\n            this.hash_buckets_.insert(it);\r\n        };\r\n        /**\r\n         * @inheritdoc\r\n         */\r\n        HashMap.prototype.handle_erase = function (it) {\r\n            this.hash_buckets_.erase(it);\r\n        };\r\n        /* ===============================================================\r\n            UTILITIES\r\n        =============================================================== */\r\n        /**\r\n         * @inheritdoc\r\n         */\r\n        HashMap.prototype.swap = function (obj) {\r\n            if (obj instanceof HashMap)\r\n                this.swap_hash_map(obj);\r\n            else\r\n                _super.prototype.swap.call(this, obj);\r\n        };\r\n        /**\r\n         * @hidden\r\n         */\r\n        HashMap.prototype.swap_hash_map = function (obj) {\r\n            _a = [obj.data_, this.data_], this.data_ = _a[0], obj.data_ = _a[1];\r\n            _b = [obj.hash_buckets_, this.hash_buckets_], this.hash_buckets_ = _b[0], obj.hash_buckets_ = _b[1];\r\n            var _a, _b;\r\n        };\r\n        return HashMap;\r\n    }(std.base.UniqueMap));\r\n    std.HashMap = HashMap;\r\n    /**\r\n     * <p> Hashed, unordered Multimap. </p>\r\n     *\r\n     * <p> {@link HashMap}s are associative containers that store elements formed by the combination of\r\n     * a <i>key value</i> and a <i>mapped value</i>, much like {@link HashMap} containers, but allowing\r\n     * different elements to have equivalent <i>keys</i>. </p>\r\n     *\r\n     * <p> In an {@link HashMap}, the <i>key value</i> is generally used to uniquely identify the\r\n     * element, while the <i>mapped value</i> is an object with the content associated to this <i>key</i>.\r\n     * Types of <i>key</i> and <i>mapped value</i> may differ. </p>\r\n     *\r\n     * <p> Internally, the elements in the {@link HashMap} are not sorted in any particular order with\r\n     * respect to either their <i>key</i> or <i>mapped values</i>, but organized into <i>buckets</i> depending on\r\n     * their hash values to allow for fast access to individual elements directly by their <i>key values</i>\r\n     * (with a constant average time complexity on average). </p>\r\n     *\r\n     * <p> Elements with equivalent <i>keys</i> are grouped together in the same bucket and in such a way that\r\n     * an iterator can iterate through all of them. Iterators in the container are doubly linked iterators. </p>\r\n     *\r\n     * <h3> Container properties </h3>\r\n     * <dl>\r\n     *\t<dt> Associative </dt>\r\n     *\t<dd> Elements in associative containers are referenced by their <i>key</i> and not by their absolute\r\n     *\t\t position in the  </dd>\r\n     *\r\n     *\t<dt> Hashed </dt>\r\n     *\t<dd> Hashed containers organize their elements using hash tables that allow for fast access to elements\r\n     *\t\t by their <i>key</i>. </dd>\r\n     *\r\n     *\t<dt> Map </dt>\r\n     *\t<dd> Each element associates a <i>key</i> to a <i>mapped value</i>:\r\n     *\t\t <i>Keys</i> are meant to identify the elements whose main content is the <i>mapped value</i>. </dd>\r\n     *\r\n     *\t<dt> Multiple equivalent keys </dt>\r\n     *\t<dd> The container can hold multiple elements with equivalent <i>keys</i>. </dd>\r\n     * </dl>\r\n     *\r\n     * <ul>\r\n     *  <li> Reference: http://www.cplusplus.com/reference/unordered_map/unordered_multimap/ </li>\r\n     * </ul>\r\n     *\r\n     * @param <Key> Type of the key values.\r\n     *\t\t\t\tEach element in an {@link HashMap} is identified by a key value.\r\n     * @param <T> Type of the mapped value.\r\n     *\t\t\t  Each element in an {@link HashMap} is used to store some data as its mapped value.\r\n     *\r\n     * @author Jeongho Nam <http://samchon.org>\r\n     */\r\n    var HashMultiMap = (function (_super) {\r\n        __extends(HashMultiMap, _super);\r\n        function HashMultiMap() {\r\n            var args = [];\r\n            for (var _i = 0; _i < arguments.length; _i++) {\r\n                args[_i - 0] = arguments[_i];\r\n            }\r\n            _super.call(this);\r\n            // HASH_BUCKET\r\n            this.hash_buckets_ = new std.base.MapHashBuckets(this);\r\n            // OVERLOADINGS\r\n            if (args.length == 1 && args[0] instanceof Array) {\r\n                this.construct_from_array(args[0]);\r\n            }\r\n            else if (args.length == 1 && args[0] instanceof std.base.MapContainer) {\r\n                this.construct_from_container(args[0]);\r\n            }\r\n            else if (args.length == 2 && args[0] instanceof std.MapIterator && args[1] instanceof std.MapIterator) {\r\n                this.construct_from_range(args[0], args[1]);\r\n            }\r\n        }\r\n        /**\r\n         * @hidden\r\n         */\r\n        HashMultiMap.prototype.construct_from_array = function (items) {\r\n            this.hash_buckets_.reserve(items.length * std.base.RATIO);\r\n            _super.prototype.construct_from_array.call(this, items);\r\n        };\r\n        /* ---------------------------------------------------------\r\n            ASSIGN & CLEAR\r\n        --------------------------------------------------------- */\r\n        /**\r\n         * @inheritdoc\r\n         */\r\n        HashMultiMap.prototype.assign = function (begin, end) {\r\n            var it;\r\n            var size = 0;\r\n            // REVERSE HASH_GROUP SIZE\r\n            for (it = begin; it.equal_to(end) == false; it = it.next())\r\n                size++;\r\n            this.hash_buckets_.clear();\r\n            this.hash_buckets_.reserve(size * std.base.RATIO);\r\n            // SUPER; INSERT\r\n            _super.prototype.assign.call(this, begin, end);\r\n        };\r\n        /**\r\n         * @inheritdoc\r\n         */\r\n        HashMultiMap.prototype.clear = function () {\r\n            _super.prototype.clear.call(this);\r\n            this.hash_buckets_.clear();\r\n        };\r\n        /* =========================================================\r\n            ACCESSORS\r\n        ========================================================= */\r\n        /**\r\n         * @inheritdoc\r\n         */\r\n        HashMultiMap.prototype.find = function (key) {\r\n            return this.hash_buckets_.find(key);\r\n        };\r\n        /* =========================================================\r\n            ELEMENTS I/O\r\n                - INSERT\r\n                - POST-PROCESS\r\n        ============================================================\r\n            INSERT\r\n        --------------------------------------------------------- */\r\n        /**\r\n         * @hidden\r\n         */\r\n        HashMultiMap.prototype.insert_by_pair = function (pair) {\r\n            var listIterator = this.data_.insert(this.data_.end(), pair);\r\n            var it = new std.MapIterator(this, listIterator);\r\n            this.handle_insert(it);\r\n            return it;\r\n        };\r\n        /**\r\n         * @hidden\r\n         */\r\n        HashMultiMap.prototype.insert_by_range = function (begin, end) {\r\n            // CALCULATE INSERTING SIZE\r\n            var size = 0;\r\n            for (var it = begin; it.equal_to(end) == false; it = it.next())\r\n                size++;\r\n            // IF NEEDED, HASH_BUCKET TO HAVE SUITABLE SIZE\r\n            if (this.size() + size > this.hash_buckets_.item_size() * std.base.MAX_RATIO)\r\n                this.hash_buckets_.reserve((this.size() + size) * std.base.RATIO);\r\n            // INSERTS\r\n            _super.prototype.insert_by_range.call(this, begin, end);\r\n        };\r\n        /* ---------------------------------------------------------\r\n            POST-PROCESS\r\n        --------------------------------------------------------- */\r\n        /**\r\n         * @inheritdoc\r\n         */\r\n        HashMultiMap.prototype.handle_insert = function (it) {\r\n            this.hash_buckets_.insert(it);\r\n        };\r\n        /**\r\n         * @inheritdoc\r\n         */\r\n        HashMultiMap.prototype.handle_erase = function (it) {\r\n            this.hash_buckets_.erase(it);\r\n        };\r\n        /* ===============================================================\r\n            UTILITIES\r\n        =============================================================== */\r\n        /**\r\n         * @inheritdoc\r\n         */\r\n        HashMultiMap.prototype.swap = function (obj) {\r\n            if (obj instanceof HashMultiMap)\r\n                this.swap_hash_multimap(obj);\r\n            else\r\n                _super.prototype.swap.call(this, obj);\r\n        };\r\n        /**\r\n         * @hidden\r\n         */\r\n        HashMultiMap.prototype.swap_hash_multimap = function (obj) {\r\n            _a = [obj.data_, this.data_], this.data_ = _a[0], obj.data_ = _a[1];\r\n            _b = [obj.hash_buckets_, this.hash_buckets_], this.hash_buckets_ = _b[0], obj.hash_buckets_ = _b[1];\r\n            var _a, _b;\r\n        };\r\n        return HashMultiMap;\r\n    }(std.base.MultiMap));\r\n    std.HashMultiMap = HashMultiMap;\r\n})(std || (std = {}));\r\n/// <reference path=\"base/UniqueSet.ts\" />\r\n/// <reference path=\"base/MultiSet.ts\" />\r\nvar std;\r\n(function (std) {\r\n    /**\r\n     * <p> Tree-structured set, <code>std::set</code> of STL. </p>\r\n     *\r\n     * <p> {@link TreeSet}s are containers that store unique elements following a specific order. </p>\r\n     *\r\n     * <p> In a {@link TreeSet}, the value of an element also identifies it (the value is itself the\r\n     * <i>key</i>, of type <i>T</i>), and each value must be unique. The value of the elements in a\r\n     * {@link TreeSet} cannot be modified once in the container (the elements are always const), but they\r\n     * can be inserted or removed from the  </p>\r\n     *\r\n     * <p> Internally, the elements in a {@link TreeSet} are always sorted following a specific strict weak\r\n     * ordering criterion indicated by its internal comparison method (of {@link less}). </p>\r\n     *\r\n     * <p> {@link TreeSet} containers are generally slower than {@link HashSet} containers to access\r\n     * individual elements by their <i>key</i>, but they allow the direct iteration on subsets based on their\r\n     * order. </p>\r\n     *\r\n     * <p> {@link TreeSet}s are typically implemented as binary search trees. </p>\r\n     *\r\n     * <h3> Container properties </h3>\r\n     * <dl>\r\n     *\t<dt> Associative </dt>\r\n     *\t<dd>\r\n     *\t\tElements in associative containers are referenced by their <i>key</i> and not by their absolute\r\n     *\t\tposition in the\r\n     *\t</dd>\r\n     *\r\n     *\t<dt> Ordered </dt>\r\n     *\t<dd>\r\n     *\t\tThe elements in the container follow a strict order at all times. All inserted elements are\r\n     *\t\tgiven a position in this order.\r\n     *\t</dd>\r\n     *\r\n     *\t<dt> Set </dt>\r\n     *\t<dd> The value of an element is also the <i>key</i> used to identify it. </dd>\r\n     *\r\n     *\t<dt> Unique keys </dt>\r\n     *\t<dd> No two elements in the container can have equivalent <i>keys</i>. </dd>\r\n     * </dl>\r\n     *\r\n     * <ul>\r\n     *\t<li> Reference: http://www.cplusplus.com/reference/set/set/ </li>\r\n     * </ul>\r\n     *\r\n     * @param <T> Type of the elements.\r\n     *\t\t\t  Each element in an {@link TreeSet} is also uniquely identified by this value.\r\n     *\r\n     * @author Jeongho Nam <http://samchon.org>\r\n     */\r\n    var TreeSet = (function (_super) {\r\n        __extends(TreeSet, _super);\r\n        function TreeSet() {\r\n            var args = [];\r\n            for (var _i = 0; _i < arguments.length; _i++) {\r\n                args[_i - 0] = arguments[_i];\r\n            }\r\n            _super.call(this);\r\n            // CONSTRUCT TREE WITH COMPARE\r\n            var compare;\r\n            if (args.length == 0 || args[args.length - 1] instanceof Function == false)\r\n                compare = std.less;\r\n            else\r\n                compare = args[args.length - 1];\r\n            this.tree_ = new std.base.AtomicTree(compare);\r\n            // OVERLOADINGS\r\n            if (args.length >= 1 && args[0] instanceof Array) {\r\n                this.construct_from_array(args[0]);\r\n            }\r\n            else if (args.length >= 1 && args[0] instanceof std.base.SetContainer) {\r\n                this.construct_from_container(args[0]);\r\n            }\r\n            else if (args.length >= 2 && args[0] instanceof std.SetIterator && args[1] instanceof std.SetIterator) {\r\n                this.construct_from_range(args[0], args[1]);\r\n            }\r\n        }\r\n        /* ---------------------------------------------------------\r\n            ASSIGN & CLEAR\r\n        --------------------------------------------------------- */\r\n        /**\r\n         * @inheritdoc\r\n         */\r\n        TreeSet.prototype.assign = function (begin, end) {\r\n            _super.prototype.assign.call(this, begin, end);\r\n        };\r\n        /**\r\n         * @inheritdoc\r\n         */\r\n        TreeSet.prototype.clear = function () {\r\n            _super.prototype.clear.call(this);\r\n            this.tree_ = new std.base.AtomicTree();\r\n        };\r\n        /* =========================================================\r\n            ACCESSORS\r\n        ========================================================= */\r\n        /**\r\n         * @inheritdoc\r\n         */\r\n        TreeSet.prototype.find = function (val) {\r\n            var node = this.tree_.find(val);\r\n            if (node == null || std.equal_to(node.value.value, val) == false)\r\n                return this.end();\r\n            else\r\n                return node.value;\r\n        };\r\n        /**\r\n         * <p> Return iterator to lower bound. </p>\r\n         *\r\n         * <p> Returns an iterator pointing to the first element in the container which is not considered to go\r\n         * before <i>val</i> (i.e., either it is equivalent or goes after). </p>\r\n         *\r\n         * <p> The function uses its internal comparison object (key_comp) to determine this, returning an\r\n         * iterator to the first element for which key_comp(element, val) would return false. </p>\r\n         *\r\n         * <p> If the {@link Set} class is instantiated with the default comparison type ({@link less}), the\r\n         * function returns an iterator to the first element that is not less than <i>val</i>. </p>\r\n         *\r\n         * <p> A similar member function, {@link upper_bound}, has the same behavior as {@link lower_bound},\r\n         * except in the case that the {@link Set} contains an element equivalent to <i>val</i>: In this case\r\n         * {@link lower_bound} returns an iterator pointing to that element, whereas {@link upper_bound} returns\r\n         * an iterator pointing to the next element. </p>\r\n         *\r\n         * @param val Value to compare.\r\n         *\r\n         * @return An iterator to the the first element in the container which is not considered to go before\r\n         *\t\t   <i>val</i>, or {@link Set.end} if all elements are considered to go before <i>val</i>.\r\n         */\r\n        TreeSet.prototype.lower_bound = function (val) {\r\n            var node = this.tree_.find(val);\r\n            if (node == null)\r\n                return this.end();\r\n            else if (std.less(node.value.value, val))\r\n                return node.value.next();\r\n            else\r\n                return node.value;\r\n        };\r\n        /**\r\n         * <p> Return iterator to upper bound. </p>\r\n         *\r\n         * <p> Returns an iterator pointing to the first element in the container which is not considered to go\r\n         * after <i>val</i>. </p>\r\n         *\r\n         * <p> The function uses its internal comparison object (key_comp) to determine this, returning an\r\n         * iterator to the first element for which key_comp(element, val) would return true. </p>\r\n         *\r\n         * <p> If the {@link Set} class is instantiated with the default comparison type ({@link less}), the\r\n         * function returns an iterator to the first element that is greater than <i>val</i>. </p>\r\n         *\r\n         * <p> A similar member function, {@link lower_bound}, has the same behavior as {@link upper_bound}, except\r\n         * in the case that the {@link Set} contains an element equivalent to <i>val</i>: In this case\r\n         * {@link lower_bound} returns an iterator pointing to that element, whereas {@link upper_bound} returns\r\n         * an iterator pointing to the next element. </p>\r\n         *\r\n         * @param val Value to compare.\r\n         *\r\n         * @return An iterator to the the first element in the container which is not considered to go before\r\n         *\t\t   <i>val</i>, or {@link Set.end} if all elements are considered to go after <i>val</i>.\r\n         */\r\n        TreeSet.prototype.upper_bound = function (val) {\r\n            var node = this.tree_.find(val);\r\n            if (node == null)\r\n                return this.end();\r\n            else if (!std.equal_to(node.value.value, val) && !std.less(node.value.value, val))\r\n                return node.value;\r\n            else\r\n                return node.value.next();\r\n        };\r\n        /**\r\n         * <p> Get range of equal elements. </p>\r\n         *\r\n         * <p> Because all elements in a {@link Set} container are unique, the range returned will contain a\r\n         * single element at most. </p>\r\n         *\r\n         * <p> If no matches are found, the range returned has a length of zero, with both iterators pointing to\r\n         * the first element that is considered to go after <i>val</i> according to the container's\r\n         * internal comparison object (key_comp). </p>\r\n         *\r\n         * <p> Two elements of a {@link Set} are considered equivalent if the container's comparison object\r\n         * returns false reflexively (i.e., no matter the order in which the elements are passed as arguments).\r\n         * </p>\r\n         *\r\n         * @param val Value to search for.\r\n         *\r\n         * @return The function returns a {@link Pair}, whose member {@link Pair.first} is the lower bound of\r\n         *\t\t   the range (the same as {@link lower_bound}), and {@link Pair.second} is the upper bound\r\n         *\t\t   (the same as {@link upper_bound}).\r\n         */\r\n        TreeSet.prototype.equal_range = function (val) {\r\n            return new std.Pair(this.lower_bound(val), this.upper_bound(val));\r\n        };\r\n        /* =========================================================\r\n            ELEMENTS I/O\r\n                - INSERT\r\n                - POST-PROCESS\r\n        ============================================================\r\n            INSERT\r\n        --------------------------------------------------------- */\r\n        /**\r\n         * @hidden\r\n         */\r\n        TreeSet.prototype.insert_by_val = function (val) {\r\n            var node = this.tree_.find(val);\r\n            // IF EQUALS, THEN RETURN FALSE\r\n            if (node != null && std.equal_to(node.value.value, val) == true)\r\n                return new std.Pair(node.value, false);\r\n            // INSERTS\r\n            var it;\r\n            if (node == null)\r\n                it = this.end();\r\n            else if (std.less(node.value.value, val) == true)\r\n                it = node.value.next();\r\n            else\r\n                it = node.value;\r\n            // ITERATOR TO RETURN\r\n            it = this.insert(it, val);\r\n            return new std.Pair(it, true);\r\n        };\r\n        /* ---------------------------------------------------------\r\n            POST-PROCESS\r\n        --------------------------------------------------------- */\r\n        /**\r\n         * @inheritdoc\r\n         */\r\n        TreeSet.prototype.handle_insert = function (item) {\r\n            this.tree_.insert(item);\r\n        };\r\n        /**\r\n         * @inheritdoc\r\n         */\r\n        TreeSet.prototype.handle_erase = function (item) {\r\n            this.tree_.erase(item);\r\n        };\r\n        /* ===============================================================\r\n            UTILITIES\r\n        =============================================================== */\r\n        /**\r\n         * @inheritdoc\r\n         */\r\n        TreeSet.prototype.swap = function (obj) {\r\n            if (obj instanceof TreeSet)\r\n                this.swap_tree_set(obj);\r\n            else\r\n                _super.prototype.swap.call(this, obj);\r\n        };\r\n        /**\r\n         * @hidden\r\n         */\r\n        TreeSet.prototype.swap_tree_set = function (obj) {\r\n            _a = [obj.data_, this.data_], this.data_ = _a[0], obj.data_ = _a[1];\r\n            _b = [obj.tree_, this.tree_], this.tree_ = _b[0], obj.tree_ = _b[1];\r\n            var _a, _b;\r\n        };\r\n        return TreeSet;\r\n    }(std.base.UniqueSet));\r\n    std.TreeSet = TreeSet;\r\n    /**\r\n     * <p> Tree-structured multiple-key set. </p>\r\n     *\r\n     * <p> {@link TreeMultiSet TreeMultiSets} are containers that store elements following a specific order, and\r\n     * where multiple elements can have equivalent values. </p>\r\n     *\r\n     * <p> In a {@link TreeMultiSet}, the value of an element also identifies it (the value is itself\r\n     * the <i>key</i>, of type <i>T</i>). The value of the elements in a {@link TreeMultiSet} cannot\r\n     * be modified once in the container (the elements are always const), but they can be inserted or removed\r\n     * from the  </p>\r\n     *\r\n     * <p> Internally, the elements in a {@link TreeMultiSet TreeMultiSets} are always sorted following a strict\r\n     * weak ordering criterion indicated by its internal comparison method (of {@link IComparable.less less}). </p>\r\n     *\r\n     * <p> {@link TreeMultiSet} containers are generally slower than {@link HashMultiSet} containers\r\n     * to access individual elements by their <i>key</i>, but they allow the direct iteration on subsets based on\r\n     * their order. </p>\r\n     *\r\n     * <p> {@link TreeMultiSet TreeMultiSets} are typically implemented as binary search trees. </p>\r\n     *\r\n     * <h3> Container properties </h3>\r\n     * <dl>\r\n     *\t<dt> Associative </dt>\r\n     *\t<dd>\r\n     *\t\tElements in associative containers are referenced by their <i>key</i> and not by their absolute\r\n     *\t\tposition in the\r\n     *\t</dd>\r\n     *\r\n     *\t<dt> Ordered </dt>\r\n     *\t<dd>\r\n     *\t\tThe elements in the container follow a strict order at all times. All inserted elements are\r\n     *\t\tgiven a position in this order.\r\n     *\t</dd>\r\n     *\r\n     *\t<dt> Set </dt>\r\n     *\t<dd> The value of an element is also the <i>key</i> used to identify it. </dd>\r\n     *\r\n     *\t<dt> Multiple equivalent keys </dt>\r\n     *\t<dd> Multiple elements in the container can have equivalent <i>keys</i>. </dd>\r\n     * </dl>\r\n     *\r\n     * <ul>\r\n     *\t<li> Reference: http://www.cplusplus.com/reference/set/multiset/ </li>\r\n     * </ul>\r\n     *\r\n     * @param <T> Type of the elements. Each element in a {@link TreeMultiSet} container is also identified\r\n     *\t\t\t  by this value (each value is itself also the element's <i>key</i>).\r\n     *\r\n     * @author Jeongho Nam <http://samchon.org>\r\n     */\r\n    var TreeMultiSet = (function (_super) {\r\n        __extends(TreeMultiSet, _super);\r\n        function TreeMultiSet() {\r\n            var args = [];\r\n            for (var _i = 0; _i < arguments.length; _i++) {\r\n                args[_i - 0] = arguments[_i];\r\n            }\r\n            _super.call(this);\r\n            // CONSTRUCT TREE WITH COMPARE\r\n            var compare;\r\n            if (args.length == 0 || args[args.length - 1] instanceof Function == false)\r\n                compare = std.less;\r\n            else\r\n                compare = args[args.length - 1];\r\n            this.tree_ = new std.base.AtomicTree(compare);\r\n            // OVERLOADINGS\r\n            if (args.length >= 1 && args[0] instanceof Array) {\r\n                this.construct_from_array(args[0]);\r\n            }\r\n            else if (args.length >= 1 && args[0] instanceof std.base.SetContainer) {\r\n                this.construct_from_container(args[0]);\r\n            }\r\n            else if (args.length >= 2 && args[0] instanceof std.SetIterator && args[1] instanceof std.SetIterator) {\r\n                this.construct_from_range(args[0], args[1]);\r\n            }\r\n        }\r\n        /* ---------------------------------------------------------\r\n            ASSIGN & CLEAR\r\n        --------------------------------------------------------- */\r\n        /**\r\n         * @inheritdoc\r\n         */\r\n        TreeMultiSet.prototype.assign = function (begin, end) {\r\n            _super.prototype.assign.call(this, begin, end);\r\n        };\r\n        /**\r\n         * @inheritdoc\r\n         */\r\n        TreeMultiSet.prototype.clear = function () {\r\n            _super.prototype.clear.call(this);\r\n            this.tree_ = new std.base.AtomicTree();\r\n        };\r\n        /* =========================================================\r\n            ACCESSORS\r\n        ========================================================= */\r\n        /**\r\n         * @inheritdoc\r\n         */\r\n        TreeMultiSet.prototype.find = function (val) {\r\n            var node = this.tree_.find(val);\r\n            if (node == null || std.equal_to(val, node.value.value) == false)\r\n                return this.end();\r\n            else\r\n                return node.value;\r\n        };\r\n        /**\r\n         * <p> Return iterator to lower bound. </p>\r\n         *\r\n         * <p> Returns an iterator pointing to the first element in the container which is not considered to\r\n         * go before <i>val</i> (i.e., either it is equivalent or goes after). </p>\r\n         *\r\n         * <p> The function uses its internal comparison object (key_comp) to determine this, returning an\r\n         * iterator to the first element for which key_comp(element,val) would return false. </p>\r\n         *\r\n         * <p> If the {@link TreeMultiSet} class is instantiated with the default comparison type ({@link less}),\r\n         * the function returns an iterator to the first element that is not less than <i>val</i>. </p>\r\n\r\n         * <p> A similar member function, {@link upper_bound}, has the same behavior as {@link lower_bound}, except\r\n         * in the case that the {@link TreeMultiSet} contains elements equivalent to <i>val</i>: In this case\r\n         * {@link lower_bound} returns an iterator pointing to the first of such elements, whereas\r\n         * {@link upper_bound} returns an iterator pointing to the element following the last. </p>\r\n         *\r\n         * @param val Value to compare.\r\n         *\r\n         * @return An iterator to the the first element in the container which is not considered to go before\r\n         *\t\t   <i>val</i>, or {@link TreeMultiSet.end} if all elements are considered to go before <i>val</i>.\r\n         */\r\n        TreeMultiSet.prototype.lower_bound = function (val) {\r\n            var node = this.tree_.find(val);\r\n            if (node == null)\r\n                return this.end();\r\n            else if (std.equal_to(node.value.value, val))\r\n                return node.value;\r\n            else {\r\n                var it = node.value;\r\n                while (!std.equal_to(it, this.end()) && std.less(it.value, val))\r\n                    it = it.next();\r\n                return it;\r\n            }\r\n        };\r\n        /**\r\n         * <p> Return iterator to upper bound. </p>\r\n         *\r\n         * <p> Returns an iterator pointing to the first element in the container which is considered to go after\r\n         * <i>val</i>. </p>\r\n\r\n         * <p> The function uses its internal comparison object (key_comp) to determine this, returning an\r\n         * iterator to the first element for which key_comp(val,element) would return true. </p>\r\n\r\n         * <p> If the {@code TreeMultiSet} class is instantiated with the default comparison type (less), the\r\n         * function returns an iterator to the first element that is greater than <i>val</i>. </p>\r\n         *\r\n         * <p> A similar member function, {@link lower_bound}, has the same behavior as {@link upper_bound}, except\r\n         * in the case that the {@TreeMultiSet} contains elements equivalent to <i>val</i>: In this case\r\n         * {@link lower_bound} returns an iterator pointing to the first of such elements, whereas\r\n         * {@link upper_bound} returns an iterator pointing to the element following the last. </p>\r\n         *\r\n         * @param val Value to compare.\r\n         *\r\n         * @return An iterator to the the first element in the container which is considered to go after\r\n         *\t\t   <i>val</i>, or {@link TreeMultiSet.end} if no elements are considered to go after <i>val</i>.\r\n         */\r\n        TreeMultiSet.prototype.upper_bound = function (val) {\r\n            var node = this.tree_.find(val);\r\n            if (node == null)\r\n                return this.end();\r\n            else {\r\n                var it = node.value;\r\n                while (!std.equal_to(it, this.end()) && (std.equal_to(it.value, val) || std.less(it.value, val)))\r\n                    it = it.next();\r\n                return it;\r\n            }\r\n        };\r\n        /**\r\n         * <p> Get range of equal elements. </p>\r\n         *\r\n         * <p> Returns the bounds of a range that includes all the elements in the container that are equivalent\r\n         * to <i>val</i>. </p>\r\n         *\r\n         * <p> If no matches are found, the range returned has a length of zero, with both iterators pointing to\r\n         * the first element that is considered to go after val according to the container's\r\n         * internal comparison object (key_comp). </p>\r\n         *\r\n         * <p> Two elements of a multiset are considered equivalent if the container's comparison object returns\r\n         * false reflexively (i.e., no matter the order in which the elements are passed as arguments). </p>\r\n         *\r\n         * @param key Value to search for.\r\n         *\r\n         * @return The function returns a {@link Pair}, whose member {@link Pair.first} is the lower bound of\r\n         *\t\t   the range (the same as {@link lower_bound}), and {@link Pair.second} is the upper bound\r\n         *\t\t   (the same as {@link upper_bound}).\r\n         */\r\n        TreeMultiSet.prototype.equal_range = function (val) {\r\n            return new std.Pair(this.lower_bound(val), this.upper_bound(val));\r\n        };\r\n        /* =========================================================\r\n            ELEMENTS I/O\r\n                - INSERT\r\n                - POST-PROCESS\r\n        ============================================================\r\n            INSERT\r\n        --------------------------------------------------------- */\r\n        /**\r\n         * @hidden\r\n         */\r\n        TreeMultiSet.prototype.insert_by_val = function (val) {\r\n            var node = this.tree_.find(val);\r\n            var it;\r\n            if (node == null) {\r\n                it = this.end();\r\n            }\r\n            else if (std.equal_to(node.value.value, val) == true) {\r\n                it = node.value.next();\r\n            }\r\n            else if (std.less(node.value.value, val) == true) {\r\n                it = node.value.next();\r\n                while (it.equal_to(this.end()) == false && std.less(it.value, val))\r\n                    it = it.next();\r\n            }\r\n            else {\r\n                it = node.value;\r\n            }\r\n            // ITERATOR TO RETURN\r\n            return this.insert(it, val);\r\n        };\r\n        /* ---------------------------------------------------------\r\n            POST-PROCESS\r\n        --------------------------------------------------------- */\r\n        /**\r\n         * @inheritdoc\r\n         */\r\n        TreeMultiSet.prototype.handle_insert = function (item) {\r\n            this.tree_.insert(item);\r\n        };\r\n        /**\r\n         * @inheritdoc\r\n         */\r\n        TreeMultiSet.prototype.handle_erase = function (item) {\r\n            this.tree_.erase(item);\r\n        };\r\n        /* ===============================================================\r\n            UTILITIES\r\n        =============================================================== */\r\n        /**\r\n         * @inheritdoc\r\n         */\r\n        TreeMultiSet.prototype.swap = function (obj) {\r\n            if (obj instanceof TreeMultiSet)\r\n                this.swap_tree_set(obj);\r\n            else\r\n                _super.prototype.swap.call(this, obj);\r\n        };\r\n        /**\r\n         * @hidden\r\n         */\r\n        TreeMultiSet.prototype.swap_tree_set = function (obj) {\r\n            _a = [obj.data_, this.data_], this.data_ = _a[0], obj.data_ = _a[1];\r\n            _b = [obj.tree_, this.tree_], this.tree_ = _b[0], obj.tree_ = _b[1];\r\n            var _a, _b;\r\n        };\r\n        return TreeMultiSet;\r\n    }(std.base.MultiSet));\r\n    std.TreeMultiSet = TreeMultiSet;\r\n})(std || (std = {}));\r\n/// <reference path=\"base/UniqueMap.ts\" />\r\n/// <reference path=\"base/MultiMap.ts\" />\r\nvar std;\r\n(function (std) {\r\n    /**\r\n     * <p> Tree-structured map, <code>std::map</code> of STL. </p>\r\n     *\r\n     * <p> {@link TreeMap TreeMaps} are associative containers that store elements formed by a combination of a\r\n     * <i>key value</i> (<i>Key</i>) and a <i>mapped value</i> (<i>T</i>), following order. </p>\r\n     *\r\n     * <p> In a {@link TreeMap}, the <i>key values</i> are generally used to sort and uniquely identify\r\n     * the elements, while the <i>mapped values</i> store the content associated to this key. The types of\r\n     * <i>key</i> and <i>mapped value</i> may differ, and are grouped together in member type <i>value_type</i>,\r\n     * which is a {@link Pair} type combining both: </p>\r\n     *\r\n     * <p> <code>typedef Pair<Key, T> value_type;</code> </p>\r\n     *\r\n     * <p> Internally, the elements in a {@link TreeMap} are always sorted by its <i>key</i> following\r\n     * a strict weak ordering criterion indicated by its internal comparison method {@link less}.\r\n     *\r\n     * <p> {@link TreeMap} containers are generally slower than {@link HashMap HashMap} containers to\r\n     * access individual elements by their <i>key</i>, but they allow the direct iteration on subsets based on\r\n     * their order. </p>\r\n     *\r\n     * <p> {@link TreeMap}s are typically implemented as binary search trees. </p>\r\n     *\r\n     * <h3> Container properties </h3>\r\n     * <dl>\r\n     *\t<dt> Associative </dt>\r\n     *\t<dd> Elements in associative containers are referenced by their <i>key</i> and not by their absolute\r\n     *\t\t position in the  </dd>\r\n     *\r\n     *\t<dt> Ordered </dt>\r\n     *\t<dd> The elements in the container follow a strict order at all times. All inserted elements are\r\n     *\t\t given a position in this order. </dd>\r\n     *\r\n     *\t<dt> Map </dt>\r\n     *\t<dd> Each element associates a <i>key</i> to a <i>mapped value</i>:\r\n     *\t\t <i>Keys</i> are meant to identify the elements whose main content is the <i>mapped value</i>. </dd>\r\n     *\r\n     *\t<dt> Unique keys </dt>\r\n     *\t<dd> No two elements in the container can have equivalent <i>keys</i>. </dd>\r\n     * </dl>\r\n     *\r\n     * <ul>\r\n     *\t<li> Reference: http://www.cplusplus.com/reference/map/map/ </li>\r\n     * </ul>\r\n     *\r\n     * @param <Key> Type of the keys. Each element in a map is uniquely identified by its key value.\r\n     * @param <T> Type of the mapped value. Each element in a map stores some data as its mapped value.\r\n     *\r\n     * @author Jeongho Nam <http://samchon.org>\r\n     */\r\n    var TreeMap = (function (_super) {\r\n        __extends(TreeMap, _super);\r\n        function TreeMap() {\r\n            var args = [];\r\n            for (var _i = 0; _i < arguments.length; _i++) {\r\n                args[_i - 0] = arguments[_i];\r\n            }\r\n            _super.call(this);\r\n            // CONSTRUCT TREE WITH COMPARE\r\n            var compare;\r\n            if (args.length == 0 || args[args.length - 1] instanceof Function == false)\r\n                compare = std.less;\r\n            else\r\n                compare = args[args.length - 1];\r\n            this.tree_ = new std.base.PairTree(compare);\r\n            // OVERLOADINGS\r\n            if (args.length >= 1 && args[0] instanceof Array) {\r\n                this.construct_from_array(args[0]);\r\n            }\r\n            else if (args.length >= 1 && args[0] instanceof std.base.MapContainer) {\r\n                this.construct_from_container(args[0]);\r\n            }\r\n            else if (args.length >= 2 && args[0] instanceof std.MapIterator && args[1] instanceof std.MapIterator) {\r\n                this.construct_from_range(args[0], args[1]);\r\n            }\r\n        }\r\n        /* ---------------------------------------------------------\r\n            ASSIGN & CLEAR\r\n        --------------------------------------------------------- */\r\n        /**\r\n         * @inheritdoc\r\n         */\r\n        TreeMap.prototype.assign = function (begin, end) {\r\n            _super.prototype.assign.call(this, begin, end);\r\n        };\r\n        /**\r\n         * @inheritdoc\r\n         */\r\n        TreeMap.prototype.clear = function () {\r\n            _super.prototype.clear.call(this);\r\n            this.tree_ = new std.base.PairTree();\r\n        };\r\n        /* =========================================================\r\n            ACCESSORS\r\n        ========================================================= */\r\n        /**\r\n         * @inheritdoc\r\n         */\r\n        TreeMap.prototype.find = function (key) {\r\n            var node = this.tree_.find(key);\r\n            if (node == null || std.equal_to(node.value.first, key) == false)\r\n                return this.end();\r\n            else\r\n                return node.value;\r\n        };\r\n        /**\r\n         * <p> Return iterator to lower bound. </p>\r\n         *\r\n         * <p> Returns an iterator pointing to the first element in the container whose key is not considered to\r\n         * go before <i>k</i> (i.e., either it is equivalent or goes after). </p>\r\n         *\r\n         * <p> The function uses its internal comparison object (key_comp) to determine this, returning an\r\n         * iterator to the first element for which key_comp(<i>k</i>, element_key) would return false. </p>\r\n         *\r\n         * <p> If the {@link TreeMap} class is instantiated with the default comparison type ({@link less}),\r\n         * the function returns an iterator to the first element whose key is not less than <i>k</i> </p>.\r\n         *\r\n         * <p> A similar member function, {@link upper_bound}, has the same behavior as {@link lower_bound}, except\r\n         * in the case that the {@link TreeMap} contains an element with a key equivalent to <i>k</i>: In this\r\n         * case, {@link lower_bound} returns an iterator pointing to that element, whereas {@link upper_bound}\r\n         * returns an iterator pointing to the next element. </p>\r\n         *\r\n         * @param k Key to search for.\r\n         *\r\n         * @return An iterator to the the first element in the container whose key is not considered to go before\r\n         *\t\t   <i>k</i>, or {@link TreeMap.end} if all keys are considered to go before <i>k</i>.\r\n         */\r\n        TreeMap.prototype.lower_bound = function (key) {\r\n            var node = this.tree_.find(key);\r\n            if (node == null)\r\n                return this.end();\r\n            else if (std.less(node.value.first, key))\r\n                return node.value.next();\r\n            else\r\n                return node.value;\r\n        };\r\n        /**\r\n         * <p> Return iterator to upper bound. </p>\r\n         *\r\n         * <p> Returns an iterator pointing to the first element in the container whose key is considered to\r\n         * go after <i>k</i> </p>.\r\n         *\r\n         * <p> The function uses its internal comparison object (key_comp) to determine this, returning an\r\n         * iterator to the first element for which key_comp(<i>k</i>, element_key) would return true. </p>\r\n         *\r\n         * <p> If the {@link TreeMap} class is instantiated with the default comparison type ({@link less}),\r\n         * the function returns an iterator to the first element whose key is greater than <i>k</i> </p>.\r\n         *\r\n         * <p> A similar member function, {@link lower_bound}, has the same behavior as {@link upper_bound}, except\r\n         * in the case that the map contains an element with a key equivalent to <i>k</i>: In this case\r\n         * {@link lower_bound} returns an iterator pointing to that element, whereas {@link upper_bound} returns an\r\n         * iterator pointing to the next element. </p>\r\n         *\r\n         * @param k Key to search for.\r\n         *\r\n         * @return An iterator to the the first element in the container whose key is considered to go after\r\n         *\t\t   <i>k</i>, or {@link TreeMap.end} if no keys are considered to go after <i>k</i>.\r\n         */\r\n        TreeMap.prototype.upper_bound = function (key) {\r\n            var node = this.tree_.find(key);\r\n            if (node == null)\r\n                return this.end();\r\n            else if (!std.equal_to(node.value.first, key) && !std.less(node.value.first, key))\r\n                return node.value;\r\n            else\r\n                return node.value.next();\r\n        };\r\n        /**\r\n         * <p> Get range of equal elements. </p>\r\n         *\r\n         * <p> Returns the bounds of a range that includes all the elements in the container which have a key\r\n         * equivalent to <i>k</i> </p>.\r\n         *\r\n         * <p> Because the elements in a {@link TreeMap} container have unique keys, the range returned will\r\n         * contain a single element at most. </p>\r\n         *\r\n         * <p> If no matches are found, the range returned has a length of zero, with both iterators pointing to\r\n         * the first element that has a key considered to go after <i>k</i> according to the container's internal\r\n         * comparison object (key_comp). </p>\r\n         *\r\n         * <p> Two keys are considered equivalent if the container's comparison object returns false reflexively\r\n         * (i.e., no matter the order in which the keys are passed as arguments). </p>\r\n         *\r\n         * @param k Key to search for.\r\n         *\r\n         * @return The function returns a {@link Pair}, whose member {@link Pair.first} is the lower bound of\r\n         *\t\t   the range (the same as {@link lower_bound}), and {@link Pair.second} is the upper bound\r\n         *\t\t   (the same as {@link upper_bound}).\r\n         */\r\n        TreeMap.prototype.equal_range = function (key) {\r\n            return new std.Pair(this.lower_bound(key), this.upper_bound(key));\r\n        };\r\n        /* =========================================================\r\n            ELEMENTS I/O\r\n                - INSERT\r\n                - POST-PROCESS\r\n        ============================================================\r\n            INSERT\r\n        --------------------------------------------------------- */\r\n        /**\r\n         * @hidden\r\n         */\r\n        TreeMap.prototype.insert_by_pair = function (pair) {\r\n            var node = this.tree_.find(pair.first);\r\n            // IF EQUALS, THEN RETURN FALSE\r\n            if (node != null && std.equal_to(node.value.first, pair.first) == true)\r\n                return new std.Pair(node.value, false);\r\n            // INSERTS\r\n            var it;\r\n            if (node == null)\r\n                it = this.end();\r\n            else if (std.less(node.value.first, pair.first) == true)\r\n                it = node.value.next();\r\n            else\r\n                it = node.value;\r\n            // ITERATOR TO RETURN\r\n            it = this.insert(it, pair);\r\n            return new std.Pair(it, true);\r\n        };\r\n        /* ---------------------------------------------------------\r\n            POST-PROCESS\r\n        --------------------------------------------------------- */\r\n        /**\r\n         * @inheritdoc\r\n         */\r\n        TreeMap.prototype.handle_insert = function (item) {\r\n            this.tree_.insert(item);\r\n        };\r\n        /**\r\n         * @inheritdoc\r\n         */\r\n        TreeMap.prototype.handle_erase = function (item) {\r\n            this.tree_.erase(item);\r\n        };\r\n        /* ===============================================================\r\n            UTILITIES\r\n        =============================================================== */\r\n        /**\r\n         * @inheritdoc\r\n         */\r\n        TreeMap.prototype.swap = function (obj) {\r\n            if (obj instanceof TreeMap)\r\n                this.swap_tree_map(obj);\r\n            else\r\n                _super.prototype.swap.call(this, obj);\r\n        };\r\n        /**\r\n         * @hidden\r\n         */\r\n        TreeMap.prototype.swap_tree_map = function (obj) {\r\n            _a = [obj.data_, this.data_], this.data_ = _a[0], obj.data_ = _a[1];\r\n            _b = [obj.tree_, this.tree_], this.tree_ = _b[0], obj.tree_ = _b[1];\r\n            var _a, _b;\r\n        };\r\n        return TreeMap;\r\n    }(std.base.UniqueMap));\r\n    std.TreeMap = TreeMap;\r\n    /**\r\n     * <p> Tree-structured multiple-key map. </p>\r\n     *\r\n     * <p> {@link TreeMultiMap TreeMultiMaps} are associative containers that store elements formed by a combination of\r\n     * a <i>key value</i> and a <i>mapped value</i>, following a specific order, and where multiple elements can\r\n     * have equivalent keys. </p>\r\n     *\r\n     * <p> In a {@link TreeMultiMap}, the <i>key values</i> are generally used to sort and uniquely identify\r\n     * the elements, while the <i>mapped values</i> store the content associated to this <i>key</i>. The types of\r\n     * <i>key</i> and <i>mapped value</i> may differ, and are grouped together in member type\r\n     * <code>value_type</code>, which is a {@link Pair} type combining both: </p>\r\n     *\r\n     * <p> <code>typedef Pair<const Key, T> value_type;</code> </p>\r\n     *\r\n     * <p> Internally, the elements in a {@link TreeMultiMap}are always sorted by its key following a\r\n     * strict weak ordering criterion indicated by its internal comparison method (of {@link less}). </p>\r\n     *\r\n     * <p> {@link TreeMultiMap}containers are generally slower than {@link HashMap} containers\r\n     * to access individual elements by their <i>key</i>, but they allow the direct iteration on subsets based\r\n     * on their order. </p>\r\n     *\r\n     * <p> {@link TreeMultiMap TreeMultiMaps} are typically implemented as binary search trees. </p>\r\n     *\r\n     * <h3> Container properties </h3>\r\n     * <dl>\r\n     *\t<dt> Associative </dt>\r\n     *\t<dd>\r\n     *\t\tElements in associative containers are referenced by their <i>key</i> and not by their absolute\r\n     *\t\tposition in the\r\n     *\t</dd>\r\n     *\r\n     *\t<dt> Ordered </dt>\r\n     *\t<dd>\r\n     *\t\tThe elements in the container follow a strict order at all times. All inserted elements are\r\n     *\t\tgiven a position in this order.\r\n     *\t</dd>\r\n     *\r\n     *\t<dt> Map </dt>\r\n     *\t<dd>\r\n     *\t\tEach element associates a <i>key</i> to a <i>mapped value</i>:\r\n     *\t\t<i>Keys</i> are meant to identify the elements whose main content is the <i>mapped value</i>.\r\n     *\t</dd>\r\n     *\r\n     *\t<dt> Multiple equivalent keys </dt>\r\n     *\t<dd> Multiple elements in the container can have equivalent <i>keys</i>. </dd>\r\n     * </dl>\r\n     *\r\n     * <ul>\r\n     *\t<li> Reference: http://www.cplusplus.com/reference/map/multimap/ </li>\r\n     * </ul>\r\n     *\r\n     * @param <Key> Type of the keys. Each element in a map is uniquely identified by its key value.\r\n     * @param <T> Type of the mapped value. Each element in a map stores some data as its mapped value.\r\n     *\r\n     * @author Jeongho Nam <http://samchon.org>\r\n     */\r\n    var TreeMultiMap = (function (_super) {\r\n        __extends(TreeMultiMap, _super);\r\n        function TreeMultiMap() {\r\n            var args = [];\r\n            for (var _i = 0; _i < arguments.length; _i++) {\r\n                args[_i - 0] = arguments[_i];\r\n            }\r\n            _super.call(this);\r\n            // CONSTRUCT TREE WITH COMPARE\r\n            var compare;\r\n            if (args.length == 0 || args[args.length - 1] instanceof Function == false)\r\n                compare = std.less;\r\n            else\r\n                compare = args[args.length - 1];\r\n            this.tree_ = new std.base.PairTree(compare);\r\n            // OVERLOADINGS\r\n            if (args.length >= 1 && args[0] instanceof Array) {\r\n                this.construct_from_array(args[0]);\r\n            }\r\n            else if (args.length >= 1 && args[0] instanceof std.base.MapContainer) {\r\n                this.construct_from_container(args[0]);\r\n            }\r\n            else if (args.length >= 2 && args[0] instanceof std.MapIterator && args[1] instanceof std.MapIterator) {\r\n                this.construct_from_range(args[0], args[1]);\r\n            }\r\n        }\r\n        /* ---------------------------------------------------------\r\n            ASSIGN & CLEAR\r\n        --------------------------------------------------------- */\r\n        /**\r\n         * @inheritdoc\r\n         */\r\n        TreeMultiMap.prototype.assign = function (begin, end) {\r\n            _super.prototype.assign.call(this, begin, end);\r\n        };\r\n        /**\r\n         * @inheritdoc\r\n         */\r\n        TreeMultiMap.prototype.clear = function () {\r\n            _super.prototype.clear.call(this);\r\n        };\r\n        /* =========================================================\r\n            ACCESSORS\r\n        ========================================================= */\r\n        /**\r\n         * @inheritdoc\r\n         */\r\n        TreeMultiMap.prototype.find = function (key) {\r\n            var node = this.tree_.find(key);\r\n            if (node == null || std.equal_to(node.value.first, key) == false)\r\n                return this.end();\r\n            else\r\n                return node.value;\r\n        };\r\n        /**\r\n         * <p> Return iterator to lower bound. </p>\r\n         *\r\n         * <p> Returns an iterator pointing to the first element in the container whose key is not considered to\r\n         * go before <i>k</i> (i.e., either it is equivalent or goes after). </p>\r\n         *\r\n         * <p> The function uses its internal comparison object (key_comp) to determine this, returning an\r\n         * iterator to the first element for which key_comp(<i>k</i>, element_key) would return false. </p>\r\n         *\r\n         * <p> If the {@link TreeMultiMap} class is instantiated with the default comparison type ({@link less}),\r\n         * the function returns an iterator to the first element whose key is not less than <i>k</i> </p>.\r\n         *\r\n         * <p> A similar member function, {@link upper_bound}, has the same behavior as {@link lower_bound}, except\r\n         * in the case that the {@link TreeMultiMap} contains an element with keys equivalent to <i>k</i>:\r\n         * In this case, {@link lower_bound} returns an iterator pointing to the first of such elements,\r\n         * whereas {@link upper_bound} returns an iterator pointing to the element following the last. </p>\r\n         *\r\n         * @param k Key to search for.\r\n         *\r\n         * @return An iterator to the the first element in the container whose key is not considered to go before\r\n         *\t\t   <i>k</i>, or {@link TreeMultiMap.end} if all keys are considered to go before <i>k</i>.\r\n         */\r\n        TreeMultiMap.prototype.lower_bound = function (key) {\r\n            var node = this.tree_.find(key);\r\n            if (node == null)\r\n                return this.end();\r\n            else if (std.equal_to(node.value.first, key))\r\n                return node.value;\r\n            else {\r\n                var it = node.value;\r\n                while (!std.equal_to(it, this.end()) && std.less(it.first, key))\r\n                    it = it.next();\r\n                return it;\r\n            }\r\n        };\r\n        /**\r\n         * <p> Return iterator to upper bound. </p>\r\n         *\r\n         * <p> Returns an iterator pointing to the first element in the container whose key is considered to\r\n         * go after <i>k</i> </p>.\r\n         *\r\n         * <p> The function uses its internal comparison object (key_comp) to determine this, returning an\r\n         * iterator to the first element for which key_comp(<i>k</i>, element_key) would return true. </p>\r\n         *\r\n         * <p> If the {@link TreeMultiMap} class is instantiated with the default comparison type ({@link less}),\r\n         * the function returns an iterator to the first element whose key is greater than <i>k</i> </p>.\r\n         *\r\n         * <p> A similar member function, {@link lower_bound}, has the same behavior as {@link upper_bound}, except\r\n         * in the case that the {@link TreeMultiMap} contains an element with keys equivalent to <i>k</i>:\r\n         * In this case {@link lower_bound} returns an iterator pointing to first of such element, whereas\r\n         * {@link upper_bound} returns an iterator pointing to the element following the last. </p>\r\n         *\r\n         * @param k Key to search for.\r\n         *\r\n         * @return An iterator to the the first element in the container whose key is considered to go after\r\n         *\t\t   <i>k</i>, or {@link TreeMultiMap.end} if no keys are considered to go after <i>k</i>.\r\n         */\r\n        TreeMultiMap.prototype.upper_bound = function (key) {\r\n            var node = this.tree_.find(key);\r\n            if (node == null)\r\n                return this.end();\r\n            else {\r\n                var it = node.value;\r\n                while (!std.equal_to(it, this.end()) && (std.equal_to(it.first, key) || std.less(it.first, key)))\r\n                    it = it.next();\r\n                return it;\r\n            }\r\n        };\r\n        /**\r\n         * <p> Get range of equal elements. </p>\r\n         *\r\n         * <p> Returns the bounds of a range that includes all the elements in the container which have a key\r\n         * equivalent to <i>k</i> </p>.\r\n         *\r\n         * <p> If no matches are found, the range returned has a length of zero, with both iterators pointing to\r\n         * the first element that has a key considered to go after <i>k</i> according to the container's internal\r\n         * comparison object (key_comp). </p>\r\n         *\r\n         * <p> Two keys are considered equivalent if the container's comparison object returns false reflexively\r\n         * (i.e., no matter the order in which the keys are passed as arguments). </p>\r\n         *\r\n         * @param k Key to search for.\r\n         *\r\n         * @return The function returns a {@link Pair}, whose member {@link Pair.first} is the lower bound of\r\n         *\t\t   the range (the same as {@link lower_bound}), and {@link Pair.second} is the upper bound\r\n         *\t\t   (the same as {@link upper_bound}).\r\n         */\r\n        TreeMultiMap.prototype.equal_range = function (key) {\r\n            return new std.Pair(this.lower_bound(key), this.upper_bound(key));\r\n        };\r\n        /* =========================================================\r\n            ELEMENTS I/O\r\n                - INSERT\r\n                - POST-PROCESS\r\n        ============================================================\r\n            INSERT\r\n        --------------------------------------------------------- */\r\n        /**\r\n         * @hidden\r\n         */\r\n        TreeMultiMap.prototype.insert_by_pair = function (pair) {\r\n            var node = this.tree_.find(pair.first);\r\n            var it;\r\n            if (node == null) {\r\n                it = this.end();\r\n            }\r\n            else if (std.equal_to(node.value.first, pair.first) == true) {\r\n                it = node.value.next();\r\n            }\r\n            else if (std.less(node.value.first, pair.first) == true) {\r\n                it = node.value.next();\r\n                while (it.equal_to(this.end()) == false && std.less(it.first, pair.first))\r\n                    it = it.next();\r\n            }\r\n            else\r\n                it = node.value;\r\n            // ITERATOR TO RETURN\r\n            return this.insert(it, pair);\r\n        };\r\n        /* ---------------------------------------------------------\r\n            POST-PROCESS\r\n        --------------------------------------------------------- */\r\n        /**\r\n         * @inheritdoc\r\n         */\r\n        TreeMultiMap.prototype.handle_insert = function (item) {\r\n            this.tree_.insert(item);\r\n        };\r\n        /**\r\n         * @inheritdoc\r\n         */\r\n        TreeMultiMap.prototype.handle_erase = function (item) {\r\n            this.tree_.erase(item);\r\n        };\r\n        /* ===============================================================\r\n            UTILITIES\r\n        =============================================================== */\r\n        /**\r\n         * @inheritdoc\r\n         */\r\n        TreeMultiMap.prototype.swap = function (obj) {\r\n            if (obj instanceof TreeMultiMap)\r\n                this.swap_tree_multimap(obj);\r\n            else\r\n                _super.prototype.swap.call(this, obj);\r\n        };\r\n        /**\r\n         * @hidden\r\n         */\r\n        TreeMultiMap.prototype.swap_tree_multimap = function (obj) {\r\n            _a = [obj.data_, this.data_], this.data_ = _a[0], obj.data_ = _a[1];\r\n            _b = [obj.tree_, this.tree_], this.tree_ = _b[0], obj.tree_ = _b[1];\r\n            var _a, _b;\r\n        };\r\n        return TreeMultiMap;\r\n    }(std.base.MultiMap));\r\n    std.TreeMultiMap = TreeMultiMap;\r\n})(std || (std = {}));\r\n// Standard Template Library: Algorithms\r\n// The header <algorithm> defines a collection of functions especially designed to be used on ranges of elements.\r\n//\r\n// A range is any sequence of objects that can be accessed through iterators or pointers, such as an array or an \r\n// instance of some of the STL containers. Notice though, that algorithms operate through iterators directly on the \r\n// values, not affecting in any way the structure of any possible container (it never affects the size or storage \r\n// allocation of the container).\r\n//\r\n// @reference http://www.cplusplus.com/reference/algorithm/\r\n// @author Jeongho Nam <http://samchon.org>\r\nvar std;\r\n(function (std) {\r\n    /* =========================================================\r\n        ITERATIONS (NON-MODIFYING SEQUENCE)\r\n            - FOR_EACH\r\n            - AGGREGATE CONDITIONS\r\n            - FINDERS\r\n            - COUNTERS\r\n    ============================================================\r\n        FOR_EACH\r\n    --------------------------------------------------------- */\r\n    /**\r\n     * <p> Apply function to range. </p>\r\n     *\r\n     * <p> Applies function <i>fn</i> to each of the elements in the range [<i>first</i>, <i>last</i>). </p>\r\n     *\r\n     * @param first An {@link Iterator} to the initial position in a sequence.\r\n     * @param last An {@link Iterator} to the final position in a sequence. The range used is [<i>first</i>, <i>last</i>),\r\n     *\t\t\t  which contains all the elements between <i>first</i> and <i>last</i>, including the element pointed by\r\n     *\t\t\t  <i>first</i> but not the element pointed by <i>last</i>.\r\n     * @param fn Unary function that accepts an element in the range as argument. This can either be a function p\r\n     *\t\t\t ointer or a move constructible function object. Its return value, if any, is ignored.\r\n     *\r\n     * @return Returns <i>fn</i>.\r\n     */\r\n    function for_each(first, last, fn) {\r\n        for (var it = first; !it.equal_to(last); it = it.next())\r\n            fn(it.value);\r\n        return fn;\r\n    }\r\n    std.for_each = for_each;\r\n    /* ---------------------------------------------------------\r\n        AGGREGATE CONDITIONS\r\n    --------------------------------------------------------- */\r\n    /**\r\n     * <p> Test condition on all elements in range. </p>\r\n     *\r\n     * <p> Returns <code>true</code> if <i>pred</i> returns <code>true</code> for all the elements in the range\r\n     * [<i>first</i>, <i>last</i>) or if the range is {@link IContainer.empty empty}, and <code>false</code> otherwise.\r\n     * </p>\r\n     *\r\n     * @param first An {@link Iterator} to the initial position in a sequence.\r\n     * @param last An {@link Iterator} to the final position in a sequence. The range used is [<i>first</i>, <i>last</i>),\r\n     *\t\t\t  which contains all the elements between <i>first</i> and <i>last</i>, including the element pointed by\r\n     *\t\t\t  <i>first</i> but not the element pointed by <i>last</i>.\r\n     * @param pred Unary function that accepts an element in the range as argument and returns a value convertible to\r\n     *\t\t\t   <code>boolean</code>. The value returned indicates whether the element fulfills the condition\r\n     *\t\t\t   checked by this function. The function shall not modify its argument.\r\n     *\r\n     * @return <code>true</code> if pred returns true for all the elements in the range or if the range is\r\n     *\t\t   {@link IContainer.empty empty}, and <code>false</code> otherwise.\r\n     */\r\n    function all_of(first, last, pred) {\r\n        for (var it = first; !it.equal_to(last); it = it.next())\r\n            if (pred(it.value) == false)\r\n                return false;\r\n        return true;\r\n    }\r\n    std.all_of = all_of;\r\n    /**\r\n     * <p> Test if any element in range fulfills condition. </p>\r\n     *\r\n     * <p> Returns <code>true</code> if <i>pred</i> returns true for any of the elements in the range\r\n     * [<i>first</i>, <i>last</i>), and <code>false</code> otherwise. </p>\r\n     *\r\n     * <p> If [<i>first</i>, <i>last</i>) is an {@link IContainer.empty empty} range, the function returns\r\n     * <code>false</code>. </p>\r\n     *\r\n     * @param first An {@link Iterator} to the initial position in a sequence.\r\n     * @param last An {@link Iterator} to the final position in a sequence. The range used is [<i>first</i>, <i>last</i>),\r\n     *\t\t\t  which contains all the elements between <i>first</i> and <i>last</i>, including the element pointed by\r\n     *\t\t\t  <i>first</i> but not the element pointed by <i>last</i>.\r\n     * @param pred Unary function that accepts an element in the range as argument and returns a value convertible to\r\n     *\t\t\t   <code>boolean</code>. The value returned indicates whether the element fulfills the condition\r\n     *\t\t\t   checked by this function. The function shall not modify its argument.\r\n     *\r\n     * @return <code>true</code> if <i>pred</i> returns <code>true</code> for any of the elements in the range\r\n     *\t\t   [<i>first</i>, <i>last</i>), and <code>false</code> otherwise. If [<i>first</i>, <i>last</i>) is an\r\n     *\t\t   {@link IContainer.empty empty} range, the function returns <code>false</code>.\r\n     */\r\n    function any_of(first, last, pred) {\r\n        for (var it = first; !it.equal_to(last); it = it.next())\r\n            if (pred(it.value) == true)\r\n                return true;\r\n        return false;\r\n    }\r\n    std.any_of = any_of;\r\n    /**\r\n     * <p> Test if no elements fulfill condition. </p>\r\n     *\r\n     * <p> Returns <code>true</code> if <i>pred</i> returns false for all the elements in the range\r\n     * [<i>first</i>, <i>last</i>) or if the range is {@link IContainer.empty empty}, and <code>false</code> otherwise.\r\n     * </p>\r\n     *\r\n     * @param first An {@link Iterator} to the initial position in a sequence.\r\n     * @param last An {@link Iterator} to the final position in a sequence. The range used is [<i>first</i>, <i>last</i>),\r\n     *\t\t\t  which contains all the elements between <i>first</i> and <i>last</i>, including the element pointed by\r\n     *\t\t\t  <i>first</i> but not the element pointed by <i>last</i>.\r\n     * @param pred Unary function that accepts an element in the range as argument and returns a value convertible to\r\n     *\t\t\t   <code>boolean</code>. The value returned indicates whether the element fulfills the condition\r\n     *\t\t\t   checked by this function. The function shall not modify its argument.\r\n     *\r\n     * @return <code>true</code> if <i>pred</i> returns <code>false</code> for all the elements in the range\r\n     *\t\t   [<i>first</i>, <i>last</i>) or if the range is {@link IContainer.empty empty}, and <code>false</code>\r\n     *\t\t   otherwise.\r\n     */\r\n    function none_of(first, last, pred) {\r\n        return !any_of(first, last, pred);\r\n    }\r\n    std.none_of = none_of;\r\n    function equal(first1, last1, first2, pred) {\r\n        if (pred === void 0) { pred = std.equal_to; }\r\n        while (!first1.equal_to(last1))\r\n            if (first2.equal_to(first2.get_source().end()) || !pred(first1.value, first2.value))\r\n                return false;\r\n            else {\r\n                first1 = first1.next();\r\n                first2 = first2.next();\r\n            }\r\n        return true;\r\n    }\r\n    std.equal = equal;\r\n    function is_permutation(first1, last1, first2, pred) {\r\n        if (pred === void 0) { pred = std.equal_to; }\r\n        // find the mismatched\r\n        var pair = mismatch(first1, last1, first2);\r\n        first1 = pair.first;\r\n        first2 = pair.second;\r\n        if (first1.equal_to(last1))\r\n            return true;\r\n        var last2 = first2.advance(std.distance(first1, last1));\r\n        for (var it = first1; !it.equal_to(last1); it = it.next())\r\n            if (find(first1, it, it.value).equal_to(it)) {\r\n                var n = count(first2, last2, it.value);\r\n                if (n == 0 || count(it, last1, it.value) != n)\r\n                    return false;\r\n            }\r\n        return true;\r\n    }\r\n    std.is_permutation = is_permutation;\r\n    function lexicographical_compare(first1, last1, first2, last2, compare) {\r\n        if (compare === void 0) { compare = std.less; }\r\n        while (!first1.equal_to(last1))\r\n            if (first2.equal_to(last2) || !compare(first1.value, first2.value))\r\n                return false;\r\n            else if (compare(first1.value, first2.value))\r\n                return true;\r\n            else {\r\n                first1 = first1.next();\r\n                first2 = first2.next();\r\n            }\r\n        return !std.equal_to(last2, last2.get_source().end()) && !std.equal_to(first2.value, last2.value);\r\n    }\r\n    std.lexicographical_compare = lexicographical_compare;\r\n    /* ---------------------------------------------------------\r\n        FINDERS\r\n    --------------------------------------------------------- */\r\n    /**\r\n     * <p> Find value in range. </p>\r\n     *\r\n     * <p> Returns an iterator to the first element in the range [<i>first</i>, <i>last</i>) that compares equal to\r\n     * <i>val</i>. If no such element is found, the function returns <i>last</i>. </p>\r\n     *\r\n     * <p> The function uses {@link equal_to equal_to} to compare the individual elements to <i>val</i>. </p>\r\n     *\r\n     * @param first An {@link Iterator} to the initial position in a sequence.\r\n     * @param last An {@link Iterator} to the final position in a sequence. The range used is [<i>first</i>, <i>last</i>),\r\n     *\t\t\t  which contains all the elements between <i>first</i> and <i>last</i>, including the element pointed by\r\n     *\t\t\t  <i>first</i> but not the element pointed by <i>last</i>.\r\n     * @param val Value to search for in the range.\r\n     *\r\n     * @return An {@link Iterator} to the first element in the range that compares equal to <i>val</i>. If no elements\r\n     *\t\t   match, the function returns <i>last</i>.\r\n     */\r\n    function find(first, last, val) {\r\n        for (var it = first; !it.equal_to(last); it = it.next())\r\n            if (std.equal_to(it.value, val))\r\n                return it;\r\n        return last;\r\n    }\r\n    std.find = find;\r\n    /**\r\n     * <p> Find element in range. </p>\r\n     *\r\n     * <p> Returns an iterator to the first element in the range [<i>first</i>, <i>last</i>) for which pred returns\r\n     * <code>true</code>. If no such element is found, the function returns <i>last</i>. </p>\r\n     *\r\n     * @param first An {@link Iterator} to the initial position in a sequence.\r\n     * @param last An {@link Iterator} to the final position in a sequence. The range used is [<i>first</i>, <i>last</i>),\r\n     *\t\t\t  which contains all the elements between <i>first</i> and <i>last</i>, including the element pointed by\r\n     *\t\t\t  <i>first</i> but not the element pointed by <i>last</i>.\r\n     * @param pred Unary function that accepts an element in the range as argument and returns a value convertible\r\n     *\t\t\t   to <code>bool</code>. The value returned indicates whether the element is considered a match in\r\n     *\t\t\t   the context of this function. The function shall not modify its argument.\r\n     *\r\n     * @return An {@link Iterator} to the first element in the range for which <i>pred</i> does not return\r\n     *\t\t   <code>false</code>. If <i>pred</i> is <code>false</code> for all elements, the function returns\r\n     *\t\t   <i>last</i>.\r\n     */\r\n    function find_if(first, last, pred) {\r\n        for (var it = first; !it.equal_to(last); it = it.next())\r\n            if (pred(it.value))\r\n                return it;\r\n        return last;\r\n    }\r\n    std.find_if = find_if;\r\n    /**\r\n     * <p> Find element in range. </p>\r\n     *\r\n     * <p> Returns an iterator to the first element in the range [<i>first</i>, <i>last</i>) for which pred returns\r\n     * <code>true</code>. If no such element is found, the function returns <i>last</i>. </p>\r\n     *\r\n     * @param first An {@link Iterator} to the initial position in a sequence.\r\n     * @param last An {@link Iterator} to the final position in a sequence. The range used is [<i>first</i>, <i>last</i>),\r\n     *\t\t\t  which contains all the elements between <i>first</i> and <i>last</i>, including the element pointed by\r\n     *\t\t\t  <i>first</i> but not the element pointed by <i>last</i>.\r\n     * @param pred Unary function that accepts an element in the range as argument and returns a value convertible\r\n     *\t\t\t   to <code>bool</code>. The value returned indicates whether the element is considered a match in\r\n     *\t\t\t   the context of this function. The function shall not modify its argument.\r\n     *\r\n     * @return An {@link Iterator} to the first element in the range for which <i>pred</i> returns <code>false</code>.\r\n     *\t\t   If <i>pred</i> is <code>true</code> for all elements, the function returns <i>last</i>.\r\n     */\r\n    function find_if_not(first, last, pred) {\r\n        for (var it = first; !it.equal_to(last); it = it.next())\r\n            if (pred(it.value) == false)\r\n                return it;\r\n        return last;\r\n    }\r\n    std.find_if_not = find_if_not;\r\n    function find_end(first1, last1, first2, last2, compare) {\r\n        if (compare === void 0) { compare = std.equal_to; }\r\n        if (first2.equal_to(last2))\r\n            return last1;\r\n        var ret = last1;\r\n        for (; !first1.equal_to(last1); first1 = first1.next()) {\r\n            var it1 = first1;\r\n            var it2 = first2;\r\n            while (std.equal_to(it1.value, it2.value)) {\r\n                it1 = it1.next();\r\n                it2 = it2.next();\r\n                if (it2.equal_to(last2)) {\r\n                    ret = first1;\r\n                    break;\r\n                }\r\n                else if (it1.equal_to(last1))\r\n                    return ret;\r\n            }\r\n        }\r\n        return ret;\r\n    }\r\n    std.find_end = find_end;\r\n    function find_first_of(first1, last1, first2, last2, pred) {\r\n        if (pred === void 0) { pred = std.equal_to; }\r\n        for (; !first1.equal_to(last1); first1 = first1.next())\r\n            for (var it = first2; !it.equal_to(last2); it = it.next())\r\n                if (pred(it.value, first1.value))\r\n                    return first1;\r\n        return last1;\r\n    }\r\n    std.find_first_of = find_first_of;\r\n    function adjacent_find(first, last, pred) {\r\n        if (pred === void 0) { pred = std.equal_to; }\r\n        if (!first.equal_to(last)) {\r\n            var next = first.next();\r\n            while (!next.equal_to(last)) {\r\n                if (std.equal_to(first.value, last.value))\r\n                    return first;\r\n                first = first.next();\r\n                next = next.next();\r\n            }\r\n        }\r\n        return last;\r\n    }\r\n    std.adjacent_find = adjacent_find;\r\n    function search(first1, last1, first2, last2, pred) {\r\n        if (pred === void 0) { pred = std.equal_to; }\r\n        if (first2.equal_to(last2))\r\n            return first1;\r\n        for (; !first1.equal_to(last1); first1 = first1.next()) {\r\n            var it1 = first1;\r\n            var it2 = first2;\r\n            while (std.equal_to(it1.value, it2.value)) {\r\n                it1 = it1.next();\r\n                it2 = it2.next();\r\n                if (it2.equal_to(last2))\r\n                    return first1;\r\n                else if (it1.equal_to(last1))\r\n                    return last1;\r\n            }\r\n        }\r\n        return last1;\r\n    }\r\n    std.search = search;\r\n    function search_n(first, last, count, val, pred) {\r\n        if (pred === void 0) { pred = std.equal_to; }\r\n        var limit = first.advance(std.distance(first, last) - count);\r\n        for (; !first.equal_to(limit); first = first.next()) {\r\n            var it = first;\r\n            var i = 0;\r\n            while (std.equal_to(it.value, val)) {\r\n                it = it.next();\r\n                if (++i == count)\r\n                    return first;\r\n            }\r\n        }\r\n        return last;\r\n    }\r\n    std.search_n = search_n;\r\n    function mismatch(first1, last1, first2, compare) {\r\n        if (compare === void 0) { compare = std.equal_to; }\r\n        while (!first1.equal_to(last1) && !first2.equal_to(first2.get_source().end())\r\n            && std.equal_to(first1.value, first2.value)) {\r\n            first1 = first1.next();\r\n            first2 = first2.next();\r\n        }\r\n        return std.make_pair(first1, first2);\r\n    }\r\n    std.mismatch = mismatch;\r\n    /* ---------------------------------------------------------\r\n        COUNTERS\r\n    --------------------------------------------------------- */\r\n    /**\r\n     * <p> Count appearances of value in range. </p>\r\n     *\r\n     * <p> Returns the number of elements in the range [<i>first</i>, <i>last</i>) that compare equal to <i>val</i>. </p>\r\n     *\r\n     * <p> The function uses {@link equal_to} to compare the individual elements to <i>val</i>. </p>\r\n     *\r\n     * @param first An {@link Iterator} to the initial position in a sequence.\r\n     * @param last An {@link Iterator} to the final position in a sequence. The range used is [<i>first</i>, <i>last</i>),\r\n     *\t\t\t  which contains all the elements between <i>first</i> and <i>last</i>, including the element pointed by\r\n     *\t\t\t  <i>first</i> but not the element pointed by <i>last</i>.\r\n     * @param val Value to match.\r\n     *\r\n     * @return The number of elements in the range [<i>first</i>, <i>last</i>) that compare equal to <i>val</i>.\r\n     */\r\n    function count(first, last, val) {\r\n        var cnt = 0;\r\n        for (var it = first; !it.equal_to(last); it = it.next())\r\n            if (std.equal_to(it.value, val))\r\n                cnt++;\r\n        return cnt;\r\n    }\r\n    std.count = count;\r\n    /**\r\n     * <p> Return number of elements in range satisfying condition. </p>\r\n     *\r\n     * <p> Returns the number of elements in the range [<i>first</i>, <i>last</i>) for which pred is <code>true</code>.\r\n     * </p>\r\n     *\r\n     * @param first An {@link Iterator} to the initial position in a sequence.\r\n     * @param last An {@link Iterator} to the final position in a sequence. The range used is [<i>first</i>, <i>last</i>),\r\n     *\t\t\t  which contains all the elements between <i>first</i> and <i>last</i>, including the element pointed by\r\n     *\t\t\t  <i>first</i> but not the element pointed by <i>last</i>.\r\n     * @param pred Unary function that accepts an element in the range as argument, and returns a value convertible\r\n     *\t\t\t   to <code>bool</code>. The value returned indicates whether the element is counted by this function.\r\n     *\t\t\t   The function shall not modify its argument. This can either be a function pointer or a function\r\n     *\t\t\t   object.\r\n     */\r\n    function count_if(first, last, pred) {\r\n        var cnt = 0;\r\n        for (var it = first; !it.equal_to(last); it = it.next())\r\n            if (pred(it.value))\r\n                cnt++;\r\n        return cnt;\r\n    }\r\n    std.count_if = count_if;\r\n    /* =========================================================\r\n        MODIFIERS (MODIFYING SEQUENCE)\r\n            - FILL\r\n            - REMOVE\r\n            - REPLACE & SWAP\r\n            - RE-ARRANGEMENT\r\n    ============================================================\r\n        FILL\r\n    --------------------------------------------------------- */\r\n    /**\r\n     * <p> Copy range of elements. </p>\r\n     *\r\n     * <p> Copies the elements in the range [<i>first</i>, <i>last</i>) into the range beginning at <i>result</i>. </p>\r\n     *\r\n     * <p> The function returns an iterator to the end of the destination range (which points to the element following the\r\n     * last element copied). </p>\r\n     *\r\n     * <p> The ranges shall not overlap in such a way that result points to an element in the range\r\n     * [<i>first</i>, <i>last</i>). For such cases, see {@link copy_backward}. </p>\r\n     *\r\n     * @param first {@link Iterator Input iterator} to the initial position in a sequence to be copied.\r\n     * @param last {@link Iterator Input iterator} to the initial position in a sequence to be copied. The range used is\r\n     *\t\t\t   [<i>first</i>, <i>last</i>), which contains all the elements between <i>first</i> and <i>last</i>,\r\n     *\t\t\t   including the element pointed by <i>first</i> but not the element pointed by <i>last</i>.\r\n     * @param result {@link Iterator Output iterator} to the initial position in the destination sequence. This shall not\r\n     *\t\t\t\t point to any element in the range [<i>first</i>, <i>last</i>).\r\n     *\r\n     * @return An iterator to the end of the destination range where elements have been copied.\r\n     */\r\n    function copy(first, last, result) {\r\n        for (; !first.equal_to(last); first = first.next()) {\r\n            result.value = first.value;\r\n            result = result.next();\r\n        }\r\n        return result;\r\n    }\r\n    std.copy = copy;\r\n    /**\r\n     * <p> Copy elements. </p>\r\n     *\r\n     * <p> Copies the first <i>n</i> elements from the range beginning at <i>first</i> into the range beginning at\r\n     * <i>result</i>. </p>\r\n     *\r\n     * <p> The function returns an iterator to the end of the destination range (which points to one past the last element\r\n     * copied). </p>\r\n     *\r\n     * <p> If <i>n</i> is negative, the function does nothing. </p>\r\n     *\r\n     * <p> If the ranges overlap, some of the elements in the range pointed by result may have undefined but valid values.\r\n     * </p>\r\n     *\r\n     * @param first {@link Iterator Input iterator} to the initial position in a sequence of at least <i>n</i> elements to\r\n     *\t\t\t\tbe copied. <i>InputIterator</i> shall point to a type assignable to the elements pointed by\r\n     *\t\t\t\t<i>OutputIterator</i>.\r\n     * @param n Number of elements to copy. If this value is negative, the function does nothing.\r\n     * @param result {@link Iterator Output iterator} to the initial position in the destination sequence of at least\r\n     *\t\t\t\t <i>n</i> elements. This shall not point to any element in the range [<i>first</i>, last].\r\n     *\r\n     * @return An iterator to the end of the destination range where elements have been copied.\r\n     */\r\n    function copy_n(first, n, result) {\r\n        for (var i = 0; i < n; i++) {\r\n            result.value = first.value;\r\n            first = first.next();\r\n            result = result.next();\r\n        }\r\n        return result;\r\n    }\r\n    std.copy_n = copy_n;\r\n    /**\r\n     * <p> Copy certain elements of range. </p>\r\n     *\r\n     * <p> Copies the elements in the range [<i>first</i>, <i>last</i>) for which pred returns <code>true</code> to the\r\n     * range beginning at <i>result</i>. </p>\r\n     *\r\n     * @param first {@link Iterator Input iterator} to the initial position in a sequence to be copied.\r\n     * @param last {@link Iterator Input iterator} to the initial position in a sequence to be copied. The range used is\r\n     *\t\t\t   [<i>first</i>, <i>last</i>), which contains all the elements between <i>first</i> and <i>last</i>,\r\n     *\t\t\t   including the element pointed by <i>first</i> but not the element pointed by <i>last</i>.\r\n     * @param result {@link Iterator Output iterator} to the initial position in the destination sequence. This shall not\r\n     *\t\t\t\t point to any element in the range [<i>first</i>, <i>last</i>).\r\n     * @param pred Unary function that accepts an element in the range as argument, and returns a value convertible to\r\n     *\t\t\t   <code>bool</code>. The value returned indicates whether the element is to be copied (if\r\n     *\t\t\t   <code>true</code>, it is copied). The function shall not modify any of its arguments.\r\n     *\r\n     * @return An iterator to the end of the destination range where elements have been copied.\r\n     */\r\n    function copy_if(first, last, result, pred) {\r\n        for (; !first.equal_to(last); first = first.next()) {\r\n            if (!pred(first.value))\r\n                continue;\r\n            result.value = first.value;\r\n            result = result.next();\r\n        }\r\n        return result;\r\n    }\r\n    std.copy_if = copy_if;\r\n    /**\r\n     * <p> Copy range of elements backward. </p>\r\n     *\r\n     * <p> Copies the elements in the range [<i>first</i>, <i>last</i>) starting from the end into the range terminating\r\n     * at <i>result</i>. </p>\r\n     *\r\n     * <p> The function returns an iterator to the first element in the destination range. </p>\r\n     *\r\n     * <p> The resulting range has the elements in the exact same order as [<i>first</i>, <i>last</i>). To reverse their\r\n     * order, see {@link reverse_copy}. </p>\r\n     *\r\n     * <p> The function begins by copying <code>*(last-1)</code> into <code>*(result-1)</code>, and then follows backward\r\n     * by the elements preceding these, until <i>first</i> is reached (and including it). </p>\r\n     *\r\n     * <p> The ranges shall not overlap in such a way that <i>result</i> (which is the <i>past-the-end element</i> in the\r\n     * destination range) points to an element in the range (first,last]. For such cases, see {@link copy}. </p>\r\n     *\r\n     * @param first {@link Iterator Bidirectional iterator} to the initial position in a sequence to be copied.\r\n     * @param last {@link Iterator Bidirectional iterator} to the initial position in a sequence to be copied. The range\r\n     *\t\t\t   used is [<i>first</i>, <i>last</i>), which contains all the elements between <i>first</i> and\r\n     *\t\t\t   <i>last</i>, including the element pointed by <i>first</i> but not the element pointed by <i>last</i>.\r\n     * @param result {@link Iterator Bidirectional iterator} to the initial position in the destination sequence. This\r\n     *\t\t\t\t shall not point to any element in the range [<i>first</i>, <i>last</i>).\r\n     *\r\n     * @return An iterator to the first element of the destination sequence where elements have been copied.\r\n     */\r\n    function copy_backward(first, last, result) {\r\n        last = last.prev();\r\n        for (; !last.equal_to(first); last = last.prev()) {\r\n            result.value = last.value;\r\n            result = result.prev();\r\n        }\r\n        return result;\r\n    }\r\n    std.copy_backward = copy_backward;\r\n    /**\r\n     * <p> Fill range with value. </p>\r\n     *\r\n     * <p> Assigns val to all the elements in the range [<i>first</i>, <i>last</i>). </p>\r\n     *\r\n     * @param first {@link Iterator Forward iterator} to the initial position in a sequence of elements that support being\r\n     *\t\t\t\tassigned a value of type <i>T</i>.\r\n     * @param last {@link Iterator Forward iterator} to the final position in a sequence of elements that support being\r\n     *\t\t\t\tassigned a value of type <i>T</i>.. The range filled is [<i>first</i>, <i>last</i>), which contains\r\n     *\t\t\t\tall the elements between <i>first</i> and <i>last</i>, including the element pointed by <i>first</i>\r\n     *\t\t\t\tbut not the element pointed by <i>last</i>.\r\n     * @param val Value to assign to the elements in the filled range.\r\n     */\r\n    function fill(first, last, val) {\r\n        for (; !first.equal_to(last); first = first.next())\r\n            first.value = val;\r\n    }\r\n    std.fill = fill;\r\n    /**\r\n     * <p> Fill sequence with value. </p>\r\n     *\r\n     * <p> Assigns <i>val</i> to the first <i>n</i> elements of the sequence pointed by <i>first</i>. </p>\r\n     *\r\n     * @param first {@link Iterator Output iterator} to the initial position in a sequence of elements that support being\r\n     *\t\t\t\tassigned a value of type <i>T</i>.\r\n     * @param n Number of elements to fill. If negative, the function does nothing.\r\n     * @param val Value to be used to fill the range.\r\n     *\r\n     * @return An iterator pointing to the element that follows the last element filled.\r\n     */\r\n    function fill_n(first, n, val) {\r\n        for (var i = 0; i < n; i++) {\r\n            first.value = val;\r\n            first = first.next();\r\n        }\r\n        return first;\r\n    }\r\n    std.fill_n = fill_n;\r\n    function transform() {\r\n        var args = [];\r\n        for (var _i = 0; _i < arguments.length; _i++) {\r\n            args[_i - 0] = arguments[_i];\r\n        }\r\n        if (args.length == 4)\r\n            return unary_transform.apply(null, args);\r\n        else\r\n            return binary_transform.apply(null, args);\r\n    }\r\n    std.transform = transform;\r\n    /**\r\n     * @hidden\r\n     */\r\n    function unary_transform(first, last, result, op) {\r\n        for (; !first.equal_to(last); first = first.next()) {\r\n            result.value = op(first.value);\r\n            result = result.next();\r\n        }\r\n        return result;\r\n    }\r\n    /**\r\n     * @hidden\r\n     */\r\n    function binary_transform(first1, last1, first2, result, binary_op) {\r\n        while (!first1.equal_to(last1)) {\r\n            result.value = binary_op(first1.value, first2.value);\r\n            first1 = first1.next();\r\n            first2 = first2.next();\r\n            result = result.next();\r\n        }\r\n        return result;\r\n    }\r\n    /**\r\n     * <p> Generate values for range with function. </p>\r\n     *\r\n     * <p> Assigns the value returned by successive calls to gen to the elements in the range [<i>first</i>, <i>last</i>).\r\n     * </p>\r\n     *\r\n     * @param first {@link Iterator Forward iterator} to the initial position in a sequence.\r\n     * @param last {@link Iterator Forward iterator} to the final position in a sequence. The range affected is\r\n     *\t\t\t   [<i>first</i>, <i>last</i>), which contains all the elements between <i>first</i> and <i>last</i>,\r\n     *\t\t\t   including the element pointed by <i>first</i> but not the element pointed by <i>last</i>.\r\n     * @param gen Generator function that is called with no arguments and returns some value of a type convertible to\r\n     *\t\t\t  those pointed by the iterators.\r\n     */\r\n    function generate(first, last, gen) {\r\n        for (; !first.equal_to(last); first = first.next())\r\n            first.value = gen();\r\n    }\r\n    std.generate = generate;\r\n    /**\r\n     * <p> Generate values for sequence with function. </p>\r\n     *\r\n     * <p> Assigns the value returned by successive calls to <i>gen</i> to the first <i>n</i> elements of the sequence\r\n     * pointed by <i>first</i>. </p>\r\n     *\r\n     * @param first {@link Iterator Output iterator} to the initial position in a sequence of at least <i>n</i> elements\r\n     *\t\t\t\tthat support being assigned a value of the type returned by <i>gen</i>.\r\n     * @param n Number of values to generate. If negative, the function does nothing.\r\n     * @param gen Generator function that is called with no arguments and returns some value of a type convertible to\r\n     *\t\t\t  those pointed by the iterators.\r\n     *\r\n     * @return An iterator pointing to the element that follows the last element whose value has been generated.\r\n     */\r\n    function generate_n(first, n, gen) {\r\n        for (var i = 0; i < n; i++) {\r\n            first.value = gen();\r\n            first = first.next();\r\n        }\r\n        return first;\r\n    }\r\n    std.generate_n = generate_n;\r\n    function unique(first, last, pred) {\r\n        if (pred === void 0) { pred = std.equal_to; }\r\n        var ret = first;\r\n        for (var it = first.next(); !it.equal_to(last);) {\r\n            if (std.equal_to(it.value, it.prev().value) == true)\r\n                it = it.get_source().erase(it);\r\n            else {\r\n                ret = it;\r\n                it = it.next();\r\n            }\r\n        }\r\n        return ret;\r\n    }\r\n    std.unique = unique;\r\n    function unique_copy(first, last, result, pred) {\r\n        if (pred === void 0) { pred = std.equal_to; }\r\n        if (first.equal_to(last))\r\n            return result;\r\n        result.value = first.value;\r\n        first = first.next();\r\n        for (; !first.equal_to(last); first = first.next())\r\n            if (!pred(first.value, result.value)) {\r\n                result = result.next();\r\n                result.value = first.value;\r\n            }\r\n        return result;\r\n    }\r\n    std.unique_copy = unique_copy;\r\n    /**\r\n     * <p> Remove value from range. </p>\r\n     *\r\n     * <p> Transforms the range [<i>first</i>, <i>last</i>) into a range with all the elements that compare equal to\r\n     * <i>val</i> removed, and returns an iterator to the new last of that range. </p>\r\n     *\r\n     * <p> The function cannot alter the properties of the object containing the range of elements (i.e., it cannot alter\r\n     * the size of an array or a container): The removal is done by replacing the elements that compare equal to\r\n     * <i>val</i> by the next element that does not, and signaling the new size of the shortened range by returning an\r\n     * iterator to the element that should be considered its new past-the-last element. </p>\r\n     *\r\n     * <p> The relative order of the elements not removed is preserved, while the elements between the returned iterator\r\n     * and last are left in a valid but unspecified state. </p>\r\n     *\r\n     * @param first An {@link Iterator} to the initial position in a sequence.\r\n     * @param last An {@link Iterator} to the final position in a sequence. The range used is [<i>first</i>, <i>last</i>),\r\n     *\t\t\t  which contains all the elements between <i>first</i> and <i>last</i>, including the element pointed by\r\n     *\t\t\t  <i>first</i> but not the element pointed by <i>last</i>.\r\n     * @param val Value to be removed.\r\n     */\r\n    function remove(first, last, val) {\r\n        var ret = last;\r\n        for (var it = first; !it.equal_to(last);) {\r\n            if (std.equal_to(it.value, val) == true)\r\n                it = it.get_source().erase(it);\r\n            else {\r\n                ret = it;\r\n                it = it.next();\r\n            }\r\n        }\r\n        return ret;\r\n    }\r\n    std.remove = remove;\r\n    /**\r\n     * <p> Remove elements from range. </p>\r\n     *\r\n     * <p> Transforms the range [<i>first</i>, <i>last</i>) into a range with all the elements for which pred returns\r\n     * <code>true</code> removed, and returns an iterator to the new last of that range. </p>\r\n     *\r\n     * <p> The function cannot alter the properties of the object containing the range of elements (i.e., it cannot\r\n     * alter the size of an array or a container): The removal is done by replacing the elements for which pred returns\r\n     * <code>true</code> by the next element for which it does not, and signaling the new size of the shortened range\r\n     * by returning an iterator to the element that should be considered its new past-the-last element. </p>\r\n     *\r\n     * <p> The relative order of the elements not removed is preserved, while the elements between the returned\r\n     * iterator and last are left in a valid but unspecified state. </p>\r\n     *\r\n     * @param first An {@link Iterator} to the initial position in a sequence.\r\n     * @param last An {@link Iterator} to the final position in a sequence. The range used is [<i>first</i>, <i>last</i>),\r\n     *\t\t\t  which contains all the elements between <i>first</i> and <i>last</i>, including the element pointed by\r\n     *\t\t\t  <i>first</i> but not the element pointed by <i>last</i>.\r\n     * @param pred Unary function that accepts an element in the range as argument, and returns a value convertible to\r\n     *\t\t\t   <code>bool</code>. The value returned indicates whether the element is to be removed (if\r\n     *\t\t\t   <code>true</code>, it is removed). The function shall not modify its argument.\r\n     */\r\n    function remove_if(first, last, pred) {\r\n        var ret = last;\r\n        for (var it = first; !it.equal_to(last);) {\r\n            if (pred(it.value) == true)\r\n                it = it.get_source().erase(it);\r\n            else {\r\n                ret = it;\r\n                it = it.next();\r\n            }\r\n        }\r\n        return ret;\r\n    }\r\n    std.remove_if = remove_if;\r\n    /**\r\n     * <p> Copy range removing value. </p>\r\n     *\r\n     * <p> Copies the elements in the range [<i>first</i>, <i>last</i>) to the range beginning at <i>result</i>, except\r\n     * those elements that compare equal to <i>val</i>. </p>\r\n     *\r\n     * <p> The resulting range is shorter than [<i>first</i>, <i>last</i>) by as many elements as matches in the sequence,\r\n     * which are \"removed\". </p>\r\n     *\r\n     * <p> The function uses {@link equal_to} to compare the individual elements to <i>val</i>. </p>\r\n     *\r\n     * @param first {@link Iterator InputIterator} to the initial position in a sequence.\r\n     * @param last {@link Iterator InputIterator} to the final position in a sequence. The range used is\r\n     *\t\t\t   [<i>first</i>, <i>last</i>), which contains all the elements between <i>first</i> and <i>last</i>,\r\n     *\t\t\t   including the element pointed by <i>first</i> but not the element pointed by <i>last</i>.\r\n     * @param result {@link Iterator Output iterator} to the initial position of the range where the resulting sequence is\r\n     *\t\t\t\t stored. The pointed type shall support being assigned the value of an element in the range\r\n     *\t\t\t\t [<i>first</i>, <i>last</i>).\r\n     * @param val Value to be removed.\r\n     *\r\n     * @return An iterator pointing to the end of the copied range, which includes all the elements in\r\n     *\t\t   [<i>first</i>, <i>last</i>) except those that compare equal to <i>val</i>.\r\n     */\r\n    function remove_copy(first, last, result, val) {\r\n        for (; !first.equal_to(last); first = first.next()) {\r\n            if (std.equal_to(first.value, val))\r\n                continue;\r\n            result.value = first.value;\r\n            result = result.next();\r\n        }\r\n        return result;\r\n    }\r\n    std.remove_copy = remove_copy;\r\n    /**\r\n     * <p> Copy range removing values. </p>\r\n     *\r\n     * <p> Copies the elements in the range [<i>first</i>, <i>last</i>) to the range beginning at <i>result</i>, except\r\n     * those elements for which <i>pred</i> returns <code>true</code>. </p>\r\n     *\r\n     * <p> The resulting range is shorter than [<i>first</i>, <i>last</i>) by as many elements as matches, which are\r\n     * \"removed\". </p>\r\n     *\r\n     * @param first {@link Iterator InputIterator} to the initial position in a sequence.\r\n     * @param last {@link Iterator InputIterator} to the final position in a sequence. The range used is\r\n     *\t\t\t   [<i>first</i>, <i>last</i>), which contains all the elements between <i>first</i> and <i>last</i>,\r\n     *\t\t\t   including the element pointed by <i>first</i> but not the element pointed by <i>last</i>.\r\n     * @param result {@link Iterator Output iterator} to the initial position of the range where the resulting sequence is\r\n     *\t\t\t\t stored. The pointed type shall support being assigned the value of an element in the range\r\n     *\t\t\t\t [<i>first</i>, <i>last</i>).\r\n     * @param pred Unary function that accepts an element in the range as argument, and returns a value convertible to\r\n     *\t\t\t   <code>bool</code>. The value returned indicates whether the element is to be removed from the copy (if\r\n     *\t\t\t   <code>true</code>, it is not copied). The function shall not modify its argument.\r\n     *\r\n     * @return An iterator pointing to the end of the copied range, which includes all the elements in\r\n     *\t\t   [<i>first</i>, <i>last</i>) except those for which <i>pred</i> returns <code>true</code>.\r\n     */\r\n    function remove_copy_if(first, last, result, pred) {\r\n        for (; !first.equal_to(last); first = first.next()) {\r\n            if (pred(first.value))\r\n                continue;\r\n            result.value = first.value;\r\n            result = result.next();\r\n        }\r\n        return result;\r\n    }\r\n    std.remove_copy_if = remove_copy_if;\r\n    /* ---------------------------------------------------------\r\n        REPLACE & SWAP\r\n    --------------------------------------------------------- */\r\n    /**\r\n     * <p> Replace value in range. </p>\r\n     *\r\n     * <p> Assigns <i>new_val</i> to all the elements in the range [<i>first</i>, <i>last</i>) that compare equal to\r\n     * <i>old_val</i>. </p>\r\n     *\r\n     * <p> The function uses {@link equal_to} to compare the individual elements to old_val. </p>\r\n     *\r\n     * @param first An {@link Iterator} to the initial position in a sequence.\r\n     * @param last An {@link Iterator} to the final position in a sequence. The range used is [<i>first</i>, <i>last</i>),\r\n     *\t\t\t  which contains all the elements between <i>first</i> and <i>last</i>, including the element pointed by\r\n     *\t\t\t  <i>first</i> but not the element pointed by <i>last</i>.\r\n     * @param old_val Value to be replaced.\r\n     * @param new_val Replacement value.\r\n     */\r\n    function replace(first, last, old_val, new_val) {\r\n        for (var it = first; !it.equal_to(last); it = it.next())\r\n            if (std.equal_to(it.value, old_val))\r\n                it.value = new_val;\r\n    }\r\n    std.replace = replace;\r\n    /**\r\n     * <p> Replace value in range. </p>\r\n     *\r\n     * <p> Assigns <i>new_val</i> to all the elements in the range [<i>first</i>, <i>last</i>) for which pred returns\r\n     * <code>true</code>. </p>\r\n     *\r\n     * @param first An {@link Iterator} to the initial position in a sequence.\r\n     * @param last An {@link Iterator} to the final position in a sequence. The range used is [<i>first</i>, <i>last</i>),\r\n     *\t\t\t  which contains all the elements between <i>first</i> and <i>last</i>, including the element pointed by\r\n     *\t\t\t  <i>first</i> but not the element pointed by <i>last</i>.\r\n     * @param pred Unary function that accepts an element in the range as argument, and returns a value convertible to\r\n     *\t\t\t   <code>bool</code>. The value returned indicates whether the element is to be replaced (if\r\n     *\t\t\t   <code>true</code>, it is replaced). The function shall not modify its argument.\r\n     * @param new_val Value to assign to replaced elements.\r\n     */\r\n    function replace_if(first, last, pred, new_val) {\r\n        for (var it = first; !it.equal_to(last); it = it.next())\r\n            if (pred(it.value) == true)\r\n                it.value = new_val;\r\n    }\r\n    std.replace_if = replace_if;\r\n    /**\r\n     * <p> Copy range replacing value. </p>\r\n     *\r\n     * <p> Copies the elements in the range [<i>first</i>, <i>last</i>) to the range beginning at <i>result</i>, replacing\r\n     * the appearances of <i>old_value</i> by <i>new_value</i>. </p>\r\n     *\r\n     * <p> The function uses {@link std.equal_to} to compare the individual elements to <i>old_value</i>. </p>\r\n     *\r\n     * <p> The ranges shall not overlap in such a way that result points to an element in the range\r\n     * [<i>first</i>, <i>last</i>). </p>\r\n     *\r\n     * @param first {@link Iterator InputIterator} to the initial position in a sequence.\r\n     * @param last {@link Iterator InputIterator} to the final position in a sequence. The range used is\r\n     *\t\t\t   [<i>first</i>, <i>last</i>), which contains all the elements between <i>first</i> and <i>last</i>,\r\n     *\t\t\t   including the element pointed by <i>first</i> but not the element pointed by <i>last</i>.\r\n     * @param result {@link Iterator Output iterator} to the initial position of the range where the resulting sequence is\r\n     *\t\t\t\t stored. The pointed type shall support being assigned the value of an element in the range\r\n     *\t\t\t\t [<i>first</i>, <i>last</i>).\r\n     * @param old_val Value to be replaced.\r\n     * @param new_val Replacement value.\r\n     *\r\n     * @return An iterator pointing to the element that follows the last element written in the result sequence.\r\n     */\r\n    function replace_copy(first, last, result, old_val, new_val) {\r\n        for (; !first.equal_to(last); first = first.next()) {\r\n            if (std.equal_to(first.value, old_val))\r\n                result.value = new_val;\r\n            else\r\n                result.value = first.value;\r\n            result = result.next();\r\n        }\r\n        return result;\r\n    }\r\n    std.replace_copy = replace_copy;\r\n    /**\r\n     * <p> Copy range replacing value. </p>\r\n     *\r\n     * <p> Copies the elements in the range [<i>first</i>, <i>last</i>) to the range beginning at <i>result</i>, replacing\r\n     * those for which <i>pred</i> returns <code>true</code> by <i>new_value</i>. </p>\r\n     *\r\n     * @param first {@link Iterator InputIterator} to the initial position in a sequence.\r\n     * @param last {@link Iterator InputIterator} to the final position in a sequence. The range used is\r\n     *\t\t\t   [<i>first</i>, <i>last</i>), which contains all the elements between <i>first</i> and <i>last</i>,\r\n     *\t\t\t   including the element pointed by <i>first</i> but not the element pointed by <i>last</i>.\r\n     * @param result {@link Iterator Output iterator} to the initial position of the range where the resulting sequence is\r\n     *\t\t\t\t stored. The pointed type shall support being assigned the value of an element in the range\r\n     *\t\t\t\t [<i>first</i>, <i>last</i>).\r\n     * @param pred Unary function that accepts an element in the range as argument, and returns a value convertible to\r\n     *\t\t\t   <code>bool</code>. The value returned indicates whether the element is to be removed from the copy (if\r\n     *\t\t\t   <code>true</code>, it is not copied). The function shall not modify its argument.\r\n     * @param new_val Value to assign to replaced values.\r\n     *\r\n     * @return An iterator pointing to the element that follows the last element written in the result sequence.\r\n     */\r\n    function replace_copy_if(first, last, result, pred, new_val) {\r\n        for (; !first.equal_to(last); first = first.next()) {\r\n            if (pred(first.value))\r\n                result.value = new_val;\r\n            else\r\n                result.value = first.value;\r\n            result = result.next();\r\n        }\r\n        return result;\r\n    }\r\n    std.replace_copy_if = replace_copy_if;\r\n    /**\r\n     * <p> Exchange values of objects pointed to by two iterators. </p>\r\n     *\r\n     * <p> Swaps the elements pointed to by <i>x</i> and <i>y</i>. </p>\r\n     *\r\n     * <p> The function calls {@link Iterator.swap} to exchange the elements. </p>\r\n     *\r\n     * @param x {@link Iterator Forward iterator} to the objects to swap.\r\n     * @param y {@link Iterator Forward iterator} to the objects to swap.\r\n     */\r\n    function iter_swap(x, y) {\r\n        x.swap(y);\r\n    }\r\n    std.iter_swap = iter_swap;\r\n    /**\r\n     * <p> Exchange values of two ranges. </p>\r\n     *\r\n     * <p> Exchanges the values of each of the elements in the range [<i>first1</i>, <i>last1</i>) with those of their\r\n     * respective elements in the range beginning at <i>first2</i>. </p>\r\n     *\r\n     * <p> The function calls {@link Iterator.swap} to exchange the elements. </p>\r\n     *\r\n     * @param first1 {@link Iterator Forward iterator} to the initial position of the first sequence.\r\n     * @param last1 {@link Iterator Forward iterator} to the final position of the first sequence. The range used is\r\n     *\t\t\t\t[<i>first1</i>, <i>last1</i>), including the element pointed by <i>first1</i>, but not the element\r\n     *\t\t\t\tpointed by <i>last1</i>.\r\n     * @param first2 {@link Iterator Forward iterator} to the initial position of the second range. The range includes as\r\n     *\t\t\t\t many elements as [<i>first1</i>, <i>last1</i>). The two ranges shall not overlap.\r\n     *\r\n     * @return An iterator to the last element swapped in the second sequence.\r\n     */\r\n    function swap_ranges(first1, last1, first2) {\r\n        for (; !first1.equal_to(last1); first1 = first1.next()) {\r\n            first1.swap(first2);\r\n            first2 = first2.next();\r\n        }\r\n        return first2;\r\n    }\r\n    std.swap_ranges = swap_ranges;\r\n    /* ---------------------------------------------------------\r\n        RE-ARRANGEMENT\r\n    --------------------------------------------------------- */\r\n    /**\r\n     * <p> Reverse range. </p>\r\n     *\r\n     * <p> Reverses the order of the elements in the range [<i>first</i>, <i>last</i>). </p>\r\n     *\r\n     * <p> The function calls {@link iter_swap} to swap the elements to their new locations. </p>\r\n     *\r\n     * @param first An {@link Iterator} to the initial position in a sequence.\r\n     * @param last An {@link Iterator} to the final position in a sequence. The range used is [<i>first</i>, <i>last</i>),\r\n     *\t\t\t  which contains all the elements between <i>first</i> and <i>last</i>, including the element pointed by\r\n     *\t\t\t  <i>first</i> but not the element pointed by <i>last</i>.\r\n     */\r\n    function reverse(first, last) {\r\n        // first != last && first != --last\r\n        while (first.equal_to(last) == false && !first.equal_to((last = last.prev())) == false) {\r\n            first.swap(last);\r\n            first = first.next();\r\n        }\r\n    }\r\n    std.reverse = reverse;\r\n    /**\r\n     * <p> Copy range reversed. </p>\r\n     *\r\n     * <p> Copies the elements in the range [<i>first</i>, <i>last</i>) to the range beginning at <i>result</i>, but in\r\n     * reverse order. </p>\r\n     *\r\n     * @param first {@link Iterator Bidirectional iterator} to the initial position in a sequence to be copied.\r\n     * @param last {@link Iterator Bidirectional iterator} to the initial position in a sequence to be copied. The range\r\n     *\t\t\t   used is [<i>first</i>, <i>last</i>), which contains all the elements between <i>first</i> and\r\n     *\t\t\t   <i>last</i>, including the element pointed by <i>first</i> but not the element pointed by <i>last</i>.\r\n     * @param result {@link Iterator Output iterator} to the initial position of the range where the reserved range is\r\n     *\t\t\t\t stored. The pointed type shall support being assigned the value of an element in the range\r\n     *\t\t\t\t [<i>first</i>, <i>last</i>).\r\n     *\r\n     * @return An output iterator pointing to the end of the copied range, which contains the same elements in reverse\r\n     *\t\t   order.\r\n     */\r\n    function reverse_copy(first, last, result) {\r\n        while (!last.equal_to(first)) {\r\n            last = last.prev();\r\n            result.value = last.value;\r\n            result = result.next();\r\n        }\r\n        return result;\r\n    }\r\n    std.reverse_copy = reverse_copy;\r\n    /**\r\n     * <p> Rotate left the elements in range. </p>\r\n     *\r\n     * <p> Rotates the order of the elements in the range [<i>first</i>, <i>last</i>), in such a way that the element\r\n     * pointed by middle becomes the new first element. </p>\r\n     *\r\n     * @param first An {@link Iterator} to the initial position in a sequence.\r\n     * @param middle An {@link Iterator} pointing to the element within the range [<i>first</i>, <i>last</i>) that is\r\n     *\t\t\t\t moved to the first position in the range.\r\n     * @param last An {@link Iterator} to the final position in a sequence. The range used is [<i>first</i>, <i>last</i>),\r\n     *\t\t\t  which contains all the elements between <i>first</i> and <i>last</i>, including the element pointed by\r\n     *\t\t\t  <i>first</i> but not the element pointed by <i>last</i>.\r\n     *\r\n     * @return An iterator pointing to the element that now contains the value previously pointed by <i>first</i>.\r\n     */\r\n    function rotate(first, middle, last) {\r\n        var next = middle;\r\n        while (next.equal_to(last) == false) {\r\n            first.swap(next);\r\n            first = first.next();\r\n            next = next.next();\r\n            if (first.equal_to(middle))\r\n                break;\r\n        }\r\n        return first;\r\n    }\r\n    std.rotate = rotate;\r\n    /**\r\n     * <p> Copy range rotated left. </p>\r\n     *\r\n     * <p> Copies the elements in the range [<i>first</i>, <i>last</i>) to the range beginning at <i>result</i>, but\r\n     * rotating the order of the elements in such a way that the element pointed by <i>middle</i> becomes the first\r\n     * element in the resulting range. </p>\r\n     *\r\n     * @param first {@link Iterator Forward iterator} to the initial position of the range to be copy-rotated.\r\n     * @param middle Forward iterator pointing to the element within the range [<i>first</i>, <i>last</i>) that is copied as the first element in the resulting range.\r\n     * @param last {@link Iterator Forward iterator} to the final positions of the range to be copy-rotated. The range\r\n     *\t\t\t   used is [<i>first</i>, <i>last</i>), which contains all the elements between <i>first</i> and\r\n     *\t\t\t   <i>last</i>, including the element pointed by <i>first</i> but not the element pointed by <i>last</i>.\r\n     *\t\t\t   Notice that in this function, these are not consecutive parameters, but the first and <b>third</b> ones.\r\n     * @param result {@link Iterator Output iterator} to the initial position of the range where the reserved range is\r\n     *\t\t\t\t stored. The pointed type shall support being assigned the value of an element in the range\r\n     *\t\t\t\t [<i>first</i>, <i>last</i>).\r\n     *\r\n     * @return An output iterator pointing to the end of the copied range.\r\n     */\r\n    function rotate_copy(first, middle, last, result) {\r\n        result = copy(middle, last, result);\r\n        return copy(first, middle, result);\r\n    }\r\n    std.rotate_copy = rotate_copy;\r\n    /**\r\n     * <p> Randomly rearrange elements in range. </p>\r\n     *\r\n     * <p> Rearranges the elements in the range [<i>first</i>, <i>last</i>) randomly. </p>\r\n     *\r\n     * <p> The function swaps the value of each element with that of some other randomly picked element. When provided,\r\n     * the function gen determines which element is picked in every case. Otherwise, the function uses some unspecified\r\n     * source of randomness. </p>\r\n     *\r\n     * <p> To specify a uniform random generator, see {@link shuffle}. </p>\r\n     *\r\n     * @param first An {@link Iterator} to the initial position in a sequence.\r\n     * @param last An {@link Iterator} to the final position in a sequence. The range used is [<i>first</i>, <i>last</i>),\r\n     *\t\t\t  which contains all the elements between <i>first</i> and <i>last</i>, including the element pointed by\r\n     *\t\t\t  <i>first</i> but not the element pointed by <i>last</i>.\r\n     */\r\n    function random_shuffle(first, last) {\r\n        return std.shuffle(first, last);\r\n    }\r\n    std.random_shuffle = random_shuffle;\r\n    /**\r\n     * <p> Randomly rearrange elements in range using generator. </p>\r\n     *\r\n     * <p> Rearranges the elements in the range [<i>first</i>, <i>last</i>) randomly, using <i>g</i> as uniform random\r\n     * number generator. </p>\r\n     *\r\n     * <p> The function swaps the value of each element with that of some other randomly picked element. The function\r\n     * determines the element picked by calling <i>g()</i>. </p>\r\n     *\r\n     * <p> To shuffle the elements of the range without such a generator, see {@link random_shuffle} instead. </p>\r\n     *\r\n     * <h5> Note </h5>\r\n     * <p> Using random generator engine is not implemented yet. </p>\r\n     *\r\n     * @param first An {@link Iterator} to the initial position in a sequence.\r\n     * @param last An {@link Iterator} to the final position in a sequence. The range used is [<i>first</i>, <i>last</i>),\r\n     *\t\t\t  which contains all the elements between <i>first</i> and <i>last</i>, including the element pointed by\r\n     *\t\t\t  <i>first</i> but not the element pointed by <i>last</i>.\r\n     */\r\n    function shuffle(first, last) {\r\n        for (var it = first; !it.equal_to(last); it = it.next()) {\r\n            var rand_index = Math.floor(Math.random() * (last.index - first.index));\r\n            it.swap(first.advance(rand_index));\r\n        }\r\n    }\r\n    std.shuffle = shuffle;\r\n    function sort(first, last, compare) {\r\n        if (compare === void 0) { compare = std.less; }\r\n        qsort(first.get_source(), first.index, last.index, compare);\r\n    }\r\n    std.sort = sort;\r\n    function partial_sort(first, middle, last, compare) {\r\n        if (compare === void 0) { compare = std.less; }\r\n        selection_sort(first.get_source(), first.index, middle.index, last.index, compare);\r\n    }\r\n    std.partial_sort = partial_sort;\r\n    function partial_sort_copy(first, last, result_first, result_last, compare) {\r\n        if (compare === void 0) { compare = std.less; }\r\n        var input_size = std.distance(first, last);\r\n        var result_size = std.distance(result_first, result_last);\r\n        var vector = new std.Vector(first, last);\r\n        sort(vector.begin(), vector.end());\r\n        if (input_size > result_size)\r\n            result_first = copy(vector.begin(), vector.begin().advance(result_size), result_first);\r\n        else\r\n            result_first = copy(vector.begin(), vector.end(), result_first);\r\n        return result_first;\r\n    }\r\n    std.partial_sort_copy = partial_sort_copy;\r\n    function is_sorted(first, last, compare) {\r\n        if (compare === void 0) { compare = std.equal_to; }\r\n        if (first.equal_to(last))\r\n            return true;\r\n        for (var next = first.next(); !next.equal_to(last); next = next.next()) {\r\n            if (std.less(next.value, first.value))\r\n                return false;\r\n            first = first.next();\r\n        }\r\n        return true;\r\n    }\r\n    std.is_sorted = is_sorted;\r\n    function is_sorted_until(first, last, compare) {\r\n        if (compare === void 0) { compare = std.equal_to; }\r\n        if (first.equal_to(last))\r\n            return first;\r\n        for (var next = first.next(); !next.equal_to(last); next = next.next()) {\r\n            if (std.less(next.value, first.value))\r\n                return next;\r\n            first = first.next();\r\n        }\r\n        return last;\r\n    }\r\n    std.is_sorted_until = is_sorted_until;\r\n    /* ---------------------------------------------------------\r\n        BACKGROUND\r\n    --------------------------------------------------------- */\r\n    /**\r\n     * @hidden\r\n     */\r\n    function qsort(container, first, last, compare) {\r\n        if (first > last)\r\n            _a = [last, first], first = _a[0], last = _a[1];\r\n        if (last == -1)\r\n            last = container.size();\r\n        var index = qsort_partition(container, first, last, compare);\r\n        qsort(container, first, index, compare);\r\n        qsort(container, index, last, compare);\r\n        var _a;\r\n    }\r\n    /**\r\n     * @hidden\r\n     */\r\n    function qsort_partition(container, first, last, compare) {\r\n        var val = container.at(first);\r\n        var i = first;\r\n        var j = last;\r\n        while (true) {\r\n            while (compare(container.at(++i), val))\r\n                if (i == last - 1)\r\n                    break;\r\n            while (compare(val, container.at(--j)))\r\n                if (j == first)\r\n                    break;\r\n            if (i >= j)\r\n                break;\r\n            // SWAP; AT(I) WITH AT(J)\r\n            var supplement_1 = container.at(i);\r\n            container.set(i, container.at(j));\r\n            container.set(j, supplement_1);\r\n        }\r\n        // SWAP; AT(BEGIN) WITH AT(J)\r\n        var supplement = container.at(first);\r\n        container.set(first, container.at(j));\r\n        container.set(j, supplement);\r\n        return j;\r\n    }\r\n    /**\r\n     * @hidden\r\n     */\r\n    function stable_qsort(container, first, last, compare) {\r\n        // QUICK SORT\r\n        if (first > last)\r\n            _a = [last, first], first = _a[0], last = _a[1];\r\n        var index = stable_qsort_partition(container, first, last, compare);\r\n        stable_qsort(container, first, index, compare);\r\n        stable_qsort(container, index, last, compare);\r\n        var _a;\r\n    }\r\n    /**\r\n     * @hidden\r\n     */\r\n    function stable_qsort_partition(container, first, last, compare) {\r\n        var val = container.at(first);\r\n        var i = first;\r\n        var j = last;\r\n        while (true) {\r\n            while (!std.equal_to(container.at(++i), val) && compare(container.at(i), val))\r\n                if (i == last - 1)\r\n                    break;\r\n            while (!std.equal_to(val, container.at(--j)) && compare(val, container.at(j)))\r\n                if (j == first)\r\n                    break;\r\n            if (i >= j)\r\n                break;\r\n            // SWAP; AT(I) WITH AT(J)\r\n            var supplement_2 = container.at(i);\r\n            container.set(i, container.at(j));\r\n            container.set(j, supplement_2);\r\n        }\r\n        // SWAP; AT(BEGIN) WITH AT(J)\r\n        var supplement = container.at(first);\r\n        container.set(first, container.at(j));\r\n        container.set(j, supplement);\r\n        return j;\r\n    }\r\n    /**\r\n     * @hidden\r\n     */\r\n    function selection_sort(container, first, middle, last, compare) {\r\n        if (last == -1)\r\n            last = container.size();\r\n        for (var i = first; i < middle; i++) {\r\n            var min_index = i;\r\n            for (var j = i + 1; j < last; j++)\r\n                if (compare(container.at(j), container.at(min_index)))\r\n                    min_index = j;\r\n            if (i != min_index) {\r\n                var supplement = container.at(i);\r\n                container.set(i, container.at(min_index));\r\n                container.set(min_index, supplement);\r\n            }\r\n        }\r\n    }\r\n    function lower_bound(first, last, val, compare) {\r\n        if (compare === void 0) { compare = std.less; }\r\n        var count = std.distance(first, last);\r\n        while (count > 0) {\r\n            var step = Math.floor(count / 2);\r\n            var it = first.advance(step);\r\n            if (!compare(it.value, val)) {\r\n                first = it.next();\r\n                count -= step + 1;\r\n            }\r\n            else\r\n                count = step;\r\n        }\r\n        return first;\r\n    }\r\n    std.lower_bound = lower_bound;\r\n    function upper_bound(first, last, val, compare) {\r\n        if (compare === void 0) { compare = std.less; }\r\n        var count = std.distance(first, last);\r\n        while (count > 0) {\r\n            var step = Math.floor(count / 2);\r\n            var it = first.advance(step);\r\n            if (!compare(val, it.value)) {\r\n                first = it.next();\r\n                count -= step + 1;\r\n            }\r\n            else\r\n                count = step;\r\n        }\r\n        return first;\r\n    }\r\n    std.upper_bound = upper_bound;\r\n    function equal_range(first, last, val, compare) {\r\n        if (compare === void 0) { compare = std.less; }\r\n        var it = lower_bound(first, last, val, compare);\r\n        return std.make_pair(it, upper_bound(it, last, val, compare));\r\n    }\r\n    std.equal_range = equal_range;\r\n    function binary_search(first, last, val, compare) {\r\n        if (compare === void 0) { compare = std.less; }\r\n        first = lower_bound(first, last, val, compare);\r\n        return !first.equal_to(last) && !compare(val, first.value);\r\n    }\r\n    std.binary_search = binary_search;\r\n    /* =========================================================\r\n        PARTITION\r\n    ========================================================= */\r\n    /**\r\n     * <p> Test whether range is partitioned. </p>\r\n     *\r\n     * <p> Returns <code>true</code> if all the elements in the range [<i>first</i>, <i>last</i>) for which <i>pred</i>\r\n     * returns <code>true</code> precede those for which it returns <code>false</code>. </p>\r\n     *\r\n     * <p> If the range is {@link IContainer.empty empty}, the function returns <code>true</code>. </p>\r\n     *\r\n     * @param first {@link Iterator Input iterator} to the initial position of the sequence.\r\n     * @param last {@link Iterator Input iterator} to the final position of the sequence. The range used is\r\n     *\t\t\t   [<i>first</i>, <i>last</i>), which contains all the elements between <i>first</i> and <i>last</i>,\r\n     *\t\t\t   including the element pointed by <i>first</i> but not the element pointed by <i>last</i>.\r\n     * @param pred Unary function that accepts an element in the range as argument, and returns a value convertible to\r\n     *\t\t\t   <code>bool</code>. The value returned indicates whether the element belongs to the first group (if\r\n     *\t\t\t   <code>true</code>, the element is expected before all the elements for which it returns\r\n     *\t\t\t   <code>false</code>). The function shall not modify its argument.\r\n     *\r\n     * @return <code>true</code> if all the elements in the range [<i>first</i>, <i>last</i>) for which <i>pred</i> returns\r\n     *\t\t   <code>true</code> precede those for which it returns <code>false</code>. Otherwise it returns\r\n     *\t\t   <code>false</code>. If the range is {@link IContainer.empty empty}, the function returns <code>true</code>.\r\n     */\r\n    function is_partitioned(first, last, pred) {\r\n        while (!first.equal_to(last) && pred(first.value))\r\n            first = first.next();\r\n        for (; !first.equal_to(last); first = first.next())\r\n            if (pred(first.value))\r\n                return false;\r\n        return true;\r\n    }\r\n    std.is_partitioned = is_partitioned;\r\n    /**\r\n     * <p> Partition range in two. </p>\r\n     *\r\n     * <p> Rearranges the elements from the range [<i>first</i>, <i>last</i>), in such a way that all the elements for\r\n     * which <i>pred</i> returns <code>true</code> precede all those for which it returns <code>false</code>. The iterator\r\n     * returned points to the first element of the second group. </p>\r\n     *\r\n     * <p> The relative ordering within each group is not necessarily the same as before the call. See\r\n     * {@link stable_partition} for a function with a similar behavior but with stable ordering within each group. </p>\r\n     *\r\n     * @param first {@link Iterator Forward iterator} to the initial position of the sequence to partition.\r\n     * @param last {@link Iterator Forward iterator} to the final position of the sequence to partition. The range used is\r\n     *\t\t\t   [<i>first</i>, <i>last</i>), which contains all the elements between <i>first</i> and <i>last</i>,\r\n     *\t\t\t   including the element pointed by <i>first</i> but not the element pointed by <i>last</i>.\r\n     * @param pred Unary function that accepts an element in the range as argument, and returns a value convertible to\r\n     *\t\t\t   <code>bool</code>. The value returned indicates whether the element belongs to the first group (if\r\n     *\t\t\t   <code>true</code>, the element is expected before all the elements for which it returns\r\n     *\t\t\t   <code>false</code>). The function shall not modify its argument.\r\n     *\r\n     * @return An iterator that points to the first element of the second group of elements (those for which <i>pred</i>\r\n     *\t\t   returns <code>false</code>), or <i>last</i> if this group is {@link IContainer.empty empty}.\r\n     */\r\n    function partition(first, last, pred) {\r\n        while (!first.equal_to(last)) {\r\n            while (pred(first.value)) {\r\n                first = first.next();\r\n                if (first.equal_to(last))\r\n                    return first;\r\n            }\r\n            do {\r\n                last = last.prev();\r\n                if (first.equal_to(last))\r\n                    return first;\r\n            } while (!pred(last.value));\r\n            first.swap(last);\r\n            first = first.next();\r\n        }\r\n        return last;\r\n    }\r\n    std.partition = partition;\r\n    /**\r\n     * <p> Partition range in two - stable ordering. </p>\r\n     *\r\n     * <p> Rearranges the elements in the range [<i>first</i>, <i>last</i>), in such a way that all the elements for which\r\n     * <i>pred</i> returns <code>true</code> precede all those for which it returns <code>false</code>, and, unlike\r\n     * function {@link partition}, the relative order of elements within each group is preserved. </p>\r\n     *\r\n     * <p> This is generally implemented using an internal temporary buffer. </p>\r\n     *\r\n     * @param first {@link Iterator Bidirectional iterator} to the initial position of the sequence to partition.\r\n     * @param last {@link Iterator Bidirectional iterator} to the final position of the sequence to partition. The range\r\n     *\t\t\t   used is [<i>first</i>, <i>last</i>), which contains all the elements between <i>first</i> and\r\n     *\t\t\t   <i>last</i>, including the element pointed by <i>first</i> but not the element pointed by <i>last</i>.\r\n     * @param pred Unary function that accepts an element in the range as argument, and returns a value convertible to\r\n     *\t\t\t   <code>bool</code>. The value returned indicates whether the element belongs to the first group (if\r\n     *\t\t\t   <code>true</code>, the element is expected before all the elements for which it returns\r\n     *\t\t\t   <code>false</code>). The function shall not modify its argument.\r\n     *\r\n     * @return An iterator that points to the first element of the second group of elements (those for which <i>pred</i>\r\n     *\t\t   returns <code>false</code>), or <i>last</i> if this group is {@link IContainer.empty empty}.\r\n     */\r\n    function stable_partition(first, last, pred) {\r\n        return partition(first, last, pred);\r\n    }\r\n    std.stable_partition = stable_partition;\r\n    /**\r\n     * <p> Partition range into two. </p>\r\n     *\r\n     * <p> Copies the elements in the range [<i>first</i>, <i>last</i>) for which <i>pred</i> returns <code>true</code>\r\n     * into the range pointed by <i>result_true</i>, and those for which it does not into the range pointed by\r\n     * <i>result_false</i>. </p>\r\n     *\r\n     * @param first {@link Iterator Input iterator} to the initial position of the range to be copy-partitioned.\r\n     * @param last {@link Iterator Input iterator} to the final position of the range to be copy-partitioned. The range\r\n     *\t\t\t   used is [<i>first</i>, <i>last</i>), which contains all the elements between <i>first</i> and\r\n     *\t\t\t   <i>last</i>, including the element pointed by <i>first</i> but not the element pointed by <i>last</i>.\r\n     * @param result_true {@link Iterator Output iterator} to the initial position of the range where the elements for\r\n     *\t\t\t\t\t  which <i>pred</i> returns <code>true</code> are stored.\r\n     * @param result_false {@link Iterator Output iterator} to the initial position of the range where the elements for\r\n     *\t\t\t\t\t   which <i>pred</i> returns <code>false</code> are stored.\r\n     * @param pred Unary function that accepts an element pointed by <i>InputIterator</i> as argument, and returns a value\r\n     *\t\t\t   convertible to <code>bool</code>. The value returned indicates on which result range the element is\r\n     *\t\t\t   copied. The function shall not modify its argument.\r\n     *\r\n     * @return A {@link Pair} of iterators with the end of the generated sequences pointed by <i>result_true</i> and\r\n     *\t\t   <i>result_false</i>, respectivelly. Its member {@link Pair.first first} points to the element that follows\r\n     *\t\t   the last element copied to the sequence of elements for which <i>pred</i> returned <code>true</code>. Its\r\n     *\t\t   member {@link Pair.second second} points to the element that follows the last element copied to the sequence\r\n     *\t\t   of elements for which <i>pred</i> returned <code>false</code>.\r\n     */\r\n    function partition_copy(first, last, result_true, result_false, pred) {\r\n        for (; !first.equal_to(last); first = first.next())\r\n            if (pred(first.value)) {\r\n                result_true.value = first.value;\r\n                result_true = result_true.next();\r\n            }\r\n            else {\r\n                result_false.value = first.value;\r\n                result_false = result_false.next();\r\n            }\r\n        return std.make_pair(result_true, result_false);\r\n    }\r\n    std.partition_copy = partition_copy;\r\n    /**\r\n     * <p> Get partition point. </p>\r\n     *\r\n     * <p> Returns an iterator to the first element in the partitioned range [<i>first</i>, <i>last</i>) for which\r\n     * <i>pred</i> is not <code>true</code>, indicating its partition point. </p>\r\n     *\r\n     * <p> The elements in the range shall already {@link is_partitioned be partitioned}, as if {@link partition} had been\r\n     * called with the same arguments. </p>\r\n     *\r\n     * <p> The function optimizes the number of comparisons performed by comparing non-consecutive elements of the sorted\r\n     * range, which is specially efficient for {@link Iteartor random-access iterators}. </p>\r\n     *\r\n     * @param first {@link Iterator Forward iterator} to the initial position of the partitioned sequence.\r\n     * @param last {@link Iterator Forward iterator} to the final position of the partitioned sequence. The range checked\r\n     *\t\t  is [<i>first</i>, <i>last</i>), which contains all the elements between <i>first</i> an <i>last</i>,\r\n     *\t\t  including the element pointed by <i>first</i> but not the element pointed by <i>last</i>.\r\n     * @param pred Unary function that accepts an element in the range as argument, and returns a value convertible to\r\n     *\t\t\t   <code>bool</code>. The value returned indicates whether the element goes before the partition point (if\r\n     *\t\t\t   <code>true</code>, it goes before; if <code>false</code> goes at or after it). The function shall not\r\n     *\t\t\t   modify its argument.\r\n     *\r\n     * @return An iterator to the first element in the partitioned range [<i>first</i>, <i>last</i>) for which <i>pred</i>\r\n     *\t\t   is not <code>true</code>, or <i>last</i> if it is not <code>true</code> for any element.\r\n     */\r\n    function partition_point(first, last, pred) {\r\n        var n = std.distance(first, last);\r\n        while (n > 0) {\r\n            var step = Math.floor(n / 2);\r\n            var it = first.advance(step);\r\n            if (pred(it.value)) {\r\n                first = it.next();\r\n                n -= step + 1;\r\n            }\r\n            else\r\n                n = step;\r\n        }\r\n        return first;\r\n    }\r\n    std.partition_point = partition_point;\r\n    function merge(first1, last1, first2, last2, result, compare) {\r\n        if (compare === void 0) { compare = std.less; }\r\n        while (true) {\r\n            if (first1.equal_to(last1))\r\n                return copy(first2, last2, result);\r\n            else if (first2.equal_to(last2))\r\n                return copy(first1, last1, result);\r\n            if (compare(first1.value, first2.value)) {\r\n                result.value = first1.value;\r\n                first1 = first1.next();\r\n            }\r\n            else {\r\n                result.value = first2.value;\r\n                first2 = first2.next();\r\n            }\r\n            result = result.next();\r\n        }\r\n    }\r\n    std.merge = merge;\r\n    function inplace_merge(first, middle, last, compare) {\r\n        if (compare === void 0) { compare = std.less; }\r\n        var vector = new std.Vector(std.distance(first, last), null);\r\n        merge(first, middle, middle, last, vector.begin());\r\n        copy(vector.begin(), vector.end(), first);\r\n    }\r\n    std.inplace_merge = inplace_merge;\r\n    function includes(first1, last1, first2, last2, compare) {\r\n        if (compare === void 0) { compare = std.less; }\r\n        while (!first2.equal_to(last2)) {\r\n            if (first1.equal_to(last2) || compare(first2.value, first1.value))\r\n                return false;\r\n            else if (!compare(first1.value, first2.value))\r\n                first2 = first2.next();\r\n            first1 = first1.next();\r\n        }\r\n        return true;\r\n    }\r\n    std.includes = includes;\r\n    function set_union(first1, last1, first2, last2, result, compare) {\r\n        if (compare === void 0) { compare = std.less; }\r\n        while (true) {\r\n            if (first1.equal_to(last1))\r\n                return copy(first2, last2, result);\r\n            else if (first2.equal_to(last2))\r\n                return copy(first1, last1, result);\r\n            if (compare(first1.value, first2.value)) {\r\n                result.value = first1.value;\r\n                first1 = first1.next();\r\n            }\r\n            else if (compare(first2.value, first1.value)) {\r\n                result.value = first2.value;\r\n                first2 = first2.next();\r\n            }\r\n            else {\r\n                result.value = first1.value;\r\n                first1 = first1.next();\r\n                first2 = first2.next();\r\n            }\r\n            result = result.next();\r\n        }\r\n    }\r\n    std.set_union = set_union;\r\n    function set_intersection(first1, last1, first2, last2, result, compare) {\r\n        if (compare === void 0) { compare = std.less; }\r\n        while (true) {\r\n            if (first1.equal_to(last1))\r\n                return copy(first2, last2, result);\r\n            else if (first2.equal_to(last2))\r\n                return copy(first1, last1, result);\r\n            if (compare(first1.value, first2.value))\r\n                first1 = first1.next();\r\n            else if (compare(first2.value, first1.value))\r\n                first2 = first2.next();\r\n            else {\r\n                result.value = first1.value;\r\n                result = result.next();\r\n                first1 = first1.next();\r\n                first2 = first2.next();\r\n            }\r\n        }\r\n    }\r\n    std.set_intersection = set_intersection;\r\n    function set_difference(first1, last1, first2, last2, result, compare) {\r\n        if (compare === void 0) { compare = std.less; }\r\n        while (!first1.equal_to(last1) && !first2.equal_to(last2))\r\n            if (std.less(first1.value, first2.value)) {\r\n                result.value = first1.value;\r\n                result = result.next();\r\n                first1 = first1.next();\r\n            }\r\n            else if (std.less(first2.value, first1.value))\r\n                first2 = first2.next();\r\n            else {\r\n                first1 = first1.next();\r\n                first2 = first2.next();\r\n            }\r\n        return copy(first1, last1, result);\r\n    }\r\n    std.set_difference = set_difference;\r\n    function set_symmetric_difference(first1, last1, first2, last2, result, compare) {\r\n        if (compare === void 0) { compare = std.less; }\r\n        while (true) {\r\n            if (first1.equal_to(last1))\r\n                return copy(first2, last2, result);\r\n            else if (first2.equal_to(last2))\r\n                return copy(first1, last1, result);\r\n            if (compare(first1.value, first2.value)) {\r\n                result.value = first1.value;\r\n                result = result.next();\r\n                first1 = first1.next();\r\n            }\r\n            else if (compare(first2.value, first1.value)) {\r\n                result.value = first2.value;\r\n                result = result.next();\r\n                first2 = first2.next();\r\n            }\r\n            else {\r\n                first1 = first1.next();\r\n                first2 = first2.next();\r\n            }\r\n        }\r\n    }\r\n    std.set_symmetric_difference = set_symmetric_difference;\r\n    /* =========================================================\r\n        MIN & MAX\r\n            - VARADIC PARAMETERS\r\n            - ITERATORS\r\n    ============================================================\r\n        VARADIC PARAMETERS\r\n    --------------------------------------------------------- */\r\n    /**\r\n     * <p> Return the smallest. </p>\r\n     *\r\n     * <p> Returns the smallest of all the elements in the <i>args</i>. </p>\r\n     *\r\n     * @param args Values to compare.\r\n     *\r\n     * @return The lesser of the values passed as arguments.\r\n     */\r\n    function min() {\r\n        var args = [];\r\n        for (var _i = 0; _i < arguments.length; _i++) {\r\n            args[_i - 0] = arguments[_i];\r\n        }\r\n        var minimum = args[0];\r\n        for (var i = 1; i < args.length; i++)\r\n            if (std.less(args[i], minimum))\r\n                minimum = args[i];\r\n        return minimum;\r\n    }\r\n    std.min = min;\r\n    /**\r\n     * <p> Return the largest. </p>\r\n     *\r\n     * <p> Returns the largest of all the elements in the <i>args</i>. </p>\r\n     *\r\n     * @param args Values to compare.\r\n     *\r\n     * @return The largest of the values passed as arguments.\r\n     */\r\n    function max() {\r\n        var args = [];\r\n        for (var _i = 0; _i < arguments.length; _i++) {\r\n            args[_i - 0] = arguments[_i];\r\n        }\r\n        var maximum = args[0];\r\n        for (var i = 1; i < args.length; i++)\r\n            if (std.greater(args[i], maximum))\r\n                maximum = args[i];\r\n        return maximum;\r\n    }\r\n    std.max = max;\r\n    /**\r\n     * <p> Return smallest and largest elements. </p>\r\n     *\r\n     * <p> Returns a {@link Pair} with the smallest of all the elements in the <i>args</i> as first element (the first of\r\n     * them, if there are more than one), and the largest as second (the last of them, if there are more than one). </p>\r\n     *\r\n     * @param args Values to compare.\r\n     *\r\n     * @return The lesser and greatest of the values passed as arguments.\r\n     */\r\n    function minmax() {\r\n        var args = [];\r\n        for (var _i = 0; _i < arguments.length; _i++) {\r\n            args[_i - 0] = arguments[_i];\r\n        }\r\n        var minimum = args[0];\r\n        var maximum = args[0];\r\n        for (var i = 1; i < args.length; i++) {\r\n            if (std.less(args[i], minimum))\r\n                minimum = args[i];\r\n            if (std.greater(args[i], maximum))\r\n                maximum = args[i];\r\n        }\r\n        return std.make_pair(minimum, maximum);\r\n    }\r\n    std.minmax = minmax;\r\n    function min_element(first, last, compare) {\r\n        if (compare === void 0) { compare = std.less; }\r\n        var smallest = first;\r\n        first = first.next();\r\n        for (; !first.equal_to(last); first = first.next())\r\n            if (compare(first.value, smallest.value))\r\n                smallest = first;\r\n        return smallest;\r\n    }\r\n    std.min_element = min_element;\r\n    function max_element(first, last, compare) {\r\n        if (compare === void 0) { compare = std.greater; }\r\n        var largest = first;\r\n        first = first.next();\r\n        for (; !first.equal_to(last); first = first.next())\r\n            if (compare(first.value, largest.value))\r\n                largest = first;\r\n        return largest;\r\n    }\r\n    std.max_element = max_element;\r\n    function minmax_element(first, last, compare) {\r\n        if (compare === void 0) { compare = std.greater; }\r\n        var smallest = first;\r\n        var largest = first;\r\n        first = first.next();\r\n        for (; !first.equal_to(last); first = first.next()) {\r\n            if (compare(first.value, smallest.value))\r\n                smallest = first;\r\n            if (!compare(first.value, largest.value))\r\n                largest = first;\r\n        }\r\n        return std.make_pair(smallest, largest);\r\n    }\r\n    std.minmax_element = minmax_element;\r\n})(std || (std = {}));\r\nvar std;\r\n(function (std) {\r\n    /* =========================================================\r\n        + EXCEPTION\r\n            + LOGIC_ERROR\r\n                - DOMAIN_ERROR\r\n                - INVALID_ARGUMENT\r\n                - LENGTH_ERROR\r\n                - OUT_OF_RANGE\r\n            + RUNTIME_ERROR\r\n                - OVERFLOW_ERROR\r\n                - RANGE_ERROR\r\n                - SYSTEM_ERROR\r\n                - UNDERFLOW_ERROR\r\n    ========================================================= */\r\n    /**\r\n     * <p> Standard exception class. </p>\r\n     *\r\n     * <p> Base class for standard exceptions. </p>\r\n     *\r\n     * <p> All objects thrown by components of the standard library are derived from this class.\r\n     * Therefore, all standard exceptions can be caught by catching this type by reference. </p>\r\n     *\r\n     * <ul>\r\n     *  <li> Reference: http://www.cplusplus.com/reference/exception/exception/\r\n     * </ul>\r\n     *\r\n     * @author Jeongho Nam <http://samchon.org>\r\n     */\r\n    var Exception = (function () {\r\n        function Exception(what) {\r\n            if (what === void 0) { what = \"\"; }\r\n            this.message = what;\r\n        }\r\n        /**\r\n         * <p> Get string identifying exception. </p>\r\n         * <p> Returns a string that may be used to identify the exception. </p>\r\n         *\r\n         * <p> The particular representation pointed by the returned value is implementation-defined.\r\n         * As a virtual function, derived classes may redefine this function so that specify value are\r\n         * returned. </p>\r\n         */\r\n        Exception.prototype.what = function () {\r\n            return this.message;\r\n        };\r\n        return Exception;\r\n    }());\r\n    std.Exception = Exception;\r\n    /* =========================================================\r\n        + LOGIC_ERROR\r\n            - DOMAIN_ERROR\r\n            - INVALID_ARGUMENT\r\n            - LENGTH_ERROR\r\n            - OUT_OF_RANGE\r\n    ========================================================= */\r\n    /**\r\n     * <p> Logic error exception. </p>\r\n     *\r\n     * <p> This class defines the type of objects thrown as exceptions to report errors in the internal\r\n     * logical of the program, such as violation of logical preconditions or class invariants. </p>\r\n     *\r\n     * <p> These errors are presumably detectable before the program executes. </p>\r\n     *\r\n     * <p> It is used as a base class for several logical error exceptions. </p>\r\n     *\r\n     * <ul>\r\n     *  <li> Reference: http://www.cplusplus.com/reference/stdexcept/logic_error/\r\n     * </ul>\r\n     *\r\n     * @author Jeongho Nam <http://samchon.org>\r\n     */\r\n    var LogicError = (function (_super) {\r\n        __extends(LogicError, _super);\r\n        /**\r\n         * <p> Construct from a message. </p>\r\n         *\r\n         * @param message A message representing specification about the Exception.\r\n         */\r\n        function LogicError(what) {\r\n            _super.call(this, what);\r\n        }\r\n        return LogicError;\r\n    }(Exception));\r\n    std.LogicError = LogicError;\r\n    /**\r\n     * <p> Domain error exception. </p>\r\n     *\r\n     * <p> This class defines the type of objects thrown as exceptions to report domain errors. </p>\r\n     *\r\n     * <p> Generally, the domain of a mathematical function is the subset of values that it is defined for.\r\n     * For example, the square root function is only defined for non-negative numbers. Thus, a negative number\r\n     * for such a function would qualify as a domain error. </p>\r\n     *\r\n     * <p> No component of the standard library throws exceptions of this type. It is designed as a standard\r\n     * exception to be thrown by programs. </p>\r\n     *\r\n     * <ul>\r\n     *  <li> Reference: http://www.cplusplus.com/reference/stdexcept/domain_error/\r\n     * </ul>\r\n     *\r\n     * @author Jeongho Nam <http://samchon.org>\r\n     */\r\n    var DomainError = (function (_super) {\r\n        __extends(DomainError, _super);\r\n        /**\r\n         * <p> Construct from a message. </p>\r\n         *\r\n         * @param message A message representing specification about the Exception.\r\n         */\r\n        function DomainError(what) {\r\n            _super.call(this, what);\r\n        }\r\n        return DomainError;\r\n    }(LogicError));\r\n    std.DomainError = DomainError;\r\n    /**\r\n     * <p> Invalid argument exception. </p>\r\n     *\r\n     * <p> This class defines the type of objects thrown as exceptions to report an invalid argument. </p>\r\n     *\r\n     * <p> It is a standard exception that can be thrown by programs. Some components of the standard library\r\n     * also throw exceptions of this type to signal invalid arguments. </p>\r\n     *\r\n     * <ul>\r\n     *  <li> Reference: http://www.cplusplus.com/reference/stdexcept/invalid_argument/\r\n     * </ul>\r\n     *\r\n     * @author Jeongho Nam <http://samchon.org>\r\n     */\r\n    var InvalidArgument = (function (_super) {\r\n        __extends(InvalidArgument, _super);\r\n        /**\r\n         * <p> Construct from a message. </p>\r\n         *\r\n         * @param message A message representing specification about the Exception.\r\n         */\r\n        function InvalidArgument(what) {\r\n            _super.call(this, what);\r\n        }\r\n        return InvalidArgument;\r\n    }(LogicError));\r\n    std.InvalidArgument = InvalidArgument;\r\n    /**\r\n     * <p> Length error exception. </p>\r\n     *\r\n     * <p> This class defines the type of objects thrown as exceptions to report a length error. </p>\r\n     *\r\n     * <p> It is a standard exception that can be thrown by programs. Some components of the standard library,\r\n     * such as vector and string also throw exceptions of this type to signal errors resizing. </p>\r\n     *\r\n     * <ul>\r\n     *  <li> Reference: http://www.cplusplus.com/reference/stdexcept/length_error/\r\n     * </ul>\r\n     *\r\n     * @author Jeongho Nam <http://samchon.org>\r\n     */\r\n    var LengthError = (function (_super) {\r\n        __extends(LengthError, _super);\r\n        /**\r\n         * <p> Construct from a message. </p>\r\n         *\r\n         * @param message A message representing specification about the Exception.\r\n         */\r\n        function LengthError(what) {\r\n            _super.call(this, what);\r\n        }\r\n        return LengthError;\r\n    }(LogicError));\r\n    std.LengthError = LengthError;\r\n    /**\r\n     * <p> Out-of-range exception. </p>\r\n     *\r\n     * <p> This class defines the type of objects thrown as exceptions to report an out-of-range error. </p>\r\n     *\r\n     * <p> It is a standard exception that can be thrown by programs. Some components of the standard library,\r\n     * such as vector, deque, string and bitset also throw exceptions of this type to signal arguments\r\n     * out of range. </p>\r\n     *\r\n     * <ul>\r\n     *  <li> Reference: http://www.cplusplus.com/reference/stdexcept/out_of_range/\r\n     * </ul>\r\n     *\r\n     * @author Jeongho Nam <http://samchon.org>\r\n     */\r\n    var OutOfRange = (function (_super) {\r\n        __extends(OutOfRange, _super);\r\n        /**\r\n         * <p> Construct from a message. </p>\r\n         *\r\n         * @param message A message representing specification about the Exception.\r\n         */\r\n        function OutOfRange(what) {\r\n            _super.call(this, what);\r\n        }\r\n        return OutOfRange;\r\n    }(LogicError));\r\n    std.OutOfRange = OutOfRange;\r\n    /* =========================================================\r\n        + RUNTIME_ERROR\r\n            - OVERFLOW_ERROR\r\n            - RANGE_ERROR\r\n            - SYSTEM_ERROR\r\n            - UNDERFLOW_ERROR\r\n    ========================================================= */\r\n    /**\r\n     * <p> Runtime error exception. </p>\r\n     *\r\n     * <p> This class defines the type of objects thrown as exceptions to report errors that can only be\r\n     * detected during runtime. </p>\r\n     *\r\n     * <p> It is used as a base class for several runtime error exceptions. </p>\r\n     *\r\n     * <ul>\r\n     *  <li> Reference: http://www.cplusplus.com/reference/stdexcept/runtime_error/\r\n     * </ul>\r\n     *\r\n     * @author Jeongho Nam <http://samchon.org>\r\n     */\r\n    var RuntimeError = (function (_super) {\r\n        __extends(RuntimeError, _super);\r\n        /**\r\n         * <p> Construct from a message. </p>\r\n         *\r\n         * @param message A message representing specification about the Exception.\r\n         */\r\n        function RuntimeError(what) {\r\n            _super.call(this, what);\r\n        }\r\n        return RuntimeError;\r\n    }(Exception));\r\n    std.RuntimeError = RuntimeError;\r\n    /**\r\n     * <p> Overflow error exception. </p>\r\n     *\r\n     * <p> This class defines the type of objects thrown as exceptions to arithmetic overflow errors. </p>\r\n     *\r\n     * <p> It is a standard exception that can be thrown by programs. Some components of the standard library\r\n     * also throw exceptions of this type to signal range errors. </p>\r\n     *\r\n     * <ul>\r\n     *  <li> Reference: http://www.cplusplus.com/reference/stdexcept/outflow_error/\r\n     * </ul>\r\n     *\r\n     * @author Jeongho Nam <http://samchon.org>\r\n     */\r\n    var OverflowError = (function (_super) {\r\n        __extends(OverflowError, _super);\r\n        /**\r\n         * <p> Construct from a message. </p>\r\n         *\r\n         * @param message A message representing specification about the Exception.\r\n         */\r\n        function OverflowError(what) {\r\n            _super.call(this, what);\r\n        }\r\n        return OverflowError;\r\n    }(RuntimeError));\r\n    std.OverflowError = OverflowError;\r\n    /**\r\n     * <p> Underflow error exception. </p>\r\n     *\r\n     * <p> This class defines the type of objects thrown as exceptions to arithmetic underflow errors. </p>\r\n     *\r\n     * <p> No component of the standard library throws exceptions of this type. It is designed as a standard\r\n     * exception to be thrown by programs. </p>\r\n     *\r\n     * <ul>\r\n     *  <li> Reference: http://www.cplusplus.com/reference/stdexcept/underflow_error/\r\n     * </ul>\r\n     *\r\n     * @author Jeongho Nam <http://samchon.org>\r\n     */\r\n    var UnderflowError = (function (_super) {\r\n        __extends(UnderflowError, _super);\r\n        /**\r\n         * <p> Construct from a message. </p>\r\n         *\r\n         * @param message A message representing specification about the Exception.\r\n         */\r\n        function UnderflowError(what) {\r\n            _super.call(this, what);\r\n        }\r\n        return UnderflowError;\r\n    }(RuntimeError));\r\n    std.UnderflowError = UnderflowError;\r\n    /**\r\n     * <p> Range error exception. </p>\r\n     *\r\n     * <p> This class defines the type of objects thrown as exceptions to report range errors in internal\r\n     * computations. </p>\r\n     *\r\n     * <p> It is a standard exception that can be thrown by programs. Some components of the standard library\r\n     * also throw exceptions of this type to signal range errors. </p>\r\n     *\r\n     * <ul>\r\n     *  <li> Reference: http://www.cplusplus.com/reference/stdexcept/range_error/\r\n     * </ul>\r\n     *\r\n     * @author Jeongho Nam <http://samchon.org>\r\n     */\r\n    var RangeError = (function (_super) {\r\n        __extends(RangeError, _super);\r\n        /**\r\n         * <p> Construct from a message. </p>\r\n         *\r\n         * @param message A message representing specification about the Exception.\r\n         */\r\n        function RangeError(what) {\r\n            _super.call(this, what);\r\n        }\r\n        return RangeError;\r\n    }(RuntimeError));\r\n    std.RangeError = RangeError;\r\n})(std || (std = {}));\r\n// Standard Template Library: Function objects\r\n// Function objects are objects specifically designed to be used with a syntax similar to that of functions.\r\n//\r\n// They are typically used as arguments to functions, such as predicates or comparison functions passed to standard algorithms.\r\n//\r\n// @reference http://www.cplusplus.com/reference/functional/\r\n// @author Jeongho Nam <http://samchon.org>\r\nvar std;\r\n(function (std) {\r\n    /**\r\n     * <p> Function object class for equality comparison. </p>\r\n     *\r\n     * <p> Binary function object class whose call returns whether its two arguments compare <i>equal</i> (as returned by\r\n     * operator ==). </p>\r\n     *\r\n     * <p> Generically, function objects are instances of a class with member function {@link IComparable.equal_to equal_to}\r\n     * defined. This member function allows the object to be used with the same syntax as a function call. </p>\r\n     *\r\n     * @param x First element to compare.\r\n     * @param y Second element to compare.\r\n     *\r\n     * @return Whether the arguments are equal.\r\n     */\r\n    function equal_to(x, y) {\r\n        if (x instanceof Object && x.equal_to != undefined)\r\n            return x.equal_to(y);\r\n        else\r\n            return x == y;\r\n    }\r\n    std.equal_to = equal_to;\r\n    /**\r\n     * <p> Function object class for non-equality comparison. </p>\r\n     *\r\n     * <p> Binary function object class whose call returns whether its two arguments compare <i>not equal</i> (as returned\r\n     * by operator operator!=). </p>\r\n     *\r\n     * <p> Generically, function objects are instances of a class with member function {@link IComparable.equal_to equal_to}\r\n     * defined. This member function allows the object to be used with the same syntax as a function call. </p>\r\n     *\r\n     * @param x First element to compare.\r\n     * @param y Second element to compare.\r\n     *\r\n     * @return Whether the arguments are not equal.\r\n     */\r\n    function not_equal_to(x, y) {\r\n        return !std.equal_to(x, y);\r\n    }\r\n    std.not_equal_to = not_equal_to;\r\n    /**\r\n     * <p> Function for less-than inequality comparison. </p>\r\n     *\r\n     * <p> Binary function returns whether the its first argument compares less than the second. </p>\r\n     *\r\n     * <p> Generically, function objects are instances of a class with member function {@link IComparable.less less}\r\n     * defined. If an object doesn't have the method, then its own uid will be used to compare insteadly.\r\n     * This member function allows the object to be used with the same syntax as a function call. </p>\r\n     *\r\n     * <p> Objects of this class can be used on standard algorithms such as {@link sort sort()}</code>,\r\n     * {@link merge merge()} or {@link TreeMap.lower_bound lower_bound()}. </p>\r\n     *\r\n     * @param <T> Type of arguments to compare by the function call. The type shall supporrt the operation\r\n     *\t\t\t  <i>operator<()</i> or method {@link IComparable.less less}.\r\n     *\r\n     * @param x First element, the standard of comparison.\r\n     * @param y Second element compare with the first.\r\n     *\r\n     * @return Whether the first parameter is less than the second.\r\n     */\r\n    function less(x, y) {\r\n        if (x instanceof Object)\r\n            if (x.less != undefined)\r\n                return x.less(y);\r\n            else\r\n                return x.__getUID() < y.__getUID();\r\n        else\r\n            return x < y;\r\n    }\r\n    std.less = less;\r\n    /**\r\n     * <p> Function object class for less-than-or-equal-to comparison. </p>\r\n     *\r\n     * <p> Binary function object class whose call returns whether the its first argument compares {@link less less than} or\r\n     * {@link equal_to equal to} the second (as returned by operator <=). </p>\r\n     *\r\n     * <p> Generically, <i>function objects</i> are instances of a class with member function {@link IComparable.less less}\r\n     * and {@link IComparable.equal_to equal_to} defined. This member function allows the object to be used with the same\r\n     * syntax as a function call. </p>\r\n     *\r\n     * @param x First element, the standard of comparison.\r\n     * @param y Second element compare with the first.\r\n     *\r\n     * @return Whether the <i>x</i> is {@link less less than} or {@link equal_to equal to} the <i>y</i>.\r\n     */\r\n    function less_equal(x, y) {\r\n        return std.less(x, y) || std.equal_to(x, y);\r\n    }\r\n    std.less_equal = less_equal;\r\n    /**\r\n     * <p> Function for greater-than inequality comparison. </p>\r\n     *\r\n     * <p> Binary function returns whether the its first argument compares greater than the second. </p>\r\n     *\r\n     * <p> Generically, function objects are instances of a class with member function {@link less} and\r\n     * {@link equal_to equal_to()} defined. If an object doesn't have those methods, then its own uid will be used\r\n     * to compare insteadly. This member function allows the object to be used with the same syntax as a function\r\n     * call. </p>\r\n     *\r\n     * <p> Objects of this class can be used on standard algorithms such as {@link sort sort()},\r\n     * {@link merge merge()} or {@link TreeMap.lower_bound lower_bound()}. </p>\r\n     *\r\n     * @param <T> Type of arguments to compare by the function call. The type shall supporrt the operation\r\n     *\t\t\t  <i>operator>()</i> or method {@link IComparable.greater greater}.\r\n     *\r\n     * @return Whether the <i>x</i> is greater than the <i>y</i>.\r\n     */\r\n    function greater(x, y) {\r\n        return !std.less_equal(x, y);\r\n    }\r\n    std.greater = greater;\r\n    /**\r\n     * <p> Function object class for greater-than-or-equal-to comparison. </p>\r\n     *\r\n     * <p> Binary function object class whose call returns whether the its first argument compares\r\n     * {@link greater greater than} or {@link equal_to equal to} the second (as returned by operator >=). </p>\r\n     *\r\n     * <p> Generically, function objects are instances of a class with member function {@link IComparable.less less}\r\n     * defined. If an object doesn't have the method, then its own uid will be used to compare insteadly.\r\n     * This member function allows the object to be used with the same syntax as a function call. </p>\r\n     *\r\n     * @param x First element, the standard of comparison.\r\n     * @param y Second element compare with the first.\r\n     *\r\n     * @return Whether the <i>x</i> is {@link greater greater than} or {@link equal_to equal to} the <i>y</i>.\r\n     */\r\n    function greater_equal(x, y) {\r\n        return !std.less(x, y);\r\n    }\r\n    std.greater_equal = greater_equal;\r\n    /**\r\n     * <p> Logical AND function object class. </p>\r\n     *\r\n     * <p> Binary function object class whose call returns the result of the <i>logical \"and\"</i> operation between its two\r\n     * arguments (as returned by operator &&). </p>\r\n     *\r\n     * <p> Generically, function objects are instances of a class with member function operator() defined. This member\r\n     * function allows the object to be used with the same syntax as a function call. </p>\r\n     *\r\n     * @param x First element.\r\n     * @param y Second element.\r\n     *\r\n     * @return Result of logical AND operation.\r\n     */\r\n    function logical_and(x, y) {\r\n        return x && y;\r\n    }\r\n    std.logical_and = logical_and;\r\n    /**\r\n     * <p> Logical OR function object class. </p>\r\n     *\r\n     * <p> Binary function object class whose call returns the result of the <i>logical \"or\"</i> operation between its two\r\n     * arguments (as returned by operator ||). </p>\r\n     *\r\n     * <p> Generically, function objects are instances of a class with member function operator() defined. This member\r\n     * function allows the object to be used with the same syntax as a function call. </p>\r\n     *\r\n     * @param x First element.\r\n     * @param y Second element.\r\n     *\r\n     * @return Result of logical OR operation.\r\n     */\r\n    function logical_or(x, y) {\r\n        return x || y;\r\n    }\r\n    std.logical_or = logical_or;\r\n    /**\r\n     * <p> Logical NOT function object class. </p>\r\n     *\r\n     * <p> Unary function object class whose call returns the result of the <i>logical \"not\"</i> operation on its argument\r\n     * (as returned by operator !). </p>\r\n     *\r\n     * <p> Generically, function objects are instances of a class with member function operator() defined. This member\r\n     * function allows the object to be used with the same syntax as a function call. </p>\r\n     *\r\n     * @param x Target element.\r\n     *\r\n     * @return Result of logical NOT operation.\r\n     */\r\n    function logical_not(x) {\r\n        return !x;\r\n    }\r\n    std.logical_not = logical_not;\r\n    /**\r\n     * <p> Bitwise AND function object class. </p>\r\n     *\r\n     * <p> Binary function object class whose call returns the result of applying the <i>bitwise \"and\"</i> operation between\r\n     * its two arguments (as returned by operator &). </p>\r\n     *\r\n     * @param x First element.\r\n     * @param y Second element.\r\n     *\r\n     * @return Result of bitwise AND operation.\r\n     */\r\n    function bit_and(x, y) {\r\n        return x & y;\r\n    }\r\n    std.bit_and = bit_and;\r\n    /**\r\n     * <p> Bitwise OR function object class. </p>\r\n     *\r\n     * <p> Binary function object class whose call returns the result of applying the <i>bitwise \"and\"</i> operation between\r\n     * its two arguments (as returned by operator &). </p>\r\n     *\r\n     * @param x First element.\r\n     * @param y Second element.\r\n     *\r\n     * @return Result of bitwise OR operation.\r\n     */\r\n    function bit_or(x, y) {\r\n        return x | y;\r\n    }\r\n    std.bit_or = bit_or;\r\n    /**\r\n     * <p> Bitwise XOR function object class. </p>\r\n     *\r\n     * <p> Binary function object class whose call returns the result of applying the <i>bitwise \"exclusive or\"</i>\r\n     * operation between its two arguments (as returned by operator ^). </p>\r\n     *\r\n     * @param x First element.\r\n     * @param y Second element.\r\n     *\r\n     * @return Result of bitwise XOR operation.\r\n     */\r\n    function bit_xor(x, y) {\r\n        return x ^ y;\r\n    }\r\n    std.bit_xor = bit_xor;\r\n    function swap(left, right) {\r\n        left.swap(right);\r\n    }\r\n    std.swap = swap;\r\n    function bind(fn) {\r\n        var args = [];\r\n        for (var _i = 1; _i < arguments.length; _i++) {\r\n            args[_i - 1] = arguments[_i];\r\n        }\r\n        var this_arg = null;\r\n        var parameters = [];\r\n        var placeholder_count = 0;\r\n        for (var i = 0; i < args.length; i++) {\r\n            if (i == 0 && args[0] instanceof Object && args[0] instanceof placeholders.PlaceHolder == false) {\r\n                // retrieve the object; items[0]\r\n                for (var key in args[0])\r\n                    if (args[0][key] == fn) {\r\n                        // found the this_arg\r\n                        this_arg = args[0];\r\n                        break;\r\n                    }\r\n                if (this_arg != null)\r\n                    continue;\r\n            }\r\n            // the placeholder also fills parameters\r\n            if (args[i] instanceof placeholders.PlaceHolder)\r\n                placeholder_count++;\r\n            parameters.push(args[i]);\r\n        }\r\n        ////////////////////\r\n        // FUNCTION TO BE RETURNED\r\n        ////////////////////\r\n        var ret = function () {\r\n            var args = [];\r\n            for (var _i = 0; _i < arguments.length; _i++) {\r\n                args[_i - 0] = arguments[_i];\r\n            }\r\n            if (args.length == 0)\r\n                return fn.apply(this_arg, parameters);\r\n            var thisArg = this_arg;\r\n            var argArray = parameters.slice();\r\n            // 1st argument is thisArg?\r\n            if (thisArg == null && (parameters.length == 0 || parameters[0] instanceof placeholders.PlaceHolder) && args[0] instanceof Object)\r\n                for (var key in args[0])\r\n                    if (args[0][key] == fn) {\r\n                        thisArg = args[0];\r\n                        argArray.splice(0, 1);\r\n                        //lastIndex++;\r\n                        break;\r\n                    }\r\n            // fill argArray from placeholders\r\n            for (var i = 0; i < argArray.length; i++)\r\n                if (argArray[i] instanceof placeholders.PlaceHolder)\r\n                    argArray[i] = args[argArray[i].index - 1];\r\n            // arguments are over the placeholder_count \r\n            if (args.length > placeholder_count)\r\n                for (var i = placeholder_count; i < args.length; i++)\r\n                    if (i == 0 && (this_arg == null && thisArg != null))\r\n                        continue; // thisArg\r\n                    else\r\n                        argArray.push(args[i]);\r\n            return fn.apply(thisArg, argArray);\r\n        };\r\n        return ret;\r\n    }\r\n    std.bind = bind;\r\n    /**\r\n     * <p> Bind argument placeholders. </p>\r\n     *\r\n     * <p> This namespace declares an unspecified number of objects: <i>_1</i>, <i>_2</i>, <i>_3</i>, ...</i>, which are\r\n     * used to specify placeholders in calls to function {@link std.bind}. </p>\r\n     *\r\n     * <p> When the function object returned by bind is called, an argument with placeholder {@link _1} is replaced by the\r\n     * first argument in the call, {@link _2} is replaced by the second argument in the call, and so on... For example: </p>\r\n     *\r\n     * <code>\r\n    let vec: Vector<number> = new Vector<number>();\r\n\r\n    let bind = std.bind(Vector.insert, _1, vec.end(), _2, _3);\r\n    bind.apply(vec, 5, 1); // vec.insert(vec.end(), 5, 1);\r\n        // [1, 1, 1, 1, 1]\r\n     * </code>\r\n     *\r\n     * <p> When a call to {@link bind} is used as a subexpression in another call to <i>bind</i>, the {@link placeholders}\r\n     * are relative to the outermost {@link bind} expression. </p>\r\n     *\r\n     * @reference http://www.cplusplus.com/reference/functional/placeholders/\r\n     * @author Jeongho Nam <http://samchon.org>\r\n     */\r\n    var placeholders;\r\n    (function (placeholders) {\r\n        /**\r\n         * @hidden\r\n         */\r\n        var PlaceHolder = (function () {\r\n            function PlaceHolder(index) {\r\n                this.index_ = index;\r\n            }\r\n            Object.defineProperty(PlaceHolder.prototype, \"index\", {\r\n                get: function () {\r\n                    return this.index_;\r\n                },\r\n                enumerable: true,\r\n                configurable: true\r\n            });\r\n            return PlaceHolder;\r\n        }());\r\n        placeholders.PlaceHolder = PlaceHolder;\r\n        /**\r\n         * Replaced by the first argument in the function call.\r\n         */\r\n        placeholders._1 = new PlaceHolder(1);\r\n        /**\r\n         * Replaced by the second argument in the function call.\r\n         */\r\n        placeholders._2 = new PlaceHolder(2);\r\n        /**\r\n         * Replaced by the third argument in the function call.\r\n         */\r\n        placeholders._3 = new PlaceHolder(3);\r\n        placeholders._4 = new PlaceHolder(4);\r\n        placeholders._5 = new PlaceHolder(5);\r\n        placeholders._6 = new PlaceHolder(6);\r\n        placeholders._7 = new PlaceHolder(7);\r\n        placeholders._8 = new PlaceHolder(8);\r\n        placeholders._9 = new PlaceHolder(9);\r\n        placeholders._10 = new PlaceHolder(10);\r\n        placeholders._11 = new PlaceHolder(11);\r\n        placeholders._12 = new PlaceHolder(12);\r\n        placeholders._13 = new PlaceHolder(13);\r\n        placeholders._14 = new PlaceHolder(14);\r\n        placeholders._15 = new PlaceHolder(15);\r\n        placeholders._16 = new PlaceHolder(16);\r\n        placeholders._17 = new PlaceHolder(17);\r\n        placeholders._18 = new PlaceHolder(18);\r\n        placeholders._19 = new PlaceHolder(19);\r\n        placeholders._20 = new PlaceHolder(20);\r\n    })(placeholders = std.placeholders || (std.placeholders = {}));\r\n})(std || (std = {}));\r\nvar std;\r\n(function (std) {\r\n    /**\r\n     * <p> Return distance between {@link Iterator iterators}. </p>\r\n     *\r\n     * <p> Calculates the number of elements between <i>first</i> and <i>last</i>. </p>\r\n     *\r\n     * <p> If it is a {@link IArrayIterator random-access iterator}, the function uses operator- to calculate this.\r\n     * Otherwise, the function uses the increase operator {@link Iterator.next next()} repeatedly. </p>\r\n     *\r\n     * @param first Iterator pointing to the initial element.\r\n     * @param last Iterator pointing to the final element. This must be reachable from first.\r\n     *\r\n     * @return The number of elements between first and last.\r\n     */\r\n    function distance(first, last) {\r\n        if (first instanceof std.VectorIterator || first instanceof std.DequeIterator)\r\n            return last.index - first.index;\r\n        var length = 0;\r\n        for (; !first.equal_to(last); first = first.next())\r\n            length++;\r\n        return length;\r\n    }\r\n    std.distance = distance;\r\n})(std || (std = {}));\r\nvar std;\r\n(function (std) {\r\n    /**\r\n     * <p> Pair of values. </p>\r\n     *\r\n     * <p> This class couples together a pair of values, which may be of different types (<i>T1</i> and\r\n     * <i>T2</i>). The individual values can be accessed through its public members {@link first} and\r\n     * {@link second}. </p>\r\n     *\r\n     * <ul>\r\n     *\t<li> Reference: http://www.cplusplus.com/reference/utility/pair/ </li>\r\n     * </ul>\r\n     *\r\n     * @param <K> Type of member {@link first}.\r\n     * @param <T> Type of member {@link second}.\r\n     *\r\n     * @author Jeongho Nam <http://samchon.org>\r\n     */\r\n    var Pair = (function () {\r\n        /* ---------------------------------------------------------\r\n            CONSTRUCTORS\r\n        --------------------------------------------------------- */\r\n        /**\r\n         * <p> Construct from pair values. </p>\r\n         *\r\n         * @param first The first value of the Pair\r\n         * @param second The second value of the Pair\r\n         */\r\n        function Pair(first, second) {\r\n            this.first = first;\r\n            this.second = second;\r\n        }\r\n        /* ---------------------------------------------------------\r\n            COMPARISON\r\n        --------------------------------------------------------- */\r\n        /**\r\n         * <p> Whether a Pair is equal with the Pair. <p>\r\n         * <p> Compare each first and second value of two Pair(s) and returns whether they are equal or not. </p>\r\n         *\r\n         * <p> If stored key and value in a Pair are not number or string but an object like a class or struct,\r\n         * the comparison will be executed by a member method (SomeObject)::equal_to(). If the object does not have\r\n         * the member method equal_to(), only address of pointer will be compared. </p>\r\n         *\r\n         * @param obj A Map to compare\r\n         * @return Indicates whether equal or not.\r\n         */\r\n        Pair.prototype.equal_to = function (pair) {\r\n            return std.equal_to(this.first, pair.first) && std.equal_to(this.second, pair.second);\r\n        };\r\n        Pair.prototype.less = function (pair) {\r\n            if (std.equal_to(this.first, pair.first) == false)\r\n                return std.less(this.first, pair.first);\r\n            else\r\n                return std.less(this.second, pair.second);\r\n        };\r\n        return Pair;\r\n    }());\r\n    std.Pair = Pair;\r\n    /**\r\n     * <p> Construct {@link Pair} object. </p>\r\n     *\r\n     * <p> Constructs a {@link Pair} object with its {@link Pair.first first} element set to <i>x</i> and its\r\n     * {@link Pair.second second} element set to <i>y</i>. </p>\r\n     *\r\n     * <p> The template types can be implicitly deduced from the arguments passed to {@link make_pair}. </p>\r\n     *\r\n     * <p> {@link Pair} objects can be constructed from other {@link Pair} objects containing different types, if the\r\n     * respective types are implicitly convertible. </p>\r\n     *\r\n     * @param x Value for member {@link Pair.first first}.\r\n     * @param y Value for member {@link Pair.second second}.\r\n     *\r\n     * @return A {@link Pair} object whose elements {@link Pair.first first} and {@link Pair.second second} are set to\r\n     *\t\t   <i>x</i> and <i>y</i> respectivelly.\r\n     */\r\n    function make_pair(x, y) {\r\n        return new Pair(x, y);\r\n    }\r\n    std.make_pair = make_pair;\r\n})(std || (std = {}));\r\n/// <reference path=\"std/Vector.ts\" />\r\n/// <reference path=\"std/Deque.ts\" />\r\n/// <reference path=\"std/List.ts\" />\r\n/// <reference path=\"std/Queue.ts\" />\r\n/// <reference path=\"std/Stack.ts\" />\r\n/// <reference path=\"std/HashSet.ts\" />\r\n/// <reference path=\"std/HashMap.ts\" />\r\n/// <reference path=\"std/TreeSet.ts\" />\r\n/// <reference path=\"std/TreeMap.ts\" />\r\n/// <reference path=\"std/Algorithm.ts\" />\r\n/// <reference path=\"std/Exception.ts\" />\r\n/// <reference path=\"std/Functional.ts\" />\r\n/// <reference path=\"std/Iterator.ts\" />\r\n/// <reference path=\"std/Utility.ts\" />\r\nif (typeof exports != undefined)\r\n    for (var key in std)\r\n        exports[key] = std[key];\r\nvar std;\r\n(function (std) {\r\n    var base;\r\n    (function (base) {\r\n        /**\r\n         * <p> Red-black Tree. </p>\r\n         *\r\n         * <p> A red-black tree is a kind of self-balancing\r\n         * binary search tree. Each node of the binary tree has an extra bit, and that bit is often interpreted as the\r\n         * color (<font color='red'>red</font> or <font color='darkBlue'>black</font>) of the node. These color bits\r\n         * are used to ensure the tree remains approximately balanced during insertions and deletions. </p>\r\n         *\r\n         * <p> Balance is preserved by painting each node of the tree with one of two colors (typically called\r\n         * '<font color='red'>red</font>' and '<font color='darkBlue'>black</font>') in a way that satisfies certain\r\n         * properties, which collectively constrain how unbalanced the tree can become in the worst case. When the tree\r\n         * is modified, the new tree is subsequently rearranged and repainted to restore the coloring properties. The\r\n         * properties are designed in such a way that this rearranging and recoloring can be performed efficiently. </p>\r\n         *\r\n         * <p> The balancing of the tree is not perfect but it is good enough to allow it to guarantee searching in\r\n         * O(log n) time, where n is the total number of elements in the tree. The insertion and deletion operations,\r\n         * along with the tree rearrangement and recoloring, are also performed in O(log n) time. </p>\r\n         *\r\n         * <p> Tracking the color of each node requires only 1 bit of information per node because there are only two\r\n         * colors. The tree does not contain any other data specific to its being a\r\n         * red-black tree so its memory footprint is almost\r\n         * identical to a classic (uncolored) binary search tree. In many cases the additional bit of information can\r\n         * be stored at no additional memory cost. </p>\r\n         *\r\n         * <h4> Properties </h4>\r\n         * <p> In addition to the requirements imposed on a binary search tree the following must be satisfied by a\r\n         * red-black tree: </p>\r\n         *\r\n         * <ol>\r\n         *\t<li> A node is either <font color='red'>red</font> or <font color='darkBlue'>black</font>. </li>\r\n         *\t<li>\r\n         *\t\tThe root is <font color='darkBlue'>black</font>. This rule is sometimes omitted. Since the root can\r\n         *\t\talways be changed from <font color='red'>red</font> to <font color='darkBlue'>black</font>, but not\r\n         *\t\tnecessarily vice versa, this rule has little effect on analysis.\r\n         *\t</li>\r\n         *\t<li> All leaves (NIL; <code>null</code>) are <font color='darkBlue'>black</font>. </li>\r\n         *  <li>\r\n         *\t\tIf a node is <font color='red'>red</font>, then both its children are\r\n         *\t\t<font color='darkBlue'>black</font>.\r\n         *\t</li>\r\n         *  <li>\r\n         *\t\tEvery path from a given node to any of its descendant NIL nodes contains the same number of\r\n         *\t\t<font color='darkBlue'>black</font> nodes. Some definitions: the number of\r\n         *\t\t<font color='darkBlue'>black</font> nodes from the root to a node is the node's\r\n         *\t\t<font color='darkBlue'>black</font> depth; the uniform number of <font color='darkBlue'>black</font>\r\n         *\t\tnodes in all paths from root to the leaves is called the <font color='darkBlue'>black</font>-height of\r\n         *\t\tthe red-black tree.\r\n         *\t</li>\r\n         * </ol>\r\n         *\r\n         * <p> <img src=\"../assets/images/tree/Red-black_tree_example.svg\" width=\"100%\" /> </p>\r\n         *\r\n         * <p> These constraints enforce a critical property of red-black trees: the path from the root to the farthest\r\n         * leaf is no more than twice as long as the path from the root to the nearest leaf. The result is that the tree\r\n         * is roughly height-balanced. Since operations such as inserting, deleting, and finding values require\r\n         * worst-case time proportional to the height of the tree, this theoretical upper bound on the height allows\r\n         * red-black trees to be efficient in the worst case, unlike ordinary binary search trees. </p>\r\n         *\r\n         * <p> To see why this is guaranteed, it suffices to consider the effect of properties 4 and 5 together. For a\r\n         * red-black tree T, let B be the number of <font color='darkBlue'>black</font> nodes in property 5. Let the\r\n         * shortest possible path from the root of T to any leaf consist of B <font color='darkBlue'>black</font> nodes.\r\n         * Longer possible paths may be constructed by inserting <font color='red'>red</font> nodes. However, property 4\r\n         * makes it impossible to insert more than one consecutive <font color='red'>red</font> node. Therefore,\r\n         * ignoring any <font color='darkBlue'>black</font> NIL leaves, the longest possible path consists of 2*B nodes,\r\n         * alternating <font color='darkBlue'>black</font> and <font color='red'>red</font> (this is the worst case).\r\n         * Counting the <font color='darkBlue'>black</font> NIL leaves, the longest possible path consists of 2*B-1\r\n         * nodes. </p>\r\n         *\r\n         * <p> The shortest possible path has all <font color='darkBlue'>black</font> nodes, and the longest possible\r\n         * path alternates between <font color='red'>red</font> and <font color='darkBlue'>black</font> nodes. Since all\r\n         * maximal paths have the same number of <font color='darkBlue'>black</font> nodes, by property 5, this shows\r\n         * that no path is more than twice as long as any other path. </p>\r\n         *\r\n         * <ul>\r\n         *\t<li> Reference: https://en.wikipedia.org/w/index.php?title=Red%E2%80%93black_tree&redirect=no </li>\r\n         * </ul>\r\n         *\r\n         * @param <T> Type of elements.\r\n         *\r\n         * @inventor Rudolf Bayer\r\n         * @author Migrated by Jeongho Nam <http://samchon.org>\r\n         */\r\n        var XTree = (function () {\r\n            /* =========================================================\r\n                CONSTRUCTOR\r\n            ========================================================= */\r\n            /**\r\n             * Default Constructor.\r\n             */\r\n            function XTree() {\r\n                this.root_ = null;\r\n            }\r\n            /* =========================================================\r\n                ACCESSORS\r\n                    - GETTERS\r\n                    - COMPARISON\r\n            ============================================================\r\n                GETTERS\r\n            --------------------------------------------------------- */\r\n            /**\r\n             * Find a node from its contained value.\r\n             *\r\n             * @param val Value to find.\r\n             */\r\n            XTree.prototype.find = function (val) {\r\n                if (this.root_ == null)\r\n                    return null;\r\n                var node = this.root_;\r\n                while (true) {\r\n                    var newNode = null;\r\n                    if (this.is_equals(val, node.value))\r\n                        break; // EQUALS, MEANS MATCHED, THEN TERMINATE\r\n                    else if (this.is_less(val, node.value))\r\n                        newNode = node.left; // LESS, THEN TO THE LEFT\r\n                    else\r\n                        newNode = node.right; // GREATER, THEN TO THE RIGHT\r\n                    // ULTIL CHILD NODE EXISTS\r\n                    if (newNode == null)\r\n                        break;\r\n                    // SHIFT A NEW NODE TO THE NODE TO BE RETURNED\r\n                    node = newNode;\r\n                }\r\n                return node;\r\n            };\r\n            /**\r\n             * Fetch maximum (the rightes?) node from one.\r\n             *\r\n             * @param node A node to fetch its maximum node.\r\n             * @return The maximum node.\r\n             */\r\n            XTree.prototype.fetch_maximum = function (node) {\r\n                while (node.right != null)\r\n                    node = node.right;\r\n                return node;\r\n            };\r\n            /* =========================================================\r\n                ELEMENTS I/O\r\n                    - INSERT\r\n                    - ERASE\r\n                    - COLOR\r\n                    - ROTATION\r\n            ============================================================\r\n                INSERT\r\n            --------------------------------------------------------- */\r\n            /**\r\n             * <p> Insert an element with a new node. </p>\r\n             *\r\n             * <p> Insertion begins by adding the node as any binary search tree insertion does and by coloring it\r\n             * <font color='red'>red</font>. Whereas in the binary search tree, we always add a leaf, in the red-black\r\n             * tree, leaves contain no information, so instead we add a <font color='red'>red</font> interior node, with\r\n             * two <font color='darkBlue'>black</font> leaves, in place of an existing\r\n             * <font color='darkBlue'>black</font> leaf. </p>\r\n             *\r\n             * <p> What happens next depends on the color of other nearby nodes. The term uncle node will be used to\r\n             * refer to the sibling of a node's parent, as in human family trees. Note that: </p>\r\n             *\r\n             * <ul>\r\n             *\t<li> property 3 (all leaves are <font color='darkBlue'>black</font>) always holds. </li>\r\n             *\t<li>\r\n             *\t\tproperty 4 (both children of every <font color='red'>red</font> node are\r\n             *\t\t<font color='darkBlue'>black</font>) is threatened only by adding a <font color='red'>red</font>\r\n             *\t\tnode, repainting a <font color='darkBlue'>black</font> node <font color='red'>red</font>, or a\r\n             *\t\trotation.\r\n             *\t</li>\r\n             *\t<li>\r\n             *\t\tproperty 5 (all paths from any given node to its leaf nodes contain the same number of\r\n             *\t\t<font color='darkBlue'>black</font> nodes) is threatened only by adding a\r\n             *\t\t<font color='darkBlue'>black</font> node, repainting a <font color='red'>red</font> node\r\n             *\t\t<font color='darkBlue'>black</font> (or vice versa), or a rotation.\r\n             *\t</li>\r\n             * </ul>\r\n             *\r\n             * <h4> Notes </h4>\r\n             * <ol>\r\n             *\t<li>\r\n             *\t\tThe label <i><b>N</b></i> will be used to denote the current node (colored\r\n             *\t\t<font color='red'>red</font>). In the diagrams <i><b>N</b></i> carries a blue contour. At the\r\n             *\t\tbeginning, this is the new node being inserted, but the entire procedure may also be applied\r\n             *\t\trecursively to other nodes (see case 3). {@link XTreeNode.parent <b>P</b>} will denote\r\n             *\t\t<i><b>N</b></i>'s parent node, {@link XTreeNode.grand_parent <b>G</b>} will denote <i><b>N</b></i>'s\r\n             *\t\tgrandparent, and {@link XTreeNode.uncle <b>U</b>} will denote <i><b>N</b></i>'s uncle. In between\r\n             *\t\tsome cases, the roles and labels of the nodes are exchanged, but in each case, every label continues\r\n             *\t\tto represent the same node it represented at the beginning of the case.\r\n             *\t</li>\r\n             *\t<li>\r\n             *\t\tIf a node in the right (target) half of a diagram carries a blue contour it will become the current\r\n             *\t\tnode in the next iteration and there the other nodes will be newly assigned relative to it. Any\r\n             *\t\tcolor shown in the diagram is either assumed in its case or implied by those assumptions.\r\n             *\t</li>\r\n             *\t<li>\r\n             *\t\tA numbered triangle represents a subtree of unspecified depth. A <font color='darkBlue'>black</font>\r\n             *\t\tcircle atop a triangle means that <font color='darkBlue'>black</font>-height of subtree is greater\r\n             *\t\tby one compared to subtree without this circle. </li>\r\n             * </ol>\r\n             *\r\n             * <p> There are several cases of red-black tree insertion to handle: </p>\r\n             *\r\n             * <ul>\r\n             *\t<li> <i><b>N</b></i> is the root node, i.e., first node of red-black tree. </li>\r\n             *\t<li>\r\n             *\t\t<i><b>N</b></i>'s parent ({@link XTreeNode.parent <b>P</b>}) is <font color='darkBlue'>black</font>.\r\n             *\t</li>\r\n             *\t<li>\r\n             *\t\t<i><b>N</b></i>'s parent ({@link XTreeNode.parent <b>P</b>}) and uncle\r\n             *\t\t({@link XTreeNode.uncle <b>U</b>}) are <font color='red'>red</font>.\r\n             *\t</li>\r\n             *\t<li>\r\n             *\t\t<i><b>N</b></i> is added to right of left child of grandparent, or <i><b>N</b></i> is added to left\r\n             *\t\tof right child of grandparent ({@link XTreeNode.parent <b>P</b>} is <font color='red'>red</font> and\r\n             *\t\t{@link XTreeNode.uncle <b>U</b>} is <font color='darkBlue'>black</font>).\r\n             *\t</li>\r\n             *\t<li>\r\n             *\t\t<i><b>N</b></i> is added to left of left child of grandparent, or <i><b>N</b></i> is added to right\r\n             *\t\tof right child of grandparent ({@link XTreeNode.parent <b>P</b>} is <font color='red'>red</font> and\r\n             *\t\t{@link XTreeNode.uncle <b>U</b>} is <font color='darkBlue'>black</font>).\r\n             *\t</li>\r\n             * </ul>\r\n             *\r\n             * <h4> Note </h4>\r\n             * <p> Note that inserting is actually in-place, since all the calls above use tail recursion. </p>\r\n             *\r\n             * <p> In the algorithm above, all cases are chained in order, except in insert case 3 where it can recurse\r\n             * to case 1 back to the grandparent node: this is the only case where an iterative implementation will\r\n             * effectively loop. Because the problem of repair is escalated to the next higher level but one, it takes\r\n             * maximally h⁄2 iterations to repair the tree (where h is the height of the tree). Because the probability\r\n             * for escalation decreases exponentially with each iteration the average insertion cost is constant. </p>\r\n             *\r\n             * @param val An element to insert.\r\n             */\r\n            XTree.prototype.insert = function (val) {\r\n                var parent = this.find(val);\r\n                var node = new base.XTreeNode(val, base.Color.RED);\r\n                if (parent == null)\r\n                    this.root_ = node;\r\n                else {\r\n                    node.parent = parent;\r\n                    if (this.is_less(node.value, parent.value))\r\n                        parent.left = node;\r\n                    else\r\n                        parent.right = node;\r\n                }\r\n                this.insert_case1(node);\r\n            };\r\n            /**\r\n             * <p> <i><b>N</b></i> is the root node, i.e., first node of red-black tree. </p>\r\n             *\r\n             * <p> The current node <i><b>N</b></i> is at the {@link root_ root} of the tree. </p>\r\n             *\r\n             * <p> In this case, it is repainted <font color='darkBlue'>black</font> to satisfy property 2 (the root is\r\n             * <font color='darkBlue'>black</font>). Since this adds one <font color='darkBlue'>black</font> node to\r\n             * every path at once, property 5 (all paths from any given node to its leaf nodes contain the same number\r\n             * of <font color='darkBlue'>black</font> nodes) is not violated. </p>\r\n             *\r\n             * @param N A node to be inserted or swapped.\r\n             */\r\n            XTree.prototype.insert_case1 = function (N) {\r\n                if (N.parent == null)\r\n                    N.color = base.Color.BLACK;\r\n                else\r\n                    this.insert_case2(N);\r\n            };\r\n            /**\r\n             * <p> <i><b>N</b></i>'s parent ({@link XTreeNode.parent <b>P</b>}) is <font color='darkBlue'>black</font>. </p>\r\n             *\r\n             * <p> The current node's parent {@link XTreeNode.parent <b>P</b>} is <font color='darkBlue'>black</font>,\r\n             * so property 4 (both children of every <font color='red'>red</font> node are\r\n             * <font color='darkBlue'>black</font>) is not invalidated. </p>\r\n             *\r\n             * <p> In this case, the tree is still valid. Property 5 (all paths from any given node to its leaf nodes\r\n             * contain the same number of <font color='darkBlue'>black</font> nodes) is not threatened, because the\r\n             * current node <i><b>N</b></i> has two <font color='darkBlue'>black</font> leaf children, but because\r\n             * <i><b>N</b></i> is <font color='red'>red</font>, the paths through each of its children have the same\r\n             * number of <font color='darkBlue'>black</font> nodes as the path through the leaf it replaced, which was\r\n             * <font color='darkBlue'>black</font>, and so this property remains satisfied. </p>\r\n             *\r\n             * @param N A node to be inserted or swapped.\r\n             */\r\n            XTree.prototype.insert_case2 = function (N) {\r\n                if (this.fetch_color(N.parent) == base.Color.BLACK)\r\n                    return;\r\n                else\r\n                    this.insert_case3(N);\r\n            };\r\n            /**\r\n             * <p> <i><b>N</b></i>'s parent ({@link XTreeNode.parent <b>P</b>}) and uncle\r\n             * (<i>{@link XTreeNode.uncle <b>U</b>}</i>) are <font color='red'>red</font>. </p>\r\n             *\r\n             * <p> If both the parent {@link XTreeNode.parent <b>P</b>} and the uncle {@link XTreeNode.uncle <b>U</b>}\r\n             * are <font color='red'>red</font>, then both of them can be repainted <font color='darkBlue'>black</font>\r\n             * and the grandparent {@link XTreeNode.grand_parent <b>G</b>} becomes <font color='red'>red</font> (to\r\n             * maintain property 5 (all paths from any given node to its leaf nodes contain the same number of\r\n             * <font color='darkBlue'>black</font> nodes)). </p>\r\n             *\r\n             * <p> Now, the current <font color='red'>red</font> node <i><b>N</b></i> has a\r\n             * <font color='darkBlue'>black</font> parent. Since any path through the parent or uncle must pass through\r\n             * the grandparent, the number of <font color='darkBlue'>black</font> nodes on these paths has not changed.\r\n             *\r\n             * <p> However, the grandparent {@link XTreeNode.grand_parent <b>G</b>} may now violate properties 2 (The\r\n             * root is <font color='darkBlue'>black</font>) or 4 (Both children of every <font color='red'>red</font>\r\n             * node are <font color='darkBlue'>black</font>) (property 4 possibly being violated since\r\n             * {@link XTreeNode.grand_parent <b>G</b>} may have a <font color='red'>red</font> parent). </p>\r\n             *\r\n             * <p> To fix this, the entire procedure is recursively performed on {@link XTreeNode.grand_parent <b>G</b>}\r\n             * from case 1. Note that this is a tail-recursive call, so it could be rewritten as a loop; since this is\r\n             * the only loop, and any rotations occur after this loop, this proves that a constant number of rotations\r\n             * occur. </p>\r\n             *\r\n             * <p> <img src=\"../assets/images/tree/Red-black_tree_insert_case_3.svg\" /> </p>\r\n             *\r\n             * @param N A node to be inserted or swapped.\r\n             */\r\n            XTree.prototype.insert_case3 = function (N) {\r\n                if (this.fetch_color(N.uncle) == base.Color.RED) {\r\n                    N.parent.color = base.Color.BLACK;\r\n                    N.uncle.color = base.Color.BLACK;\r\n                    N.grand_parent.color = base.Color.RED;\r\n                    this.insert_case1(N.grand_parent);\r\n                }\r\n                else {\r\n                    this.insert_case4(N);\r\n                }\r\n            };\r\n            /**\r\n             * <p> <i><b>N</b></i> is added to right of left child of grandparent, or <i><b>N</b></i> is added to left\r\n             * of right child of grandparent ({@link XTreeNode.parent <b>P</b>} is <font color='red'>red</font> and\r\n             * {@link XTreeNode.uncle <b>U</b>} is <font color='darkBlue'>black</font>). </p>\r\n             *\r\n             * <p> The parent {@link XTreeNode.parent <b>P</b>} is <font color='red'>red</font> but the uncle\r\n             * {@link XTreeNode.uncle <b>U</b>} is <font color='darkBlue'>black</font>; also, the current node\r\n             * <i><b>N</b></i> is the right child of {@link XTreeNode.parent <b>P</b>}, and\r\n             * {@link XTreeNode.parent <b>P</b>} in turn is the left child of its parent\r\n             * {@link XTreeNode.grand_parent <b>G</b>}. </p>\r\n             *\r\n             * <p> In this case, a left rotation on {@link XTreeNode.parent <b>P</b>} that switches the roles of the\r\n             * current node <i><b>N</b></i> and its parent {@link XTreeNode.parent <b>P</b>} can be performed; then,\r\n             * the former parent node {@link XTreeNode.parent <b>P</b>} is dealt with using case 5\r\n             * (relabeling <i><b>N</b></i> and {@link XTreeNode.parent <b>P</b>}) because property 4 (both children of\r\n             * every <font color='red'>red</font> node are <font color='darkBlue'>black</font>) is still violated. </p>\r\n             *\r\n             * <p> The rotation causes some paths (those in the sub-tree labelled \"1\") to pass through the node\r\n             * <i><b>N</b></i> where they did not before. It also causes some paths (those in the sub-tree labelled \"3\")\r\n             * not to pass through the node {@link XTreeNode.parent <b>P</b>} where they did before. However, both of\r\n             * these nodes are <font color='red'>red</font>, so property 5 (all paths from any given node to its leaf\r\n             * nodes contain the same number of <font color='darkBlue'>black</font> nodes) is not violated by the\r\n             * rotation. </p>\r\n             *\r\n             * <p> After this case has been completed, property 4 (both children of every <font color='red'>red</font>\r\n             * node are <font color='darkBlue'>black</font>) is still violated, but now we can resolve this by\r\n             * continuing to case 5. </p>\r\n             *\r\n             * <p> <img src=\"../assets/images/tree/Red-black_tree_insert_case_4.svg\" /> </p>\r\n             *\r\n             * @param N A node to be inserted or swapped.\r\n             */\r\n            XTree.prototype.insert_case4 = function (node) {\r\n                if (node == node.parent.right && node.parent == node.grand_parent.left) {\r\n                    this.rotate_left(node.parent);\r\n                    node = node.left;\r\n                }\r\n                else if (node == node.parent.left && node.parent == node.grand_parent.right) {\r\n                    this.rotate_right(node.parent);\r\n                    node = node.right;\r\n                }\r\n                this.insert_case5(node);\r\n            };\r\n            /**\r\n             * <p> <i><b>N</b></i> is added to left of left child of grandparent, or <i><b>N</b></i> is added to right\r\n             * of right child of grandparent ({@link XTreeNode.parent <b>P</b>} is <font color='red'>red</font> and\r\n             * {@link XTreeNode.uncle <b>U</b>} is <font color='darkBlue'>black</font>). </p>\r\n             *\r\n             * <p> The parent {@link XTreeNode.parent <b>P</b>} is <font color='red'>red</font> but the uncle\r\n             * {@link XTreeNode.uncle <b>U</b>} is <font color='darkBlue'>black</font>, the current node <i><b>N</b></i>\r\n             * is the left child of {@link XTreeNode.parent <b>P</b>}, and {@link XTreeNode.parent <b>P</b>} is the left\r\n             * child of its parent {@link XTreeNode.grand_parent <b>G</b>}. </p>\r\n             *\r\n             * <p>In this case, a right rotation on {@link XTreeNode.grand_parent <b>G</b>} is performed; the result is a\r\n             * tree where the former parent {@link XTreeNode.parent <b>P</b>} is now the parent of both the current node\r\n             * <i><b>N</b></i> and the former grandparent {@link XTreeNode.grand_parent <b>G</b>}. </p>\r\n             *\r\n             * <p> {@link XTreeNode.grand_parent <b>G</b>} is known to be <font color='darkBlue'>black</font>, since its\r\n             * former child {@link XTreeNode.parent <b>P</b>} could not have been <font color='red'>red</font> otherwise\r\n             * (without violating property 4). Then, the colors of {@link XTreeNode.parent <b>P</b>} and\r\n             * {@link XTreeNode.grand_parent <b>G</b>} are switched, and the resulting tree satisfies property 4 (both\r\n             * children of every <font color='red'>red</font> node are <font color='darkBlue'>black</font>). Property 5\r\n             * (all paths from any given node to its leaf nodes contain the same number of\r\n             * <font color='darkBlue'>black</font> nodes) also remains satisfied, since all paths that went through any\r\n             * of these three nodes went through {@link XTreeNode.grand_parent <b>G</b>} before, and now they all go\r\n             * through {@link XTreeNode.parent <b>P</b>}. In each case, this is the only\r\n             * <font color='darkBlue'>black</font> node of the three. </p>\r\n             *\r\n             * <p> <img src=\"../assets/images/tree/Red-black_tree_insert_case_5.svg\" /> </p>\r\n             *\r\n             * @param N A node to be inserted or swapped.\r\n             */\r\n            XTree.prototype.insert_case5 = function (node) {\r\n                node.parent.color = base.Color.BLACK;\r\n                node.grand_parent.color = base.Color.RED;\r\n                if (node == node.parent.left && node.parent == node.grand_parent.left)\r\n                    this.rotate_right(node.grand_parent);\r\n                else\r\n                    this.rotate_left(node.grand_parent);\r\n            };\r\n            /* ---------------------------------------------------------\r\n                ERASE\r\n            --------------------------------------------------------- */\r\n            /**\r\n             * <p> Erase an element with its node. </p>\r\n             *\r\n             * <p> In a regular binary search tree when deleting a node with two non-leaf children, we find either the\r\n             * maximum element in its left subtree (which is the in-order predecessor) or the minimum element in its\r\n             * right subtree (which is the in-order successor) and move its value into the node being deleted (as shown\r\n             * here). We then delete the node we copied the value from, which must have fewer than two non-leaf children.\r\n             * (Non-leaf children, rather than all children, are specified here because unlike normal binary search\r\n             * trees, red-black trees can have leaf nodes anywhere, so that all nodes are either internal nodes with\r\n             * two children or leaf nodes with, by definition, zero children. In effect, internal nodes having two leaf\r\n             * children in a red-black tree are like the leaf nodes in a regular binary search tree.) Because merely\r\n             * copying a value does not violate any red-black properties, this reduces to the problem of deleting a node\r\n             * with at most one non-leaf child. Once we have solved that problem, the solution applies equally to the\r\n             * case where the node we originally want to delete has at most one non-leaf child as to the case just\r\n             * considered where it has two non-leaf children. </p>\r\n             *\r\n             * <p> Therefore, for the remainder of this discussion we address the deletion of a node with at most one\r\n             * non-leaf child. We use the label <b>M</b> to denote the node to be deleted; <b>C</b> will denote a\r\n             * selected child of <b>M</b>, which we will also call \"its child\". If <b>M</b> does have a non-leaf child,\r\n             * call that its child, <b>C</b>; otherwise, choose either leaf as its child, <b>C</b>. </p>\r\n             *\r\n             * <p> If <b>M</b> is a <font color='red'>red</font> node, we simply replace it with its child <b>C</b>,\r\n             *  which must be <font color='darkBlue'>black</font> by property 4. (This can only occur when <b>M</b> has\r\n             * two leaf children, because if the <font color='red'>red</font> node <b>M</b> had a\r\n             * <font color='darkBlue'>black</font> non-leaf child on one side but just a leaf child on the other side,\r\n             * then the count of <font color='darkBlue'>black</font> nodes on both sides would be different, thus the\r\n             * tree would violate property 5.) All paths through the deleted node will simply pass through one fewer\r\n             * <font color='red'>red</font> node, and both the deleted node's parent and child must be\r\n             * <font color='darkBlue'>black</font>, so property 3 (all leaves are <font color='darkBlue'>black</font>)\r\n             * and property 4 (both children of every <font color='red'>red</font> node are\r\n             * <font color='darkBlue'>black</font>) still hold. </p>\r\n             *\r\n             * <p> Another simple case is when <b>M</b> is <font color='darkBlue'>black</font> and <b>C</b> is\r\n             * <font color='red'>red</font>. Simply removing a <font color='darkBlue'>black</font> node could break\r\n             * Properties 4 (“Both children of every <font color='red'>red</font> node are\r\n             * <font color='darkBlue'>black</font>”) and 5 (“All paths from any given node to its leaf nodes contain the\r\n             * same number of <font color='darkBlue'>black</font> nodes”), but if we repaint <b>C</b>\r\n             * <font color='darkBlue'>black</font>, both of these properties are preserved. </p>\r\n             *\r\n             * <p> The complex case is when both <b>M</b> and <b>C</b> are <font color='darkBlue'>black</font>. (This\r\n             * can only occur when deleting a <font color='darkBlue'>black</font> node which has two leaf children,\r\n             * because if the <font color='darkBlue'>black</font> node <b>M</b> had a <font color='darkBlue'>black</font>\r\n             * non-leaf child on one side but just a leaf child on the other side, then the count of\r\n             * <font color='darkBlue'>black</font> nodes on both sides would be different, thus the tree would have been\r\n             * an invalid red-black tree by violation of property 5.) We begin by replacing <b>M</b> with its child\r\n             * <b>C</b>. We will relabel this child <b>C</b> (in its new position) <i><b>N</b></i>, and its sibling (its\r\n             * new parent's other child) {@link XTreeNode.sibling <b>S</b>}. ({@link XTreeNode.sibling <b>S</b>} was\r\n             * previously the sibling of <b>M</b>.) </p>\r\n             *\r\n             * <p> In the diagrams below, we will also use {@link XTreeNode.parent <b>P</b>} for <i><b>N</b></i>'s new\r\n             * parent (<b>M</b>'s old parent), <b>SL</b> for {@link XTreeNode.sibling <b>S</b>}'s left child, and\r\n             * <b>SR</b> for {@link XTreeNode.sibling <b>S</b>}'s right child ({@link XTreeNode.sibling <b>S</b>} cannot\r\n             * be a leaf because if <b>M</b> and <b>C</b> were <font color='darkBlue'>black</font>, then\r\n             * {@link XTreeNode.parent <b>P</b>}'s one subtree which included <b>M</b> counted two\r\n             * <font color='darkBlue'>black</font>-height and thus {@link XTreeNode.parent <b>P</b>}'s other subtree\r\n             * which includes {@link XTreeNode.sibling <b>S</b>} must also count two\r\n             * <font color='darkBlue'>black</font>-height, which cannot be the case if {@link XTreeNode.sibling <b>S</b>}\r\n             * is a leaf node). </p>\r\n             *\r\n             * <h4> Notes </h4>\r\n             * <ol>\r\n             *\t<li>\r\n             *\t\tThe label <i><b>N</b></i> will be used to denote the current node (colored\r\n             *\t\t<font color='darkBlue'>black</font>). In the diagrams <i><b>N</b></i> carries a blue contour. At the\r\n             *\t\tbeginning, this is the replacement node and a leaf, but the entire procedure may also be applied\r\n             *\t\trecursively to other nodes (see case 3). In between some cases, the roles and labels of the nodes\r\n             *\t\tare exchanged, but in each case, every label continues to represent the same node it represented at\r\n             *\t\tthe beginning of the case.\r\n             *\t</li>\r\n             *\t<li>\r\n             *\t\tIf a node in the right (target) half of a diagram carries a blue contour it will become the current\r\n             *\t\tnode in the next iteration and there the other nodes will be newly assigned relative to it. Any\r\n             *\t\tcolor shown in the diagram is either assumed in its case or implied by those assumptions.\r\n             *\t\tWhite represents an arbitrary color (either <font color='red'>red</font> or\r\n             *\t\t<font color='darkBlue'>black</font>), but the same in both halves of the diagram.\r\n             *\t</li>\r\n             *\t<li>\r\n             *\t\tA numbered triangle represents a subtree of unspecified depth. A <font color='darkBlue'>black</font>\r\n             *\t\tcircle atop a triangle means that <font color='darkBlue'>black</font>-height of subtree is greater\r\n             *\t\tby one compared to subtree without this circle.\r\n             *\t</li>\r\n             * </ol>\r\n             *\r\n             * <p> If both <i><b>N</b></i> and its original parent are <font color='darkBlue'>black</font>, then\r\n             * deleting this original parent causes paths which proceed through <i><b>N</b></i> to have one fewer\r\n             * <font color='darkBlue'>black</font> node than paths that do not. As this violates property 5 (all paths\r\n             * from any given node to its leaf nodes contain the same number of <font color='darkBlue'>black</font>\r\n             * nodes), the tree must be rebalanced. There are several cases to consider: </p>\r\n             *\r\n             * <ol>\r\n             *\t<li> <i><b>N</b></i> is the new root. </li>\r\n             *\t<li> {@link XTreeNode.sibling <b>S</b>} is <font color='red'>red</font>. </li>\r\n             *\t<li>\r\n             *\t\t{@link XTreeNode.parent <b>P</b>}, {@link XTreeNode.sibling <b>S</b>}, and\r\n             *\t\t{@link XTreeNode.sibling <b>S</b>}'s children are <font color='darkBlue'>black</font>. </li>\r\n             *\t<li>\r\n             *\t\t{@link XTreeNode.sibling <b>S</b>} and {@link XTreeNode.sibling <b>S</b>}'s children are\r\n             *\t\t<font color='darkBlue'>black</font>, but {@link XTreeNode.parent <b>P</b>} is\r\n             *\t\t<font color='red'>red</font>.\r\n             *\t</li>\r\n             *\t<li>\r\n             *\t\t{@link XTreeNode.sibling <b>S</b>} is <font color='darkBlue'>black</font>,\r\n             *\t\t{@link XTreeNode.sibling <b>S</b>}'s left child is <font color='red'>red</font>,\r\n             *\t\t{@link XTreeNode.sibling <b>S</b>}'s right child is <font color='darkBlue'>black</font>, and\r\n             *\t\t<i><b>N</b></i> is the left child of its parent.\r\n             *\t</li>\r\n             *\t<li>\r\n             *\t\t{@link XTreeNode.sibling <b>S</b>} is <font color='darkBlue'>black</font>,\r\n             *\t\t{@link XTreeNode.sibling <b>S</b>}'s right child is <font color='red'>red</font>, and\r\n             *\t\t<i><b>N</b></i> is the left child of its parent {@link XTreeNode.parent <b>P</b>}.\r\n             *\t</li>\r\n             * </ol>\r\n             *\r\n             * <p> Again, the function calls all use tail recursion, so the algorithm is in-place. </p>\r\n             *\r\n             * <p> In the algorithm above, all cases are chained in order, except in delete case 3 where it can recurse\r\n             * to case 1 back to the parent node: this is the only case where an iterative implementation will\r\n             * effectively loop. No more than h loops back to case 1 will occur (where h is the height of the tree).\r\n             * And because the probability for escalation decreases exponentially with each iteration the average\r\n             * removal cost is constant. </p>\r\n             *\r\n             * <p> Additionally, no tail recursion ever occurs on a child node, so the tail recursion loop can only\r\n             * move from a child back to its successive ancestors. If a rotation occurs in case 2 (which is the only\r\n             * possibility of rotation within the loop of cases 1–3), then the parent of the node <i><b>N</b></i>\r\n             * becomes <font color='red'>red</font> after the rotation and we will exit the loop. Therefore, at most one\r\n             * rotation will occur within this loop. Since no more than two additional rotations will occur after\r\n             * exiting the loop, at most three rotations occur in total. </p>\r\n             *\r\n             * @param val An element to erase.\r\n             */\r\n            XTree.prototype.erase = function (val) {\r\n                var node = this.find(val);\r\n                if (node == null || this.is_equals(val, node.value) == false)\r\n                    return;\r\n                if (node.left != null && node.right != null) {\r\n                    var pred = this.fetch_maximum(node.left);\r\n                    node.value = pred.value;\r\n                    node = pred;\r\n                }\r\n                var child = (node.right == null) ? node.left : node.right;\r\n                if (this.fetch_color(node) == base.Color.BLACK) {\r\n                    node.color = this.fetch_color(child);\r\n                    this.erase_case1(node);\r\n                }\r\n                this.replace_node(node, child);\r\n            };\r\n            /**\r\n             * <p> <i><b>N</b></i> is the new root. </p>\r\n             *\r\n             * <p> In this case, we are done. We removed one <font color='darkBlue'>black</font> node from every path,\r\n             * and the new root is <font color='darkBlue'>black</font>, so the properties are preserved. </p>\r\n             *\r\n             * <h4> Note </h4>\r\n             * <p> In cases 2, 5, and 6, we assume <i><b>N</b></i> is the left child of its parent\r\n             * {@link XTreeNode.parent <b>P</b>}. If it is the right child, left and right should be reversed throughout\r\n             * these three cases. Again, the code examples take both cases into account. </p>\r\n             *\r\n             * @param N A node to be erased or swapped.\r\n             */\r\n            XTree.prototype.erase_case1 = function (N) {\r\n                if (N.parent == null)\r\n                    return;\r\n                else\r\n                    this.erase_case2(N);\r\n            };\r\n            /**\r\n             * <p> {@link XTreeNode.sibling <b>S</b>} is <font color='red'>red</font>. </p>\r\n             *\r\n             * <p> <img src=\"../assets/images/tree/Red-black_tree_delete_case_2.svg\" /> </p>\r\n             *\r\n             * <p> In this case we reverse the colors of {@link XTreeNode.parent <b>P</b>} and\r\n             * {@link XTreeNode.sibling <b>S</b>}, and then rotate left at {@link XTreeNode.parent <b>P</b>}, turning\r\n             * {@link XTreeNode.sibling <b>S</b>} into <i><b>N</b></i>'s grandparent. </p>\r\n             *\r\n             * <p> Note that {@link XTreeNode.parent <b>P</b>} has to be <font color='darkBlue'>black</font> as it had a\r\n             * <font color='red'>red</font> child. The resulting subtree has a path short one\r\n             * <font color='darkBlue'>black</font> node so we are not done. Now <i><b>N</b></i> has a\r\n             * <font color='darkBlue'>black</font> sibling and a <font color='red'>red</font> parent, so we can proceed\r\n             * to step 4, 5, or 6. (Its new sibling is <font color='darkBlue'>black</font> because it was once the child\r\n             * of the <font color='red'>red</font> {@link XTreeNode.sibling <b>S</b>}.) In later cases, we will re-label\r\n             * <i><b>N</b></i>'s new sibling as {@link XTreeNode.sibling <b>S</b>}. </p>\r\n             *\r\n             * @param N A node to be erased or swapped.\r\n             */\r\n            XTree.prototype.erase_case2 = function (N) {\r\n                if (this.fetch_color(N.sibling) == base.Color.RED) {\r\n                    N.parent.color = base.Color.RED;\r\n                    N.sibling.color = base.Color.BLACK;\r\n                    if (N == N.parent.left)\r\n                        this.rotate_left(N.parent);\r\n                    else\r\n                        this.rotate_right(N.parent);\r\n                }\r\n                this.erase_case3(N);\r\n            };\r\n            /**\r\n             * <p> {@link XTreeNode.parent <b>P</b>}, {@link XTreeNode.sibling <b>S</b>}, and {@link XTreeNode.sibling\r\n             * <b>S</b>}'s children are <font color='darkBlue'>black</font>. </p>\r\n             *\r\n             * <p> <img src=\"../assets/images/tree/Red-black_tree_delete_case_3.svg\" /> </p>\r\n             *\r\n             * <p> In this case, we simply repaint {@link XTreeNode.sibling <b>S</b>} <font color='red'>red</font>. The\r\n             * result is that all paths passing through {@link XTreeNode.sibling <b>S</b>}, which are precisely those\r\n             * paths not passing through <i><b>N</b></i>, have one less <font color='darkBlue'>black</font> node.\r\n             * Because deleting <i><b>N</b></i>'s original parent made all paths passing through <i><b>N</b></i> have\r\n             * one less <font color='darkBlue'>black</font> node, this evens things up. </p>\r\n             *\r\n             * <p> However, all paths through {@link XTreeNode.parent <b>P</b>} now have one fewer\r\n             * <font color='darkBlue'>black</font> node than paths that do not pass through\r\n             * {@link XTreeNode.parent <b>P</b>}, so property 5 (all paths from any given node to its leaf nodes contain\r\n             * the same number of <font color='darkBlue'>black</font> nodes) is still violated. </p>\r\n             *\r\n             * <p> To correct this, we perform the rebalancing procedure on {@link XTreeNode.parent <b>P</b>}, starting\r\n             * at case 1. </p>\r\n             *\r\n             * @param N A node to be erased or swapped.\r\n             */\r\n            XTree.prototype.erase_case3 = function (N) {\r\n                if (this.fetch_color(N.parent) == base.Color.BLACK &&\r\n                    this.fetch_color(N.sibling) == base.Color.BLACK &&\r\n                    this.fetch_color(N.sibling.left) == base.Color.BLACK &&\r\n                    this.fetch_color(N.sibling.right) == base.Color.BLACK) {\r\n                    N.sibling.color = base.Color.RED;\r\n                    this.erase_case1(N.parent);\r\n                }\r\n                else\r\n                    this.erase_case4(N);\r\n            };\r\n            /**\r\n             * <p> {@link XTreeNode.sibling <b>S</b>} and {@link XTreeNode.sibling <b>S</b>}'s children are\r\n             * <font color='darkBlue'>black</font>, but {@link XTreeNode.parent <b>P</b>} is <font color='red'>red</font>. </p>\r\n             *\r\n             * <p> <img src=\"../assets/images/tree/Red-black_tree_delete_case_4.svg\" /> </p>\r\n             *\r\n             * <p> In this case, we simply exchange the colors of {@link XTreeNode.sibling <b>S</b>} and\r\n             * {@link XTreeNode.parent <b>P</b>}. This does not affect the number of <font color='darkBlue'>black</font>\r\n             * nodes on paths going through {@link XTreeNode.sibling <b>S</b>}, but it does add one to the number of\r\n             * <font color='darkBlue'>black</font> nodes on paths going through <i><b>N</b></i>, making up for the\r\n             * deleted <font color='darkBlue'>black</font> node on those paths. </p>\r\n             *\r\n             * @param N A node to be erased or swapped.\r\n             */\r\n            XTree.prototype.erase_case4 = function (N) {\r\n                if (this.fetch_color(N.parent) == base.Color.RED &&\r\n                    N.sibling != null &&\r\n                    this.fetch_color(N.sibling) == base.Color.BLACK &&\r\n                    this.fetch_color(N.sibling.left) == base.Color.BLACK &&\r\n                    this.fetch_color(N.sibling.right) == base.Color.BLACK) {\r\n                    N.sibling.color = base.Color.RED;\r\n                    N.parent.color = base.Color.BLACK;\r\n                }\r\n                else\r\n                    this.erase_case5(N);\r\n            };\r\n            /**\r\n             * <p> {@link XTreeNode.sibling <b>S</b>} is <font color='darkBlue'>black</font>, {@link XTreeNode.sibling <b>S</b>}'s\r\n             * left child is <font color='red'>red</font>, {@link XTreeNode.sibling <b>S</b>}'s right child is\r\n             * <font color='darkBlue'>black</font>, and <i><b>N</b></i> is the left child of its parent. </p>\r\n             *\r\n             * <p> <img src=\"../assets/images/tree/Red-black_tree_delete_case_5.svg\" /> </p>\r\n             *\r\n             * <p> In this case we rotate right at {@link XTreeNode.sibling <b>S</b>}, so that\r\n             * {@link XTreeNode.sibling <b>S</b>}'s left child becomes {@link XTreeNode.sibling <b>S</b>}'s parent and\r\n             * <i><b>N</b></i>'s new sibling. We then exchange the colors of {@link XTreeNode.sibling <b>S</b>} and its\r\n             * new parent. </p>\r\n             *\r\n             * <p> All paths still have the same number of <font color='darkBlue'>black</font> nodes, but now\r\n             * <i><b>N</b></i> has a <font color='darkBlue'>black</font> sibling whose right child is\r\n             * <font color='red'>red</font>, so we fall into case 6. Neither <i><b>N</b></i> nor its parent are affected\r\n             * by this transformation. (Again, for case 6, we relabel <i><b>N</b></i>'s new sibling as\r\n             * {@link XTreeNode.sibling <b>S</b>}.) </p>\r\n             *\r\n             * @param N A node to be erased or swapped.\r\n             */\r\n            XTree.prototype.erase_case5 = function (N) {\r\n                if (N == N.parent.left &&\r\n                    N.sibling != null &&\r\n                    this.fetch_color(N.sibling) == base.Color.BLACK &&\r\n                    this.fetch_color(N.sibling.left) == base.Color.RED &&\r\n                    this.fetch_color(N.sibling.right) == base.Color.BLACK) {\r\n                    N.sibling.color = base.Color.RED;\r\n                    N.sibling.left.color = base.Color.BLACK;\r\n                    this.rotate_right(N.sibling);\r\n                }\r\n                else if (N == N.parent.right &&\r\n                    N.sibling != null &&\r\n                    this.fetch_color(N.sibling) == base.Color.BLACK &&\r\n                    this.fetch_color(N.sibling.left) == base.Color.BLACK &&\r\n                    this.fetch_color(N.sibling.right) == base.Color.RED) {\r\n                    N.sibling.color = base.Color.RED;\r\n                    N.sibling.right.color = base.Color.BLACK;\r\n                    this.rotate_left(N.sibling);\r\n                }\r\n            };\r\n            /**\r\n             * <p> {@link XTreeNode.sibling <b>S</b>} is <font color='darkBlue'>black</font>,\r\n             * {@link XTreeNode.sibling <b>S</b>}'s right child is <font color='red'>red</font>, and <i><b>N</b></i> is\r\n             * the left child of its parent {@link XTreeNode.parent <b>P</b>}. </p>\r\n             *\r\n             * <p> In this case we rotate left at {@link XTreeNode.parent <b>P</b>}, so that\r\n             * {@link XTreeNode.sibling <b>S</b>} becomes the parent of {@link XTreeNode.parent <b>P</b>} and\r\n             * {@link XTreeNode.sibling <b>S</b>}'s right child. We then exchange the colors of\r\n             * {@link XTreeNode.parent <b>P</b>} and {@link XTreeNode.sibling <b>S</b>}, and make\r\n             * {@link XTreeNode.sibling <b>S</b>}'s right child <font color='darkBlue'>black</font>. </p>\r\n             *\r\n             * <p> The subtree still has the same color at its root, so Properties 4 (Both children of every\r\n             * <font color='red'>red</font> node are <font color='darkBlue'>black</font>) and 5 (All paths from any\r\n             * given node to its leaf nodes contain the same number of <font color='darkBlue'>black</font> nodes) are\r\n             * not violated. However, <i><b>N</b></i> now has one additional <font color='darkBlue'>black</font>\r\n             * ancestor: either {@link XTreeNode.parent <b>P</b>} has become <font color='darkBlue'>black</font>, or it\r\n             * was <font color='darkBlue'>black</font> and {@link XTreeNode.sibling <b>S</b>} was added as a\r\n             * <font color='darkBlue'>black</font> grandparent. </p>\r\n             *\r\n             * <p> Thus, the paths passing through <i><b>N</b></i> pass through one additional\r\n             * <font color='darkBlue'>black</font> node. </p>\r\n             *\r\n             * <p> <img src=\"../assets/images/tree/Red-black_tree_delete_case_6.svg\" /> </p>\r\n             *\r\n             * <p> Meanwhile, if a path does not go through <i><b>N</b></i>, then there are two possibilities: </p>\r\n             * <ol>\r\n             *\t<li>\r\n             *\t\tIt goes through <i><b>N</b></i>'s new sibling <b>SL</b>, a node with arbitrary color and the root of\r\n             *\t\tthe subtree labeled 3 (s. diagram). Then, it must go through {@link XTreeNode.sibling <b>S</b>} and\r\n             *\t\t{@link XTreeNode.parent <b>P</b>}, both formerly and currently, as they have only exchanged colors\r\n             *\t\tand places. Thus the path contains the same number of <font color='darkBlue'>black</font> nodes.\r\n             *\t</li>\r\n             *\t<li>\r\n             *\t\tIt goes through <i><b>N</b></i>'s new uncle, {@link XTreeNode.sibling <b>S</b>}'s right child. Then,\r\n             *\t\tit formerly went through {@link XTreeNode.sibling <b>S</b>}, {@link XTreeNode.sibling <b>S</b>}'s\r\n             *\t\tparent, and {@link XTreeNode.sibling <b>S</b>}'s right child <b>SR</b> (which was\r\n             *\t\t<font color='red'>red</font>), but now only goes through {@link XTreeNode.sibling <b>S</b>}, which\r\n             *\t\thas assumed the color of its former parent, and {@link XTreeNode.sibling <b>S</b>}'s right child,\r\n             *\t\twhich has changed from <font color='red'>red</font> to <font color='darkBlue'>black</font> (assuming\r\n             *\t\t{@link XTreeNode.sibling <b>S</b>}'s color: <font color='darkBlue'>black</font>). The net effect is\r\n             *\t\tthat this path goes through the same number of <font color='darkBlue'>black</font> nodes.\r\n             *\t</li>\r\n             * </ol>\r\n             *\r\n             * <p> Either way, the number of <font color='darkBlue'>black</font> nodes on these paths does not change.\r\n             * Thus, we have restored Properties 4 (Both children of every <font color='red'>red</font> node are\r\n             * <font color='darkBlue'>black</font>) and 5 (All paths from any given node to its leaf nodes contain the\r\n             * same number of <font color='darkBlue'>black</font> nodes). The white node in the diagram can be either\r\n             * <font color='red'>red</font> or <font color='darkBlue'>black</font>, but must refer to the same color\r\n             * both before and after the transformation. </p>\r\n             *\r\n             * @param N A node to be erased or swapped.\r\n             */\r\n            XTree.prototype.erase_case6 = function (node) {\r\n                node.sibling.color = this.fetch_color(node.parent);\r\n                node.parent.color = base.Color.BLACK;\r\n                if (node == node.parent.left) {\r\n                    node.sibling.right.color = base.Color.BLACK;\r\n                    this.rotate_left(node.parent);\r\n                }\r\n                else {\r\n                    node.sibling.left.color = base.Color.BLACK;\r\n                    this.rotate_right(node.parent);\r\n                }\r\n            };\r\n            /* ---------------------------------------------------------\r\n                ROTATION\r\n            --------------------------------------------------------- */\r\n            /**\r\n             * Rotate a node left.\r\n             *\r\n             * @param node Node to rotate left.\r\n             */\r\n            XTree.prototype.rotate_left = function (node) {\r\n                var right = node.right;\r\n                this.replace_node(node, right);\r\n                node.right = right.left;\r\n                if (right.left != null)\r\n                    right.left.parent = node;\r\n                right.left = node;\r\n                node.parent = right;\r\n            };\r\n            /**\r\n             * Rotate a node to right.\r\n             *\r\n             * @param node A node to rotate right.\r\n             */\r\n            XTree.prototype.rotate_right = function (node) {\r\n                var left = node.left;\r\n                this.replace_node(node, left);\r\n                node.left = left.right;\r\n                if (left.right != null)\r\n                    left.right.parent = node;\r\n                left.right = node;\r\n                node.parent = left;\r\n            };\r\n            /**\r\n             * Replace a node.\r\n             *\r\n             * @param oldNode Ordinary node to be replaced.\r\n             * @param newNode Target node to replace.\r\n             */\r\n            XTree.prototype.replace_node = function (oldNode, newNode) {\r\n                if (oldNode.parent == null)\r\n                    this.root_ = newNode;\r\n                else {\r\n                    if (oldNode == oldNode.parent.left)\r\n                        oldNode.parent.left = newNode;\r\n                    else\r\n                        oldNode.parent.right = newNode;\r\n                }\r\n                if (newNode != null)\r\n                    newNode.parent = oldNode.parent;\r\n            };\r\n            /* ---------------------------------------------------------\r\n                COLOR\r\n            --------------------------------------------------------- */\r\n            /**\r\n             * Fetch color from a node.\r\n             *\r\n             * @param node A node to fetch color.\r\n             * @retur color.\r\n             */\r\n            XTree.prototype.fetch_color = function (node) {\r\n                if (node == null)\r\n                    return base.Color.BLACK;\r\n                else\r\n                    return node.color;\r\n            };\r\n            return XTree;\r\n        }());\r\n        base.XTree = XTree;\r\n    })(base = std.base || (std.base = {}));\r\n})(std || (std = {}));\r\n/// <reference path=\"XTree.ts\" />\r\nvar std;\r\n(function (std) {\r\n    var base;\r\n    (function (base) {\r\n        /**\r\n         * @author Jeongho Nam <http://samchon.org>\r\n         */\r\n        var AtomicTree = (function (_super) {\r\n            __extends(AtomicTree, _super);\r\n            /* ---------------------------------------------------------\r\n                CONSTRUCTOR\r\n            --------------------------------------------------------- */\r\n            /**\r\n             * Default Constructor.\r\n             */\r\n            function AtomicTree(compare) {\r\n                if (compare === void 0) { compare = std.less; }\r\n                _super.call(this);\r\n                this.compare_ = compare;\r\n            }\r\n            AtomicTree.prototype.find = function (val) {\r\n                if (val instanceof std.SetIterator && val.value instanceof std.SetIterator == false)\r\n                    return _super.prototype.find.call(this, val);\r\n                else\r\n                    return this.find_by_val(val);\r\n            };\r\n            /**\r\n             * @hidden\r\n             */\r\n            AtomicTree.prototype.find_by_val = function (val) {\r\n                if (this.root_ == null)\r\n                    return null;\r\n                var node = this.root_;\r\n                while (true) {\r\n                    var newNode = null;\r\n                    if (std.equal_to(val, node.value.value))\r\n                        break; // EQUALS, MEANS MATCHED, THEN TERMINATE\r\n                    else if (std.less(val, node.value.value))\r\n                        newNode = node.left; // LESS, THEN TO THE LEFT\r\n                    else\r\n                        newNode = node.right; // GREATER, THEN TO THE RIGHT\r\n                    // ULTIL CHILD NODE EXISTS\r\n                    if (newNode == null)\r\n                        break;\r\n                    // SHIFT A NEW NODE TO THE NODE TO BE RETURNED\r\n                    node = newNode;\r\n                }\r\n                return node;\r\n            };\r\n            /* ---------------------------------------------------------\r\n                COMPARISON\r\n            --------------------------------------------------------- */\r\n            AtomicTree.prototype.get_compare = function () {\r\n                return this.compare_;\r\n            };\r\n            /**\r\n             * @inheritdoc\r\n             */\r\n            AtomicTree.prototype.is_equals = function (left, right) {\r\n                return std.equal_to(left, right);\r\n            };\r\n            /**\r\n             * @inheritdoc\r\n             */\r\n            AtomicTree.prototype.is_less = function (left, right) {\r\n                return this.compare_(left.value, right.value);\r\n            };\r\n            return AtomicTree;\r\n        }(base.XTree));\r\n        base.AtomicTree = AtomicTree;\r\n    })(base = std.base || (std.base = {}));\r\n})(std || (std = {}));\r\nvar std;\r\n(function (std) {\r\n    var base;\r\n    (function (base) {\r\n        /**\r\n         * <p> Static class holding enumeration codes of color of Red-black tree. </p>\r\n         *\r\n         * <p> Color codes imposed to nodes of RB-Tree are following those rules: </p>\r\n         *\r\n         * <ol>\r\n         *\t<li> A node is either <font color='red'>red</font> or <font color='darkBlue'>black</font>. </li>\r\n         *\t<li> The root is <font color='darkBlue'>black</font>. This rule is sometimes omitted. Since the root can\r\n         *\t\t always be changed from <font color='red'>red</font> to <font color='darkBlue'>black</font>, but not\r\n         *\t\t necessarily vice versa, this rule has little effect on analysis. </li>\r\n         *\t<li> All leaves (NIL; <code>null</code>) are <font color='darkBlue'>black</font>. </li>\r\n         *  <li> If a node is <font color='red'>red</font>, then both its children are\r\n         *\t\t <font color='darkBlue'>black</font>. </li>\r\n         *  <li> Every path from a given node to any of its descendant NIL nodes contains the same number of\r\n         *\t\t <font color='darkBlue'>black</font> nodes. Some definitions: the number of\r\n         *\t\t <font color='darkBlue'>black</font> nodes from the root to a node is the node's\r\n         *\t\t <font color='darkBlue'>black</font> depth; the uniform number of <font color='darkBlue'>black</font>\r\n         *\t\t nodes in all paths from root to the leaves is called the <font color='darkBlue'>black</font>-height of\r\n         *\t\t the red-black tree. </li>\r\n         * </ol>\r\n         *\r\n         * @author Migrated by Jeongho Nam <http://samchon.org>\r\n         */\r\n        (function (Color) {\r\n            /**\r\n             * <p> Code of color black. </p>\r\n             *\r\n             * <ul>\r\n             *\t<li> Those are clearly black: root, leaf nodes or children nodes of red. </li>\r\n             *\t<li> Every path from a given nodes containes the same number of black nodes exclude NIL(s). </li>\r\n             * </ul>\r\n             */\r\n            Color[Color[\"BLACK\"] = 0] = \"BLACK\";\r\n            /**\r\n             * <p> Code of color red. </p>\r\n             */\r\n            Color[Color[\"RED\"] = 1] = \"RED\";\r\n        })(base.Color || (base.Color = {}));\r\n        var Color = base.Color;\r\n    })(base = std.base || (std.base = {}));\r\n})(std || (std = {}));\r\nvar std;\r\n(function (std) {\r\n    var base;\r\n    (function (base) {\r\n        /**\r\n         * <p> An abstract error instance. </p>\r\n         *\r\n         * <p> {@link ErrorInstance} is an abstract class of {@link ErrorCode} and {@link ErrorCondition}\r\n         * holding an error instance's identifier {@link value}, associated with a {@link category}. </p>\r\n         *\r\n         * <p> The operating system and other low-level applications and libraries generate numerical error codes to\r\n         * represent possible results. These numerical values may carry essential information for a specific platform,\r\n         * but be non-portable from one platform to another. </p>\r\n         *\r\n         * <p> Objects of this class associate such numerical codes to {@link ErrorCategory error categories},\r\n         * so that they can be interpreted when needed as more abstract (and portable)\r\n         * {@link ErrorCondition error conditions}. </p>\r\n         *\r\n         * @author Jeongho Nam <http://samchon.org>\r\n         */\r\n        var ErrorInstance = (function () {\r\n            function ErrorInstance(val, category) {\r\n                if (val === void 0) { val = 0; }\r\n                if (category === void 0) { category = null; }\r\n                this.assign(val, category);\r\n            }\r\n            /**\r\n             * <p> Assign error instance. </p>\r\n             *\r\n             * <p> Assigns the {@link ErrorCode} object a value of val associated with the {@link ErrorCategory}. </p>\r\n             *\r\n             * @param val A numerical value identifying an error instance.\r\n             * @param category A reference to an {@link ErrorCategory} object.\r\n             */\r\n            ErrorInstance.prototype.assign = function (val, category) {\r\n                this.category_ = category;\r\n                this.value_ = val;\r\n            };\r\n            /**\r\n             * <p> Clear error instance. </p>\r\n             *\r\n             * <p> Clears the value in the {@link ErrorCode} object so that it is set to a value of <i>0</i> of the\r\n             * {@link ErrorCategory.systemCategory ErrorCategory.systemCategory()} (indicating no error). </p>\r\n             */\r\n            ErrorInstance.prototype.clear = function () {\r\n                this.value_ = 0;\r\n            };\r\n            /* ---------------------------------------------------------\r\n                ACCESSORS\r\n            --------------------------------------------------------- */\r\n            /**\r\n             * <p> Get category. </p>\r\n             *\r\n             * <p> Returns a reference to the {@link ErrorCategory} associated with the {@link ErrorCode} object. </p>\r\n             *\r\n             * @return A reference to a non-copyable object of a type derived from {@link ErrorCategory}.\r\n             */\r\n            ErrorInstance.prototype.category = function () {\r\n                return this.category_;\r\n            };\r\n            /**\r\n             * <p> Error value. </p>\r\n             *\r\n             * <p> Returns the error value associated with the {@link ErrorCode} object. </p>\r\n             *\r\n             * @return The error value.\r\n             */\r\n            ErrorInstance.prototype.value = function () {\r\n                return this.value_;\r\n            };\r\n            /**\r\n             * <p> Get message. </p>\r\n             *\r\n             * <p> Returns the message associated with the error instance. </p>\r\n             *\r\n             * <p> Error messages are defined by the {@link category} the error instance belongs to. </p>\r\n             *\r\n             * <p> This function returns the same as if the following member was called: </p>\r\n             *\r\n             * <p> <code>category().message(value())</code> </p>\r\n             *\r\n             * @return A string object with the message associated with the {@link ErrorCode}.\r\n             */\r\n            ErrorInstance.prototype.message = function () {\r\n                if (this.category_ == null || this.value_ == 0)\r\n                    return \"\";\r\n                else\r\n                    return this.category_.message(this.value_);\r\n            };\r\n            /**\r\n             * <p> Default error condition. </p>\r\n             *\r\n             * <p> Returns the default {@link ErrorCondition}object associated with the {@link ErrorCode} object. </p>\r\n             *\r\n             * <p> This function returns the same as if the following member was called: </p>\r\n             *\r\n             * <p> <code>category().default_error_condition(value())</code> </p>\r\n             *\r\n             * <p> {@link ErrorCategory.default_error_condition ErrorCategory.default_error_condition()}\r\n             * is a virtual member function, that can operate differently for each category. </p>\r\n             *\r\n             * @return An {@link ErrorCondition}object that corresponds to the {@link ErrorCode} object.\r\n             */\r\n            ErrorInstance.prototype.default_error_condition = function () {\r\n                if (this.category_ == null || this.value_ == 0)\r\n                    return null;\r\n                else\r\n                    return this.category_.default_error_condition(this.value_);\r\n            };\r\n            /* ---------------------------------------------------------\r\n                OPERATORS\r\n            --------------------------------------------------------- */\r\n            /**\r\n             * <p> Convert to bool. </p>\r\n             *\r\n             * <p> Returns whether the error instance has a numerical {@link value} other than 0. </p>\r\n             *\r\n             * <p> If it is zero (which is generally used to represent no error), the function returns false, otherwise it returns true. </p>\r\n             *\r\n             * @return <code>true</code> if the error's numerical value is not zero.\r\n             *\t\t   <code>false</code> otherwise.\r\n             */\r\n            ErrorInstance.prototype.to_bool = function () {\r\n                return this.value_ != 0;\r\n            };\r\n            return ErrorInstance;\r\n        }());\r\n        base.ErrorInstance = ErrorInstance;\r\n    })(base = std.base || (std.base = {}));\r\n})(std || (std = {}));\r\nvar std;\r\n(function (std) {\r\n    var base;\r\n    (function (base) {\r\n        base.MIN_SIZE = 10;\r\n        base.RATIO = 0.8;\r\n        base.MAX_RATIO = 2.0;\r\n        function code(par) {\r\n            var type = typeof par;\r\n            if (type == \"number\")\r\n                return code_of_number(par);\r\n            else if (type == \"string\")\r\n                return code_of_string(par);\r\n            else\r\n                return code_of_object(par);\r\n        }\r\n        base.code = code;\r\n        /**\r\n         * @hidden\r\n         */\r\n        function code_of_number(val) {\r\n            // ------------------------------------------\r\n            //\tIN C++\r\n            //\t\tCONSIDER A NUMBER AS A STRING\r\n            //\t\tHASH<STRING>((CHAR*)&VAL, 8)\r\n            // ------------------------------------------\r\n            // CONSTRUCT BUFFER AND BYTE_ARRAY\r\n            var buffer = new ArrayBuffer(8);\r\n            var byteArray = new Int8Array(buffer);\r\n            var valueArray = new Float64Array(buffer);\r\n            valueArray[0] = val;\r\n            var code = 2166136261;\r\n            for (var i = 0; i < byteArray.length; i++) {\r\n                var byte = (byteArray[i] < 0) ? byteArray[i] + 256 : byteArray[i];\r\n                code ^= byte;\r\n                code *= 16777619;\r\n            }\r\n            return Math.abs(code);\r\n        }\r\n        /**\r\n         * @hidden\r\n         */\r\n        function code_of_string(str) {\r\n            // ------------------------\r\n            //\tIN C++\r\n            // ------------------------\r\n            var code = 2166136261;\r\n            for (var i = 0; i < str.length; i++) {\r\n                code ^= str.charCodeAt(i);\r\n                code *= 16777619;\r\n            }\r\n            return Math.abs(code);\r\n            // ------------------------\r\n            //\tIN JAVA\r\n            // ------------------------\r\n            //let val: number = 0;\r\n            //for (let i: number = 0; i < str.length; i++)\r\n            //\tval += str.charCodeAt(i) * Math.pow(31, str.length - 1 - i);\r\n            //return val;\r\n        }\r\n        /**\r\n         * @hidden\r\n         */\r\n        function code_of_object(obj) {\r\n            if (obj.hash != undefined)\r\n                return obj.hash();\r\n            else\r\n                return code_of_number(obj.__getUID());\r\n        }\r\n    })(base = std.base || (std.base = {}));\r\n})(std || (std = {}));\r\nvar std;\r\n(function (std) {\r\n    var base;\r\n    (function (base) {\r\n        /**\r\n         * <p> Hask buckets. </p>\r\n         *\r\n         * @author Jeongho Nam <http://samchon.org>\r\n         */\r\n        var HashBuckets = (function () {\r\n            /* ---------------------------------------------------------\r\n                CONSTRUCTORS\r\n            --------------------------------------------------------- */\r\n            /**\r\n             * Default Constructor.\r\n             */\r\n            function HashBuckets() {\r\n                this.clear();\r\n            }\r\n            /**\r\n             * Reserve the bucket size.\r\n             *\r\n             * @param size Number of bucket size to reserve.\r\n             */\r\n            HashBuckets.prototype.reserve = function (size) {\r\n                if (size < base.MIN_SIZE)\r\n                    size = base.MIN_SIZE;\r\n                var prevMatrix = this.buckets_;\r\n                this.buckets_ = new std.Vector();\r\n                for (var i = 0; i < size; i++)\r\n                    this.buckets_.push_back(new std.Vector());\r\n                for (var i = 0; i < prevMatrix.size(); i++)\r\n                    for (var j = 0; j < prevMatrix.at(i).size(); j++) {\r\n                        var val = prevMatrix.at(i).at(j);\r\n                        var bucket = this.buckets_.at(this.hash_index(val));\r\n                        bucket.push_back(val);\r\n                        this.item_size_++;\r\n                    }\r\n            };\r\n            HashBuckets.prototype.clear = function () {\r\n                this.buckets_ = new std.Vector();\r\n                this.item_size_ = 0;\r\n                for (var i = 0; i < base.MIN_SIZE; i++)\r\n                    this.buckets_.push_back(new std.Vector());\r\n            };\r\n            /* ---------------------------------------------------------\r\n                ACCESSORS\r\n            --------------------------------------------------------- */\r\n            HashBuckets.prototype.size = function () {\r\n                return this.buckets_.size();\r\n            };\r\n            HashBuckets.prototype.item_size = function () {\r\n                return this.item_size_;\r\n            };\r\n            HashBuckets.prototype.at = function (index) {\r\n                return this.buckets_.at(index);\r\n            };\r\n            HashBuckets.prototype.hash_index = function (val) {\r\n                return std.hash(val) % this.buckets_.size();\r\n            };\r\n            /* ---------------------------------------------------------\r\n                ELEMENTS I/O\r\n            --------------------------------------------------------- */\r\n            HashBuckets.prototype.insert = function (val) {\r\n                this.buckets_.at(this.hash_index(val)).push_back(val);\r\n                if (++this.item_size_ > this.buckets_.size() * base.MAX_RATIO)\r\n                    this.reserve(this.item_size_ * base.RATIO);\r\n            };\r\n            HashBuckets.prototype.erase = function (val) {\r\n                var hashes = this.buckets_.at(this.hash_index(val));\r\n                for (var i = 0; i < hashes.size(); i++)\r\n                    if (hashes.at(i) == val) {\r\n                        hashes.splice(i, 1);\r\n                        this.item_size_--;\r\n                        break;\r\n                    }\r\n            };\r\n            return HashBuckets;\r\n        }());\r\n        base.HashBuckets = HashBuckets;\r\n    })(base = std.base || (std.base = {}));\r\n})(std || (std = {}));\r\n/// <reference path=\"HashBuckets.ts\" />\r\nvar std;\r\n(function (std) {\r\n    var base;\r\n    (function (base) {\r\n        var MapHashBuckets = (function (_super) {\r\n            __extends(MapHashBuckets, _super);\r\n            function MapHashBuckets(map) {\r\n                _super.call(this);\r\n                this.map = map;\r\n            }\r\n            MapHashBuckets.prototype.find = function (key) {\r\n                var index = std.hash(key) % this.size();\r\n                var bucket = this.at(index);\r\n                for (var i = 0; i < bucket.size(); i++)\r\n                    if (std.equal_to(bucket.at(i).first, key))\r\n                        return bucket.at(i);\r\n                return this.map.end();\r\n            };\r\n            return MapHashBuckets;\r\n        }(base.HashBuckets));\r\n        base.MapHashBuckets = MapHashBuckets;\r\n    })(base = std.base || (std.base = {}));\r\n})(std || (std = {}));\r\n/// <reference path=\"XTree.ts\" />\r\nvar std;\r\n(function (std) {\r\n    var base;\r\n    (function (base) {\r\n        /**\r\n         * @author Jeongho Nam <http://samchon.org>\r\n         */\r\n        var PairTree = (function (_super) {\r\n            __extends(PairTree, _super);\r\n            /* ---------------------------------------------------------\r\n                CONSTRUCTOR\r\n            --------------------------------------------------------- */\r\n            /**\r\n             * Default Constructor.\r\n             */\r\n            function PairTree(compare) {\r\n                if (compare === void 0) { compare = std.less; }\r\n                _super.call(this);\r\n                this.compare_ = compare;\r\n            }\r\n            PairTree.prototype.find = function (val) {\r\n                if (val instanceof std.MapIterator && val.first instanceof std.SetIterator == false)\r\n                    return _super.prototype.find.call(this, val);\r\n                else\r\n                    return this.find_by_key(val);\r\n            };\r\n            /**\r\n             * @hidden\r\n             */\r\n            PairTree.prototype.find_by_key = function (key) {\r\n                if (this.root_ == null)\r\n                    return null;\r\n                var node = this.root_;\r\n                while (true) {\r\n                    var newNode = null;\r\n                    if (std.equal_to(key, node.value.first))\r\n                        break; // EQUALS, MEANS MATCHED, THEN TERMINATE\r\n                    else if (std.less(key, node.value.first))\r\n                        newNode = node.left; // LESS, THEN TO THE LEFT\r\n                    else\r\n                        newNode = node.right; // GREATER, THEN TO THE RIGHT\r\n                    // ULTIL CHILD NODE EXISTS\r\n                    if (newNode == null)\r\n                        break;\r\n                    // SHIFT A NEW NODE TO THE NODE TO BE RETURNED\r\n                    node = newNode;\r\n                }\r\n                return node;\r\n            };\r\n            /* ---------------------------------------------------------\r\n                COMPARISON\r\n            --------------------------------------------------------- */\r\n            PairTree.prototype.get_compare = function () {\r\n                return this.compare_;\r\n            };\r\n            /**\r\n             * @inheritdoc\r\n             */\r\n            PairTree.prototype.is_equals = function (left, right) {\r\n                return std.equal_to(left.first, right.first);\r\n            };\r\n            /**\r\n             * @inheritdoc\r\n             */\r\n            PairTree.prototype.is_less = function (left, right) {\r\n                return this.compare_(left.first, right.first);\r\n            };\r\n            return PairTree;\r\n        }(base.XTree));\r\n        base.PairTree = PairTree;\r\n    })(base = std.base || (std.base = {}));\r\n})(std || (std = {}));\r\n/// <reference path=\"HashBuckets.ts\" />\r\nvar std;\r\n(function (std) {\r\n    var base;\r\n    (function (base) {\r\n        var SetHashBuckets = (function (_super) {\r\n            __extends(SetHashBuckets, _super);\r\n            function SetHashBuckets(set) {\r\n                _super.call(this);\r\n                this.set = set;\r\n            }\r\n            SetHashBuckets.prototype.find = function (val) {\r\n                var index = base.code(val) % this.size();\r\n                var bucket = this.at(index);\r\n                for (var i = 0; i < bucket.size(); i++)\r\n                    if (std.equal_to(bucket.at(i).value, val))\r\n                        return bucket.at(i);\r\n                return this.set.end();\r\n            };\r\n            return SetHashBuckets;\r\n        }(base.HashBuckets));\r\n        base.SetHashBuckets = SetHashBuckets;\r\n    })(base = std.base || (std.base = {}));\r\n})(std || (std = {}));\r\nvar std;\r\n(function (std) {\r\n    var base;\r\n    (function (base) {\r\n        /**\r\n         * <p> A node in an XTree. </p>\r\n         *\r\n         * @param <T> Type of elements.\r\n         *\r\n         * @inventor Rudolf Bayer\r\n         * @author Migrated by Jeongho Nam <http://samchon.org>\r\n         */\r\n        var XTreeNode = (function () {\r\n            /* ---------------------------------------------------------\r\n                CONSTRUCTORS\r\n            --------------------------------------------------------- */\r\n            /**\r\n             * Construct from value and color of node.\r\n             *\r\n             * @param value Value to be stored in.\r\n             * @param color Color of the node, red or black.\r\n             */\r\n            function XTreeNode(value, color) {\r\n                this.value = value;\r\n                this.color = color;\r\n                this.parent = null;\r\n                this.left = null;\r\n                this.right = null;\r\n            }\r\n            Object.defineProperty(XTreeNode.prototype, \"grand_parent\", {\r\n                /**\r\n                 * Get grand-parent.\r\n                 */\r\n                get: function () {\r\n                    return this.parent.parent;\r\n                },\r\n                enumerable: true,\r\n                configurable: true\r\n            });\r\n            Object.defineProperty(XTreeNode.prototype, \"sibling\", {\r\n                /**\r\n                 * Get sibling, opposite side node in same parent.\r\n                 */\r\n                get: function () {\r\n                    if (this == this.parent.left)\r\n                        return this.parent.right;\r\n                    else\r\n                        return this.parent.left;\r\n                },\r\n                enumerable: true,\r\n                configurable: true\r\n            });\r\n            Object.defineProperty(XTreeNode.prototype, \"uncle\", {\r\n                /**\r\n                 * Get uncle, parent's sibling.\r\n                 */\r\n                get: function () {\r\n                    return this.parent.sibling;\r\n                },\r\n                enumerable: true,\r\n                configurable: true\r\n            });\r\n            return XTreeNode;\r\n        }());\r\n        base.XTreeNode = XTreeNode;\r\n    })(base = std.base || (std.base = {}));\r\n})(std || (std = {}));\r\n// Type definitions for STL (Standard Template Library) Containers v0.8\r\n// Project: https://github.com/samchon/stl\r\n// Definitions by: Jeongho Nam <http://samchon.org>\r\n// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped \r\n/*\r\n//////////////////////////////////////////////////\r\n// List of ambigious names for notation\r\n//////////////////////////////////////////////////\r\n// CLASSES\r\n// -----------------------------------------------\r\n    - vector\t\t\t\t\tVector\r\n    - deque\t\t\t\t\t\tDeque\r\n    - list\t\t\t\t\t\tList\r\n    - set\t\t\t\t\t\tSet\r\n    - map\t\t\t\t\t\tMap\r\n    - multiset\t\t\t\t\tMultiSet\r\n    - multimap\t\t\t\t\tMultiMap\r\n    - unordered_set\t\t\t\tHashSet\r\n    - unordered_map\t\t\t\tHashMap\r\n    - unordered_multiset\t\tHashMultiSet\r\n    - unordered_multimap\t\tHashMultiMap\r\n\r\n    - exception...\t\t\t\tException...\r\n    - error_code\t\t\t\tErrorCode\r\n    - error_condition\t\t\tErrorCondition\r\n    - system_error\t\t\t\tSystemError\r\n// -----------------------------------------------\r\n*/ \r\nvar std;\r\n(function (std) {\r\n    var example;\r\n    (function (example) {\r\n        function test_bind() {\r\n            var list = new std.List();\r\n            // <List>???.insert(...)\r\n            // list.insert(list.end(), 5, 1)\r\n            var fn = std.bind(std.List.prototype.insert);\r\n            fn(list, list.end(), 5, 1);\r\n            debug_list();\r\n            var fn2 = std.bind(std.List.prototype.clear);\r\n            fn2(list);\r\n            debug_list();\r\n            // <List>???.insert(_1, _2, 5, _3)\r\n            // list.insert(list.end(), 5, 2)\r\n            var fn3 = std.bind(list.insert, std.placeholders._1, std.placeholders._2, 5, std.placeholders._3);\r\n            fn3(list, list.end(), 2);\r\n            debug_list();\r\n            function debug_list() {\r\n                console.log(\"#\" + list.size());\r\n                for (var it = list.begin(); !it.equal_to(list.end()); it = it.next())\r\n                    console.log(it.value);\r\n                console.log(\"----------------------------------------------------------\");\r\n            }\r\n        }\r\n        example.test_bind = test_bind;\r\n    })(example = std.example || (std.example = {}));\r\n})(std || (std = {}));\r\nvar std;\r\n(function (std) {\r\n    var example;\r\n    (function (example) {\r\n        function test_deque() {\r\n            var deque = new std.Deque();\r\n            for (var i = 0; i < 10; i++)\r\n                deque.push_back(i);\r\n            var it = deque.begin().advance(3);\r\n            it = deque.erase(it); // erase 3\r\n            console.log(it.value); // print 4\r\n            it = deque.begin().advance(2);\r\n            it = deque.insert(it, -1); // insert -1\r\n            console.log(it.next().value); // print 2\r\n            it = deque.begin().advance(6);\r\n            it = deque.erase(it, it.advance(3)); // erase from 6 to 9\r\n            //console.log(it.value); // print 9\r\n            console.log(it.equal_to(deque.end()));\r\n            console.log(\"-------------------------------------\");\r\n            for (var it_1 = deque.begin(); !it_1.equal_to(deque.end()); it_1 = it_1.next())\r\n                console.log(it_1.value);\r\n        }\r\n        example.test_deque = test_deque;\r\n    })(example = std.example || (std.example = {}));\r\n})(std || (std = {}));\r\nvar std;\r\n(function (std) {\r\n    var example;\r\n    (function (example) {\r\n        function test_for_each() {\r\n            var array = new std.Vector();\r\n            for (var i = 0; i < 20; i++)\r\n                array.push_back(i);\r\n            var fn = std.for_each(array.begin(), array.end(), function (val) { console.log(val); });\r\n        }\r\n        example.test_for_each = test_for_each;\r\n    })(example = std.example || (std.example = {}));\r\n})(std || (std = {}));\r\nvar std;\r\n(function (std) {\r\n    var example;\r\n    (function (example) {\r\n        function test_hash_map() {\r\n            /////////////////////////////////////\r\n            // CONSTRUCT DATA FROM 1 TO 10\r\n            /////////////////////////////////////\r\n            var map = new std.HashMap();\r\n            for (var i = 0; i < 10; i++)\r\n                map.insert([i, \"Its key is \" + i]);\r\n            /////////////////////////////////////\r\n            //  ELEMENT I/O\r\n            /////////////////////////////////////\r\n            //// ERASE AN ELEMENT\r\n            var it = map.find(3); // find 3.\r\n            it = map.erase(it); // erase 3. [it] points key 4.\r\n            console.log(it.first); // prints key 4.\r\n            // INSERT AN ELEMENT\r\n            it = map.begin().advance(2); // [it] points key 2 (0 ----> 2)\r\n            it = map.insert(it, [-1, \"Its key is -1\"]);\r\n            // [it] points key -1=\r\n            // key list: [0, 1, -1, 2, 4, 5, 6, 7, 8, 9]\r\n            console.log(it.next().first); // prints 2, next of [it] (-1 -> 2)\r\n            // RANGE ERASER\r\n            var px = map.begin().advance(6);\r\n            var py = map.begin().advance(9);\r\n            it = map.erase(map.begin().advance(6), map.begin().advance(9));\r\n            // erase elements from 6th until 9th.\r\n            // INSPECT ELEMENTS BY THEIR KEY\r\n            // key list: [0, 1, -1, 2, 4, 5, 9]\r\n            console.log(\"has 7:\", map.has(7));\r\n            console.log(\"count 5:\", map.count(5));\r\n            console.log(\"it is end():\", it.equal_to(map.end()));\r\n            /////////////////////////////////////\r\n            // PRINT ALL ELEMENTS\r\n            /////////////////////////////////////\r\n            console.log(\"------------------------------\");\r\n            // key list: [0, 1, -1, 2, 4, 5, 9]\r\n            for (var it_2 = map.begin(); !it_2.equal_to(map.end()); it_2 = it_2.next())\r\n                console.log(it_2.second);\r\n            /* OUTPUT\r\n            =========================================\r\n                4\r\n                2\r\n                has 7: true\r\n                count 5: 1\r\n                it is end(): false\r\n                ------------------------------\r\n                Its key is 0\r\n                Its key is 1\r\n                Its key is -1\r\n                Its key is 2\r\n                Its key is 4\r\n                Its key is 5\r\n                Its key is 9\r\n            =========================================\r\n            */\r\n        }\r\n        example.test_hash_map = test_hash_map;\r\n    })(example = std.example || (std.example = {}));\r\n})(std || (std = {}));\r\nvar std;\r\n(function (std) {\r\n    var example;\r\n    (function (example) {\r\n        function test_list() {\r\n            var list = new std.List();\r\n            for (var i = 0; i < 10; i++)\r\n                list.push_back(i);\r\n            var it = list.begin().advance(3);\r\n            it = list.erase(it); // erase 3\r\n            console.log(it.value); // print 4\r\n            it = list.begin().advance(2);\r\n            it = list.insert(it, -1); // insert -1\r\n            console.log(it.next().value); // print 2\r\n            it = list.begin().advance(6);\r\n            it = list.erase(it, it.advance(3)); // erase from 6 to 9\r\n            //console.log(it.value); // print 9\r\n            console.log(it.equal_to(list.end()));\r\n            console.log(\"-------------------------------------\");\r\n            for (var it_3 = list.begin(); !it_3.equal_to(list.end()); it_3 = it_3.next())\r\n                console.log(it_3.value);\r\n        }\r\n        example.test_list = test_list;\r\n    })(example = std.example || (std.example = {}));\r\n})(std || (std = {}));\r\nvar std;\r\n(function (std) {\r\n    var example;\r\n    (function (example) {\r\n        function sorting() {\r\n            var cubes = new std.Deque();\r\n            for (var i = 0; i < 10; i++)\r\n                cubes.push_back(new Cube());\r\n            ///////////////////////////////\r\n            // SORT BY Cube.less()\r\n            ///////////////////////////////\r\n            std.sort(cubes.begin(), cubes.end());\r\n            for (var it = cubes.begin(); !it.equal_to(cubes.end()); it = it.next())\r\n                it.value.debug_size();\r\n            console.log(\"------------------------------\");\r\n            ///////////////////////////////\r\n            // SORT BY inline function\r\n            ///////////////////////////////\r\n            std.sort(cubes.begin(), cubes.end(), function (left, right) {\r\n                if (left.x != right.x)\r\n                    return left.x < right.x;\r\n                else if (left.y != right.y)\r\n                    return left.y < right.y;\r\n                else\r\n                    return left.z < right.z;\r\n            });\r\n            for (var it = cubes.begin(); !it.equal_to(cubes.end()); it = it.next())\r\n                it.value.debug_position();\r\n        }\r\n        example.sorting = sorting;\r\n        var Cube = (function () {\r\n            function Cube() {\r\n                this.width = Math.random() * 10;\r\n                this.height = Math.random() * 10;\r\n                this.length = Math.random() * 10;\r\n                this.x = Math.random() * 100 - 50;\r\n                this.y = Math.random() * 100 - 50;\r\n                this.z = Math.random() * 100 - 50;\r\n            }\r\n            Object.defineProperty(Cube.prototype, \"volume\", {\r\n                get: function () {\r\n                    return this.width * this.height * this.length;\r\n                },\r\n                enumerable: true,\r\n                configurable: true\r\n            });\r\n            Cube.prototype.less = function (obj) {\r\n                return this.volume < obj.volume;\r\n            };\r\n            Cube.prototype.debug_size = function () {\r\n                console.log(this.width, this.height, this.length + \" => \" + this.volume);\r\n            };\r\n            Cube.prototype.debug_position = function () {\r\n                console.log(this.x, this.y, this.z);\r\n            };\r\n            return Cube;\r\n        }());\r\n    })(example = std.example || (std.example = {}));\r\n})(std || (std = {}));\r\nvar std;\r\n(function (std) {\r\n    var example;\r\n    (function (example) {\r\n        function tree_set() {\r\n            var set = new std.TreeMultiSet();\r\n            // INSERTS EVEN NUMBERS\r\n            for (var i = 0; i <= 10; i += 2)\r\n                for (var j = 0; j < 3; j++)\r\n                    set.insert(i);\r\n            // FIND 4 -> HAS\r\n            console.log(\"Matched node: 4\");\r\n            console.log(\"\tlower bound: \" + set.lower_bound(4).value);\r\n            console.log(\"\tupper bound: \" + set.upper_bound(4).value);\r\n            console.log(\" \");\r\n            // FIND ODD NUMBERS -> NOT EXIST\r\n            for (var i = 1; i <= 10; i += 2) {\r\n                console.log(\"Mis-matched node: \" + i);\r\n                console.log(\"\tlower bound: \" + set.lower_bound(i).value);\r\n                console.log(\"\tupper bound: \" + set.upper_bound(i).value);\r\n                console.log(\" \");\r\n            }\r\n        }\r\n        example.tree_set = tree_set;\r\n    })(example = std.example || (std.example = {}));\r\n})(std || (std = {}));\r\nvar std;\r\n(function (std) {\r\n    /**\r\n     * Default hash function.\r\n     *\r\n     * @param obj\r\n     */\r\n    function hash(obj) {\r\n        return std.base.code(obj);\r\n    }\r\n    std.hash = hash;\r\n    /**\r\n     * Incremental sequence of unique id for objects.\r\n     */\r\n    var __s_iUID = 0;\r\n    Object.defineProperties(Object.prototype, {\r\n        \"__getUID\": {\r\n            value: function () {\r\n                if (this.hasOwnProperty(\"__m_iUID\") == false) {\r\n                    var uid = ++__s_iUID;\r\n                    Object.defineProperty(this, \"__m_iUID\", {\r\n                        \"get\": function () {\r\n                            return uid;\r\n                        }\r\n                    });\r\n                }\r\n                return this.__m_iUID;\r\n            }\r\n        }\r\n    });\r\n})(std || (std = {}));\r\nvar std;\r\n(function (std) {\r\n    /**\r\n     * <p> Priority queue. </p>\r\n     *\r\n     * <p> {@link PriorityQueue Priority queues} are a type of container adaptors, specifically designed such that its\r\n     * first element is always the greatest of the elements it contains, according to some <i>strict weak ordering</i>\r\n     * criterion. </p>\r\n     *\r\n     * <p> This context is similar to a <i>heap</i>, where elements can be inserted at any moment, and only the\r\n     * <i>max heap</i> element can be retrieved (the one at the top in the {@link PriorityQueue priority queue}). </p>\r\n     *\r\n     * <p> {@link PriorityQueue Priority queues} are implemented as <i>container adaptors</i>, which are classes that\r\n     * use an encapsulated object of a specific container class as its {@link container_ underlying container},\r\n     * providing a specific set of member functions to access its elements. Elements are popped from the <i>\"back\"</i>\r\n     * of the specific container, which is known as the <i>top</i> of the {@link PriorityQueue Priority queue}. </p>\r\n     *\r\n     * <p> The {@link container_ underlying container} may be any of the standard container class templates or some\r\n     * other specifically designed container class. The container shall be accessible through\r\n     * {@link IArrayIterator random access iterators} and support the following operations: </p>\r\n     *\r\n     * <ul>\r\n     *\t<li> empty() </li>\r\n     *\t<li> size() </li>\r\n     *\t<li> front() </li>\r\n     *\t<li> push_back() </li>\r\n     *\t<li> pop_back() </li>\r\n     * </ul>\r\n     *\r\n     * <p> The standard container classes {@link Vector} and {@link Deque} fulfill these requirements. By default, if\r\n     * no container class is specified for a particular {@link PriorityQueue} class instantiation, the standard\r\n     * container {@link Vector} is used. </p>\r\n     *\r\n     * <p> Support of {@link IArrayIterator random access iterators} is required to keep a heap structure internally\r\n     * at all times. This is done automatically by the container adaptor by automatically calling the algorithm\r\n     * functions <i>make_heap</i>, <i>push_heap</i> and <i>pop_heap</i> when needed. </p>\r\n     *\r\n     * @param <T> Type of the elements.\r\n     *\r\n     * @reference http://www.cplusplus.com/reference/queue/priority_queue/\r\n     * @author Jeongho Nam\r\n     */\r\n    var PriorityQueue = (function () {\r\n        function PriorityQueue() {\r\n            var args = [];\r\n            for (var _i = 0; _i < arguments.length; _i++) {\r\n                args[_i - 0] = arguments[_i];\r\n            }\r\n            // CONSTRUCT UNDERLYING CONTAINER WITH COMPARE\r\n            var compare;\r\n            if (args.length == 0 || args[args.length - 1] instanceof Function == false)\r\n                compare = std.greater;\r\n            else\r\n                compare = args[args.length - 1];\r\n            this.container_ = new std.TreeMultiSet(compare);\r\n            // OVERLOADINGS\r\n            if (args.length >= 1 && args[0] instanceof Array) {\r\n                this.construct_from_array(args[0]);\r\n            }\r\n            else if (args.length >= 1 && args[0] instanceof std.base.SetContainer) {\r\n                this.construct_from_container(args[0]);\r\n            }\r\n            else if (args.length >= 2 && args[0] instanceof std.SetIterator && args[1] instanceof std.SetIterator) {\r\n                this.construct_from_range(args[0], args[1]);\r\n            }\r\n        }\r\n        /**\r\n         * @hidden\r\n         */\r\n        PriorityQueue.prototype.construct_from_array = function (items) {\r\n            for (var i = 0; i < items.length; i++)\r\n                (_a = this.container_).push.apply(_a, items);\r\n            var _a;\r\n        };\r\n        /**\r\n         * @hidden\r\n         */\r\n        PriorityQueue.prototype.construct_from_container = function (container) {\r\n            this.construct_from_range(container.begin(), container.end());\r\n        };\r\n        /**\r\n         * @hidden\r\n         */\r\n        PriorityQueue.prototype.construct_from_range = function (begin, end) {\r\n            this.container_.assign(begin, end);\r\n        };\r\n        /* ---------------------------------------------------------\r\n            ACCESSORS\r\n        --------------------------------------------------------- */\r\n        /**\r\n         * <p> Return size. </p>\r\n         *\r\n         * <p> Returns the number of elements in the {@link PriorityQueue}. </p>\r\n         *\r\n         * <p> This member function effectively calls member {@link IArray.size size} of the\r\n         * {@link container_ underlying container} object. </p>\r\n         *\r\n         * @return The number of elements in the underlying\r\n         */\r\n        PriorityQueue.prototype.size = function () {\r\n            return this.container_.size();\r\n        };\r\n        /**\r\n         * <p> Test whether container is empty. </p>\r\n         *\r\n         * <p> Returns whether the {@link PriorityQueue} is empty: i.e. whether its {@link size} is zero. </p>\r\n         *\r\n         * <p> This member function effectively calls member {@link IARray.empty empty} of the\r\n         * {@link container_ underlying container} object. </p>\r\n         */\r\n        PriorityQueue.prototype.empty = function () {\r\n            return this.container_.empty();\r\n        };\r\n        /* ---------------------------------------------------------\r\n            ELEMENTS I/O\r\n        --------------------------------------------------------- */\r\n        /**\r\n         * <p> Access top element. </p>\r\n         *\r\n         * <p> Returns a constant reference to the top element in the {@link PriorityQueue}. </p>\r\n         *\r\n         * <p> The top element is the element that compares higher in the {@link PriorityQueue}, and the next that is\r\n         * removed from the container when {@link PriorityQueue.pop} is called. </p>\r\n         *\r\n         * <p> This member function effectively calls member {@link IArray.front front} of the\r\n         * {@link container_ underlying container} object. </p>\r\n         *\r\n         * @return A reference to the top element in the {@link PriorityQueue}.\r\n         */\r\n        PriorityQueue.prototype.top = function () {\r\n            return this.container_.begin().value;\r\n        };\r\n        /**\r\n         * <p> Insert element. </p>\r\n         *\r\n         * <p> Inserts a new element in the {@link PriorityQueue}. The content of this new element is initialized to\r\n         * <i>val</i>.\r\n         *\r\n         * <p> This member function effectively calls the member function {@link IArray.push_back push_back} of the\r\n         * {@link container_ underlying container} object, and then reorders it to its location in the heap by calling\r\n         * the <i>push_heap</i> algorithm on the range that includes all the elements of the  </p>\r\n         *\r\n         * @param val Value to which the inserted element is initialized.\r\n         */\r\n        PriorityQueue.prototype.push = function (val) {\r\n            this.container_.insert(val);\r\n        };\r\n        /**\r\n         * <p> Remove top element. </p>\r\n         *\r\n         * <p> Removes the element on top of the {@link PriorityQueue}, effectively reducing its {@link size} by one.\r\n         * The element removed is the one with the highest (or lowest) value. </p>\r\n         *\r\n         * <p> The value of this element can be retrieved before being popped by calling member\r\n         * {@link PriorityQueue.top}. </p>\r\n         *\r\n         * <p> This member function effectively calls the <i>pop_heap</i> algorithm to keep the heap property of\r\n         * {@link PriorityQueue PriorityQueues} and then calls the member function {@link IArray.pop_back pop_back} of\r\n         * the {@link container_ underlying container} object to remove the element. </p>\r\n         */\r\n        PriorityQueue.prototype.pop = function () {\r\n            this.container_.erase(this.container_.begin());\r\n        };\r\n        /**\r\n         * <p> Swap contents. </p>\r\n         *\r\n         * <p> Exchanges the contents of the container adaptor by those of <i>obj</i>, swapping both the\r\n         * {@link container_ underlying container} value and their comparison function using the corresponding\r\n         * {@link std.swap swap} non-member functions (unqualified). </p>\r\n         *\r\n         * <p> This member function has a <i>noexcept</i> specifier that matches the combined <i>noexcept</i> of the\r\n         * {@link IArray.swap swap} operations on the {@link container_ underlying container} and the comparison\r\n         * functions. </p>\r\n         *\r\n         * @param obj {@link PriorityQueue} container adaptor of the same type (i.e., instantiated with the same\r\n         *\t\t\t  template parameters, <b>T</b>). Sizes may differ.\r\n         */\r\n        PriorityQueue.prototype.swap = function (obj) {\r\n            this.container_.swap(obj.container_);\r\n        };\r\n        return PriorityQueue;\r\n    }());\r\n    std.PriorityQueue = PriorityQueue;\r\n})(std || (std = {}));\r\n/// <reference path=\"Exception.ts\" />\r\n/// <reference path=\"base/ErrorInstance.ts\" />\r\nvar std;\r\n(function (std) {\r\n    /**\r\n     * <p> System error exception. </p>\r\n     *\r\n     * <p> This class defines the type of objects thrown as exceptions to report conditions originating during\r\n     * runtime from the operating system or other low-level application program interfaces which have an\r\n     * associated {@link ErrorCode}. </p>\r\n     *\r\n     * <p> The class inherits from {@link RuntimeError}, to which it adds an {@link ErrorCode} as\r\n     * member code (and defines a specialized what member). </p>\r\n     *\r\n     * <ul>\r\n     *  <li> Reference: http://www.cplusplus.com/reference/system_error/system_error/\r\n     * </ul>\r\n     *\r\n     * @author Jeongho Nam <http://samchon.org>\r\n     */\r\n    var SystemError = (function (_super) {\r\n        __extends(SystemError, _super);\r\n        function SystemError() {\r\n            var args = [];\r\n            for (var _i = 0; _i < arguments.length; _i++) {\r\n                args[_i - 0] = arguments[_i];\r\n            }\r\n            _super.call(this, \"\");\r\n        }\r\n        /* ---------------------------------------------------------\r\n            ACCESSORS\r\n        --------------------------------------------------------- */\r\n        /**\r\n         * <p> Get error code. </p>\r\n         *\r\n         * <p> Returns the {@link ErrorCode} object associated with the exception. </p>\r\n         *\r\n         * <p> This value is either the {@link ErrorCode} passed to the construction or its equivalent\r\n         * (if constructed with a value and a {@link category}. </p>\r\n         *\r\n         * @return The {@link ErrorCode} associated with the object.\r\n         */\r\n        SystemError.prototype.code = function () {\r\n            return this.code_;\r\n        };\r\n        return SystemError;\r\n    }(std.RuntimeError));\r\n    std.SystemError = SystemError;\r\n    /**\r\n     * <p> Error category. </p>\r\n     *\r\n     * <p> This type serves as a base class for specific category types. </p>\r\n     *\r\n     * <p> Category types are used to identify the source of an error. They also define the relation between\r\n     * {@link ErrorCode} and {@link ErrorCondition}objects of its category, as well as the message set for {@link ErrorCode}\r\n     * objects.\r\n     *\r\n     * <p> Objects of these types have no distinct values and are not-copyable and not-assignable, and thus can only be\r\n     * passed by reference. As such, only one object of each of these types shall exist, each uniquely identifying its own\r\n     * category: all error codes and conditions of a same category shall return a reference to same object. </p>\r\n     *\r\n     * <ul>\r\n     *\t<li> Reference: http://www.cplusplus.com/reference/system_error/error_category/ </li>\r\n     * </ul>\r\n     *\r\n     * @author Jeongho Nam <http://samchon.org>\r\n     */\r\n    var ErrorCategory = (function () {\r\n        /* ---------------------------------------------------------\r\n            CONSTRUCTORS\r\n        --------------------------------------------------------- */\r\n        /**\r\n         * Default Constructor.\r\n         */\r\n        function ErrorCategory() {\r\n        }\r\n        /* ---------------------------------------------------------\r\n            OPERATORS\r\n        --------------------------------------------------------- */\r\n        /**\r\n         * <p> Default error condition. </p>\r\n         *\r\n         * <p> Returns the default {@link ErrorCondition}object of this category that is associated with the\r\n         * {@link ErrorCode} identified by a value of <i>val</i>. </p>\r\n         *\r\n         * <p> Its definition in the base class {@link ErrorCategory} returns the same as constructing an\r\n         * {@link ErrorCondition} object with:\r\n         *\r\n         * <p> <code>new ErrorCondition(val, *this);</code> </p>\r\n         *\r\n         * <p> As a virtual member function, this behavior can be overriden in derived classes. </p>\r\n         *\r\n         * <p> This function is called by the default definition of member {@link equivalent equivalent()}, which is used to\r\n         * compare {@link ErrorCondition error conditions} with error codes. </p>\r\n         *\r\n         * @param val A numerical value identifying an error condition.\r\n         *\r\n         * @return The default {@link ErrorCondition}object associated with condition value <i>val</i> for this category.\r\n         */\r\n        ErrorCategory.prototype.default_error_condition = function (val) {\r\n            return null;\r\n        };\r\n        ErrorCategory.prototype.equivalent = function () {\r\n            var args = [];\r\n            for (var _i = 0; _i < arguments.length; _i++) {\r\n                args[_i - 0] = arguments[_i];\r\n            }\r\n            if (args[1] instanceof ErrorCondition) {\r\n                var val_code = args[0];\r\n                var cond = args[1];\r\n                return std.equal_to(this.default_error_condition(val_code), cond);\r\n            }\r\n            else {\r\n                var code = args[0];\r\n                var valcond = args[1];\r\n                return std.equal_to(this, code.category()) && code.value() == valcond;\r\n            }\r\n        };\r\n        return ErrorCategory;\r\n    }());\r\n    std.ErrorCategory = ErrorCategory;\r\n    /**\r\n     * <p> Error condition. </p>\r\n     *\r\n     * <p> Objects of this type hold a condition {@link value} associated with a {@link category}. </p>\r\n     *\r\n     * <p> Objects of this type describe errors in a generic way so that they may be portable across different\r\n     * systems. This is in contrast with {@link ErrorCode} objects, that may contain system-specific\r\n     * information. </p>\r\n     *\r\n     * <p> Because {@link ErrorCondition}objects can be compared with error_code objects directly by using\r\n     * <code>relational operators</code>, {@link ErrorCondition}objects are generally used to check whether\r\n     * a particular {@link ErrorCode} obtained from the system matches a specific error condition no matter\r\n     * the system. </p>\r\n     *\r\n     * <p> The {@link ErrorCategory categories} associated with the {@link ErrorCondition} and the\r\n     * {@link ErrorCode} define the equivalences between them. </p>\r\n     *\r\n     * <ul>\r\n     *\t<li> Reference: http://www.cplusplus.com/reference/system_error/error_condition/ </li>\r\n     * </ul>\r\n     *\r\n     * @author Jeongho Nam <http://samchon.org>\r\n     */\r\n    var ErrorCondition = (function (_super) {\r\n        __extends(ErrorCondition, _super);\r\n        function ErrorCondition(val, category) {\r\n            if (val === void 0) { val = 0; }\r\n            if (category === void 0) { category = null; }\r\n            _super.call(this, val, category);\r\n        }\r\n        return ErrorCondition;\r\n    }(std.base.ErrorInstance));\r\n    std.ErrorCondition = ErrorCondition;\r\n    /**\r\n     * <p> Error code. </p>\r\n     *\r\n     * <p> Objects of this type hold an error code {@link value} associated with a {@link category}. </p>\r\n     *\r\n     * <p> The operating system and other low-level applications and libraries generate numerical error codes to\r\n     * represent possible results. These numerical values may carry essential information for a specific platform,\r\n     * but be non-portable from one platform to another. </p>\r\n     *\r\n     * <p> Objects of this class associate such numerical codes to {@link ErrorCategory error categories}, so that they\r\n     * can be interpreted when needed as more abstract (and portable) {@link ErrorCondition error conditions}. </p>\r\n     *\r\n     * <ul>\r\n     *\t<li> Reference: http://www.cplusplus.com/reference/system_error/error_code/ </li>\r\n     * </ul>\r\n     *\r\n     * @author Jeongho Nam <http://samchon.org>\r\n     */\r\n    var ErrorCode = (function (_super) {\r\n        __extends(ErrorCode, _super);\r\n        function ErrorCode(val, category) {\r\n            if (val === void 0) { val = 0; }\r\n            if (category === void 0) { category = null; }\r\n            _super.call(this, val, category);\r\n        }\r\n        return ErrorCode;\r\n    }(std.base.ErrorInstance));\r\n    std.ErrorCode = ErrorCode;\r\n})(std || (std = {}));\r\n"]}