diff --git a/.gitignore b/.gitignore index 2a8f4a97..3a6739eb 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,8 @@ # ====================================================== # CUSTOM IGNORE # ====================================================== +handbook/ +lib/ *.bat *.lnk \ No newline at end of file diff --git a/ts/src/std/API.ts b/ts/src/std/API.ts index c3f89dc8..b4a8a6e9 100644 --- a/ts/src/std/API.ts +++ b/ts/src/std/API.ts @@ -16,7 +16,6 @@ namespace std { } - /** * Base classes composing STL in background. * diff --git a/ts/src/std/Algorithm.ts b/ts/src/std/Algorithm.ts index bddf70d2..11f7943f 100644 --- a/ts/src/std/Algorithm.ts +++ b/ts/src/std/Algorithm.ts @@ -23,9 +23,9 @@ namespace std FOR_EACH --------------------------------------------------------- */ /** - *

Apply function to range.

+ * Apply function to range. * - *

Applies function fn to each of the elements in the range [first, last).

+ * Applies function fn to each of the elements in the range [first, last). * * @param first An {@link Iterator} to the initial position in a sequence. * @param last An {@link Iterator} to the final position in a sequence. The range used is [first, last), @@ -70,11 +70,11 @@ namespace std AGGREGATE CONDITIONS --------------------------------------------------------- */ /** - *

Test condition on all elements in range.

+ * Test condition on all elements in range. * - *

Returns true if pred returns true for all the elements in the range + * Returns true if pred returns true for all the elements in the range * [first, last) or if the range is {@link Container.empty empty}, and false otherwise. - *

+ * * * @param first An {@link Iterator} to the initial position in a sequence. * @param last An {@link Iterator} to the final position in a sequence. The range used is [first, last), @@ -98,13 +98,13 @@ namespace std } /** - *

Test if any element in range fulfills condition.

+ * Test if any element in range fulfills condition. * - *

Returns true if pred returns true for any of the elements in the range - * [first, last), and false otherwise.

+ * Returns true if pred returns true for any of the elements in the range + * [first, last), and false otherwise. * - *

If [first, last) is an {@link Container.empty empty} range, the function returns - * false.

+ * If [first, last) is an {@link Container.empty empty} range, the function returns + * false. * * @param first An {@link Iterator} to the initial position in a sequence. * @param last An {@link Iterator} to the final position in a sequence. The range used is [first, last), @@ -129,11 +129,10 @@ namespace std } /** - *

Test if no elements fulfill condition.

+ * Test if no elements fulfill condition. * - *

Returns true if pred returns false for all the elements in the range + * Returns true if pred returns false for all the elements in the range * [first, last) or if the range is {@link Container.empty empty}, and false otherwise. - *

* * @param first An {@link Iterator} to the initial position in a sequence. * @param last An {@link Iterator} to the final position in a sequence. The range used is [first, last), @@ -154,10 +153,10 @@ namespace std } /** - *

Test whether the elements in two ranges are equal.

+ * Test whether the elements in two ranges are equal. * - *

Compares the elements in the range [first1, last1) with those in the range beginning at - * first2, and returns true if all of the elements in both ranges match.

+ * Compares the elements in the range [first1, last1) with those in the range beginning at + * first2, and returns true if all of the elements in both ranges match. * * @param first1 An {@link Iterator} to the initial position of the first sequence. * @param last1 An {@link Iterator} to the final position in a sequence. The range used is @@ -173,10 +172,10 @@ namespace std (first1: InputIterator, last1: InputIterator, first2: Iterator): boolean; /** - *

Test whether the elements in two ranges are equal.

+ * Test whether the elements in two ranges are equal. * - *

Compares the elements in the range [first1, last1) with those in the range beginning at - * first2, and returns true if all of the elements in both ranges match.

+ * Compares the elements in the range [first1, last1) with those in the range beginning at + * first2, and returns true if all of the elements in both ranges match. * * @param first1 An {@link Iterator} to the initial position of the first sequence. * @param last1 An {@link Iterator} to the final position in a sequence. The range used is @@ -200,7 +199,7 @@ namespace std export function equal> ( first1: InputIterator, last1: InputIterator, first2: Iterator, - pred: (x: T, y: T) => boolean = std.equal_to + pred: (x: T, y: T) => boolean = equal_to ): boolean { while (!first1.equals(last1)) @@ -215,18 +214,18 @@ namespace std } /** - *

Lexicographical less-than comparison.

+ * Lexicographical less-than comparison. * - *

Returns true if the range [first1, last1) compares lexicographically less - * than the range [first2, last2).

+ * Returns true if the range [first1, last1) compares lexicographically less + * than the range [first2, last2). * - *

A lexicographical comparison is the kind of comparison generally used to sort words alphabetically in + * A lexicographical comparison is the kind of comparison generally used to sort words alphabetically in * dictionaries; It involves comparing sequentially the elements that have the same position in both ranges against * each other until one element is not equivalent to the other. The result of comparing these first non-matching - * elements is the result of the lexicographical comparison.

+ * elements is the result of the lexicographical comparison. * - *

If both sequences compare equal until one of them ends, the shorter sequence is lexicographically less - * than the longer one.

+ * If both sequences compare equal until one of them ends, the shorter sequence is lexicographically less + * than the longer one. * * @param first1 An {@link Iterator} to the initial position of the first sequence. * @param last1 An {@link Iterator} to the final position in a sequence. The range used is @@ -245,18 +244,18 @@ namespace std (first1: Iterator1, last1: Iterator1, first2: Iterator2, last2: Iterator2): boolean; /** - *

Lexicographical comparison.

+ * Lexicographical comparison. * - *

Returns true if the range [first1, last1) compares lexicographically - * relationship than the range [first2, last2).

+ * Returns true if the range [first1, last1) compares lexicographically + * relationship than the range [first2, last2). * - *

A lexicographical comparison is the kind of comparison generally used to sort words alphabetically in + * A lexicographical comparison is the kind of comparison generally used to sort words alphabetically in * dictionaries; It involves comparing sequentially the elements that have the same position in both ranges against * each other until one element is not equivalent to the other. The result of comparing these first non-matching - * elements is the result of the lexicographical comparison.

+ * elements is the result of the lexicographical comparison. * - *

If both sequences compare equal until one of them ends, the shorter sequence is lexicographically - * relationship than the longer one.

+ * If both sequences compare equal until one of them ends, the shorter sequence is lexicographically + * relationship than the longer one. * * @param first1 An {@link Iterator} to the initial position of the first sequence. * @param last1 An {@link Iterator} to the final position in a sequence. The range used is @@ -285,7 +284,7 @@ namespace std Iterator1 extends Iterator, Iterator2 extends Iterator> ( first1: Iterator1, last1: Iterator1, first2: Iterator2, last2: Iterator2, - compare: (x: T, y: T) => boolean = std.less + compare: (x: T, y: T) => boolean = less ): boolean { while (!first1.equals(last1)) @@ -299,19 +298,19 @@ namespace std first2 = first2.next() as Iterator2; } - return !std.equal_to(last2, last2.source().end()) && !std.equal_to(first2.value, last2.value); + return !equal_to(last2, last2.source().end()) && !equal_to(first2.value, last2.value); } /* --------------------------------------------------------- FINDERS --------------------------------------------------------- */ /** - *

Find value in range.

+ * Find value in range. * - *

Returns an iterator to the first element in the range [first, last) that compares equal to - * val. If no such element is found, the function returns last.

+ * Returns an iterator to the first element in the range [first, last) that compares equal to + * val. If no such element is found, the function returns last. * - *

The function uses {@link equal_to equal_to} to compare the individual elements to val.

+ * The function uses {@link equal_to equal_to} to compare the individual elements to val. * * @param first An {@link Iterator} to the initial position in a sequence. * @param last An {@link Iterator} to the final position in a sequence. The range used is [first, last), @@ -326,17 +325,17 @@ namespace std (first: InputIterator, last: InputIterator, val: T): InputIterator { for (let it = first; !it.equals(last); it = it.next() as InputIterator) - if (std.equal_to(it.value, val)) + if (equal_to(it.value, val)) return it; return last; } /** - *

Find element in range.

+ * Find element in range. * - *

Returns an iterator to the first element in the range [first, last) for which pred returns - * true. If no such element is found, the function returns last.

+ * Returns an iterator to the first element in the range [first, last) for which pred returns + * true. If no such element is found, the function returns last. * * @param first An {@link Iterator} to the initial position in a sequence. * @param last An {@link Iterator} to the final position in a sequence. The range used is [first, last), @@ -361,10 +360,10 @@ namespace std } /** - *

Find element in range.

+ * Find element in range. * - *

Returns an iterator to the first element in the range [first, last) for which pred returns - * true. If no such element is found, the function returns last.

+ * Returns an iterator to the first element in the range [first, last) for which pred returns + * true. If no such element is found, the function returns last. * * @param first An {@link Iterator} to the initial position in a sequence. * @param last An {@link Iterator} to the final position in a sequence. The range used is [first, last), @@ -388,18 +387,18 @@ namespace std } /** - *

Find last subsequence in range.

+ * Find last subsequence in range. * - *

Searches the range [first1, last1) for the last occurrence of the sequence defined by + * Searches the range [first1, last1) for the last occurrence of the sequence defined by * [first2, last2), and returns an {@link Iterator} to its first element, or last1,/i> if no - * occurrences are found.

+ * occurrences are found. * - *

The elements in both ranges are compared sequentially using {@link equal_to}: A subsequence of + * The elements in both ranges are compared sequentially using {@link equal_to}: A subsequence of * [first1, last1) is considered a match only when this is true for all the elements of - * [first2, last2).

+ * [first2, last2). * - *

This function returns the last of such occurrences. For an algorithm that returns the first instead, see - * {@link search}.

+ * This function returns the last of such occurrences. For an algorithm that returns the first instead, see + * {@link search}. * * @param first1 An {@link Iterator} to the initial position of the first sequence. * @param last1 An {@link Iterator} to the final position in a sequence. The range used is @@ -421,18 +420,18 @@ namespace std (first1: Iterator1, last1: Iterator1, first2: Iterator2, last2: Iterator2): Iterator1; /** - *

Find last subsequence in range.

+ * Find last subsequence in range. * - *

Searches the range [first1, last1) for the last occurrence of the sequence defined by + * Searches the range [first1, last1) for the last occurrence of the sequence defined by * [first2, last2), and returns an {@link Iterator} to its first element, or last1,/i> if no - * occurrences are found.

+ * occurrences are found. * - *

The elements in both ranges are compared sequentially using pred: A subsequence of + * The elements in both ranges are compared sequentially using pred: A subsequence of * [first1, last1) is considered a match only when this is true for all the elements of - * [first2, last2).

+ * [first2, last2). * - *

This function returns the last of such occurrences. For an algorithm that returns the first instead, see - * {@link search}.

+ * This function returns the last of such occurrences. For an algorithm that returns the first instead, see + * {@link search}. * * @param first1 An {@link Iterator} to the initial position of the first sequence. * @param last1 An {@link Iterator} to the final position in a sequence. The range used is @@ -460,7 +459,7 @@ namespace std , Iterator2 extends Iterator> ( first1: Iterator1, last1: Iterator1, first2: Iterator2, last2: Iterator2, - compare: (x: T, y: T) => boolean = std.equal_to + compare: (x: T, y: T) => boolean = equal_to ): Iterator1 { if (first2.equals(last2)) @@ -473,7 +472,7 @@ namespace std let it1: Iterator1 = first1; let it2: Iterator2 = first2; - while (std.equal_to(it1.value, it2.value)) + while (equal_to(it1.value, it2.value)) { it1 = it1.next() as Iterator1; it2 = it2.next() as Iterator2; @@ -491,13 +490,13 @@ namespace std } /** - *

Find element from set in range.

+ * Find element from set in range. * - *

Returns an iterator to the first element in the range [first1, last1) that matches any of the - * elements in [first2, last2). If no such element is found, the function returns last1.

+ * Returns an iterator to the first element in the range [first1, last1) that matches any of the + * elements in [first2, last2). If no such element is found, the function returns last1. * - *

The elements in [first1, last1) are sequentially compared to each of the values in - * [first2, last2) using {@link equal_to}, until a pair matches.

+ * The elements in [first1, last1) are sequentially compared to each of the values in + * [first2, last2) using {@link equal_to}, until a pair matches. * * @param first1 An {@link Iterator} to the initial position of the first sequence. * @param last1 An {@link Iterator} to the final position in a sequence. The range used is @@ -515,13 +514,13 @@ namespace std (first1: Iterator1, last1: Iterator1, first2: Iterator2, last2: Iterator2): Iterator1; /** - *

Find element from set in range.

+ * Find element from set in range. * - *

Returns an iterator to the first element in the range [first1, last1) that matches any of the - * elements in [first2, last2). If no such element is found, the function returns last1.

+ * Returns an iterator to the first element in the range [first1, last1) that matches any of the + * elements in [first2, last2). If no such element is found, the function returns last1. * - *

The elements in [first1, last1) are sequentially compared to each of the values in - * [first2, last2) using pred, until a pair matches.

+ * The elements in [first1, last1) are sequentially compared to each of the values in + * [first2, last2) using pred, until a pair matches. * * @param first1 An {@link Iterator} to the initial position of the first sequence. * @param last1 An {@link Iterator} to the final position in a sequence. The range used is @@ -548,7 +547,7 @@ namespace std , Iterator2 extends Iterator> ( first1: Iterator1, last1: Iterator1, first2: Iterator2, last2: Iterator2, - pred: (x: T, y: T) => boolean = std.equal_to + pred: (x: T, y: T) => boolean = equal_to ): Iterator1 { for (; !first1.equals(last1); first1 = first1.next() as Iterator1) @@ -560,12 +559,12 @@ namespace std } /** - *

Find equal adjacent elements in range.

+ * Find equal adjacent elements in range. * - *

Searches the range [first, last) for the first occurrence of two consecutive elements that match, - * and returns an {@link Iterator} to the first of these two elements, or last if no such pair is found.

+ * Searches the range [first, last) for the first occurrence of two consecutive elements that match, + * and returns an {@link Iterator} to the first of these two elements, or last if no such pair is found. * - *

Two elements match if they compare equal using {@link equal_to}.

+ * Two elements match if they compare equal using {@link equal_to}. * * @param first An {@link Iterator} to the initial position in a sequence. * @param last An {@link Iterator} to the final position in a sequence. The range used is [first, last), @@ -579,12 +578,12 @@ namespace std (first: InputIterator, last: InputIterator): InputIterator; /** - *

Find equal adjacent elements in range.

+ * Find equal adjacent elements in range. * - *

Searches the range [first, last) for the first occurrence of two consecutive elements that match, - * and returns an {@link Iterator} to the first of these two elements, or last if no such pair is found.

+ * Searches the range [first, last) for the first occurrence of two consecutive elements that match, + * and returns an {@link Iterator} to the first of these two elements, or last if no such pair is found. * - *

Two elements match if they compare equal using pred.

+ * Two elements match if they compare equal using pred. * * @param first An {@link Iterator} to the initial position in a sequence. * @param last An {@link Iterator} to the final position in a sequence. The range used is [first, last), @@ -601,7 +600,7 @@ namespace std (first: InputIterator, last: InputIterator, pred: (x: T, y: T) => boolean): InputIterator; export function adjacent_find> - (first: InputIterator, last: InputIterator, pred: (x: T, y: T) => boolean = std.equal_to): InputIterator + (first: InputIterator, last: InputIterator, pred: (x: T, y: T) => boolean = equal_to): InputIterator { if (!first.equals(last)) { @@ -609,7 +608,7 @@ namespace std while (!next.equals(last)) { - if (std.equal_to(first.value, last.value)) + if (equal_to(first.value, last.value)) return first; first = first.next() as InputIterator; @@ -620,18 +619,18 @@ namespace std } /** - *

Search range for subsequence.

+ * Search range for subsequence. * - *

Searches the range [first1, last1) for the first occurrence of the sequence defined by + * Searches the range [first1, last1) for the first occurrence of the sequence defined by * [first2, last2), and returns an iterator to its first element, or last1 if no occurrences are - * found.

+ * found. * - *

The elements in both ranges are compared sequentially using {@link equal_to}: A subsequence of + * The elements in both ranges are compared sequentially using {@link equal_to}: A subsequence of * [first1, last1) is considered a match only when this is true for all the elements of - * [first2, last2).

+ * [first2, last2). * - *

This function returns the first of such occurrences. For an algorithm that returns the last instead, see - * {@link find_end}.

+ * This function returns the first of such occurrences. For an algorithm that returns the last instead, see + * {@link find_end}. * * @param first1 {@link Iterator Forward iterator} to the initial position of the searched sequence. * @param last1 {@link Iterator Forward iterator} to the final position of the searched sequence. The range used is @@ -649,18 +648,18 @@ namespace std (first1: ForwardIterator1, last1: ForwardIterator1, first2: ForwardIterator2, last2: ForwardIterator2): ForwardIterator1 /** - *

Search range for subsequence.

+ * Search range for subsequence. * - *

Searches the range [first1, last1) for the first occurrence of the sequence defined by + * Searches the range [first1, last1) for the first occurrence of the sequence defined by * [first2, last2), and returns an iterator to its first element, or last1 if no occurrences are - * found.

+ * found. * - *

The elements in both ranges are compared sequentially using pred: A subsequence of + * The elements in both ranges are compared sequentially using pred: A subsequence of * [first1, last1) is considered a match only when this is true for all the elements of - * [first2, last2).

+ * [first2, last2). * - *

This function returns the first of such occurrences. For an algorithm that returns the last instead, see - * {@link find_end}.

+ * This function returns the first of such occurrences. For an algorithm that returns the last instead, see + * {@link find_end}. * * @param first1 {@link Iterator Forward iterator} to the initial position of the searched sequence. * @param last1 {@link Iterator Forward iterator} to the final position of the searched sequence. The range used is @@ -687,7 +686,7 @@ namespace std export function search, ForwardIterator2 extends Iterator> ( first1: ForwardIterator1, last1: ForwardIterator1, first2: ForwardIterator2, last2: ForwardIterator2, - pred: (x: T, y: T) => boolean = std.equal_to + pred: (x: T, y: T) => boolean = equal_to ): ForwardIterator1 { if (first2.equals(last2)) @@ -698,7 +697,7 @@ namespace std let it1: ForwardIterator1 = first1; let it2: ForwardIterator2 = first2; - while (std.equal_to(it1.value, it2.value)) + while (equal_to(it1.value, it2.value)) { it1 = it1.next() as ForwardIterator1; it2 = it2.next() as ForwardIterator2; @@ -713,13 +712,12 @@ namespace std } /** - *

Search range for elements.

+ * Search range for elements. * - *

Searches the range [first, last) for a sequence of count elements, each comparing equal to - * val.

+ * Searches the range [first, last) for a sequence of count elements, each comparing equal to + * val. * - *

The function returns an iterator to the first of such elements, or last if no such sequence is found. - *

+ * The function returns an iterator to the first of such elements, or last if no such sequence is found. * * @param first {@link Iterator Forward iterator} to the initial position of the searched sequence. * @param last {@link Iterator Forward iterator} to the final position of the searched sequence. The range used is @@ -735,13 +733,13 @@ namespace std (first: ForwardIterator, last: ForwardIterator, count: number, val: T): ForwardIterator; /** - *

Search range for elements.

+ * Search range for elements. * - *

Searches the range [first, last) for a sequence of count elements, each comparing equal to - * val.

+ * Searches the range [first, last) for a sequence of count elements, each comparing equal to + * val. * - *

The function returns an iterator to the first of such elements, or last if no such sequence is found. - *

+ * The function returns an iterator to the first of such elements, or last if no such sequence is found. + * * * @param first {@link Iterator Forward iterator} to the initial position of the searched sequence. * @param last {@link Iterator Forward iterator} to the final position of the searched sequence. The range used is @@ -766,7 +764,7 @@ namespace std export function search_n> ( first: ForwardIterator, last: ForwardIterator, count: number, val: T, - pred: (x: T, y: T) => boolean = std.equal_to + pred: (x: T, y: T) => boolean = equal_to ): ForwardIterator { let limit: ForwardIterator = first.advance(distance(first, last) - count) as ForwardIterator; @@ -776,7 +774,7 @@ namespace std let it: ForwardIterator = first; let i: number = 0; - while (std.equal_to(it.value, val)) + while (equal_to(it.value, val)) { it = it.next() as ForwardIterator; @@ -788,13 +786,13 @@ namespace std } /** - *

Return first position where two ranges differ.

+ * Return first position where two ranges differ. * - *

Compares the elements in the range [first1, last1) with those in the range beginning at - * first2, and returns the first element of both sequences that does not match.

+ * Compares the elements in the range [first1, last1) with those in the range beginning at + * first2, and returns the first element of both sequences that does not match. * - *

The function returns a {@link Pair} of {@link iterators Iterator} to the first element in each range that - * does not match.

+ * The function returns a {@link Pair} of {@link iterators Iterator} to the first element in each range that + * does not match. * * @param first1 An {@link Iterator} to the initial position of the first sequence. * @param last1 An {@link Iterator} to the final position in a sequence. The range used is @@ -814,13 +812,13 @@ namespace std (first1: Iterator1, last1: Iterator1, first2: Iterator2): Pair; /** - *

Return first position where two ranges differ.

+ * Return first position where two ranges differ. * - *

Compares the elements in the range [first1, last1) with those in the range beginning at - * first2, and returns the first element of both sequences that does not match.

+ * Compares the elements in the range [first1, last1) with those in the range beginning at + * first2, and returns the first element of both sequences that does not match. * - *

The function returns a {@link Pair} of {@link iterators Iterator} to the first element in each range that - * does not match.

+ * The function returns a {@link Pair} of {@link iterators Iterator} to the first element in each range that + * does not match. * * @param first1 An {@link Iterator} to the initial position of the first sequence. * @param last1 An {@link Iterator} to the final position in a sequence. The range used is @@ -849,11 +847,11 @@ namespace std , Iterator2 extends Iterator> ( first1: Iterator1, last1: Iterator1, first2: Iterator2, - compare: (x: T, y: T) => boolean = std.equal_to + compare: (x: T, y: T) => boolean = equal_to ): Pair { while (!first1.equals(last1) && !first2.equals(first2.source().end()) - && std.equal_to(first1.value, first2.value)) + && equal_to(first1.value, first2.value)) { first1 = first1.next() as Iterator1; first2 = first2.next() as Iterator2; @@ -865,11 +863,11 @@ namespace std COUNTERS --------------------------------------------------------- */ /** - *

Count appearances of value in range.

+ * Count appearances of value in range. * - *

Returns the number of elements in the range [first, last) that compare equal to val.

+ * Returns the number of elements in the range [first, last) that compare equal to val. * - *

The function uses {@link equal_to} to compare the individual elements to val.

+ * The function uses {@link equal_to} to compare the individual elements to val. * * @param first An {@link Iterator} to the initial position in a sequence. * @param last An {@link Iterator} to the final position in a sequence. The range used is [first, last), @@ -885,17 +883,16 @@ namespace std let cnt: number = 0; for (let it = first; !it.equals(last); it = it.next() as InputIterator) - if (std.equal_to(it.value, val)) + if (equal_to(it.value, val)) cnt++; return cnt; } /** - *

Return number of elements in range satisfying condition.

+ * Return number of elements in range satisfying condition. * - *

Returns the number of elements in the range [first, last) for which pred is true. - *

+ * Returns the number of elements in the range [first, last) for which pred is true. * * @param first An {@link Iterator} to the initial position in a sequence. * @param last An {@link Iterator} to the final position in a sequence. The range used is [first, last), @@ -931,15 +928,15 @@ namespace std FILL --------------------------------------------------------- */ /** - *

Copy range of elements.

+ * Copy range of elements. * - *

Copies the elements in the range [first, last) into the range beginning at result.

+ * Copies the elements in the range [first, last) into the range beginning at result. * - *

The function returns an iterator to the end of the destination range (which points to the element following the - * last element copied).

+ * The function returns an iterator to the end of the destination range (which points to the element following the + * last element copied). * - *

The ranges shall not overlap in such a way that result points to an element in the range - * [first, last). For such cases, see {@link copy_backward}.

+ * The ranges shall not overlap in such a way that result points to an element in the range + * [first, last). For such cases, see {@link copy_backward}. * * @param first {@link Iterator Input iterator} to the initial position in a sequence to be copied. * @param last {@link Iterator Input iterator} to the initial position in a sequence to be copied. The range used is @@ -963,18 +960,17 @@ namespace std } /** - *

Copy elements.

+ * Copy elements. * - *

Copies the first n elements from the range beginning at first into the range beginning at - * result.

+ * Copies the first n elements from the range beginning at first into the range beginning at + * result. * - *

The function returns an iterator to the end of the destination range (which points to one past the last element - * copied).

+ * The function returns an iterator to the end of the destination range (which points to one past the last element + * copied). * - *

If n is negative, the function does nothing.

+ * If n is negative, the function does nothing. * - *

If the ranges overlap, some of the elements in the range pointed by result may have undefined but valid values. - *

+ * If the ranges overlap, some of the elements in the range pointed by result may have undefined but valid values. * * @param first {@link Iterator Input iterator} to the initial position in a sequence of at least n elements to * be copied. InputIterator shall point to a type assignable to the elements pointed by @@ -1000,10 +996,10 @@ namespace std } /** - *

Copy certain elements of range.

+ * Copy certain elements of range. * - *

Copies the elements in the range [first, last) for which pred returns true to the - * range beginning at result.

+ * Copies the elements in the range [first, last) for which pred returns true to the + * range beginning at result. * * @param first {@link Iterator Input iterator} to the initial position in a sequence to be copied. * @param last {@link Iterator Input iterator} to the initial position in a sequence to be copied. The range used is @@ -1033,21 +1029,21 @@ namespace std } /** - *

Copy range of elements backward.

+ * Copy range of elements backward. * - *

Copies the elements in the range [first, last) starting from the end into the range terminating - * at result.

+ * Copies the elements in the range [first, last) starting from the end into the range terminating + * at result. * - *

The function returns an iterator to the first element in the destination range.

+ * The function returns an iterator to the first element in the destination range. * - *

The resulting range has the elements in the exact same order as [first, last). To reverse their - * order, see {@link reverse_copy}.

+ * The resulting range has the elements in the exact same order as [first, last). To reverse their + * order, see {@link reverse_copy}. * - *

The function begins by copying *(last-1) into *(result-1), and then follows backward - * by the elements preceding these, until first is reached (and including it).

+ * The function begins by copying *(last-1) into *(result-1), and then follows backward + * by the elements preceding these, until first is reached (and including it). * - *

The ranges shall not overlap in such a way that result (which is the past-the-end element in the - * destination range) points to an element in the range (first,last]. For such cases, see {@link copy}.

+ * The ranges shall not overlap in such a way that result (which is the past-the-end element in the + * destination range) points to an element in the range (first,last]. For such cases, see {@link copy}. * * @param first {@link Iterator Bidirectional iterator} to the initial position in a sequence to be copied. * @param last {@link Iterator Bidirectional iterator} to the initial position in a sequence to be copied. The range @@ -1073,9 +1069,9 @@ namespace std } /** - *

Fill range with value.

+ * Fill range with value. * - *

Assigns val to all the elements in the range [first, last).

+ * Assigns val to all the elements in the range [first, last). * * @param first {@link Iterator Forward iterator} to the initial position in a sequence of elements that support being * assigned a value of type T. @@ -1093,9 +1089,9 @@ namespace std } /** - *

Fill sequence with value.

+ * Fill sequence with value. * - *

Assigns val to the first n elements of the sequence pointed by first.

+ * Assigns val to the first n elements of the sequence pointed by first. * * @param first {@link Iterator Output iterator} to the initial position in a sequence of elements that support being * assigned a value of type T. @@ -1116,10 +1112,10 @@ namespace std } /** - *

Transform range.

+ * Transform range. * - *

Applies op to each of the elements in the range [first, last) and stores the value returned - * by each operation in the range that begins at result.

+ * Applies op to each of the elements in the range [first, last) and stores the value returned + * by each operation in the range that begins at result. * * @param first {@link Iterator Input iterator} to the initial position in a sequence to be transformed. * @param last {@link Iterator Input iterator} to the initial position in a sequence to be transformed. The range @@ -1136,11 +1132,11 @@ namespace std (first: InputIterator, last: InputIterator, result: OutputIterator, op: (val: T) => T): OutputIterator; /** - *

Transform range.

+ * Transform range. * - *

Calls binary_op using each of the elements in the range [first1, last1) as first argument, + * Calls binary_op using each of the elements in the range [first1, last1) as first argument, * and the respective argument in the range that begins at first2 as second argument. The value returned by - * each call is stored in the range that begins at result.

+ * each call is stored in the range that begins at result. * * @param first1 {@link Iterator Input iterator} to the initial position of the first sequence. * @param last1 {@link Iterator Input iterator} to the final position of the first sequence. The range used is @@ -1211,10 +1207,9 @@ namespace std } /** - *

Generate values for range with function.

+ * Generate values for range with function. * - *

Assigns the value returned by successive calls to gen to the elements in the range [first, last). - *

+ * Assigns the value returned by successive calls to gen to the elements in the range [first, last). * * @param first {@link Iterator Forward iterator} to the initial position in a sequence. * @param last {@link Iterator Forward iterator} to the final position in a sequence. The range affected is @@ -1231,10 +1226,10 @@ namespace std } /** - *

Generate values for sequence with function.

+ * Generate values for sequence with function. * - *

Assigns the value returned by successive calls to gen to the first n elements of the sequence - * pointed by first.

+ * Assigns the value returned by successive calls to gen to the first n elements of the sequence + * pointed by first. * * @param first {@link Iterator Output iterator} to the initial position in a sequence of at least n elements * that support being assigned a value of the type returned by gen. @@ -1259,18 +1254,18 @@ namespace std REMOVE --------------------------------------------------------- */ /** - *

Remove consecutive duplicates in range.

+ * Remove consecutive duplicates in range. * - *

Removes all but the first element from every consecutive group of equivalent elements in the range - * [first, last).

+ * Removes all but the first element from every consecutive group of equivalent elements in the range + * [first, last). * - *

The function cannot alter the properties of the object containing the range of elements (i.e., it cannot + * The function cannot alter the properties of the object containing the range of elements (i.e., it cannot * alter the size of an array or a container): The removal is done by replacing the duplicate elements by the next * element that is not a duplicate, and signaling the new size of the shortened range by returning an iterator to - * the element that should be considered its new past-the-last element.

+ * the element that should be considered its new past-the-last element. * - *

The relative order of the elements not removed is preserved, while the elements between the returned - * iterator and last are left in a valid but unspecified state.

+ * The relative order of the elements not removed is preserved, while the elements between the returned + * iterator and last are left in a valid but unspecified state. * * @param first An {@link Iterator} to the initial position in a sequence. * @param last An {@link Iterator} to the final position in a sequence. The range used is [first, last), @@ -1284,18 +1279,18 @@ namespace std (first: InputIterator, last: InputIterator): InputIterator; /** - *

Remove consecutive duplicates in range.

+ * Remove consecutive duplicates in range. * - *

Removes all but the first element from every consecutive group of equivalent elements in the range - * [first, last).

+ * Removes all but the first element from every consecutive group of equivalent elements in the range + * [first, last). * - *

The function cannot alter the properties of the object containing the range of elements (i.e., it cannot + * The function cannot alter the properties of the object containing the range of elements (i.e., it cannot * alter the size of an array or a container): The removal is done by replacing the duplicate elements by the next * element that is not a duplicate, and signaling the new size of the shortened range by returning an iterator to - * the element that should be considered its new past-the-last element.

+ * the element that should be considered its new past-the-last element. * - *

The relative order of the elements not removed is preserved, while the elements between the returned - * iterator and last are left in a valid but unspecified state.

+ * The relative order of the elements not removed is preserved, while the elements between the returned + * iterator and last are left in a valid but unspecified state. * * @param first An {@link Iterator} to the initial position in a sequence. * @param last An {@link Iterator} to the final position in a sequence. The range used is [first, last), @@ -1313,13 +1308,13 @@ namespace std (first: InputIterator, last: InputIterator, pred: (left: t, right: t) => boolean): InputIterator; export function unique> - (first: InputIterator, last: InputIterator, pred: (left: t, right: t) => boolean = std.equal_to): InputIterator + (first: InputIterator, last: InputIterator, pred: (left: t, right: t) => boolean = equal_to): InputIterator { let ret: InputIterator = first; for (let it = first.next(); !it.equals(last);) { - if (std.equal_to(it.value, it.prev().value) == true) + if (equal_to(it.value, it.prev().value) == true) it = it.source().erase(it) as InputIterator; else { @@ -1331,15 +1326,15 @@ namespace std } /** - *

Copy range removing duplicates.

+ * Copy range removing duplicates. * - *

Copies the elements in the range [first, last) to the range beginning at result, except - * consecutive duplicates (elements that compare equal to the element preceding).

+ * Copies the elements in the range [first, last) to the range beginning at result, except + * consecutive duplicates (elements that compare equal to the element preceding). * - *

Only the first element from every consecutive group of equivalent elements in the range - * [first, last) is copied.

+ * Only the first element from every consecutive group of equivalent elements in the range + * [first, last) is copied. * - *

The comparison between elements is performed by applying {@lnk equal_to}.

+ * The comparison between elements is performed by applying {@lnk equal_to}. * * @param first {@link Iterator Forward iterator} to the initial position in a sequence. * @param last {@link Iterator Forward iterator} to the final position in a sequence. The range used is @@ -1355,15 +1350,15 @@ namespace std (first: InputIterator, last: InputIterator, result: OutputIterator): OutputIterator; /** - *

Copy range removing duplicates.

+ * Copy range removing duplicates. * - *

Copies the elements in the range [first, last) to the range beginning at result, except - * consecutive duplicates (elements that compare equal to the element preceding).

+ * Copies the elements in the range [first, last) to the range beginning at result, except + * consecutive duplicates (elements that compare equal to the element preceding). * - *

Only the first element from every consecutive group of equivalent elements in the range - * [first, last) is copied.

+ * Only the first element from every consecutive group of equivalent elements in the range + * [first, last) is copied. * - *

The comparison between elements is performed by applying pred.

+ * The comparison between elements is performed by applying pred. * * @param first {@link Iterator Forward iterator} to the initial position in a sequence. * @param last {@link Iterator Forward iterator} to the final position in a sequence. The range used is @@ -1388,7 +1383,7 @@ namespace std export function unique_copy, OutputIterator extends base.ILinearIterator> ( first: InputIterator, last: InputIterator, result: OutputIterator, - pred: (x: T, y: T) => boolean = std.equal_to + pred: (x: T, y: T) => boolean = equal_to ): OutputIterator { if (first.equals(last)) @@ -1408,18 +1403,18 @@ namespace std } /** - *

Remove value from range.

+ * Remove value from range. * - *

Transforms the range [first, last) into a range with all the elements that compare equal to - * val removed, and returns an iterator to the new last of that range.

+ * Transforms the range [first, last) into a range with all the elements that compare equal to + * val removed, and returns an iterator to the new last of that range. * - *

The function cannot alter the properties of the object containing the range of elements (i.e., it cannot alter + * The function cannot alter the properties of the object containing the range of elements (i.e., it cannot alter * the size of an array or a container): The removal is done by replacing the elements that compare equal to * val by the next element that does not, and signaling the new size of the shortened range by returning an - * iterator to the element that should be considered its new past-the-last element.

+ * iterator to the element that should be considered its new past-the-last element. * - *

The relative order of the elements not removed is preserved, while the elements between the returned iterator - * and last are left in a valid but unspecified state.

+ * The relative order of the elements not removed is preserved, while the elements between the returned iterator + * and last are left in a valid but unspecified state. * * @param first An {@link Iterator} to the initial position in a sequence. * @param last An {@link Iterator} to the final position in a sequence. The range used is [first, last), @@ -1434,7 +1429,7 @@ namespace std for (let it = first; !it.equals(last); ) { - if (std.equal_to(it.value, val) == true) + if (equal_to(it.value, val) == true) it = it.source().erase(it) as InputIterator; else { @@ -1446,18 +1441,18 @@ namespace std } /** - *

Remove elements from range.

+ * Remove elements from range. * - *

Transforms the range [first, last) into a range with all the elements for which pred returns - * true removed, and returns an iterator to the new last of that range.

+ * Transforms the range [first, last) into a range with all the elements for which pred returns + * true removed, and returns an iterator to the new last of that range. * - *

The function cannot alter the properties of the object containing the range of elements (i.e., it cannot + * The function cannot alter the properties of the object containing the range of elements (i.e., it cannot * alter the size of an array or a container): The removal is done by replacing the elements for which pred returns * true by the next element for which it does not, and signaling the new size of the shortened range - * by returning an iterator to the element that should be considered its new past-the-last element.

+ * by returning an iterator to the element that should be considered its new past-the-last element. * - *

The relative order of the elements not removed is preserved, while the elements between the returned - * iterator and last are left in a valid but unspecified state.

+ * The relative order of the elements not removed is preserved, while the elements between the returned + * iterator and last are left in a valid but unspecified state. * * @param first An {@link Iterator} to the initial position in a sequence. * @param last An {@link Iterator} to the final position in a sequence. The range used is [first, last), @@ -1486,15 +1481,15 @@ namespace std } /** - *

Copy range removing value.

+ * Copy range removing value. * - *

Copies the elements in the range [first, last) to the range beginning at result, except - * those elements that compare equal to val.

+ * Copies the elements in the range [first, last) to the range beginning at result, except + * those elements that compare equal to val. * - *

The resulting range is shorter than [first, last) by as many elements as matches in the sequence, - * which are "removed".

+ * The resulting range is shorter than [first, last) by as many elements as matches in the sequence, + * which are "removed". * - *

The function uses {@link equal_to} to compare the individual elements to val.

+ * The function uses {@link equal_to} to compare the individual elements to val. * * @param first {@link Iterator InputIterator} to the initial position in a sequence. * @param last {@link Iterator InputIterator} to the final position in a sequence. The range used is @@ -1513,7 +1508,7 @@ namespace std { for (; !first.equals(last); first = first.next() as InputIterator) { - if (std.equal_to(first.value, val)) + if (equal_to(first.value, val)) continue; result.value = first.value; @@ -1524,13 +1519,13 @@ namespace std } /** - *

Copy range removing values.

+ * Copy range removing values. * - *

Copies the elements in the range [first, last) to the range beginning at result, except - * those elements for which pred returns true.

+ * Copies the elements in the range [first, last) to the range beginning at result, except + * those elements for which pred returns true. * - *

The resulting range is shorter than [first, last) by as many elements as matches, which are - * "removed".

+ * The resulting range is shorter than [first, last) by as many elements as matches, which are + * "removed". * * @param first {@link Iterator InputIterator} to the initial position in a sequence. * @param last {@link Iterator InputIterator} to the final position in a sequence. The range used is @@ -1565,12 +1560,12 @@ namespace std REPLACE & SWAP --------------------------------------------------------- */ /** - *

Replace value in range.

+ * Replace value in range. * - *

Assigns new_val to all the elements in the range [first, last) that compare equal to - * old_val.

+ * Assigns new_val to all the elements in the range [first, last) that compare equal to + * old_val. * - *

The function uses {@link equal_to} to compare the individual elements to old_val.

+ * The function uses {@link equal_to} to compare the individual elements to old_val. * * @param first An {@link Iterator} to the initial position in a sequence. * @param last An {@link Iterator} to the final position in a sequence. The range used is [first, last), @@ -1583,15 +1578,15 @@ namespace std (first: InputIterator, last: InputIterator, old_val: T, new_val: T): void { for (let it = first; !it.equals(last); it = it.next() as InputIterator) - if (std.equal_to(it.value, old_val)) + if (equal_to(it.value, old_val)) it.value = new_val; } /** - *

Replace value in range.

+ * Replace value in range. * - *

Assigns new_val to all the elements in the range [first, last) for which pred returns - * true.

+ * Assigns new_val to all the elements in the range [first, last) for which pred returns + * true. * * @param first An {@link Iterator} to the initial position in a sequence. * @param last An {@link Iterator} to the final position in a sequence. The range used is [first, last), @@ -1611,15 +1606,15 @@ namespace std } /** - *

Copy range replacing value.

+ * Copy range replacing value. * - *

Copies the elements in the range [first, last) to the range beginning at result, replacing - * the appearances of old_value by new_value.

+ * Copies the elements in the range [first, last) to the range beginning at result, replacing + * the appearances of old_value by new_value. * - *

The function uses {@link std.equal_to} to compare the individual elements to old_value.

+ * The function uses {@link equal_to} to compare the individual elements to old_value. * - *

The ranges shall not overlap in such a way that result points to an element in the range - * [first, last).

+ * The ranges shall not overlap in such a way that result points to an element in the range + * [first, last). * * @param first {@link Iterator InputIterator} to the initial position in a sequence. * @param last {@link Iterator InputIterator} to the final position in a sequence. The range used is @@ -1638,7 +1633,7 @@ namespace std { for (; !first.equals(last); first = first.next() as InputIterator) { - if (std.equal_to(first.value, old_val)) + if (equal_to(first.value, old_val)) result.value = new_val; else result.value = first.value; @@ -1650,10 +1645,10 @@ namespace std } /** - *

Copy range replacing value.

+ * Copy range replacing value. * - *

Copies the elements in the range [first, last) to the range beginning at result, replacing - * those for which pred returns true by new_value.

+ * Copies the elements in the range [first, last) to the range beginning at result, replacing + * those for which pred returns true by new_value. * * @param first {@link Iterator InputIterator} to the initial position in a sequence. * @param last {@link Iterator InputIterator} to the final position in a sequence. The range used is @@ -1686,11 +1681,11 @@ namespace std } /** - *

Exchange values of objects pointed to by two iterators.

+ * Exchange values of objects pointed to by two iterators. * - *

Swaps the elements pointed to by x and y.

+ * Swaps the elements pointed to by x and y. * - *

The function calls {@link Iterator.swap} to exchange the elements.

+ * The function calls {@link Iterator.swap} to exchange the elements. * * @param x {@link Iterator Forward iterator} to the objects to swap. * @param y {@link Iterator Forward iterator} to the objects to swap. @@ -1701,12 +1696,12 @@ namespace std } /** - *

Exchange values of two ranges.

+ * Exchange values of two ranges. * - *

Exchanges the values of each of the elements in the range [first1, last1) with those of their - * respective elements in the range beginning at first2.

+ * Exchanges the values of each of the elements in the range [first1, last1) with those of their + * respective elements in the range beginning at first2. * - *

The function calls {@link Iterator.swap} to exchange the elements.

+ * The function calls {@link Iterator.swap} to exchange the elements. * * @param first1 {@link Iterator Forward iterator} to the initial position of the first sequence. * @param last1 {@link Iterator Forward iterator} to the final position of the first sequence. The range used is @@ -1732,11 +1727,11 @@ namespace std RE-ARRANGEMENT --------------------------------------------------------- */ /** - *

Reverse range.

+ * Reverse range. * - *

Reverses the order of the elements in the range [first, last).

+ * Reverses the order of the elements in the range [first, last). * - *

The function calls {@link iter_swap} to swap the elements to their new locations.

+ * The function calls {@link iter_swap} to swap the elements to their new locations. * * @param first An {@link Iterator} to the initial position in a sequence. * @param last An {@link Iterator} to the final position in a sequence. The range used is [first, last), @@ -1755,10 +1750,10 @@ namespace std } /** - *

Copy range reversed.

+ * Copy range reversed. * - *

Copies the elements in the range [first, last) to the range beginning at result, but in - * reverse order.

+ * Copies the elements in the range [first, last) to the range beginning at result, but in + * reverse order. * * @param first {@link Iterator Bidirectional iterator} to the initial position in a sequence to be copied. * @param last {@link Iterator Bidirectional iterator} to the initial position in a sequence to be copied. The range @@ -1785,10 +1780,10 @@ namespace std } /** - *

Rotate left the elements in range.

+ * Rotate left the elements in range. * - *

Rotates the order of the elements in the range [first, last), in such a way that the element - * pointed by middle becomes the new first element.

+ * Rotates the order of the elements in the range [first, last), in such a way that the element + * pointed by middle becomes the new first element. * * @param first An {@link Iterator} to the initial position in a sequence. * @param middle An {@link Iterator} pointing to the element within the range [first, last) that is @@ -1819,11 +1814,11 @@ namespace std } /** - *

Copy range rotated left.

+ * Copy range rotated left. * - *

Copies the elements in the range [first, last) to the range beginning at result, but + * Copies the elements in the range [first, last) to the range beginning at result, but * rotating the order of the elements in such a way that the element pointed by middle becomes the first - * element in the resulting range.

+ * element in the resulting range. * * @param first {@link Iterator Forward iterator} to the initial position of the range to be copy-rotated. * @param middle Forward iterator pointing to the element within the range [first, last) that is copied as the first element in the resulting range. @@ -1845,15 +1840,15 @@ namespace std } /** - *

Randomly rearrange elements in range.

+ * Randomly rearrange elements in range. * - *

Rearranges the elements in the range [first, last) randomly.

+ * Rearranges the elements in the range [first, last) randomly. * - *

The function swaps the value of each element with that of some other randomly picked element. When provided, + * The function swaps the value of each element with that of some other randomly picked element. When provided, * the function gen determines which element is picked in every case. Otherwise, the function uses some unspecified - * source of randomness.

+ * source of randomness. * - *

To specify a uniform random generator, see {@link shuffle}.

+ * To specify a uniform random generator, see {@link shuffle}. * * @param first An {@link Iterator} to the initial position in a sequence. * @param last An {@link Iterator} to the final position in a sequence. The range used is [first, last), @@ -1863,22 +1858,22 @@ namespace std export function random_shuffle> (first: RandomAccessIterator, last: RandomAccessIterator): void { - return std.shuffle(first, last); + return shuffle(first, last); } /** - *

Randomly rearrange elements in range using generator.

+ * Randomly rearrange elements in range using generator. * - *

Rearranges the elements in the range [first, last) randomly, using g as uniform random - * number generator.

+ * Rearranges the elements in the range [first, last) randomly, using g as uniform random + * number generator. * - *

The function swaps the value of each element with that of some other randomly picked element. The function - * determines the element picked by calling g().

+ * The function swaps the value of each element with that of some other randomly picked element. The function + * determines the element picked by calling g(). * - *

To shuffle the elements of the range without such a generator, see {@link random_shuffle} instead.

+ * To shuffle the elements of the range without such a generator, see {@link random_shuffle} instead. * *
Note
- *

Using random generator engine is not implemented yet.

+ * Using random generator engine is not implemented yet. * * @param first An {@link Iterator} to the initial position in a sequence. * @param last An {@link Iterator} to the final position in a sequence. The range used is [first, last), @@ -1909,10 +1904,10 @@ namespace std SORT --------------------------------------------------------- */ /** - *

Sort elements in range.

+ * Sort elements in range. * - *

Sorts the elements in the range [first, last) into ascending order. The elements are compared - * using {@link less}.

+ * Sorts the elements in the range [first, last) into ascending order. The elements are compared + * using {@link less}. * * @param first {@link IArrayIterator Random-access iterator} to the initial position of the sequence to be sorted. * @param last {@link IArrayIterator Random-access iterator} to the final position of the sequence to be sorted. @@ -1925,10 +1920,10 @@ namespace std (first: RandomAccessIterator, last: RandomAccessIterator): void; /** - *

Sort elements in range.

+ * Sort elements in range. * - *

Sorts the elements in the range [first, last) into specific order. The elements are compared - * using compare.

+ * Sorts the elements in the range [first, last) into specific order. The elements are compared + * using compare. * * @param first {@link IArrayIterator Random-access iterator} to the initial position of the sequence to be sorted. * @param last {@link IArrayIterator Random-access iterator} to the final position of the sequence to be sorted. @@ -1946,19 +1941,19 @@ namespace std (first: RandomAccessIterator, last: RandomAccessIterator, compare: (left: T, right: T) => boolean): void; export function sort> - (first: RandomAccessIterator, last: RandomAccessIterator, compare: (left: T, right: T) => boolean = std.less): void + (first: RandomAccessIterator, last: RandomAccessIterator, compare: (left: T, right: T) => boolean = less): void { - qsort(first.source() as base.IArrayContainer, first.index(), last.index() - 1, compare); + _Quick_sort(first.source() as base.IArrayContainer, first.index(), last.index() - 1, compare); } /** - *

Partially sort elements in range.

+ * Partially sort elements in range. * - *

Rearranges the elements in the range [first, last), in such a way that the elements before + * Rearranges the elements in the range [first, last), in such a way that the elements before * middle are the smallest elements in the entire range and are sorted in ascending order, while the remaining - * elements are left without any specific order.

+ * elements are left without any specific order. * - *

The elements are compared using {@link less}.

+ * The elements are compared using {@link less}. * * @param last {@link IArrayIterator Random-access iterator} to the first position of the sequence to be sorted. * @param middle {@link IArrayIterator Random-access iterator} pointing to the element within the range [first, last) that is used as the upper boundary of the elements that are fully sorted. @@ -1971,13 +1966,13 @@ namespace std (first: RandomAccessIterator, middle: RandomAccessIterator, last: RandomAccessIterator): void; /** - *

Partially sort elements in range.

+ * Partially sort elements in range. * - *

Rearranges the elements in the range [first, last), in such a way that the elements before + * Rearranges the elements in the range [first, last), in such a way that the elements before * middle are the smallest elements in the entire range and are sorted in ascending order, while the remaining - * elements are left without any specific order.

+ * elements are left without any specific order. * - *

The elements are compared using comp.

+ * The elements are compared using comp. * * @param last {@link IArrayIterator Random-access iterator} to the first position of the sequence to be sorted. * @param middle {@link IArrayIterator Random-access iterator} pointing to the element within the range [first, last) that is used as the upper boundary of the elements that are fully sorted. @@ -1999,23 +1994,23 @@ namespace std export function partial_sort> ( first: RandomAccessIterator, middle: RandomAccessIterator, last: RandomAccessIterator, - compare: (x: T, y: T) => boolean = std.less + compare: (x: T, y: T) => boolean = less ): void { - selection_sort(first.source() as base.IArrayContainer, first.index(), middle.index(), last.index(), compare); + _Selection_sort(first.source() as base.IArrayContainer, first.index(), middle.index(), last.index(), compare); } /** - *

Copy and partially sort range.

+ * Copy and partially sort range. * - *

Copies the smallest elements in the range [first, last) to + * Copies the smallest elements in the range [first, last) to * [result_first, result_last), sorting the elements copied. The number of elements copied is the same * as the {@link distance} between result_first and result_last (unless this is more than the amount of - * elements in [first, last)).

+ * elements in [first, last)). * - *

The range [first, last) is not modified.

+ * The range [first, last) is not modified. * - *

The elements are compared using {@link less}.

+ * The elements are compared using {@link less}. * * @param first {@link Iterator Input iterator} to the initial position of the sequence to copy from. * @param last {@link Iterator Input iterator} to the final position of the sequence to copy from. The range used is @@ -2040,16 +2035,16 @@ namespace std ): RandomAccessIterator; /** - *

Copy and partially sort range.

+ * Copy and partially sort range. * - *

Copies the smallest (or largest) elements in the range [first, last) to + * Copies the smallest (or largest) elements in the range [first, last) to * [result_first, result_last), sorting the elements copied. The number of elements copied is the same * as the {@link distance} between result_first and result_last (unless this is more than the amount of - * elements in [first, last)).

+ * elements in [first, last)). * - *

The range [first, last) is not modified.

+ * The range [first, last) is not modified. * - *

The elements are compared using compare.

+ * The elements are compared using compare. * * @param first {@link Iterator Input iterator} to the initial position of the sequence to copy from. * @param last {@link Iterator Input iterator} to the final position of the sequence to copy from. The range used is @@ -2080,7 +2075,7 @@ namespace std ( first: InputIterator, last: InputIterator, result_first: RandomAccessIterator, result_last: RandomAccessIterator, - compare: (x: T, y: T) => boolean = std.less + compare: (x: T, y: T) => boolean = less ): RandomAccessIterator { let input_size: number = distance(first, last); @@ -2101,11 +2096,11 @@ namespace std INSPECTOR --------------------------------------------------------- */ /** - *

Check whether range is sorted.

+ * Check whether range is sorted. * - *

Returns true if the range [first, last) is sorted into ascending order.

+ * Returns true if the range [first, last) is sorted into ascending order. * - *

The elements are compared using {@link less}.

+ * The elements are compared using {@link less}. * * @param first {@link Iterator Forward iterator} to the initial position of the sequence. * @param last {@link Iterator Forward iterator} to the final position of the sequence. The range checked is @@ -2120,11 +2115,11 @@ namespace std (first: ForwardIterator, last: ForwardIterator): boolean; /** - *

Check whether range is sorted.

+ * Check whether range is sorted. * - *

Returns true if the range [first, last) is sorted into ascending order.

+ * Returns true if the range [first, last) is sorted into ascending order. * - *

The elements are compared using compare.

+ * The elements are compared using compare. * * @param first {@link Iterator Forward iterator} to the initial position of the sequence. * @param last {@link Iterator Forward iterator} to the final position of the sequence. The range checked is @@ -2143,14 +2138,14 @@ namespace std (first: ForwardIterator, last: ForwardIterator, compare: (x: T, y: T) => boolean): boolean; export function is_sorted> - (first: ForwardIterator, last: ForwardIterator, compare: (x: T, y: T) => boolean = std.equal_to): boolean + (first: ForwardIterator, last: ForwardIterator, compare: (x: T, y: T) => boolean = equal_to): boolean { if (first.equals(last)) return true; for (let next = first.next() as ForwardIterator; !next.equals(last); next = next.next() as ForwardIterator) { - if (std.less(next.value, first.value)) // or, if (comp(*next,*first)) for version (2) + if (less(next.value, first.value)) // or, if (comp(*next,*first)) for version (2) return false; first = first.next() as ForwardIterator; @@ -2159,16 +2154,16 @@ namespace std } /** - *

Find first unsorted element in range.

+ * Find first unsorted element in range. * - *

Returns an iterator to the first element in the range [first, last) which does not follow an - * ascending order.

+ * Returns an iterator to the first element in the range [first, last) which does not follow an + * ascending order. * - *

The range between first and the iterator returned {@link is_sorted is sorted}.

+ * The range between first and the iterator returned {@link is_sorted is sorted}. * - *

If the entire range is sorted, the function returns last.

+ * If the entire range is sorted, the function returns last. * - *

The elements are compared using {@link equal_to}.

+ * The elements are compared using {@link equal_to}. * * @param first {@link Iterator Forward iterator} to the initial position of the sequence. * @param last {@link Iterator Forward iterator} to the final position of the sequence. The range checked is @@ -2186,16 +2181,16 @@ namespace std (first: ForwardIterator, last: ForwardIterator): ForwardIterator; /** - *

Find first unsorted element in range.

+ * Find first unsorted element in range. * - *

Returns an iterator to the first element in the range [first, last) which does not follow an - * ascending order.

+ * Returns an iterator to the first element in the range [first, last) which does not follow an + * ascending order. * - *

The range between first and the iterator returned {@link is_sorted is sorted}.

+ * The range between first and the iterator returned {@link is_sorted is sorted}. * - *

If the entire range is sorted, the function returns last.

+ * If the entire range is sorted, the function returns last. * - *

The elements are compared using compare.

+ * The elements are compared using compare. * * @param first {@link Iterator Forward iterator} to the initial position of the sequence. * @param last {@link Iterator Forward iterator} to the final position of the sequence. The range checked is @@ -2213,14 +2208,14 @@ namespace std (first: ForwardIterator, last: ForwardIterator, compare: (x: T, y: T) => boolean): ForwardIterator; export function is_sorted_until> - (first: ForwardIterator, last: ForwardIterator, compare: (x: T, y: T) => boolean = std.equal_to): ForwardIterator + (first: ForwardIterator, last: ForwardIterator, compare: (x: T, y: T) => boolean = equal_to): ForwardIterator { if (first.equals(last)) return first; for (let next = first.next() as ForwardIterator; !next.equals(last); next = next.next() as ForwardIterator) { - if (std.less(next.value ,first.value)) + if (less(next.value ,first.value)) return next; first = first.next() as ForwardIterator; @@ -2234,7 +2229,7 @@ namespace std /** * @hidden */ - function qsort + function _Quick_sort (container: base.IArrayContainer, first: number, last: number, compare: (left: T, right: T) => boolean): void { if (last == -2) @@ -2242,15 +2237,15 @@ namespace std if (first >= last) return; - let index: number = qsort_partition(container, first, last, compare); - qsort(container, first, index - 1, compare); - qsort(container, index + 1, last, compare); + let index: number = _Quick_sort_partition(container, first, last, compare); + _Quick_sort(container, first, index - 1, compare); + _Quick_sort(container, index + 1, last, compare); } /** * @hidden */ - function qsort_partition + function _Quick_sort_partition ( container: base.IArrayContainer, first: number, last: number, compare: (left: T, right: T) => boolean @@ -2289,7 +2284,7 @@ namespace std /** * @hidden */ - function stable_qsort + function _Stable_quick_sort ( container: base.IArrayContainer, first: number, last: number, compare: (left: T, right: T) => boolean @@ -2301,15 +2296,15 @@ namespace std else if (first >= last) return; - let index: number = stable_qsort_partition(container, first, last, compare); - stable_qsort(container, first, index - 1, compare); - stable_qsort(container, index + 1, last, compare); + let index: number = _Stable_quick_sort_partition(container, first, last, compare); + _Stable_quick_sort(container, first, index - 1, compare); + _Stable_quick_sort(container, index + 1, last, compare); } /** * @hidden */ - function stable_qsort_partition + function _Stable_quick_sort_partition ( container: base.IArrayContainer, first: number, last: number, compare: (left: T, right: T) => boolean @@ -2321,10 +2316,10 @@ namespace std while (true) { - while (!std.equal_to(container.at(++i), val) && compare(container.at(i), val)) + while (!equal_to(container.at(++i), val) && compare(container.at(i), val)) if (i == last - 1) break; - while (!std.equal_to(val, container.at(--j)) && compare(val, container.at(j))) + while (!equal_to(val, container.at(--j)) && compare(val, container.at(j))) if (j == first) break; @@ -2348,7 +2343,7 @@ namespace std /** * @hidden */ - function selection_sort + function _Selection_sort ( container: base.IArrayContainer, first: number, middle: number, last: number, compare: (x: T, y: T) => boolean @@ -2381,22 +2376,22 @@ namespace std HEAP ========================================================= */ /** - *

Make heap from range.

+ * Make heap from range. * - *

Rearranges the elements in the range [first, last) in such a way that they form a heap.

+ * Rearranges the elements in the range [first, last) in such a way that they form a heap. * - *

A heap is a way to organize the elements of a range that allows for fast retrieval of the element with the + * A heap is a way to organize the elements of a range that allows for fast retrieval of the element with the * highest value at any moment (with {@link pop_heap}), even repeatedly, while allowing for fast insertion of new - * elements (with {@link push_heap}).

+ * elements (with {@link push_heap}). * - *

The element with the highest value is always pointed by first. The order of the other elements depends on the - * particular implementation, but it is consistent throughout all heap-related functions of this header.

+ * The element with the highest value is always pointed by first. The order of the other elements depends on the + * particular implementation, but it is consistent throughout all heap-related functions of this header. * - *

The elements are compared using {@link less}: The element with the highest value is an element for which this - * would return false when compared to every other element in the range.

+ * The elements are compared using {@link less}: The element with the highest value is an element for which this + * would return false when compared to every other element in the range. * - *

The standard container adaptor {@link PriorityQueue} calls {@link make_heap}, {@link push_heap} and - * {@link pop_heap} automatically to maintain heap properties for a container.

+ * The standard container adaptor {@link PriorityQueue} calls {@link make_heap}, {@link push_heap} and + * {@link pop_heap} automatically to maintain heap properties for a container. * * @param first {@link IArrayIterator Random-access iterator} to the initial position of the sequence to be * transformed into a heap. @@ -2410,22 +2405,22 @@ namespace std (first: RandomAccessIterator, last: RandomAccessIterator): void; /** - *

Make heap from range.

+ * Make heap from range. * - *

Rearranges the elements in the range [first, last) in such a way that they form a heap.

+ * Rearranges the elements in the range [first, last) in such a way that they form a heap. * - *

A heap is a way to organize the elements of a range that allows for fast retrieval of the element with the + * A heap is a way to organize the elements of a range that allows for fast retrieval of the element with the * highest value at any moment (with {@link pop_heap}), even repeatedly, while allowing for fast insertion of new - * elements (with {@link push_heap}).

+ * elements (with {@link push_heap}). * - *

The element with the highest value is always pointed by first. The order of the other elements depends on the - * particular implementation, but it is consistent throughout all heap-related functions of this header.

+ * The element with the highest value is always pointed by first. The order of the other elements depends on the + * particular implementation, but it is consistent throughout all heap-related functions of this header. * - *

The elements are compared using compare: The element with the highest value is an element for which this - * would return false when compared to every other element in the range.

+ * The elements are compared using compare: The element with the highest value is an element for which this + * would return false when compared to every other element in the range. * - *

The standard container adaptor {@link PriorityQueue} calls {@link make_heap}, {@link push_heap} and - * {@link pop_heap} automatically to maintain heap properties for a container.

+ * The standard container adaptor {@link PriorityQueue} calls {@link make_heap}, {@link push_heap} and + * {@link pop_heap} automatically to maintain heap properties for a container. * * @param first {@link IArrayIterator Random-access iterator} to the initial position of the sequence to be * transformed into a heap. @@ -2444,7 +2439,7 @@ namespace std (first: RandomAccessIterator, last: RandomAccessIterator, compare: (x: T, y: T) => boolean): void; export function make_heap> - (first: RandomAccessIterator, last: RandomAccessIterator, compare: (x: T, y: T) => boolean = std.less): void + (first: RandomAccessIterator, last: RandomAccessIterator, compare: (x: T, y: T) => boolean = less): void { let heap_compare = function (x: T, y: T): boolean @@ -2452,19 +2447,19 @@ namespace std return !compare(x, y); } - std.sort(first, last, heap_compare); + sort(first, last, heap_compare); } /** - *

Push element into heap range.

+ * Push element into heap range. * - *

Given a heap in the range [first, last - 1), this function extends the range considered a heap to + * Given a heap in the range [first, last - 1), this function extends the range considered a heap to * [first, last) by placing the value in (last - 1) into its corresponding location within it. - *

+ * * - *

A range can be organized into a heap by calling {@link make_heap}. After that, its heap properties are + * A range can be organized into a heap by calling {@link make_heap}. After that, its heap properties are * preserved if elements are added and removed from it using {@link push_heap} and {@link pop_heap}, respectively. - *

+ * * * @param first {@link IArrayIterator Random-access iterator} to the initial position of the new heap range, including * the pushed element. @@ -2478,15 +2473,14 @@ namespace std (first: RandomAccessIterator, last: RandomAccessIterator): void; /** - *

Push element into heap range.

+ * Push element into heap range. * - *

Given a heap in the range [first, last - 1), this function extends the range considered a heap to + * Given a heap in the range [first, last - 1), this function extends the range considered a heap to * [first, last) by placing the value in (last - 1) into its corresponding location within it. - *

* - *

A range can be organized into a heap by calling {@link make_heap}. After that, its heap properties are + * A range can be organized into a heap by calling {@link make_heap}. After that, its heap properties are * preserved if elements are added and removed from it using {@link push_heap} and {@link pop_heap}, respectively. - *

+ * * * @param first {@link IArrayIterator Random-access iterator} to the initial position of the new heap range, including * the pushed element. @@ -2505,7 +2499,7 @@ namespace std (first: RandomAccessIterator, last: RandomAccessIterator, compare: (x: T, y: T) => boolean): void; export function push_heap> - (first: RandomAccessIterator, last: RandomAccessIterator, compare: (x: T, y: T) => boolean = std.less): void + (first: RandomAccessIterator, last: RandomAccessIterator, compare: (x: T, y: T) => boolean = less): void { let last_item_it = last.prev(); let less_it: RandomAccessIterator = null; @@ -2529,18 +2523,17 @@ namespace std } /** - *

Pop element from heap range.

+ * Pop element from heap range. * - *

Rearranges the elements in the heap range [first, last) in such a way that the part considered a - * heap is shortened by one: The element with the highest value is moved to (last - 1).

+ * Rearranges the elements in the heap range [first, last) in such a way that the part considered a + * heap is shortened by one: The element with the highest value is moved to (last - 1). * - *

While the element with the highest value is moved from first to (last - 1) (which now is out of the + * While the element with the highest value is moved from first to (last - 1) (which now is out of the * heap), the other elements are reorganized in such a way that the range [first, last - 1) preserves - * the properties of a heap.

+ * the properties of a heap. * - *

A range can be organized into a heap by calling {@link make_heap}. After that, its heap properties are + * A range can be organized into a heap by calling {@link make_heap}. After that, its heap properties are * preserved if elements are added and removed from it using {@link push_heap} and {@link pop_heap}, respectively. - *

* * @param first {@link IArrayIterator Random-access iterator} to the initial position of the heap to be shrank by one. * @param last {@link IArrayIterator Random-access iterator} to the final position of the heap to be shrank by one. @@ -2553,18 +2546,17 @@ namespace std (first: RandomAccessIterator, last: RandomAccessIterator): void; /** - *

Pop element from heap range.

+ * Pop element from heap range. * - *

Rearranges the elements in the heap range [first, last) in such a way that the part considered a - * heap is shortened by one: The element with the highest value is moved to (last - 1).

+ * Rearranges the elements in the heap range [first, last) in such a way that the part considered a + * heap is shortened by one: The element with the highest value is moved to (last - 1). * - *

While the element with the highest value is moved from first to (last - 1) (which now is out of the + * While the element with the highest value is moved from first to (last - 1) (which now is out of the * heap), the other elements are reorganized in such a way that the range [first, last - 1) preserves - * the properties of a heap.

+ * the properties of a heap. * - *

A range can be organized into a heap by calling {@link make_heap}. After that, its heap properties are + * A range can be organized into a heap by calling {@link make_heap}. After that, its heap properties are * preserved if elements are added and removed from it using {@link push_heap} and {@link pop_heap}, respectively. - *

* * @param first {@link IArrayIterator Random-access iterator} to the initial position of the heap to be shrank by one. * @param last {@link IArrayIterator Random-access iterator} to the final position of the heap to be shrank by one. @@ -2582,7 +2574,7 @@ namespace std (first: RandomAccessIterator, last: RandomAccessIterator, compare: (x: T, y: T) => boolean): void; export function pop_heap> - (first: RandomAccessIterator, last: RandomAccessIterator, compare: (x: T, y: T) => boolean = std.less): void + (first: RandomAccessIterator, last: RandomAccessIterator, compare: (x: T, y: T) => boolean = less): void { let container = first.source() as base.IArrayContainer; @@ -2591,12 +2583,11 @@ namespace std } /** - *

Test if range is heap.

+ * Test if range is heap. * - *

Returns true if the range [first, last) forms a heap, as if constructed with {@link make_heap}. - *

+ * Returns true if the range [first, last) forms a heap, as if constructed with {@link make_heap}. * - *

The elements are compared using {@link less}.

+ * The elements are compared using {@link less}. * * @param first {@link IArrayIterator Random-access iterator} to the initial position of the sequence. * @param last {@link IArrayIterator Random-access iterator} to the final position of the sequence. The range used is @@ -2613,12 +2604,11 @@ namespace std (first: RandomAccessIterator, last: RandomAccessIterator): boolean; /** - *

Test if range is heap.

+ * Test if range is heap. * - *

Returns true if the range [first, last) forms a heap, as if constructed with {@link make_heap}. - *

+ * Returns true if the range [first, last) forms a heap, as if constructed with {@link make_heap}. * - *

The elements are compared using compare.

+ * The elements are compared using compare. * * @param first {@link IArrayIterator Random-access iterator} to the initial position of the sequence. * @param last {@link IArrayIterator Random-access iterator} to the final position of the sequence. The range used is @@ -2640,24 +2630,24 @@ namespace std (first: RandomAccessIterator, last: RandomAccessIterator, compare: (x: T, y: T) => boolean): boolean; export function is_heap> - (first: RandomAccessIterator, last: RandomAccessIterator, compare: (x: T, y: T) => boolean = std.less): boolean + (first: RandomAccessIterator, last: RandomAccessIterator, compare: (x: T, y: T) => boolean = less): boolean { - let it = std.is_heap_until(first, last, compare); + let it = is_heap_until(first, last, compare); return it.equals(last); } /** - *

Find first element not in heap order.

+ * Find first element not in heap order. * - *

Returns an iterator to the first element in the range [first, last) which is not in a valid - * position if the range is considered a heap (as if constructed with {@link make_heap}).

+ * Returns an iterator to the first element in the range [first, last) which is not in a valid + * position if the range is considered a heap (as if constructed with {@link make_heap}). * - *

The range between first and the iterator returned is a heap.

+ * The range between first and the iterator returned is a heap. * - *

If the entire range is a valid heap, the function returns last.

+ * If the entire range is a valid heap, the function returns last. * - *

The elements are compared using {@link less}.

+ * The elements are compared using {@link less}. * * @param first {@link IArrayIterator Random-access iterator} to the initial position of the sequence. * @param last {@link IArrayIterator Random-access iterator} to the final position of the sequence. The range used is @@ -2670,16 +2660,16 @@ namespace std (first: RandomAccessIterator, last: RandomAccessIterator): RandomAccessIterator; /** - *

Find first element not in heap order.

+ * Find first element not in heap order. * - *

Returns an iterator to the first element in the range [first, last) which is not in a valid - * position if the range is considered a heap (as if constructed with {@link make_heap}).

+ * Returns an iterator to the first element in the range [first, last) which is not in a valid + * position if the range is considered a heap (as if constructed with {@link make_heap}). * - *

The range between first and the iterator returned is a heap.

+ * The range between first and the iterator returned is a heap. * - *

If the entire range is a valid heap, the function returns last.

+ * If the entire range is a valid heap, the function returns last. * - *

The elements are compared using {@link less}.

+ * The elements are compared using {@link less}. * * @param first {@link IArrayIterator Random-access iterator} to the initial position of the sequence. * @param last {@link IArrayIterator Random-access iterator} to the final position of the sequence. The range used is @@ -2697,7 +2687,7 @@ namespace std (first: RandomAccessIterator, last: RandomAccessIterator, compare: (x: T, y: T) => boolean): RandomAccessIterator; export function is_heap_until> - (first: RandomAccessIterator, last: RandomAccessIterator, compare: (x: T, y: T) => boolean = std.less): RandomAccessIterator + (first: RandomAccessIterator, last: RandomAccessIterator, compare: (x: T, y: T) => boolean = less): RandomAccessIterator { let prev = first; for (let it = first.next() as RandomAccessIterator; !it.equals(last); it = it.next() as RandomAccessIterator) @@ -2711,13 +2701,13 @@ namespace std } /** - *

Sort elements of heap.

+ * Sort elements of heap. * - *

Sorts the elements in the heap range [first, last) into ascending order.

+ * Sorts the elements in the heap range [first, last) into ascending order. * - *

The elements are compared using {@link less}, which shall be the same as used to construct the heap.

+ * The elements are compared using {@link less}, which shall be the same as used to construct the heap. * - *

The range loses its properties as a heap.

+ * The range loses its properties as a heap. * * @param first {@link IArrayIterator Random-access iterator} to the initial position of the sequence to be sorted. * @param last {@link IArrayIterator Random-access iterator} to the final position of the sequence to be sorted. @@ -2730,13 +2720,13 @@ namespace std (first: RandomAccessIterator, last: RandomAccessIterator): void; /** - *

Sort elements of heap.

+ * Sort elements of heap. * - *

Sorts the elements in the heap range [first, last) into ascending order.

+ * Sorts the elements in the heap range [first, last) into ascending order. * - *

The elements are compared using compare, which shall be the same as used to construct the heap.

+ * The elements are compared using compare, which shall be the same as used to construct the heap. * - *

The range loses its properties as a heap.

+ * The range loses its properties as a heap. * * @param first {@link IArrayIterator Random-access iterator} to the initial position of the sequence to be sorted. * @param last {@link IArrayIterator Random-access iterator} to the final position of the sequence to be sorted. @@ -2754,9 +2744,9 @@ namespace std (first: RandomAccessIterator, last: RandomAccessIterator, compare: (x: T, y: T) => boolean): void; export function sort_heap> - (first: RandomAccessIterator, last: RandomAccessIterator, compare: (x: T, y: T) => boolean = std.less): void + (first: RandomAccessIterator, last: RandomAccessIterator, compare: (x: T, y: T) => boolean = less): void { - std.sort(first, last, compare); + sort(first, last, compare); } } @@ -2766,20 +2756,20 @@ namespace std BINARY SEARCH ========================================================= */ /** - *

Return iterator to lower bound.

+ * Return iterator to lower bound. * - *

Returns an iterator pointing to the first element in the range [first, last) which does not - * compare less than val.

+ * Returns an iterator pointing to the first element in the range [first, last) which does not + * compare less than val. * - *

The elements are compared using {@link less}. The elements in the range shall already be {@link is_sorted sorted} + * The elements are compared using {@link less}. The elements in the range shall already be {@link is_sorted sorted} * according to this same criterion ({@link less}), or at least {@link is_partitioned partitioned} with respect to - * val.

+ * val. * - *

The function optimizes the number of comparisons performed by comparing non-consecutive elements of the sorted - * range, which is specially efficient for {@link IArrayIterator random-access iterators}.

+ * The function optimizes the number of comparisons performed by comparing non-consecutive elements of the sorted + * range, which is specially efficient for {@link IArrayIterator random-access iterators}. * - *

Unlike {@link upper_bound}, the value pointed by the iterator returned by this function may also be equivalent - * to val, and not only greater.

+ * Unlike {@link upper_bound}, the value pointed by the iterator returned by this function may also be equivalent + * to val, and not only greater. * * @param first {@link Iterator Forward iterator} to the initial position of a {@link is_sorted sorted} (or properly * {@link is_partitioned partitioned}) sequence. @@ -2797,20 +2787,20 @@ namespace std (first: ForwardIterator, last: ForwardIterator, val: T): ForwardIterator; /** - *

Return iterator to lower bound.

+ * Return iterator to lower bound. * - *

Returns an iterator pointing to the first element in the range [first, last) which does not - * compare less than val.

+ * Returns an iterator pointing to the first element in the range [first, last) which does not + * compare less than val. * - *

The elements are compared using compare. The elements in the range shall already be + * The elements are compared using compare. The elements in the range shall already be * {@link is_sorted sorted} according to this same criterion (compare), or at least - * {@link is_partitioned partitioned} with respect to val.

+ * {@link is_partitioned partitioned} with respect to val. * - *

The function optimizes the number of comparisons performed by comparing non-consecutive elements of the sorted - * range, which is specially efficient for {@link IArrayIterator random-access iterators}.

+ * The function optimizes the number of comparisons performed by comparing non-consecutive elements of the sorted + * range, which is specially efficient for {@link IArrayIterator random-access iterators}. * - *

Unlike {@link upper_bound}, the value pointed by the iterator returned by this function may also be equivalent - * to val, and not only greater.

+ * Unlike {@link upper_bound}, the value pointed by the iterator returned by this function may also be equivalent + * to val, and not only greater. * * @param first {@link Iterator Forward iterator} to the initial position of a {@link is_sorted sorted} (or properly * {@link is_partitioned partitioned}) sequence. @@ -2836,7 +2826,7 @@ namespace std export function lower_bound> ( first: ForwardIterator, last: ForwardIterator, val: T, - compare: (x: T, y: T) => boolean = std.less + compare: (x: T, y: T) => boolean = less ): ForwardIterator { let count: number = distance(first, last); @@ -2858,20 +2848,20 @@ namespace std } /** - *

Return iterator to upper bound.

+ * Return iterator to upper bound. * - *

Returns an iterator pointing to the first element in the range [first, last) which compares - * greater than val.

+ * Returns an iterator pointing to the first element in the range [first, last) which compares + * greater than val. * - *

The elements are compared using {@link less}. The elements in the range shall already be {@link is_sorted sorted} + * The elements are compared using {@link less}. The elements in the range shall already be {@link is_sorted sorted} * according to this same criterion ({@link less}), or at least {@link is_partitioned partitioned} with respect to - * val.

+ * val. * - *

The function optimizes the number of comparisons performed by comparing non-consecutive elements of the sorted - * range, which is specially efficient for {@link IArrayIterator random-access iterators}.

+ * The function optimizes the number of comparisons performed by comparing non-consecutive elements of the sorted + * range, which is specially efficient for {@link IArrayIterator random-access iterators}. * - *

Unlike {@link lower_bound}, the value pointed by the iterator returned by this function cannot be equivalent to - * val, only greater.

+ * Unlike {@link lower_bound}, the value pointed by the iterator returned by this function cannot be equivalent to + * val, only greater. * * @param first {@link Iterator Forward iterator} to the initial position of a {@link is_sorted sorted} (or properly * {@link is_partitioned partitioned}) sequence. @@ -2889,20 +2879,20 @@ namespace std (first: ForwardIterator, last: ForwardIterator, val: T): ForwardIterator; /** - *

Return iterator to upper bound.

+ * Return iterator to upper bound. * - *

Returns an iterator pointing to the first element in the range [first, last) which compares - * greater than val.

+ * Returns an iterator pointing to the first element in the range [first, last) which compares + * greater than val. * - *

The elements are compared using compare. The elements in the range shall already be + * The elements are compared using compare. The elements in the range shall already be * {@link is_sorted sorted} according to this same criterion (compare), or at least - * {@link is_partitioned partitioned} with respect to val.

+ * {@link is_partitioned partitioned} with respect to val. * - *

The function optimizes the number of comparisons performed by comparing non-consecutive elements of the sorted - * range, which is specially efficient for {@link IArrayIterator random-access iterators}.

+ * The function optimizes the number of comparisons performed by comparing non-consecutive elements of the sorted + * range, which is specially efficient for {@link IArrayIterator random-access iterators}. * - *

Unlike {@link lower_bound}, the value pointed by the iterator returned by this function cannot be equivalent to - * val, only greater.

+ * Unlike {@link lower_bound}, the value pointed by the iterator returned by this function cannot be equivalent to + * val, only greater. * * @param first {@link Iterator Forward iterator} to the initial position of a {@link is_sorted sorted} (or properly * {@link is_partitioned partitioned}) sequence. @@ -2928,7 +2918,7 @@ namespace std export function upper_bound> ( first: ForwardIterator, last: ForwardIterator, val: T, - compare: (x: T, y: T) => boolean = std.less + compare: (x: T, y: T) => boolean = less ): ForwardIterator { let count: number = distance(first, last); @@ -2950,20 +2940,20 @@ namespace std } /** - *

Get subrange of equal elements.

+ * Get subrange of equal elements. * - *

Returns the bounds of the subrange that includes all the elements of the range [first, last) with - * values equivalent to val.

+ * Returns the bounds of the subrange that includes all the elements of the range [first, last) with + * values equivalent to val. * - *

The elements are compared using {@link less}. Two elements, ax/i> and y are considered equivalent - * if (!std.less(x, y) && !std.less(y, x)).

+ * The elements are compared using {@link less}. Two elements, ax/i> and y are considered equivalent + * if (!less(x, y) && !less(y, x)). * - *

The elements in the range shall already be {@link is_sorted sorted} according to this same criterion - * ({@link less}), or at least {@link is_partitioned partitioned} with respect to val.

+ * The elements in the range shall already be {@link is_sorted sorted} according to this same criterion + * ({@link less}), or at least {@link is_partitioned partitioned} with respect to val. * - *

If val is not equivalent to any value in the range, the subrange returned has a length of zero, with both + * If val is not equivalent to any value in the range, the subrange returned has a length of zero, with both * iterators pointing to the nearest value greater than val, if any, or to last, if val compares - * greater than all the elements in the range.

+ * greater than all the elements in the range. * * @param first {@link Iterator Forward iterator} to the initial position of a {@link is_sorted sorted} (or properly * {@link is_partitioned partitioned}) sequence. @@ -2982,20 +2972,20 @@ namespace std (first: ForwardIterator, last: ForwardIterator, val: T): Pair /** - *

Get subrange of equal elements.

+ * Get subrange of equal elements. * - *

Returns the bounds of the subrange that includes all the elements of the range [first, last) with - * values equivalent to val.

+ * Returns the bounds of the subrange that includes all the elements of the range [first, last) with + * values equivalent to val. * - *

The elements are compared using compare. Two elements, ax/i> and y are considered equivalent - * if (!compare(x, y) && !compare(y, x)).

+ * The elements are compared using compare. Two elements, ax/i> and y are considered equivalent + * if (!compare(x, y) && !compare(y, x)). * - *

The elements in the range shall already be {@link is_sorted sorted} according to this same criterion - * (compare), or at least {@link is_partitioned partitioned} with respect to val.

+ * The elements in the range shall already be {@link is_sorted sorted} according to this same criterion + * (compare), or at least {@link is_partitioned partitioned} with respect to val. * - *

If val is not equivalent to any value in the range, the subrange returned has a length of zero, with both + * If val is not equivalent to any value in the range, the subrange returned has a length of zero, with both * iterators pointing to the nearest value greater than val, if any, or to last, if val compares - * greater than all the elements in the range.

+ * greater than all the elements in the range. * * @param first {@link Iterator Forward iterator} to the initial position of a {@link is_sorted sorted} (or properly * {@link is_partitioned partitioned}) sequence. @@ -3022,7 +3012,7 @@ namespace std export function equal_range> ( first: ForwardIterator, last: ForwardIterator, val: T, - compare: (x: T, y: T) => boolean = std.less + compare: (x: T, y: T) => boolean = less ): Pair { let it: ForwardIterator = lower_bound(first, last, val, compare); @@ -3031,20 +3021,20 @@ namespace std } /** - *

Get subrange of equal elements.

+ * Get subrange of equal elements. * - *

Returns the bounds of the subrange that includes all the elements of the range [first, last) with - * values equivalent to val.

+ * Returns the bounds of the subrange that includes all the elements of the range [first, last) with + * values equivalent to val. * - *

The elements are compared using {@link less}. Two elements, x and y are considered equivalent - * if (!std.less(x, y) && !std.less(y, x)).

+ * The elements are compared using {@link less}. Two elements, x and y are considered equivalent + * if (!less(x, y) && !less(y, x)). * - *

The elements in the range shall already be {@link is_sorted sorted} according to this same criterion - * ({@link less}), or at least {@link is_partitioned partitioned} with respect to val.

+ * The elements in the range shall already be {@link is_sorted sorted} according to this same criterion + * ({@link less}), or at least {@link is_partitioned partitioned} with respect to val. * - *

If val is not equivalent to any value in the range, the subrange returned has a length of zero, with both + * If val is not equivalent to any value in the range, the subrange returned has a length of zero, with both * iterators pointing to the nearest value greater than val, if any, or to last, if val compares - * greater than all the elements in the range.

+ * greater than all the elements in the range. * * @param first {@link Iterator Forward iterator} to the initial position of a {@link is_sorted sorted} (or properly * {@link is_partitioned partitioned}) sequence. @@ -3061,20 +3051,20 @@ namespace std (first: ForwardIterator, last: ForwardIterator, val: T): boolean; /** - *

Get subrange of equal elements.

+ * Get subrange of equal elements. * - *

Returns the bounds of the subrange that includes all the elements of the range [first, last) with - * values equivalent to val.

+ * Returns the bounds of the subrange that includes all the elements of the range [first, last) with + * values equivalent to val. * - *

The elements are compared using {compare}. Two elements, x and y are considered equivalent - * if (!compare(x, y) && !compare(y, x)).

+ * The elements are compared using {compare}. Two elements, x and y are considered equivalent + * if (!compare(x, y) && !compare(y, x)). * - *

The elements in the range shall already be {@link is_sorted sorted} according to this same criterion - * (compare), or at least {@link is_partitioned partitioned} with respect to val.

+ * The elements in the range shall already be {@link is_sorted sorted} according to this same criterion + * (compare), or at least {@link is_partitioned partitioned} with respect to val. * - *

If val is not equivalent to any value in the range, the subrange returned has a length of zero, with both + * If val is not equivalent to any value in the range, the subrange returned has a length of zero, with both * iterators pointing to the nearest value greater than val, if any, or to last, if val compares - * greater than all the elements in the range.

+ * greater than all the elements in the range. * * @param first {@link Iterator Forward iterator} to the initial position of a {@link is_sorted sorted} (or properly * {@link is_partitioned partitioned}) sequence. @@ -3099,7 +3089,7 @@ namespace std export function binary_search> ( first: ForwardIterator, last: ForwardIterator, val: T, - compare: (x: T, y: T) => boolean = std.less + compare: (x: T, y: T) => boolean = less ): boolean { first = lower_bound(first, last, val, compare); @@ -3114,12 +3104,12 @@ namespace std PARTITION ========================================================= */ /** - *

Test whether range is partitioned.

+ * Test whether range is partitioned. * - *

Returns true if all the elements in the range [first, last) for which pred - * returns true precede those for which it returns false.

+ * Returns true if all the elements in the range [first, last) for which pred + * returns true precede those for which it returns false. * - *

If the range is {@link Container.empty empty}, the function returns true.

+ * If the range is {@link Container.empty empty}, the function returns true. * * @param first {@link Iterator Input iterator} to the initial position of the sequence. * @param last {@link Iterator Input iterator} to the final position of the sequence. The range used is @@ -3148,14 +3138,14 @@ namespace std } /** - *

Partition range in two.

+ * Partition range in two. * - *

Rearranges the elements from the range [first, last), in such a way that all the elements for + * Rearranges the elements from the range [first, last), in such a way that all the elements for * which pred returns true precede all those for which it returns false. The iterator - * returned points to the first element of the second group.

+ * returned points to the first element of the second group. * - *

The relative ordering within each group is not necessarily the same as before the call. See - * {@link stable_partition} for a function with a similar behavior but with stable ordering within each group.

+ * The relative ordering within each group is not necessarily the same as before the call. See + * {@link stable_partition} for a function with a similar behavior but with stable ordering within each group. * * @param first {@link Iterator Forward iterator} to the initial position of the sequence to partition. * @param last {@link Iterator Forward iterator} to the final position of the sequence to partition. The range used is @@ -3196,13 +3186,13 @@ namespace std } /** - *

Partition range in two - stable ordering.

+ * Partition range in two - stable ordering. * - *

Rearranges the elements in the range [first, last), in such a way that all the elements for which + * Rearranges the elements in the range [first, last), in such a way that all the elements for which * pred returns true precede all those for which it returns false, and, unlike - * function {@link partition}, the relative order of elements within each group is preserved.

+ * function {@link partition}, the relative order of elements within each group is preserved. * - *

This is generally implemented using an internal temporary buffer.

+ * This is generally implemented using an internal temporary buffer. * * @param first {@link Iterator Bidirectional iterator} to the initial position of the sequence to partition. * @param last {@link Iterator Bidirectional iterator} to the final position of the sequence to partition. The range @@ -3223,11 +3213,11 @@ namespace std } /** - *

Partition range into two.

+ * Partition range into two. * - *

Copies the elements in the range [first, last) for which pred returns true + * Copies the elements in the range [first, last) for which pred returns true * into the range pointed by result_true, and those for which it does not into the range pointed by - * result_false.

+ * result_false. * * @param first {@link Iterator Input iterator} to the initial position of the range to be copy-partitioned. * @param last {@link Iterator Input iterator} to the final position of the range to be copy-partitioned. The range @@ -3271,16 +3261,16 @@ namespace std } /** - *

Get partition point.

+ * Get partition point. * - *

Returns an iterator to the first element in the partitioned range [first, last) for which - * pred is not true, indicating its partition point.

+ * Returns an iterator to the first element in the partitioned range [first, last) for which + * pred is not true, indicating its partition point. * - *

The elements in the range shall already {@link is_partitioned be partitioned}, as if {@link partition} had been - * called with the same arguments.

+ * The elements in the range shall already {@link is_partitioned be partitioned}, as if {@link partition} had been + * called with the same arguments. * - *

The function optimizes the number of comparisons performed by comparing non-consecutive elements of the sorted - * range, which is specially efficient for {@link Iteartor random-access iterators}.

+ * The function optimizes the number of comparisons performed by comparing non-consecutive elements of the sorted + * range, which is specially efficient for {@link Iteartor random-access iterators}. * * @param first {@link Iterator Forward iterator} to the initial position of the partitioned sequence. * @param last {@link Iterator Forward iterator} to the final position of the partitioned sequence. The range checked @@ -3327,13 +3317,13 @@ namespace std MERGE --------------------------------------------------------- */ /** - *

Merge sorted ranges.

+ * Merge sorted ranges. * - *

Combines the elements in the sorted ranges [first1, last1) and [first2, last2), into - * a new range beginning at result with all its elements sorted.

+ * Combines the elements in the sorted ranges [first1, last1) and [first2, last2), into + * a new range beginning at result with all its elements sorted. * - *

The elements are compared using {@link less}. The elements in both ranges shall already be ordered according to - * this same criterion ({@link less}). The resulting range is also sorted according to this.

+ * The elements are compared using {@link less}. The elements in both ranges shall already be ordered according to + * this same criterion ({@link less}). The resulting range is also sorted according to this. * * @param first1 {@link Iterator Input iterator} to the initial position of the first sorted sequence. * @param last1 {@link Iterator Input iterator} to the final position of the first sorted sequence. The range used is @@ -3356,13 +3346,13 @@ namespace std ): OutputIterator; /** - *

Merge sorted ranges.

+ * Merge sorted ranges. * - *

Combines the elements in the sorted ranges [first1, last1) and [first2, last2), into - * a new range beginning at result with all its elements sorted.

+ * Combines the elements in the sorted ranges [first1, last1) and [first2, last2), into + * a new range beginning at result with all its elements sorted. * - *

The elements are compared using {@link less}. The elements in both ranges shall already be ordered according to - * this same criterion (compare). The resulting range is also sorted according to this.

+ * The elements are compared using {@link less}. The elements in both ranges shall already be ordered according to + * this same criterion (compare). The resulting range is also sorted according to this. * * @param first1 {@link Iterator Input iterator} to the initial position of the first sorted sequence. * @param last1 {@link Iterator Input iterator} to the final position of the first sorted sequence. The range used is @@ -3393,7 +3383,7 @@ namespace std OutputIterator extends base.ILinearIterator> ( first1: InputIterator1, last1: InputIterator1, first2: InputIterator2, last2: InputIterator2, - result: OutputIterator, compare: (x: T, y: T) => boolean = std.less + result: OutputIterator, compare: (x: T, y: T) => boolean = less ): OutputIterator { while (true) @@ -3419,16 +3409,16 @@ namespace std } /** - *

Merge consecutive sorted ranges.

+ * Merge consecutive sorted ranges. * - *

Merges two consecutive sorted ranges: [first, middle) and [middle, last), putting - * the result into the combined sorted range [first, last).

+ * Merges two consecutive sorted ranges: [first, middle) and [middle, last), putting + * the result into the combined sorted range [first, last). * - *

The elements are compared using {@link less}. The elements in both ranges shall already be ordered according to - * this same criterion ({@link less}). The resulting range is also sorted according to this.

+ * The elements are compared using {@link less}. The elements in both ranges shall already be ordered according to + * this same criterion ({@link less}). The resulting range is also sorted according to this. * - *

The function preserves the relative order of elements with equivalent values, with the elements in the first - * range preceding those equivalent in the second.

+ * The function preserves the relative order of elements with equivalent values, with the elements in the first + * range preceding those equivalent in the second. * * @param first {@link Iterator Bidirectional iterator} to the initial position in the first sorted sequence to merge. * This is also the initial position where the resulting merged range is stored. @@ -3443,16 +3433,16 @@ namespace std (first: BidirectionalIterator, middle: BidirectionalIterator, last: BidirectionalIterator): void; /** - *

Merge consecutive sorted ranges.

+ * Merge consecutive sorted ranges. * - *

Merges two consecutive sorted ranges: [first, middle) and [middle, last), putting - * the result into the combined sorted range [first, last).

+ * Merges two consecutive sorted ranges: [first, middle) and [middle, last), putting + * the result into the combined sorted range [first, last). * - *

The elements are compared using compare. The elements in both ranges shall already be ordered according - * to this same criterion (compare). The resulting range is also sorted according to this.

+ * The elements are compared using compare. The elements in both ranges shall already be ordered according + * to this same criterion (compare). The resulting range is also sorted according to this. * - *

The function preserves the relative order of elements with equivalent values, with the elements in the first - * range preceding those equivalent in the second.

+ * The function preserves the relative order of elements with equivalent values, with the elements in the first + * range preceding those equivalent in the second. * * @param first {@link Iterator Bidirectional iterator} to the initial position in the first sorted sequence to merge. * This is also the initial position where the resulting merged range is stored. @@ -3476,7 +3466,7 @@ namespace std export function inplace_merge> ( first: BidirectionalIterator, middle: BidirectionalIterator, last: BidirectionalIterator, - compare: (x: T, y: T) => boolean = std.less + compare: (x: T, y: T) => boolean = less ): void { let vector: Vector = new Vector(distance(first, last), null); @@ -3489,15 +3479,15 @@ namespace std SET OPERATIONS --------------------------------------------------------- */ /** - *

Test whether sorted range includes another sorted range.

+ * Test whether sorted range includes another sorted range. * - *

Returns true if the sorted range [first1, last1) contains all the elements in the - * sorted range [first2, last2).

+ * Returns true if the sorted range [first1, last1) contains all the elements in the + * sorted range [first2, last2). * - *

The elements are compared using {@link less}. Two elements, x and y are considered equivalent - * if (!std.less(x, y) && !std.less(y, x)).

+ * The elements are compared using {@link less}. Two elements, x and y are considered equivalent + * if (!less(x, y) && !less(y, x)). * - *

The elements in the range shall already be ordered according to this same criterion ({@link less}).

+ * The elements in the range shall already be ordered according to this same criterion ({@link less}). * * @param first1 {@link Iterator Input iterator} to the initial position of the first sorted sequence. * @param last1 {@link Iterator Input iterator} to the final position of the first sorted sequence (which is tested on @@ -3516,15 +3506,15 @@ namespace std (first1: InputIterator1, last1: InputIterator1, first2: InputIterator2, last2: InputIterator2): boolean; /** - *

Test whether sorted range includes another sorted range.

+ * Test whether sorted range includes another sorted range. * - *

Returns true if the sorted range [first1, last1) contains all the elements in the - * sorted range [first2, last2).

+ * Returns true if the sorted range [first1, last1) contains all the elements in the + * sorted range [first2, last2). * - *

The elements are compared using compare. Two elements, x and y are considered equivalent - * if (!compare(x, y) && !compare(y, x)).

+ * The elements are compared using compare. Two elements, x and y are considered equivalent + * if (!compare(x, y) && !compare(y, x)). * - *

The elements in the range shall already be ordered according to this same criterion (compare).

+ * The elements in the range shall already be ordered according to this same criterion (compare). * * @param first1 {@link Iterator Input iterator} to the initial position of the first sorted sequence. * @param last1 {@link Iterator Input iterator} to the final position of the first sorted sequence (which is tested on @@ -3552,7 +3542,7 @@ namespace std export function includes, InputIterator2 extends Iterator> ( first1: InputIterator1, last1: InputIterator1, first2: InputIterator2, last2: InputIterator2, - compare: (x: T, y: T) => boolean = std.less + compare: (x: T, y: T) => boolean = less ): boolean { while (!first2.equals(last2)) @@ -3569,20 +3559,20 @@ namespace std } /** - *

Union of two sorted ranges.

+ * Union of two sorted ranges. * - *

Constructs a sorted range beginning in the location pointed by result with the set union of the - * two sorted ranges [first1, last1) and [first2, last2).

+ * Constructs a sorted range beginning in the location pointed by result with the set union of the + * two sorted ranges [first1, last1) and [first2, last2). * - *

The union of two sets is formed by the elements that are present in either one of the sets, or in both. + * The union of two sets is formed by the elements that are present in either one of the sets, or in both. * Elements from the second range that have an equivalent element in the first range are not copied to the resulting - * range.

+ * range. * - *

The elements are compared using {@link less}. Two elements, x and y are considered equivalent - * if (!std.less(x, y) && !std.less(y, x)).

+ * The elements are compared using {@link less}. Two elements, x and y are considered equivalent + * if (!less(x, y) && !less(y, x)). * - *

The elements in the ranges shall already be ordered according to this same criterion ({@link less}). The - * resulting range is also sorted according to this.

+ * The elements in the ranges shall already be ordered according to this same criterion ({@link less}). The + * resulting range is also sorted according to this. * * @param first1 {@link Iterator Input iterator} to the initial position of the first sorted sequence. * @param last1 {@link Iterator Input iterator} to the final position of the first sorted sequence. The range used is @@ -3606,20 +3596,20 @@ namespace std ): OutputIterator; /** - *

Union of two sorted ranges.

+ * Union of two sorted ranges. * - *

Constructs a sorted range beginning in the location pointed by result with the set union of the - * two sorted ranges [first1, last1) and [first2, last2).

+ * Constructs a sorted range beginning in the location pointed by result with the set union of the + * two sorted ranges [first1, last1) and [first2, last2). * - *

The union of two sets is formed by the elements that are present in either one of the sets, or in both. + * The union of two sets is formed by the elements that are present in either one of the sets, or in both. * Elements from the second range that have an equivalent element in the first range are not copied to the resulting - * range.

+ * range. * - *

The elements are compared using compare. Two elements, x and y are considered equivalent - * if (!compare(x, y) && !compare(y, x)).

+ * The elements are compared using compare. Two elements, x and y are considered equivalent + * if (!compare(x, y) && !compare(y, x)). * - *

The elements in the ranges shall already be ordered according to this same criterion (compare). The - * resulting range is also sorted according to this.

+ * The elements in the ranges shall already be ordered according to this same criterion (compare). The + * resulting range is also sorted according to this. * * @param first1 {@link Iterator Input iterator} to the initial position of the first sorted sequence. * @param last1 {@link Iterator Input iterator} to the final position of the first sorted sequence. The range used is @@ -3652,7 +3642,7 @@ namespace std OutputIterator extends base.ILinearIterator> ( first1: InputIterator1, last1: InputIterator1, first2: InputIterator2, last2: InputIterator2, - result: OutputIterator, compare: (x: T, y: T) => boolean = std.less + result: OutputIterator, compare: (x: T, y: T) => boolean = less ): OutputIterator { while (true) @@ -3687,19 +3677,19 @@ namespace std } /** - *

Intersection of two sorted ranges.

+ * Intersection of two sorted ranges. * - *

Constructs a sorted range beginning in the location pointed by result with the set intersection of - * the two sorted ranges [first1, last1) and [first2, last2).

+ * Constructs a sorted range beginning in the location pointed by result with the set intersection of + * the two sorted ranges [first1, last1) and [first2, last2). * - *

The intersection of two sets is formed only by the elements that are present in both sets. The elements - * copied by the function come always from the first range, in the same order.

+ * The intersection of two sets is formed only by the elements that are present in both sets. The elements + * copied by the function come always from the first range, in the same order. * - *

The elements are compared using {@link less}. Two elements, x and y are considered equivalent - * if (!std.less(x, y) && !std.less(y, x)).

+ * The elements are compared using {@link less}. Two elements, x and y are considered equivalent + * if (!less(x, y) && !less(y, x)). * - *

The elements in the ranges shall already be ordered according to this same criterion ({@link less}). The - * resulting range is also sorted according to this.

+ * The elements in the ranges shall already be ordered according to this same criterion ({@link less}). The + * resulting range is also sorted according to this. * * @param first1 {@link Iterator Input iterator} to the initial position of the first sorted sequence. * @param last1 {@link Iterator Input iterator} to the final position of the first sorted sequence. The range used is @@ -3723,19 +3713,19 @@ namespace std ): OutputIterator; /** - *

Intersection of two sorted ranges.

+ * Intersection of two sorted ranges. * - *

Constructs a sorted range beginning in the location pointed by result with the set intersection of - * the two sorted ranges [first1, last1) and [first2, last2).

+ * Constructs a sorted range beginning in the location pointed by result with the set intersection of + * the two sorted ranges [first1, last1) and [first2, last2). * - *

The intersection of two sets is formed only by the elements that are present in both sets. The elements - * copied by the function come always from the first range, in the same order.

+ * The intersection of two sets is formed only by the elements that are present in both sets. The elements + * copied by the function come always from the first range, in the same order. * - *

The elements are compared using compare. Two elements, x and y are considered equivalent - * if (!compare(x, y) && !compare(y, x)).

+ * The elements are compared using compare. Two elements, x and y are considered equivalent + * if (!compare(x, y) && !compare(y, x)). * - *

The elements in the ranges shall already be ordered according to this same criterion (compare). The - * resulting range is also sorted according to this.

+ * The elements in the ranges shall already be ordered according to this same criterion (compare). The + * resulting range is also sorted according to this. * * @param first1 {@link Iterator Input iterator} to the initial position of the first sorted sequence. * @param last1 {@link Iterator Input iterator} to the final position of the first sorted sequence. The range used is @@ -3768,7 +3758,7 @@ namespace std OutputIterator extends base.ILinearIterator> ( first1: InputIterator1, last1: InputIterator1, first2: InputIterator2, last2: InputIterator2, - result: OutputIterator, compare: (x: T, y: T) => boolean = std.less + result: OutputIterator, compare: (x: T, y: T) => boolean = less ): OutputIterator { while (true) @@ -3794,25 +3784,24 @@ namespace std } /** - *

Difference of two sorted ranges.

+ * Difference of two sorted ranges. * - *

Constructs a sorted range beginning in the location pointed by result with the set difference of - * the sorted range [first1, last1) with respect to the sorted range [first2, last2).

+ * Constructs a sorted range beginning in the location pointed by result with the set difference of + * the sorted range [first1, last1) with respect to the sorted range [first2, last2). * - *

The difference of two sets is formed by the elements that are present in the first set, but not in the - * second one. The elements copied by the function come always from the first range, in the same order.

+ * The difference of two sets is formed by the elements that are present in the first set, but not in the + * second one. The elements copied by the function come always from the first range, in the same order. * - *

For containers supporting multiple occurrences of a value, the difference includes as many occurrences of - * a given value as in the first range, minus the amount of matching elements in the second, preserving order.

+ * For containers supporting multiple occurrences of a value, the difference includes as many occurrences of + * a given value as in the first range, minus the amount of matching elements in the second, preserving order. * - *

Notice that this is a directional operation - for a symmetrical equivalent, see {@link set_symmetric_difference}. - *

+ * Notice that this is a directional operation - for a symmetrical equivalent, see {@link set_symmetric_difference}. * - *

The elements are compared using {@link less}. Two elements, x and y are considered equivalent - * if (!std.less(x, y) && !std.less(y, x)).

+ * The elements are compared using {@link less}. Two elements, x and y are considered equivalent + * if (!less(x, y) && !less(y, x)). * - *

The elements in the ranges shall already be ordered according to this same criterion ({@link less}). The - * resulting range is also sorted according to this.

+ * The elements in the ranges shall already be ordered according to this same criterion ({@link less}). The + * resulting range is also sorted according to this. * * @param first1 {@link Iterator Input iterator} to the initial position of the first sorted sequence. * @param last1 {@link Iterator Input iterator} to the final position of the first sorted sequence. The range used is @@ -3836,25 +3825,24 @@ namespace std ): OutputIterator; /** - *

Difference of two sorted ranges.

+ * Difference of two sorted ranges. * - *

Constructs a sorted range beginning in the location pointed by result with the set difference of - * the sorted range [first1, last1) with respect to the sorted range [first2, last2).

+ * Constructs a sorted range beginning in the location pointed by result with the set difference of + * the sorted range [first1, last1) with respect to the sorted range [first2, last2). * - *

The difference of two sets is formed by the elements that are present in the first set, but not in the - * second one. The elements copied by the function come always from the first range, in the same order.

+ * The difference of two sets is formed by the elements that are present in the first set, but not in the + * second one. The elements copied by the function come always from the first range, in the same order. * - *

For containers supporting multiple occurrences of a value, the difference includes as many occurrences of - * a given value as in the first range, minus the amount of matching elements in the second, preserving order.

+ * For containers supporting multiple occurrences of a value, the difference includes as many occurrences of + * a given value as in the first range, minus the amount of matching elements in the second, preserving order. * - *

Notice that this is a directional operation - for a symmetrical equivalent, see {@link set_symmetric_difference}. - *

+ * Notice that this is a directional operation - for a symmetrical equivalent, see {@link set_symmetric_difference}. * - *

The elements are compared using compare. Two elements, x and y are considered equivalent - * if (!compare(x, y) && !compare(y, x)).

+ * The elements are compared using compare. Two elements, x and y are considered equivalent + * if (!compare(x, y) && !compare(y, x)). * - *

The elements in the ranges shall already be ordered according to this same criterion (compare). The - * resulting range is also sorted according to this.

+ * The elements in the ranges shall already be ordered according to this same criterion (compare). The + * resulting range is also sorted according to this. * * @param first1 {@link Iterator Input iterator} to the initial position of the first sorted sequence. * @param last1 {@link Iterator Input iterator} to the final position of the first sorted sequence. The range used is @@ -3887,18 +3875,18 @@ namespace std OutputIterator extends base.ILinearIterator> ( first1: InputIterator1, last1: InputIterator1, first2: InputIterator2, last2: InputIterator2, - result: OutputIterator, compare: (x: T, y: T) => boolean = std.less + result: OutputIterator, compare: (x: T, y: T) => boolean = less ): OutputIterator { while (!first1.equals(last1) && !first2.equals(last2)) - if (std.less(first1.value, first2.value)) + if (less(first1.value, first2.value)) { result.value = first1.value; result = result.next() as OutputIterator; first1 = first1.next() as InputIterator1; } - else if (std.less(first2.value, first1.value)) + else if (less(first2.value, first1.value)) first2 = first2.next() as InputIterator2; else { @@ -3910,21 +3898,20 @@ namespace std } /** - *

Symmetric difference of two sorted ranges.

+ * Symmetric difference of two sorted ranges. * - *

Constructs a sorted range beginning in the location pointed by0 result with the set + * Constructs a sorted range beginning in the location pointed by0 result with the set * symmetric difference of the two sorted ranges [first1, last1) and [first2, last2). - *

* - *

The symmetric difference of two sets is formed by the elements that are present in one of the sets, but + * The symmetric difference of two sets is formed by the elements that are present in one of the sets, but * not in the other. Among the equivalent elements in each range, those discarded are those that appear before in the - * existent order before the call. The existing order is also preserved for the copied elements.

+ * existent order before the call. The existing order is also preserved for the copied elements. * - *

The elements are compared using {@link less}. Two elements, x and y are considered equivalent - * if (!std.less(x, y) && !std.less(y, x)).

+ * The elements are compared using {@link less}. Two elements, x and y are considered equivalent + * if (!less(x, y) && !less(y, x)). * - *

The elements in the ranges shall already be ordered according to this same criterion ({@link std.less}). The - * resulting range is also sorted according to this.

+ * The elements in the ranges shall already be ordered according to this same criterion ({@link less}). The + * resulting range is also sorted according to this. * * @param first1 {@link Iterator Input iterator} to the initial position of the first sorted sequence. * @param last1 {@link Iterator Input iterator} to the final position of the first sorted sequence. The range used is @@ -3952,21 +3939,20 @@ namespace std ): OutputIterator; /** - *

Symmetric difference of two sorted ranges.

+ * Symmetric difference of two sorted ranges. * - *

Constructs a sorted range beginning in the location pointed by0 result with the set + * Constructs a sorted range beginning in the location pointed by0 result with the set * symmetric difference of the two sorted ranges [first1, last1) and [first2, last2). - *

* - *

The symmetric difference of two sets is formed by the elements that are present in one of the sets, but + * The symmetric difference of two sets is formed by the elements that are present in one of the sets, but * not in the other. Among the equivalent elements in each range, those discarded are those that appear before in the - * existent order before the call. The existing order is also preserved for the copied elements.

+ * existent order before the call. The existing order is also preserved for the copied elements. * - *

The elements are compared using compare. Two elements, x and y are considered equivalent - * if (!compare(x, y) && !compare(y, x)).

+ * The elements are compared using compare. Two elements, x and y are considered equivalent + * if (!compare(x, y) && !compare(y, x)). * - *

The elements in the ranges shall already be ordered according to this same criterion (compare). The - * resulting range is also sorted according to this.

+ * The elements in the ranges shall already be ordered according to this same criterion (compare). The + * resulting range is also sorted according to this. * * @param first1 {@link Iterator Input iterator} to the initial position of the first sorted sequence. * @param last1 {@link Iterator Input iterator} to the final position of the first sorted sequence. The range used is @@ -3999,7 +3985,7 @@ namespace std OutputIterator extends base.ILinearIterator> ( first1: InputIterator1, last1: InputIterator1, first2: InputIterator2, last2: InputIterator2, - result: OutputIterator, compare: (x: T, y: T) => boolean = std.less + result: OutputIterator, compare: (x: T, y: T) => boolean = less ): OutputIterator { while (true) @@ -4038,13 +4024,14 @@ namespace std MATHMATICS - MIN & MAX - PERMUTATION + - MISCELLANEOUS ============================================================ MIN & MAX --------------------------------------------------------- */ /** - *

Return the smallest.

+ * Return the smallest. * - *

Returns the smallest of all the elements in the args.

+ * Returns the smallest of all the elements in the args. * * @param args Values to compare. * @@ -4055,16 +4042,16 @@ namespace std let minimum: T = args[0]; for (let i: number = 1; i < args.length; i++) - if (std.less(args[i], minimum)) + if (less(args[i], minimum)) minimum = args[i]; return minimum; } /** - *

Return the largest.

+ * Return the largest. * - *

Returns the largest of all the elements in the args.

+ * Returns the largest of all the elements in the args. * * @param args Values to compare. * @@ -4075,17 +4062,17 @@ namespace std let maximum: T = args[0]; for (let i: number = 1; i < args.length; i++) - if (std.greater(args[i], maximum)) + if (greater(args[i], maximum)) maximum = args[i]; return maximum; } /** - *

Return smallest and largest elements.

+ * Return smallest and largest elements. * - *

Returns a {@link Pair} with the smallest of all the elements in the args as first element (the first of - * them, if there are more than one), and the largest as second (the last of them, if there are more than one).

+ * Returns a {@link Pair} with the smallest of all the elements in the args as first element (the first of + * them, if there are more than one), and the largest as second (the last of them, if there are more than one). * * @param args Values to compare. * @@ -4098,9 +4085,9 @@ namespace std for (let i: number = 1; i < args.length; i++) { - if (std.less(args[i], minimum)) + if (less(args[i], minimum)) minimum = args[i]; - if (std.greater(args[i], maximum)) + if (greater(args[i], maximum)) maximum = args[i]; } @@ -4108,14 +4095,13 @@ namespace std } /** - *

Return smallest element in range.

+ * Return smallest element in range. * - *

Returns an iterator pointing to the element with the smallest value in the range [first, last). - *

+ * Returns an iterator pointing to the element with the smallest value in the range [first, last). * - *

The comparisons are performed using either {@link less}; An element is the smallest if no other element + * The comparisons are performed using either {@link less}; An element is the smallest if no other element * compares less than it. If more than one element fulfills this condition, the iterator returned points to the first - * of such elements.

+ * of such elements. * * @param first {@link Iteartor Input iterator} to the initial final position of the sequence to compare. * @param last {@link Iteartor Input iterator} to the final final position of the sequence to compare. The range used @@ -4128,14 +4114,13 @@ namespace std (first: ForwardIterator, last: ForwardIterator): ForwardIterator; /** - *

Return smallest element in range.

+ * Return smallest element in range. * - *

Returns an iterator pointing to the element with the smallest value in the range [first, last). - *

+ * Returns an iterator pointing to the element with the smallest value in the range [first, last). * - *

The comparisons are performed using either compare; An element is the smallest if no other element + * The comparisons are performed using either compare; An element is the smallest if no other element * compares less than it. If more than one element fulfills this condition, the iterator returned points to the first - * of such elements.

+ * of such elements. * * @param first {@link Iteartor Input iterator} to the initial final position of the sequence to compare. * @param last {@link Iteartor Input iterator} to the final final position of the sequence to compare. The range used @@ -4151,7 +4136,7 @@ namespace std (first: ForwardIterator, last: ForwardIterator, compare: (x: T, y: T) => boolean): ForwardIterator; export function min_element> - (first: ForwardIterator, last: ForwardIterator, compare: (x: T, y: T) => boolean = std.less): ForwardIterator + (first: ForwardIterator, last: ForwardIterator, compare: (x: T, y: T) => boolean = less): ForwardIterator { let smallest: ForwardIterator = first; first = first.next() as ForwardIterator; @@ -4164,14 +4149,13 @@ namespace std } /** - *

Return largest element in range.

+ * Return largest element in range. * - *

Returns an iterator pointing to the element with the largest value in the range [first, last). - *

+ * Returns an iterator pointing to the element with the largest value in the range [first, last). * - *

The comparisons are performed using either {@link greater}; An element is the largest if no other element + * The comparisons are performed using either {@link greater}; An element is the largest if no other element * compares less than it. If more than one element fulfills this condition, the iterator returned points to the first - * of such elements.

+ * of such elements. * * @param first {@link Iteartor Input iterator} to the initial final position of the sequence to compare. * @param last {@link Iteartor Input iterator} to the final final position of the sequence to compare. The range used @@ -4184,14 +4168,13 @@ namespace std (first: ForwardIterator, last: ForwardIterator): ForwardIterator; /** - *

Return largest element in range.

+ * Return largest element in range. * - *

Returns an iterator pointing to the element with the largest value in the range [first, last). - *

+ * Returns an iterator pointing to the element with the largest value in the range [first, last). * - *

The comparisons are performed using either compare; An element is the largest if no other element + * The comparisons are performed using either compare; An element is the largest if no other element * compares less than it. If more than one element fulfills this condition, the iterator returned points to the first - * of such elements.

+ * of such elements. * * @param first {@link Iteartor Input iterator} to the initial final position of the sequence to compare. * @param last {@link Iteartor Input iterator} to the final final position of the sequence to compare. The range used @@ -4207,7 +4190,7 @@ namespace std (first: ForwardIterator, last: ForwardIterator, compare: (x: T, y: T) => boolean): ForwardIterator; export function max_element> - (first: ForwardIterator, last: ForwardIterator, compare: (x: T, y: T) => boolean = std.greater): ForwardIterator + (first: ForwardIterator, last: ForwardIterator, compare: (x: T, y: T) => boolean = greater): ForwardIterator { let largest: ForwardIterator = first; first = first.next() as ForwardIterator; @@ -4220,18 +4203,18 @@ namespace std } /** - *

Return smallest and largest elements in range.

+ * Return smallest and largest elements in range. * - *

Returns a {@link Pair} with an iterator pointing to the element with the smallest value in the range - * [first, last) as first element, and the largest as second.

+ * Returns a {@link Pair} with an iterator pointing to the element with the smallest value in the range + * [first, last) as first element, and the largest as second. * - *

The comparisons are performed using either {@link less} and {@link greater}.

+ * The comparisons are performed using either {@link less} and {@link greater}. * - *

If more than one equivalent element has the smallest value, the first iterator points to the first of such - * elements.

+ * If more than one equivalent element has the smallest value, the first iterator points to the first of such + * elements. * - *

If more than one equivalent element has the largest value, the second iterator points to the last of such - * elements.

+ * If more than one equivalent element has the largest value, the second iterator points to the last of such + * elements. * * @param first {@link Iteartor Input iterator} to the initial final position of the sequence to compare. * @param last {@link Iteartor Input iterator} to the final final position of the sequence to compare. The range used @@ -4248,18 +4231,18 @@ namespace std (first: ForwardIterator, last: ForwardIterator): Pair; /** - *

Return smallest and largest elements in range.

+ * Return smallest and largest elements in range. * - *

Returns a {@link Pair} with an iterator pointing to the element with the smallest value in the range - * [first, last) as first element, and the largest as second.

+ * Returns a {@link Pair} with an iterator pointing to the element with the smallest value in the range + * [first, last) as first element, and the largest as second. * - *

The comparisons are performed using either compare.

+ * The comparisons are performed using either compare. * - *

If more than one equivalent element has the smallest value, the first iterator points to the first of such - * elements.

+ * If more than one equivalent element has the smallest value, the first iterator points to the first of such + * elements. * - *

If more than one equivalent element has the largest value, the second iterator points to the last of such - * elements.

+ * If more than one equivalent element has the largest value, the second iterator points to the last of such + * elements. * * @param first {@link Iteartor Input iterator} to the initial final position of the sequence to compare. * @param last {@link Iteartor Input iterator} to the final final position of the sequence to compare. The range used @@ -4279,7 +4262,7 @@ namespace std export function minmax_element> ( - first: ForwardIterator, last: ForwardIterator, compare: (x: T, y: T) => boolean = std.greater + first: ForwardIterator, last: ForwardIterator, compare: (x: T, y: T) => boolean = greater ): Pair { let smallest: ForwardIterator = first; @@ -4297,15 +4280,48 @@ namespace std return make_pair(smallest, largest); } + /** + * Clamp a value between a pair of boundary. + * + * @param v The value to clamp. + * @param lo Start of the boundaries to clamp *v* to. + * @param hi Terminal of the boundaries to clamp *v* to. + * + * @return *lo* if *v* is less than *lo*, *hi* if *hi* is less than *v*, otherwise *v*. + */ + export function clamp(v: T, lo: T, hi: T): T; + + /** + * Clamp a value between a pair of boundary. + * + * @param v The value to clamp. + * @param lo Start of the boundaries to clamp *v* to. + * @param hi Terminal of the boundaries to clamp *v* to. + * @param comp Binary function that accepts two elements as arguments (one of each of the two sequences, in the + * same order), and returns a value convertible to bool. The value returned indicates + * whether the elements are considered to match in the context of this function. + * + * @return *lo* if *v* is less than *lo*, *hi* if *hi* is less than *v*, otherwise *v*. + */ + export function clamp(v: T, lo: T, hi: T, comp: (x: T, y: T) => boolean): T; + + export function clamp(v: T, lo: T, hi: T, comp: (x: T, y: T) => boolean = less): T + { + let vec: Vector = new Vector([v, lo, hi]); + sort(vec.begin(), vec.end(), comp); + + return vec.at(1); + } + /* --------------------------------------------------------- PERMUATATIONS --------------------------------------------------------- */ /** - *

Test whether range is permutation of another.

+ * Test whether range is permutation of another. * - *

Compares the elements in the range [first1, last1) with those in the range beginning at + * Compares the elements in the range [first1, last1) with those in the range beginning at * first2, and returns true if all of the elements in both ranges match, even in a different - * order.

+ * order. * * @param first1 An {@link Iterator} to the initial position of the first sequence. * @param last1 An {@link Iterator} to the final position in a sequence. The range used is @@ -4322,11 +4338,11 @@ namespace std (first1: Iterator1, last1: Iterator1, first2: Iterator2): boolean; /** - *

Test whether range is permutation of another.

+ * Test whether range is permutation of another. * - *

Compares the elements in the range [first1, last1) with those in the range beginning at + * Compares the elements in the range [first1, last1) with those in the range beginning at * first2, and returns true if all of the elements in both ranges match, even in a different - * order.

+ * order. * * @param first1 An {@link Iterator} to the initial position of the first sequence. * @param last1 An {@link Iterator} to the final position in a sequence. The range used is @@ -4352,7 +4368,7 @@ namespace std , Iterator2 extends Iterator> ( first1: Iterator1, last1: Iterator1, first2: Iterator2, - pred: (x: T, y: T) => boolean = std.equal_to + pred: (x: T, y: T) => boolean = equal_to ): boolean { // find the mismatched @@ -4386,7 +4402,7 @@ namespace std * that would compare *lexicographically smaller* to all other permutations) is the one which has all its elements * sorted in ascending order, and the largest has all its elements sorted in descending order. * - * The comparisons of individual elements are performed using the {@link std.less std.less()} function. + * The comparisons of individual elements are performed using the {@link less less()} function. * * If the function can determine the previous permutation, it rearranges the elements as such and returns true. If * that was not possible (because it is already at the lowest possible permutation), it rearranges the elements @@ -4437,7 +4453,7 @@ namespace std (first: BidirectionalIterator, last: BidirectionalIterator, compare: (x: T, y: T) => boolean): boolean; export function prev_permutation> - (first: BidirectionalIterator, last: BidirectionalIterator, compare: (x: T, y: T) => boolean = std.less): boolean + (first: BidirectionalIterator, last: BidirectionalIterator, compare: (x: T, y: T) => boolean = less): boolean { if (first.equals(last) == true) return false; @@ -4458,14 +4474,14 @@ namespace std while (compare(y.value, i.value) == false) y = y.prev() as BidirectionalIterator; - std.iter_swap(i, y); - std.reverse(x, last); + iter_swap(i, y); + reverse(x, last); return true; } if (i.equals(first) == true) { - std.reverse(first, last); + reverse(first, last); return false; } } @@ -4482,7 +4498,7 @@ namespace std * that would compare *lexicographically smaller* to all other permutations) is the one which has all its elements * sorted in ascending order, and the largest has all its elements sorted in descending order. * - * The comparisons of individual elements are performed using the {@link std.less} function. + * The comparisons of individual elements are performed using the {@link less} function. * * If the function can determine the next higher permutation, it rearranges the elements as such and returns true. If * that was not possible (because it is already at the largest possible permutation), it rearranges the elements @@ -4533,7 +4549,7 @@ namespace std (first: BidirectionalIterator, last: BidirectionalIterator, compare: (x: T, y: T) => boolean): boolean; export function next_permutation> - (first: BidirectionalIterator, last: BidirectionalIterator, compare: (x: T, y: T) => boolean = std.less): boolean + (first: BidirectionalIterator, last: BidirectionalIterator, compare: (x: T, y: T) => boolean = less): boolean { if (first.equals(last) == true) return false; @@ -4554,14 +4570,14 @@ namespace std while (compare(i.value, y.value) == false) y = y.prev() as BidirectionalIterator; - std.iter_swap(i, y); - std.reverse(x, last); + iter_swap(i, y); + reverse(x, last); return true; } if (i.equals(first) == true) { - std.reverse(first, last); + reverse(first, last); return false; } } diff --git a/ts/src/std/Deque.ts b/ts/src/std/Deque.ts index 53ed098d..0c52a69a 100644 --- a/ts/src/std/Deque.ts +++ b/ts/src/std/Deque.ts @@ -5,46 +5,46 @@ namespace std.Deque { - export type iterator = std.DequeIterator; - export type reverse_iterator = std.DequeReverseIterator; + export type iterator = DequeIterator; + export type reverse_iterator = DequeReverseIterator; } namespace std { /** - *

Double ended queue.

+ * Double ended queue. * - *

{@link Deque} (usually pronounced like "deck") is an irregular acronym of + * {@link Deque} (usually pronounced like "deck") is an irregular acronym of * double-ended queue. Double-ended queues are sequence containers with dynamic sizes that can be - * expanded or contracted on both ends (either its front or its back).

+ * expanded or contracted on both ends (either its front or its back). * - *

Specific libraries may implement deques in different ways, generally as some form of dynamic array. But in any + * Specific libraries may implement deques in different ways, generally as some form of dynamic array. But in any * case, they allow for the individual elements to be accessed directly through random access iterators, with storage - * handled automatically by expanding and contracting the container as needed.

+ * handled automatically by expanding and contracting the container as needed. * - *

Therefore, they provide a functionality similar to vectors, but with efficient insertion and deletion of + * Therefore, they provide a functionality similar to vectors, but with efficient insertion and deletion of * elements also at the beginning of the sequence, and not only at its end. But, unlike {@link Vector Vectors}, * {@link Deque Deques} are not guaranteed to store all its elements in contiguous storage locations: accessing - * elements in a deque by offsetting a pointer to another element causes undefined behavior.

+ * elements in a deque by offsetting a pointer to another element causes undefined behavior. * - *

Both {@link Vector}s and {@link Deque}s provide a very similar interface and can be used for similar purposes, + * Both {@link Vector}s and {@link Deque}s provide a very similar interface and can be used for similar purposes, * but internally both work in quite different ways: While {@link Vector}s use a single array that needs to be * occasionally reallocated for growth, the elements of a {@link Deque} can be scattered in different chunks of * storage, with the container keeping the necessary information internally to provide direct access to any of its * elements in constant time and with a uniform sequential interface (through iterators). Therefore, * {@link Deque Deques} are a little more complex internally than {@link Vector}s, but this allows them to grow more * efficiently under certain circumstances, especially with very long sequences, where reallocations become more - * expensive.

+ * expensive. * - *

For operations that involve frequent insertion or removals of elements at positions other than the beginning or + * For operations that involve frequent insertion or removals of elements at positions other than the beginning or * the end, {@link Deque Deques} perform worse and have less consistent iterators and references than - * {@link List Lists}.

+ * {@link List Lists}. * - *

+ * * - *

+ * * - *

Container properties

+ * ### Container properties *
*
Sequence
*
Elements in sequence containers are ordered in a strict linear sequence. Individual elements @@ -152,25 +152,25 @@ namespace std CONSTURCTORS --------------------------------------------------------- */ /** - *

Default Constructor.

+ * Default Constructor. * - *

Constructs an empty container, with no elements.

+ * Constructs an empty container, with no elements. */ public constructor(); /** - *

Initializer list Constructor.

+ * Initializer list Constructor. * - *

Constructs a container with a copy of each of the elements in array, in the same order.

+ * Constructs a container with a copy of each of the elements in array, in the same order. * * @param array An array containing elements to be copied and contained. */ public constructor(items: Array); /** - *

Fill Constructor.

+ * Fill Constructor. * - *

Constructs a container with n elements. Each element is a copy of val (if provided).

+ * Constructs a container with n elements. Each element is a copy of val (if provided). * * @param n Initial container size (i.e., the number of elements in the container at construction). * @param val Value to fill the container with. Each of the n elements in the container is @@ -179,9 +179,9 @@ namespace std public constructor(size: number, val: T); /** - *

Copy Constructor.

+ * Copy Constructor. * - *

Constructs a container with a copy of each of the elements in container, in the same order.

+ * Constructs a container with a copy of each of the elements in container, in the same order. * * @param container Another container object of the same type (with the same class template * arguments T), whose contents are either copied or acquired. @@ -189,10 +189,10 @@ namespace std public constructor(container: Deque); /** - *

Range Constructor.

+ * Range Constructor. * - *

Constructs a container with as many elements as the range (begin, end), with each - * element emplace-constructed from its corresponding element in that range, in the same order.

+ * Constructs a container with as many elements as the range (begin, end), with each + * element emplace-constructed from its corresponding element in that range, in the same order. * * @param begin Input interator of the initial position in a sequence. * @param end Input interator of the final position in a sequence. @@ -306,20 +306,20 @@ namespace std } /** - *

Request a change in capacity.

+ * Request a change in capacity. * - *

Requests that the {@link Deque container} {@link capacity} be at least enough to contain - * n elements.

+ * Requests that the {@link Deque container} {@link capacity} be at least enough to contain + * n elements. * - *

If n is greater than the current {@link Deque container} {@link capacity}, the + * If n is greater than the current {@link Deque container} {@link capacity}, the * function causes the {@link Deque container} to reallocate its storage increasing its - * {@link capacity} to n (or greater).

+ * {@link capacity} to n (or greater). * - *

In all other cases, the function call does not cause a reallocation and the - * {@link Deque container} {@link capacity} is not affected.

+ * In all other cases, the function call does not cause a reallocation and the + * {@link Deque container} {@link capacity} is not affected. * - *

This function has no effect on the {@link Deque container} {@link size} and cannot alter - * its elements.

+ * This function has no effect on the {@link Deque container} {@link size} and cannot alter + * its elements. * * @param n Minimum {@link capacity} for the {@link Deque container}. * Note that the resulting {@link capacity} may be equal or greater than n. @@ -425,23 +425,23 @@ namespace std } /** - *

Return size of allocated storage capacity.

+ * Return size of allocated storage capacity. * - *

Returns the size of the storage space currently allocated for the {@link Deque container}, - * expressed in terms of elements.

+ * Returns the size of the storage space currently allocated for the {@link Deque container}, + * expressed in terms of elements. * - *

This {@link capacity} is not necessarily equal to the {@link Deque container} {@link size}. + * This {@link capacity} is not necessarily equal to the {@link Deque container} {@link size}. * It can be equal or greater, with the extra space allowing to accommodate for growth without the - * need to reallocate on each insertion.

+ * need to reallocate on each insertion. * - *

Notice that this {@link capacity} does not suppose a limit on the {@link size} of the + * Notice that this {@link capacity} does not suppose a limit on the {@link size} of the * {@link Deque container}. When this {@link capacity} is exhausted and more is needed, it is * automatically expanded by the {@link Deque container} (reallocating it storage space). * The theoretical limit on the {@link size} of a {@link Deque container} is given by member - * {@link max_size}.

+ * {@link max_size}. * - *

The {@link capacity} of a {@link Deque container} can be explicitly altered by calling member - * {@link Deque.reserve}.

+ * The {@link capacity} of a {@link Deque container} can be explicitly altered by calling member + * {@link Deque.reserve}. * * @return The size of the currently allocated storage capacity in the {@link Deque container}, * measured in terms of the number elements it can hold. @@ -895,17 +895,17 @@ namespace std SWAP --------------------------------------------------------- */ /** - *

Swap content.

+ * Swap content. * - *

Exchanges the content of the container by the content of obj, which is another - * {@link Deque container} object with same type of elements. Sizes and container type may differ.

+ * Exchanges the content of the container by the content of obj, which is another + * {@link Deque container} object with same type of elements. Sizes and container type may differ. * - *

After the call to this member function, the elements in this container are those which were in obj + * After the call to this member function, the elements in this container are those which were in obj * before the call, and the elements of obj are those which were in this. All iterators, references and - * pointers remain valid for the swapped objects.

+ * pointers remain valid for the swapped objects. * - *

Notice that a non-member function exists with the same name, {@link std.swap swap}, overloading that - * algorithm with an optimization that behaves like this member function.

+ * Notice that a non-member function exists with the same name, {@link swap swap}, overloading that + * algorithm with an optimization that behaves like this member function. * * @param obj Another {@link Deque container} of the same type of elements (i.e., instantiated * with the same template parameter, T) whose content is swapped with that of this @@ -936,11 +936,10 @@ namespace std namespace std { /** - *

An iterator of {@link Deque}.

+ * An iterator of {@link Deque}. * - *

+ * * - *

* * @author Jeongho Nam */ @@ -949,7 +948,7 @@ namespace std implements base.IArrayIterator { /** - * Sequence number of iterator in the source {@link Deque}. + * @hidden */ private index_: number; @@ -957,11 +956,12 @@ namespace std CONSTRUCTORS --------------------------------------------------------- */ /** - *

Construct from the source {@link Deque container}.

+ * Construct from the source {@link Deque container}. * - *

Note

- *

Do not create the iterator directly, by yourself.

- *

Use {@link Deque.begin begin()}, {@link Deque.end end()} in {@link Deque container} instead.

+ * #### Note + * Do not create the iterator directly, by yourself. + * + * Use {@link Deque.begin begin()}, {@link Deque.end end()} in {@link Deque container} instead. * * @param source The source {@link Deque container} to reference. * @param index Sequence number of the element in the source {@link Deque}. @@ -1078,11 +1078,10 @@ namespace std namespace std { /** - *

A reverse-iterator of Deque.

+ * A reverse-iterator of Deque. * - *

+ * * - *

* * @param Type of the elements. * diff --git a/ts/src/std/Exception.ts b/ts/src/std/Exception.ts index 6c8e288d..fc9082ed 100644 --- a/ts/src/std/Exception.ts +++ b/ts/src/std/Exception.ts @@ -11,26 +11,26 @@ namespace std { /** - *

Function handling termination on exception

+ * Function handling termination on exception * - *

Calls the current terminate handler.

+ * Calls the current terminate handler. * - *

By default, the terminate handler calls abort. But this behavior can be redefined by calling - * {@link set_terminate}.

+ * By default, the terminate handler calls abort. But this behavior can be redefined by calling + * {@link set_terminate}. * - *

This function is automatically called when no catch handler can be found for a thrown exception, - * or for some other exceptional circumstance that makes impossible to continue the exception handling process.

+ * This function is automatically called when no catch handler can be found for a thrown exception, + * or for some other exceptional circumstance that makes impossible to continue the exception handling process. * - *

This function is provided so that the terminate handler can be explicitly called by a program that needs to + * This function is provided so that the terminate handler can be explicitly called by a program that needs to * abnormally terminate, and works even if {@link set_terminate} has not been used to set a custom terminate handler - * (calling abort in this case).

+ * (calling abort in this case). */ export function terminate(): void { if (_Terminate_handler != null) _Terminate_handler(); - if (std.is_node() == true) + if (is_node() == true) process.exit(); else { @@ -40,15 +40,15 @@ namespace std } /** - *

Set terminate handler function.

+ * Set terminate handler function. * - *

A terminate handler function is a function automatically called when the exception handling process has + * A terminate handler function is a function automatically called when the exception handling process has * to be abandoned for some reason. This happens when no catch handler can be found for a thrown exception, or for - * some other exceptional circumstance that makes impossible to continue the exception handling process.

+ * some other exceptional circumstance that makes impossible to continue the exception handling process. * - *

Before this function is called by the program for the first time, the default behavior is to call abort.

+ * Before this function is called by the program for the first time, the default behavior is to call abort. * - *

A program may explicitly call the current terminate handler function by calling {@link terminate}.

+ * A program may explicitly call the current terminate handler function by calling {@link terminate}. * * @param f Function that takes no parameters and returns no value (void). */ @@ -56,7 +56,7 @@ namespace std { _Terminate_handler = f; - if (std.is_node() == true) + if (is_node() == true) process.on("uncaughtException", function (error: Error): void { @@ -72,14 +72,14 @@ namespace std } /** - *

Get terminate handler function.

+ * Get terminate handler function. * - *

The terminate handler function is automatically called when no catch handler can be found + * The terminate handler function is automatically called when no catch handler can be found * for a thrown exception, or for some other exceptional circumstance that makes impossible to continue the exception - * handling process.

+ * handling process. * - *

If no such function has been set by a previous call to {@link set_terminate}, the function returns a - * null-pointer.

+ * If no such function has been set by a previous call to {@link set_terminate}, the function returns a + * null-pointer. * * @return If {@link set_terminate} has previously been called by the program, the function returns the current * terminate handler function. Otherwise, it returns a null-pointer. @@ -103,15 +103,15 @@ namespace std - UNDERFLOW_ERROR ========================================================= */ /** - *

Standard exception class.

+ * Standard exception class. * - *

Base class for standard exceptions.

+ * Base class for standard exceptions. * - *

All objects thrown by components of the standard library are derived from this class. - * Therefore, all standard exceptions can be caught by catching this type by reference.

+ * All objects thrown by components of the standard library are derived from this class. + * Therefore, all standard exceptions can be caught by catching this type by reference. * - *

- *

+ * + * * * @reference http://www.cplusplus.com/reference/exception/exception * @author Jeongho Nam @@ -129,7 +129,7 @@ namespace std public constructor(); /** - *

Construct from a message.

+ * Construct from a message. * * @param message A message representing specification about the Exception. */ @@ -141,13 +141,13 @@ namespace std } /** - *

Get string identifying exception.

+ * Get string identifying exception. * - *

Returns a string that may be used to identify the exception.

+ * Returns a string that may be used to identify the exception. * - *

The particular representation pointed by the returned value is implementation-defined. + * The particular representation pointed by the returned value is implementation-defined. * As a virtual function, derived classes may redefine this function so that specify value are - * returned.

+ * returned. */ public what(): string { @@ -163,17 +163,17 @@ namespace std - OUT_OF_RANGE ========================================================= */ /** - *

Logic error exception.

+ * Logic error exception. * - *

This class defines the type of objects thrown as exceptions to report errors in the internal - * logical of the program, such as violation of logical preconditions or class invariants.

+ * This class defines the type of objects thrown as exceptions to report errors in the internal + * logical of the program, such as violation of logical preconditions or class invariants. * - *

These errors are presumably detectable before the program executes.

+ * These errors are presumably detectable before the program executes. * - *

It is used as a base class for several logical error exceptions.

+ * It is used as a base class for several logical error exceptions. * - *

- *

+ * + * * * @reference http://www.cplusplus.com/reference/stdexcept/logic_error * @author Jeongho Nam @@ -182,7 +182,7 @@ namespace std extends Exception { /** - *

Construct from a message.

+ * Construct from a message. * * @param message A message representing specification about the Exception. */ @@ -193,18 +193,18 @@ namespace std } /** - *

Domain error exception.

+ * Domain error exception. * - *

This class defines the type of objects thrown as exceptions to report domain errors.

+ * This class defines the type of objects thrown as exceptions to report domain errors. * - *

Generally, the domain of a mathematical function is the subset of values that it is defined for. + * Generally, the domain of a mathematical function is the subset of values that it is defined for. * For example, the square root function is only defined for non-negative numbers. Thus, a negative number - * for such a function would qualify as a domain error.

+ * for such a function would qualify as a domain error. * - *

No component of the standard library throws exceptions of this type. It is designed as a standard - * exception to be thrown by programs.

+ * No component of the standard library throws exceptions of this type. It is designed as a standard + * exception to be thrown by programs. * - *

+ * *

* * @reference http://www.cplusplus.com/reference/stdexcept/domain_error @@ -214,7 +214,7 @@ namespace std extends LogicError { /** - *

Construct from a message.

+ * Construct from a message. * * @param message A message representing specification about the Exception. */ @@ -225,15 +225,15 @@ namespace std } /** - *

Invalid argument exception.

+ * Invalid argument exception. * - *

This class defines the type of objects thrown as exceptions to report an invalid argument.

+ * This class defines the type of objects thrown as exceptions to report an invalid argument. * - *

It is a standard exception that can be thrown by programs. Some components of the standard library - * also throw exceptions of this type to signal invalid arguments.

+ * It is a standard exception that can be thrown by programs. Some components of the standard library + * also throw exceptions of this type to signal invalid arguments. * - *

- *

+ * + * * * @reference http://www.cplusplus.com/reference/stdexcept/invalid_argument * @author Jeongho Nam @@ -242,7 +242,7 @@ namespace std extends LogicError { /** - *

Construct from a message.

+ * Construct from a message. * * @param message A message representing specification about the Exception. */ @@ -253,15 +253,15 @@ namespace std } /** - *

Length error exception.

+ * Length error exception. * - *

This class defines the type of objects thrown as exceptions to report a length error.

+ * This class defines the type of objects thrown as exceptions to report a length error. * - *

It is a standard exception that can be thrown by programs. Some components of the standard library, - * such as vector and string also throw exceptions of this type to signal errors resizing.

+ * It is a standard exception that can be thrown by programs. Some components of the standard library, + * such as vector and string also throw exceptions of this type to signal errors resizing. * - *

- *

+ * + * * * @reference http://www.cplusplus.com/reference/stdexcept/length_error * @author Jeongho Nam @@ -270,7 +270,7 @@ namespace std extends LogicError { /** - *

Construct from a message.

+ * Construct from a message. * * @param message A message representing specification about the Exception. */ @@ -281,16 +281,16 @@ namespace std } /** - *

Out-of-range exception.

+ * Out-of-range exception. * - *

This class defines the type of objects thrown as exceptions to report an out-of-range error.

+ * This class defines the type of objects thrown as exceptions to report an out-of-range error. * - *

It is a standard exception that can be thrown by programs. Some components of the standard library, + * It is a standard exception that can be thrown by programs. Some components of the standard library, * such as vector, deque, string and bitset also throw exceptions of this type to signal arguments - * out of range.

+ * out of range. * - *

- *

+ * + * * * @reference http://www.cplusplus.com/reference/stdexcept/out_of_range * @author Jeongho Nam @@ -299,7 +299,7 @@ namespace std extends LogicError { /** - *

Construct from a message.

+ * Construct from a message. * * @param message A message representing specification about the Exception. */ @@ -317,15 +317,15 @@ namespace std - UNDERFLOW_ERROR ========================================================= */ /** - *

Runtime error exception.

+ * Runtime error exception. * - *

This class defines the type of objects thrown as exceptions to report errors that can only be - * detected during runtime.

+ * This class defines the type of objects thrown as exceptions to report errors that can only be + * detected during runtime. * - *

It is used as a base class for several runtime error exceptions.

+ * It is used as a base class for several runtime error exceptions. * - *

- *

+ * + * * * @reference http://www.cplusplus.com/reference/stdexcept/runtime_error * @author Jeongho Nam @@ -334,7 +334,7 @@ namespace std extends Exception { /** - *

Construct from a message.

+ * Construct from a message. * * @param message A message representing specification about the Exception. */ @@ -345,15 +345,15 @@ namespace std } /** - *

Overflow error exception.

+ * Overflow error exception. * - *

This class defines the type of objects thrown as exceptions to arithmetic overflow errors.

+ * This class defines the type of objects thrown as exceptions to arithmetic overflow errors. * - *

It is a standard exception that can be thrown by programs. Some components of the standard library - * also throw exceptions of this type to signal range errors.

+ * It is a standard exception that can be thrown by programs. Some components of the standard library + * also throw exceptions of this type to signal range errors. * - *

- *

+ * + * * * @reference http://www.cplusplus.com/reference/stdexcept/overflow_error * @author Jeongho Nam @@ -362,7 +362,7 @@ namespace std extends RuntimeError { /** - *

Construct from a message.

+ * Construct from a message. * * @param message A message representing specification about the Exception. */ @@ -373,15 +373,15 @@ namespace std } /** - *

Underflow error exception.

+ * Underflow error exception. * - *

This class defines the type of objects thrown as exceptions to arithmetic underflow errors.

+ * This class defines the type of objects thrown as exceptions to arithmetic underflow errors. * - *

No component of the standard library throws exceptions of this type. It is designed as a standard - * exception to be thrown by programs.

+ * No component of the standard library throws exceptions of this type. It is designed as a standard + * exception to be thrown by programs. * - *

- *

+ * + * * * @reference http://www.cplusplus.com/reference/stdexcept/underflow_error * @author Jeongho Nam @@ -390,7 +390,7 @@ namespace std extends RuntimeError { /** - *

Construct from a message.

+ * Construct from a message. * * @param message A message representing specification about the Exception. */ @@ -401,16 +401,16 @@ namespace std } /** - *

Range error exception.

+ * Range error exception. * - *

This class defines the type of objects thrown as exceptions to report range errors in internal - * computations.

+ * This class defines the type of objects thrown as exceptions to report range errors in internal + * computations. * - *

It is a standard exception that can be thrown by programs. Some components of the standard library - * also throw exceptions of this type to signal range errors.

+ * It is a standard exception that can be thrown by programs. Some components of the standard library + * also throw exceptions of this type to signal range errors. * - *

- *

+ * + * * * @reference http://www.cplusplus.com/reference/stdexcept/range_error * @author Jeongho Nam @@ -419,7 +419,7 @@ namespace std extends RuntimeError { /** - *

Construct from a message.

+ * Construct from a message. * * @param message A message representing specification about the Exception. */ diff --git a/ts/src/std/Functional.ts b/ts/src/std/Functional.ts index 224e8ad3..7c1f56ea 100644 --- a/ts/src/std/Functional.ts +++ b/ts/src/std/Functional.ts @@ -11,13 +11,13 @@ namespace std { /** - *

Function object class for equality comparison.

+ * Function object class for equality comparison. * - *

Binary function object class whose call returns whether its two arguments compare equal (as returned by - * operator ==).

+ * Binary function object class whose call returns whether its two arguments compare equal (as returned by + * operator ==). * - *

Generically, function objects are instances of a class with member function {@link IComparable.equal_to equal_to} - * defined. This member function allows the object to be used with the same syntax as a function call.

+ * Generically, function objects are instances of a class with member function {@link IComparable.equal_to equal_to} + * defined. This member function allows the object to be used with the same syntax as a function call. * * @param x First element to compare. * @param y Second element to compare. @@ -38,13 +38,13 @@ namespace std } /** - *

Function object class for non-equality comparison.

+ * Function object class for non-equality comparison. * - *

Binary function object class whose call returns whether its two arguments compare not equal (as returned - * by operator operator!=).

+ * Binary function object class whose call returns whether its two arguments compare not equal (as returned + * by operator operator!=). * - *

Generically, function objects are instances of a class with member function {@link IComparable.equal_to equal_to} - * defined. This member function allows the object to be used with the same syntax as a function call.

+ * Generically, function objects are instances of a class with member function {@link IComparable.equal_to equal_to} + * defined. This member function allows the object to be used with the same syntax as a function call. * * @param x First element to compare. * @param y Second element to compare. @@ -53,20 +53,20 @@ namespace std */ export function not_equal_to(x: T, y: T): boolean { - return !std.equal_to(x, y); + return !equal_to(x, y); } /** - *

Function for less-than inequality comparison.

+ * Function for less-than inequality comparison. * - *

Binary function returns whether the its first argument compares less than the second.

+ * Binary function returns whether the its first argument compares less than the second. * - *

Generically, function objects are instances of a class with member function {@link IComparable.less less} + * Generically, function objects are instances of a class with member function {@link IComparable.less less} * defined. If an object doesn't have the method, then its own uid will be used to compare insteadly. - * This member function allows the object to be used with the same syntax as a function call.

+ * This member function allows the object to be used with the same syntax as a function call. * - *

Objects of this class can be used on standard algorithms such as {@link sort sort()}, - * {@link merge merge()} or {@link TreeMap.lower_bound lower_bound()}.

+ * Objects of this class can be used on standard algorithms such as {@link sort sort()}, + * {@link merge merge()} or {@link TreeMap.lower_bound lower_bound()}. * * @param Type of arguments to compare by the function call. The type shall supporrt the operation * operator<() or method {@link IComparable.less less}. @@ -88,14 +88,14 @@ namespace std } /** - *

Function object class for less-than-or-equal-to comparison.

+ * Function object class for less-than-or-equal-to comparison. * - *

Binary function object class whose call returns whether the its first argument compares {@link less less than} or - * {@link equal_to equal to} the second (as returned by operator <=).

+ * Binary function object class whose call returns whether the its first argument compares {@link less less than} or + * {@link equal_to equal to} the second (as returned by operator <=). * - *

Generically, function objects are instances of a class with member function {@link IComparable.less less} + * Generically, function objects are instances of a class with member function {@link IComparable.less less} * and {@link IComparable.equal_to equal_to} defined. This member function allows the object to be used with the same - * syntax as a function call.

+ * syntax as a function call. * * @param x First element, the standard of comparison. * @param y Second element compare with the first. @@ -104,21 +104,21 @@ namespace std */ export function less_equal(x: T, y: T): boolean { - return std.less(x, y) || std.equal_to(x, y); + return less(x, y) || equal_to(x, y); } /** - *

Function for greater-than inequality comparison.

+ * Function for greater-than inequality comparison. * - *

Binary function returns whether the its first argument compares greater than the second.

+ * Binary function returns whether the its first argument compares greater than the second. * - *

Generically, function objects are instances of a class with member function {@link less} and + * Generically, function objects are instances of a class with member function {@link less} and * {@link equal_to equal_to()} defined. If an object doesn't have those methods, then its own uid will be used * to compare insteadly. This member function allows the object to be used with the same syntax as a function - * call.

+ * call. * - *

Objects of this class can be used on standard algorithms such as {@link sort sort()}, - * {@link merge merge()} or {@link TreeMap.lower_bound lower_bound()}.

+ * Objects of this class can be used on standard algorithms such as {@link sort sort()}, + * {@link merge merge()} or {@link TreeMap.lower_bound lower_bound()}. * * @param Type of arguments to compare by the function call. The type shall supporrt the operation * operator>() or method {@link IComparable.greater greater}. @@ -127,18 +127,18 @@ namespace std */ export function greater(x: T, y: T): boolean { - return !std.less_equal(x, y); + return !less_equal(x, y); } /** - *

Function object class for greater-than-or-equal-to comparison.

+ * Function object class for greater-than-or-equal-to comparison. * - *

Binary function object class whose call returns whether the its first argument compares - * {@link greater greater than} or {@link equal_to equal to} the second (as returned by operator >=).

+ * Binary function object class whose call returns whether the its first argument compares + * {@link greater greater than} or {@link equal_to equal to} the second (as returned by operator >=). * - *

Generically, function objects are instances of a class with member function {@link IComparable.less less} + * Generically, function objects are instances of a class with member function {@link IComparable.less less} * defined. If an object doesn't have the method, then its own uid will be used to compare insteadly. - * This member function allows the object to be used with the same syntax as a function call.

+ * This member function allows the object to be used with the same syntax as a function call. * * @param x First element, the standard of comparison. * @param y Second element compare with the first. @@ -147,17 +147,17 @@ namespace std */ export function greater_equal(x: T, y: T): boolean { - return !std.less(x, y); + return !less(x, y); } /** - *

Logical AND function object class.

+ * Logical AND function object class. * - *

Binary function object class whose call returns the result of the logical "and" operation between its two - * arguments (as returned by operator &&).

+ * Binary function object class whose call returns the result of the logical "and" operation between its two + * arguments (as returned by operator &&). * - *

Generically, function objects are instances of a class with member function operator() defined. This member - * function allows the object to be used with the same syntax as a function call.

+ * Generically, function objects are instances of a class with member function operator() defined. This member + * function allows the object to be used with the same syntax as a function call. * * @param x First element. * @param y Second element. @@ -170,13 +170,13 @@ namespace std } /** - *

Logical OR function object class.

+ * Logical OR function object class. * - *

Binary function object class whose call returns the result of the logical "or" operation between its two - * arguments (as returned by operator ||).

+ * Binary function object class whose call returns the result of the logical "or" operation between its two + * arguments (as returned by operator ||). * - *

Generically, function objects are instances of a class with member function operator() defined. This member - * function allows the object to be used with the same syntax as a function call.

+ * Generically, function objects are instances of a class with member function operator() defined. This member + * function allows the object to be used with the same syntax as a function call. * * @param x First element. * @param y Second element. @@ -189,13 +189,13 @@ namespace std } /** - *

Logical NOT function object class.

+ * Logical NOT function object class. * - *

Unary function object class whose call returns the result of the logical "not" operation on its argument - * (as returned by operator !).

+ * Unary function object class whose call returns the result of the logical "not" operation on its argument + * (as returned by operator !). * - *

Generically, function objects are instances of a class with member function operator() defined. This member - * function allows the object to be used with the same syntax as a function call.

+ * Generically, function objects are instances of a class with member function operator() defined. This member + * function allows the object to be used with the same syntax as a function call. * * @param x Target element. * @@ -207,10 +207,10 @@ namespace std } /** - *

Bitwise AND function object class.

+ * Bitwise AND function object class. * - *

Binary function object class whose call returns the result of applying the bitwise "and" operation between - * its two arguments (as returned by operator &).

+ * Binary function object class whose call returns the result of applying the bitwise "and" operation between + * its two arguments (as returned by operator &). * * @param x First element. * @param y Second element. @@ -223,10 +223,10 @@ namespace std } /** - *

Bitwise OR function object class.

+ * Bitwise OR function object class. * - *

Binary function object class whose call returns the result of applying the bitwise "and" operation between - * its two arguments (as returned by operator &).

+ * Binary function object class whose call returns the result of applying the bitwise "and" operation between + * its two arguments (as returned by operator &). * * @param x First element. * @param y Second element. @@ -239,10 +239,10 @@ namespace std } /** - *

Bitwise XOR function object class.

+ * Bitwise XOR function object class. * - *

Binary function object class whose call returns the result of applying the bitwise "exclusive or" - * operation between its two arguments (as returned by operator ^).

+ * Binary function object class whose call returns the result of applying the bitwise "exclusive or" + * operation between its two arguments (as returned by operator ^). * * @param x First element. * @param y Second element. @@ -255,14 +255,14 @@ namespace std } /** - *

Default hash function for number.

+ * Default hash function for number. * - *

Unary function that defines the default hash function used by the standard library.

+ * Unary function that defines the default hash function used by the standard library. * - *

The functional call returns a hash value of its argument: A hash value is a value that depends solely on + * The functional call returns a hash value of its argument: A hash value is a value that depends solely on * its argument, returning always the same value for the same argument (for a given execution of a program). The * value returned shall have a small likelihood of being the same as the one returned for a different argument. - *

+ * * * @param val Value to be hashed. * @@ -271,14 +271,13 @@ namespace std export function hash(val: number): number; /** - *

Default hash function for string.

+ * Default hash function for string. * - *

Unary function that defines the default hash function used by the standard library.

+ * Unary function that defines the default hash function used by the standard library. * - *

The functional call returns a hash value of its argument: A hash value is a value that depends solely on + * The functional call returns a hash value of its argument: A hash value is a value that depends solely on * its argument, returning always the same value for the same argument (for a given execution of a program). The * value returned shall have a small likelihood of being the same as the one returned for a different argument. - *

* * @param str A string to be hashed. * @@ -287,18 +286,18 @@ namespace std export function hash(str: string): number; /** - *

Default hash function for Object.

+ * Default hash function for Object. * - *

Unary function that defines the default hash function used by the standard library.

+ * Unary function that defines the default hash function used by the standard library. * - *

The functional call returns a hash value of its argument: A hash value is a value that depends solely on + * The functional call returns a hash value of its argument: A hash value is a value that depends solely on * its argument, returning always the same value for the same argument (for a given execution of a program). The * value returned shall have a small likelihood of being the same as the one returned for a different argument. - *

+ * * - *

The default {@link hash} function of Object returns a value returned from {@link hash hash(number)} with + * The default {@link hash} function of Object returns a value returned from {@link hash hash(number)} with * an unique id of each Object. If you want to specify {@link hash} function of a specific class, then - * define a member function public hashCode(): number in the class.

+ * define a member function public hashCode(): number in the class. * * @param obj Object to be hashed. * @@ -311,17 +310,17 @@ namespace std let type: string = typeof par; if (type == "number") - return hash_of_number(par); + return _Hash_number(par); else if (type == "string") - return hash_of_string(par); + return _Hash_string(par); else - return hash_of_object(par); + return _Hash_object(par); } /** * @hidden */ - function hash_of_number(val: number): number + function _Hash_number(val: number): number { // ------------------------------------------ // IN C++ @@ -350,7 +349,7 @@ namespace std /** * @hidden */ - function hash_of_string(str: string): number + function _Hash_string(str: string): number { let code: number = 2166136261; @@ -365,12 +364,12 @@ namespace std /** * @hidden */ - function hash_of_object(obj: Object): number + function _Hash_object(obj: Object): number { if ((obj).hashCode != undefined) return (obj as IComparable).hashCode(); else - return hash_of_number((obj).__get_m_iUID()); + return _Hash_number((obj).__get_m_iUID()); } /* --------------------------------------------------------- @@ -419,19 +418,19 @@ namespace std SWAP --------------------------------------------------------- */ /** - *

Exchange contents of {@link IContainers containers}.

+ * Exchange contents of {@link IContainers containers}. * - *

The contents of container left are exchanged with those of right. Both container objects must have - * same type of elements (same template parameters), although sizes may differ.

+ * The contents of container left are exchanged with those of right. Both container objects must have + * same type of elements (same template parameters), although sizes may differ. * - *

After the call to this member function, the elements in left are those which were in right before + * After the call to this member function, the elements in left are those which were in right before * the call, and the elements of right are those which were in left. All iterators, references and - * pointers remain valid for the swapped objects.

+ * pointers remain valid for the swapped objects. * - *

This is an overload of the generic algorithm swap that improves its performance by mutually transferring + * This is an overload of the generic algorithm swap that improves its performance by mutually transferring * ownership over their assets to the other container (i.e., the containers exchange references to their data, without * actually performing any element copy or movement): It behaves as if left. - * {@link Container.swap swap}(right) was called.

+ * {@link Container.swap swap}(right) was called. * * @param left A {@link Container container} to swap its contents. * @param right A {@link Container container} to swap its contents. @@ -440,9 +439,9 @@ namespace std (left: base.Container, right: base.Container): void; /** - *

Exchange contents of queues.

+ * Exchange contents of queues. * - *

Exchanges the contents of left and right.

+ * Exchanges the contents of left and right. * * @param left A {@link Queue} container of the same type. Size may differ. * @param right A {@link Queue} container of the same type. Size may differ. @@ -451,9 +450,9 @@ namespace std (left: Queue, right: Queue): void; /** - *

Exchange contents of {@link PriorityQueue PriorityQueues}.

+ * Exchange contents of {@link PriorityQueue PriorityQueues}. * - *

Exchanges the contents of left and right.

+ * Exchanges the contents of left and right. * * @param left A {@link PriorityQueue} container of the same type. Size may differ. * @param right A {@link PriorityQueue} container of the same type. Size may differ. @@ -462,9 +461,9 @@ namespace std (left: PriorityQueue, right: PriorityQueue): void; /** - *

Exchange contents of {@link Stack Stacks}.

+ * Exchange contents of {@link Stack Stacks}. * - *

Exchanges the contents of left and right.

+ * Exchanges the contents of left and right. * * @param left A {@link Stack} container of the same type. Size may differ. * @param right A {@link Stack} container of the same type. Size may differ. @@ -473,19 +472,19 @@ namespace std (left: Stack, right: Stack): void; /** - *

Exchanges the contents of two {@link UniqueMap unique maps}.

+ * Exchanges the contents of two {@link UniqueMap unique maps}. * - *

The contents of container left are exchanged with those of right. Both container objects must - * be of the same type (same template parameters), although sizes may differ.

+ * The contents of container left are exchanged with those of right. Both container objects must + * be of the same type (same template parameters), although sizes may differ. * - *

After the call to this member function, the elements in left are those which were in right + * After the call to this member function, the elements in left are those which were in right * before the call, and the elements of right are those which were in left. All iterators, references - * and pointers remain valid for the swapped objects.

+ * and pointers remain valid for the swapped objects. * - *

This is an overload of the generic algorithm swap that improves its performance by mutually transferring + * This is an overload of the generic algorithm swap that improves its performance by mutually transferring * ownership over their assets to the other container (i.e., the containers exchange references to their data, * without actually performing any element copy or movement): It behaves as if - * left.{@link UniqueMap.swap swap}(right) was called.

+ * left.{@link UniqueMap.swap swap}(right) was called. * * @param left An {@link UniqueMap unique map} to swap its conents. * @param right An {@link UniqueMap unique map} to swap its conents. @@ -494,19 +493,19 @@ namespace std (left: base.UniqueMap, right: base.UniqueMap): void; /** - *

Exchanges the contents of two {@link MultiMap multi maps}.

+ * Exchanges the contents of two {@link MultiMap multi maps}. * - *

The contents of container left are exchanged with those of right. Both container objects must - * be of the same type (same template parameters), although sizes may differ.

+ * The contents of container left are exchanged with those of right. Both container objects must + * be of the same type (same template parameters), although sizes may differ. * - *

After the call to this member function, the elements in left are those which were in right + * After the call to this member function, the elements in left are those which were in right * before the call, and the elements of right are those which were in left. All iterators, references - * and pointers remain valid for the swapped objects.

+ * and pointers remain valid for the swapped objects. * - *

This is an overload of the generic algorithm swap that improves its performance by mutually transferring + * This is an overload of the generic algorithm swap that improves its performance by mutually transferring * ownership over their assets to the other container (i.e., the containers exchange references to their data, * without actually performing any element copy or movement): It behaves as if - * left.{@link MultiMap.swap swap}(right) was called.

+ * left.{@link MultiMap.swap swap}(right) was called. * * @param left A {@link MultiMap multi map} to swap its conents. * @param right A {@link MultiMap multi map} to swap its conents. @@ -526,11 +525,11 @@ namespace std BINDING --------------------------------------------------------- */ /** - *

Bind function arguments.

+ * Bind function arguments. * - *

Returns a function object based on fn, but with its arguments bound to args.

+ * Returns a function object based on fn, but with its arguments bound to args. * - *

Each argument may either be bound to a value or be a {@link placeholders placeholder}:

+ * Each argument may either be bound to a value or be a {@link placeholders placeholder}: *
    *
  • If bound to a value, calling the returned function object will always use that value as argument.
  • *
  • @@ -539,7 +538,7 @@ namespace std *
  • *
* - *

Calling the returned object returns the same type as fn.

+ * Calling the returned object returns the same type as fn. * * @param fn A function object, pointer to function or pointer to member. * @param args List of arguments to bind: either values, or {@link placeholders}. @@ -552,11 +551,11 @@ namespace std (fn: (...args: any[]) => Ret, ...args: any[]): (...args: any[]) => Ret; /** - *

Bind function arguments.

+ * Bind function arguments. * - *

Returns a function object based on fn, but with its arguments bound to args.

+ * Returns a function object based on fn, but with its arguments bound to args. * - *

Each argument may either be bound to a value or be a {@link placeholders placeholder}:

+ * Each argument may either be bound to a value or be a {@link placeholders placeholder}: *
    *
  • If bound to a value, calling the returned function object will always use that value as argument.
  • *
  • @@ -565,7 +564,7 @@ namespace std *
  • *
* - *

Calling the returned object returns the same type as fn.

+ * Calling the returned object returns the same type as fn. * * @param fn A function object, pointer to function or pointer to member. * @param thisArg This argument, owner object of the member method fn. @@ -634,7 +633,7 @@ namespace std // fill argArray from placeholders for (let i: number = 0; i < argArray.length; i++) if (argArray[i] instanceof placeholders.PlaceHolder) - argArray[i] = args[argArray[i].index - 1]; + argArray[i] = args[(argArray[i] as placeholders.PlaceHolder).index() - 1]; // arguments are over the placeholder_count if (args.length > placeholder_count) @@ -651,24 +650,24 @@ namespace std } /** - *

Bind argument placeholders.

+ * Bind argument placeholders. * - *

This namespace declares an unspecified number of objects: _1, _2, _3, ..., which are - * used to specify placeholders in calls to function {@link std.bind}.

+ * This namespace declares an unspecified number of objects: _1, _2, _3, ..., which are + * used to specify placeholders in calls to function {@link bind}. * - *

When the function object returned by bind is called, an argument with placeholder {@link _1} is replaced by the - * first argument in the call, {@link _2} is replaced by the second argument in the call, and so on... For example:

+ * When the function object returned by bind is called, an argument with placeholder {@link _1} is replaced by the + * first argument in the call, {@link _2} is replaced by the second argument in the call, and so on... For example: * * * let vec: Vector = new Vector(); * - * let bind = std.bind(Vector.insert, _1, vec.end(), _2, _3); + * let bind = bind(Vector.insert, _1, vec.end(), _2, _3); * bind.apply(vec, 5, 1); // vec.insert(vec.end(), 5, 1); * // [1, 1, 1, 1, 1] * * - *

When a call to {@link bind} is used as a subexpression in another call to bind, the {@link placeholders} - * are relative to the outermost {@link bind} expression.

+ * When a call to {@link bind} is used as a subexpression in another call to bind, the {@link placeholders} + * are relative to the outermost {@link bind} expression. * * @reference http://www.cplusplus.com/reference/functional/placeholders/ * @author Jeongho Nam @@ -687,7 +686,7 @@ namespace std.placeholders this.index_ = index; } - public get index(): number + public index(): number { return this.index_; } diff --git a/ts/src/std/HashMap.ts b/ts/src/std/HashMap.ts index 65ca33da..aa003405 100644 --- a/ts/src/std/HashMap.ts +++ b/ts/src/std/HashMap.ts @@ -5,36 +5,34 @@ namespace std.HashMap { - export type iterator = std.MapIterator; - export type reverse_iterator = std.MapReverseIterator; + export type iterator = MapIterator; + export type reverse_iterator = MapReverseIterator; } namespace std { /** - *

Hashed, unordered map.

+ * Hashed, unordered map. * - *

{@link HashMap}s are associative containers that store elements formed by the combination of a key value + * {@link HashMap}s are associative containers that store elements formed by the combination of a key value * and a mapped value, and which allows for fast retrieval of individual elements based on their keys. - *

* - *

In an {@link HashMap}, the key value is generally used to uniquely identify the element, while the + * In an {@link HashMap}, the key value is generally used to uniquely identify the element, while the * mapped value is an object with the content associated to this key. Types of key and - * mapped value may differ.

+ * mapped value may differ. * - *

Internally, the elements in the {@link HashMap} are not sorted in any particular order with respect to either + * Internally, the elements in the {@link HashMap} are not sorted in any particular order with respect to either * their key or mapped values, but organized into buckets depending on their hash values to allow * for fast access to individual elements directly by their key values (with a constant average time complexity - * on average).

+ * on average). * - *

{@link HashMap} containers are faster than {@link TreeMap} containers to access individual elements by their - * key, although they are generally less efficient for range iteration through a subset of their elements.

+ * {@link HashMap} containers are faster than {@link TreeMap} containers to access individual elements by their + * key, although they are generally less efficient for range iteration through a subset of their elements. * - *

+ * * - *

* - *

Container properties

+ * ### Container properties *
*
Associative
*
Elements in associative containers are referenced by their key and not by their absolute @@ -281,7 +279,7 @@ namespace std */ public bucket(key: Key): number { - return std.hash(key) % this.hash_buckets_.size(); + return hash(key) % this.hash_buckets_.size(); } /** @@ -404,17 +402,17 @@ namespace std SWAP --------------------------------------------------------- */ /** - *

Swap content.

+ * Swap content. * - *

Exchanges the content of the container by the content of obj, which is another - * {@link HashMap map} of the same type. Sizes abd container type may differ.

+ * Exchanges the content of the container by the content of obj, which is another + * {@link HashMap map} of the same type. Sizes abd container type may differ. * - *

After the call to this member function, the elements in this container are those which were + * After the call to this member function, the elements in this container are those which were * in obj before the call, and the elements of obj are those which were in this. All - * iterators, references and pointers remain valid for the swapped objects.

+ * iterators, references and pointers remain valid for the swapped objects. * - *

Notice that a non-member function exists with the same name, {@link std.swap swap}, overloading that - * algorithm with an optimization that behaves like this member function.

+ * Notice that a non-member function exists with the same name, {@link swap swap}, overloading that + * algorithm with an optimization that behaves like this member function. * * @param obj Another {@link HashMap map container} of the same type of elements as this (i.e., * with the same template parameters, Key and T) whose content is swapped diff --git a/ts/src/std/HashMultiMap.ts b/ts/src/std/HashMultiMap.ts index 533e95c3..8335b079 100644 --- a/ts/src/std/HashMultiMap.ts +++ b/ts/src/std/HashMultiMap.ts @@ -4,36 +4,35 @@ namespace std.HashMultiMap { - export type iterator = std.MapIterator; - export type reverse_iterator = std.MapReverseIterator; + export type iterator = MapIterator; + export type reverse_iterator = MapReverseIterator; } namespace std { /** - *

Hashed, unordered Multimap.

+ * Hashed, unordered Multimap. * - *

{@link HashMultiMap}s are associative containers that store elements formed by the combination of + * {@link HashMultiMap}s are associative containers that store elements formed by the combination of * a key value and a mapped value, much like {@link HashMultiMap} containers, but allowing - * different elements to have equivalent keys.

+ * different elements to have equivalent keys. * - *

In an {@link HashMultiMap}, the key value is generally used to uniquely identify the + * In an {@link HashMultiMap}, the key value is generally used to uniquely identify the * element, while the mapped value is an object with the content associated to this key. - * Types of key and mapped value may differ.

+ * Types of key and mapped value may differ. * - *

Internally, the elements in the {@link HashMultiMap} are not sorted in any particular order with + * Internally, the elements in the {@link HashMultiMap} are not sorted in any particular order with * respect to either their key or mapped values, but organized into buckets depending on * their hash values to allow for fast access to individual elements directly by their key values - * (with a constant average time complexity on average).

+ * (with a constant average time complexity on average). * - *

Elements with equivalent keys are grouped together in the same bucket and in such a way that - * an iterator can iterate through all of them. Iterators in the container are doubly linked iterators.

+ * Elements with equivalent keys are grouped together in the same bucket and in such a way that + * an iterator can iterate through all of them. Iterators in the container are doubly linked iterators. * - *

+ * * - *

* - *

Container properties

+ * ### Container properties *
*
Associative
*
Elements in associative containers are referenced by their key and not by their absolute @@ -171,13 +170,13 @@ namespace std public count(key: Key): number { // FIND MATCHED BUCKET - let index = std.hash(key) % this.hash_buckets_.item_size(); + let index = hash(key) % this.hash_buckets_.item_size(); let bucket = this.hash_buckets_.at(index); // ITERATE THE BUCKET let cnt: number = 0; for (let i = 0; i < bucket.size(); i++) - if (std.equal_to(bucket.at(i).first, key)) + if (equal_to(bucket.at(i).first, key)) cnt++; return cnt; @@ -291,7 +290,7 @@ namespace std */ public bucket(key: Key): number { - return std.hash(key) % this.hash_buckets_.size(); + return hash(key) % this.hash_buckets_.size(); } /** @@ -389,17 +388,17 @@ namespace std SWAP --------------------------------------------------------- */ /** - *

Swap content.

+ * Swap content. * - *

Exchanges the content of the container by the content of obj, which is another - * {@link HashMultiMap map} of the same type. Sizes abd container type may differ.

+ * Exchanges the content of the container by the content of obj, which is another + * {@link HashMultiMap map} of the same type. Sizes abd container type may differ. * - *

After the call to this member function, the elements in this container are those which were + * After the call to this member function, the elements in this container are those which were * in obj before the call, and the elements of obj are those which were in this. All - * iterators, references and pointers remain valid for the swapped objects.

+ * iterators, references and pointers remain valid for the swapped objects. * - *

Notice that a non-member function exists with the same name, {@link std.swap swap}, overloading that - * algorithm with an optimization that behaves like this member function.

+ * Notice that a non-member function exists with the same name, {@link swap swap}, overloading that + * algorithm with an optimization that behaves like this member function. * * @param obj Another {@link HashMultiMap map container} of the same type of elements as this (i.e., * with the same template parameters, Key and T) whose content is swapped diff --git a/ts/src/std/HashMultiSet.ts b/ts/src/std/HashMultiSet.ts index c9905ecc..68f85901 100644 --- a/ts/src/std/HashMultiSet.ts +++ b/ts/src/std/HashMultiSet.ts @@ -4,34 +4,34 @@ namespace std.HashMultiSet { - export type iterator = std.SetIterator; - export type reverse_iterator = std.SetReverseIterator; + export type iterator = SetIterator; + export type reverse_iterator = SetReverseIterator; } namespace std { /** - *

Hashed, unordered Multiset.

+ * Hashed, unordered Multiset. * - *

{@link HashMultiSet HashMultiSets} are containers that store elements in no particular order, allowing fast + * {@link HashMultiSet HashMultiSets} are containers that store elements in no particular order, allowing fast * retrieval of individual elements based on their value, much like {@link HashMultiSet} containers, - * but allowing different elements to have equivalent values.

+ * but allowing different elements to have equivalent values. * - *

In an {@link HashMultiSet}, the value of an element is at the same time its key, used to + * In an {@link HashMultiSet}, the value of an element is at the same time its key, used to * identify it. Keys are immutable, therefore, the elements in an {@link HashMultiSet} cannot be - * modified once in the container - they can be inserted and removed, though.

+ * modified once in the container - they can be inserted and removed, though. * - *

Internally, the elements in the {@link HashMultiSet} are not sorted in any particular, but + * Internally, the elements in the {@link HashMultiSet} are not sorted in any particular, but * organized into buckets depending on their hash values to allow for fast access to individual - * elements directly by their values (with a constant average time complexity on average).

+ * elements directly by their values (with a constant average time complexity on average). * - *

Elements with equivalent values are grouped together in the same bucket and in such a way that an - * iterator can iterate through all of them. Iterators in the container are doubly linked iterators.

+ * Elements with equivalent values are grouped together in the same bucket and in such a way that an + * iterator can iterate through all of them. Iterators in the container are doubly linked iterators. * - *

- *

+ * + * * - *

Container properties

+ * ### Container properties *
*
Associative
*
Elements in associative containers are referenced by their key and not by their absolute @@ -159,13 +159,13 @@ namespace std public count(key: T): number { // FIND MATCHED BUCKET - let index = std.hash(key) % this.hash_buckets_.item_size(); + let index = hash(key) % this.hash_buckets_.item_size(); let bucket = this.hash_buckets_.at(index); // ITERATE THE BUCKET let cnt: number = 0; for (let i = 0; i < bucket.size(); i++) - if (std.equal_to(bucket.at(i).value, key)) + if (equal_to(bucket.at(i).value, key)) cnt++; return cnt; @@ -285,7 +285,7 @@ namespace std */ public bucket(key: T): number { - return std.hash(key) % this.hash_buckets_.size(); + return hash(key) % this.hash_buckets_.size(); } /** @@ -383,17 +383,17 @@ namespace std SWAP --------------------------------------------------------- */ /** - *

Swap content.

+ * Swap content. * - *

Exchanges the content of the container by the content of obj, which is another - * {@link HashMultiSet set} of the same type. Sizes abd container type may differ.

+ * Exchanges the content of the container by the content of obj, which is another + * {@link HashMultiSet set} of the same type. Sizes abd container type may differ. * - *

After the call to this member function, the elements in this container are those which were + * After the call to this member function, the elements in this container are those which were * in obj before the call, and the elements of obj are those which were in this. All - * iterators, references and pointers remain valid for the swapped objects.

+ * iterators, references and pointers remain valid for the swapped objects. * - *

Notice that a non-member function exists with the same name, {@link std.swap swap}, overloading that - * algorithm with an optimization that behaves like this member function.

+ * Notice that a non-member function exists with the same name, {@link swap swap}, overloading that + * algorithm with an optimization that behaves like this member function. * * @param obj Another {@link HashMultiSet set container} of the same type of elements as this (i.e., * with the same template parameters, Key and T) whose content is swapped diff --git a/ts/src/std/HashSet.ts b/ts/src/std/HashSet.ts index ee665ebc..40212e1c 100644 --- a/ts/src/std/HashSet.ts +++ b/ts/src/std/HashSet.ts @@ -4,34 +4,34 @@ namespace std.HashSet { - export type iterator = std.SetIterator; - export type reverse_iterator = std.SetReverseIterator; + export type iterator = SetIterator; + export type reverse_iterator = SetReverseIterator; } namespace std { /** - *

Hashed, unordered set.

+ * Hashed, unordered set. * - *

{@link HashSet}s are containers that store unique elements in no particular order, and which - * allow for fast retrieval of individual elements based on their value.

+ * {@link HashSet}s are containers that store unique elements in no particular order, and which + * allow for fast retrieval of individual elements based on their value. * - *

In an {@link HashSet}, the value of an element is at the same time its key, that + * In an {@link HashSet}, the value of an element is at the same time its key, that * identifies it uniquely. Keys are immutable, therefore, the elements in an {@link HashSet} cannot be - * modified once in the container - they can be inserted and removed, though.

+ * modified once in the container - they can be inserted and removed, though. * - *

Internally, the elements in the {@link HashSet} are not sorted in any particular order, but + * Internally, the elements in the {@link HashSet} are not sorted in any particular order, but * organized into buckets depending on their hash values to allow for fast access to individual elements - * directly by their values (with a constant average time complexity on average).

+ * directly by their values (with a constant average time complexity on average). * - *

{@link HashSet} containers are faster than {@link TreeSet} containers to access individual + * {@link HashSet} containers are faster than {@link TreeSet} containers to access individual * elements by their key, although they are generally less efficient for range iteration through a - * subset of their elements.

+ * subset of their elements. * - *

- *

+ * + * * - *

Container properties

+ * ### Container properties *
*
Associative
*
Elements in associative containers are referenced by their key and not by their absolute @@ -268,7 +268,7 @@ namespace std */ public bucket(key: T): number { - return std.hash(key) % this.hash_buckets_.size(); + return hash(key) % this.hash_buckets_.size(); } /** @@ -390,17 +390,17 @@ namespace std SWAP --------------------------------------------------------- */ /** - *

Swap content.

+ * Swap content. * - *

Exchanges the content of the container by the content of obj, which is another - * {@link HashSet set} of the same type. Sizes abd container type may differ.

+ * Exchanges the content of the container by the content of obj, which is another + * {@link HashSet set} of the same type. Sizes abd container type may differ. * - *

After the call to this member function, the elements in this container are those which were + * After the call to this member function, the elements in this container are those which were * in obj before the call, and the elements of obj are those which were in this. All - * iterators, references and pointers remain valid for the swapped objects.

+ * iterators, references and pointers remain valid for the swapped objects. * - *

Notice that a non-member function exists with the same name, {@link std.swap swap}, overloading that - * algorithm with an optimization that behaves like this member function.

+ * Notice that a non-member function exists with the same name, {@link swap swap}, overloading that + * algorithm with an optimization that behaves like this member function. * * @param obj Another {@link HashSet set container} of the same type of elements as this (i.e., * with the same template parameters, Key and T) whose content is swapped diff --git a/ts/src/std/IComparable.ts b/ts/src/std/IComparable.ts index 4858bdc2..d85d99d9 100644 --- a/ts/src/std/IComparable.ts +++ b/ts/src/std/IComparable.ts @@ -1,9 +1,9 @@ namespace std { /** - *

Comparable instance.

+ * Comparable instance. * - *

{@link IComparable} is a common interface for objects who can compare each other.

+ * {@link IComparable} is a common interface for objects who can compare each other. * * @reference https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html * @author Jeongho Nam @@ -12,9 +12,9 @@ extends Object { /** - *

Indicates whether some other object is "equal to" this one.

+ * Indicates whether some other object is "equal to" this one. * - *

The {@link equal_to} method implements an equivalence relation on non-null object references:

+ * The {@link equal_to} method implements an equivalence relation on non-null object references: * *
    *
  • @@ -41,18 +41,16 @@ *
  • *
* - *

The {@link equal_to} method for interface {@link IComparable} implements the most discriminating possible + * The {@link equal_to} method for interface {@link IComparable} implements the most discriminating possible * equivalence relation on objects; that is, for any non-null reference values x and * y, this method returns true if and only if x and y - * refer to the same object (x == y has the value true).

+ * refer to the same object (x == y has the value true). * - *

Note that it is generally necessary to override the {@link hash_code} method whenever this method is + * Note that it is generally necessary to override the {@link hash_code} method whenever this method is * overridden, so as to maintain the general contract for the {@link hash_code} method, which states that - * equal objects must have equal hash codes.

+ * equal objects must have equal hash codes. * - *
    - *
  • {@link IComparable.equal_to} is called by {@link std.equal_to}.
  • - *
+ * - {@link IComparable.equal_to} is called by {@link equal_to}. * * @param obj the reference object with which to compare. * @@ -61,13 +59,13 @@ equals(obj: T): boolean; /** - *

Less-than inequality comparison.

+ * Less-than inequality comparison. * - *

Binary method returns whether the the instance compares less than the obj.

+ * Binary method returns whether the the instance compares less than the obj. * *
    *
  • - * {@link IComparable.less} is called by {@link std.less}. Also, this method can be used on standard + * {@link IComparable.less} is called by {@link less}. Also, this method can be used on standard * algorithms such as {@link sort sort()}, {@link merge merge()} or * {@link TreeMap.lower_bound lower_bound()}. *
  • @@ -80,21 +78,21 @@ less(obj: T): boolean; /** - *

    Issue a hash code.

    + * Issue a hash code. * - *

    Returns a hash code value for the object. This method is supported for the benefit of hash tables such + * Returns a hash code value for the object. This method is supported for the benefit of hash tables such * as those provided by hash containers; {@link HashSet}, {@link HashMap}, {@link MultiHashSet} and - * {@link MultiHashMap}.

    + * {@link MultiHashMap}. * - *

    As much as is reasonably practical, the {@link hash_code} method defined by interface + * As much as is reasonably practical, the {@link hash_code} method defined by interface * {@link IComparable} does return distinct integers for distinct objects. (This is typically implemented by * converting the internal address of the object into an integer, but this implementation technique is not - * required by the JavaScript programming language.)

    + * required by the JavaScript programming language.) * *
      *
    • - * {@link IComparable.hash_code} is called by {@link std.hash_code}. If you want to keep basically - * provided hash function, then returns {@link std.Hash.code}; return std.Hash.code(this); + * {@link IComparable.hash_code} is called by {@link hash_code}. If you want to keep basically + * provided hash function, then returns {@link Hash.code}; return Hash.code(this); *
    • *
    * diff --git a/ts/src/std/Iterator.ts b/ts/src/std/Iterator.ts index d8282ab0..24954565 100644 --- a/ts/src/std/Iterator.ts +++ b/ts/src/std/Iterator.ts @@ -8,20 +8,18 @@ namespace std { /** - *

    Bi-directional iterator.

    + * Bi-directional iterator. * - *

    {@link Iterator Bidirectional iterators} are iterators that can be used to access the sequence of elements - * in a range in both directions (towards the end and towards the beginning).

    + * {@link Iterator Bidirectional iterators} are iterators that can be used to access the sequence of elements + * in a range in both directions (towards the end and towards the beginning). * - *

    All {@link IArrayIterator random-access iterators} are also valid {@link Iterrator bidirectional iterators}. - *

    + * All {@link IArrayIterator random-access iterators} are also valid {@link Iterrator bidirectional iterators}. * - *

    There is not a single type of {@link Iterator bidirectional iterator}: {@link Container Each container} - * may define its own specific iterator type able to iterate through it and access its elements.

    + * There is not a single type of {@link Iterator bidirectional iterator}: {@link Container Each container} + * may define its own specific iterator type able to iterate through it and access its elements. * - *

    + * * - *

    * * @reference http://www.cplusplus.com/reference/iterator/BidirectionalIterator * @author Jeongho Nam @@ -29,7 +27,7 @@ namespace std export abstract class Iterator { /** - * Source container of the iterator is directing for. + * @hidden */ protected source_: base.Container; @@ -50,19 +48,19 @@ namespace std MOVERS --------------------------------------------------------- */ /** - *

    Get iterator to previous element.

    + * Get iterator to previous element. * - *

    If current iterator is the first item(equal with {@link Container.begin Container.begin()}), - * returns {@link Container.end Container.end()}.

    + * If current iterator is the first item(equal with {@link Container.begin Container.begin()}), + * returns {@link Container.end Container.end()}. * * @return An iterator of the previous item. */ public abstract prev(): Iterator; /** - *

    Get iterator to next element.

    + * Get iterator to next element. * - *

    If current iterator is the last item, returns {@link Container.end Container.end()}.

    + * If current iterator is the last item, returns {@link Container.end Container.end()}. * * @return An iterator of the next item. */ @@ -81,20 +79,22 @@ namespace std --------------------------------------------------------- */ /** * Get source container. + * + * Get source container of this iterator is directing for. */ public abstract source(): base.Container; /** - *

    Whether an iterator is equal with the iterator.

    + * Whether an iterator is equal with the iterator. * - *

    Compare two iterators and returns whether they are equal or not.

    + * Compare two iterators and returns whether they are equal or not. * - *

    Note

    - *

    Iterator's {@link equals equals()} only compare souce container and index number.

    + * #### Note + * Iterator's {@link equals equals()} only compare souce container and index number. * - *

    Although elements in a pair, key and value are {@link std.equal_to equal_to}, if the source map or + * Although elements in a pair, key and value are {@link equal_to equal_to}, if the source map or * index number is different, then the {@link equals equals()} will return false. If you want to - * compare the elements of a pair, compare them directly by yourself.

    + * compare the elements of a pair, compare them directly by yourself. * * @param obj An iterator to compare * @return Indicates whether equal or not. @@ -105,7 +105,7 @@ namespace std } /** - *

    Get value of the iterator is pointing.

    + * Get value of the iterator is pointing. * * @return A value of the iterator. */ @@ -118,24 +118,22 @@ namespace std namespace std { /** - *

    This class reverses the direction in which a bidirectional or random-access iterator iterates through a range. - *

    + * This class reverses the direction in which a bidirectional or random-access iterator iterates through a range. * - *

    A copy of the original iterator (the {@link Iterator base iterator}) is kept internally and used to reflect + * A copy of the original iterator (the {@link Iterator base iterator}) is kept internally and used to reflect * the operations performed on the {@link ReverseIterator}: whenever the {@link ReverseIterator} is incremented, its * {@link Iterator base iterator} is decreased, and vice versa. A copy of the {@link Iterator base iterator} with the - * current state can be obtained at any time by calling member {@link base}.

    + * current state can be obtained at any time by calling member {@link base}. * - *

    Notice however that when an iterator is reversed, the reversed version does not point to the same element in + * Notice however that when an iterator is reversed, the reversed version does not point to the same element in * the range, but to the one preceding it. This is so, in order to arrange for the past-the-end element of a * range: An iterator pointing to a past-the-end element in a range, when reversed, is pointing to the last element * (not past it) of the range (this would be the first element of the reversed range). And if an iterator to the * first element in a range is reversed, the reversed iterator points to the element before the first element (this - * would be the past-the-end element of the reversed range).

    + * would be the past-the-end element of the reversed range). * - *

    + * * - *

    * * @reference http://www.cplusplus.com/reference/iterator/reverse_iterator * @author Jeongho Nam @@ -182,11 +180,11 @@ namespace std } /** - *

    Return base iterator.

    + * Return base iterator. * - *

    Return a reference of the base iteraotr.

    + * Return a reference of the base iteraotr. * - *

    The base iterator is an iterator of the same type as the one used to construct the {@link ReverseIterator}, + * The base iterator is an iterator of the same type as the one used to construct the {@link ReverseIterator}, * but pointing to the element next to the one the {@link ReverseIterator} is currently pointing to * (a {@link ReverseIterator} has always an offset of -1 with respect to its base iterator). * @@ -198,7 +196,7 @@ namespace std } /** - *

    Get value of the iterator is pointing.

    + * Get value of the iterator is pointing. * * @return A value of the reverse iterator. */ @@ -287,12 +285,12 @@ namespace std } /** - *

    Return distance between {@link Iterator iterators}.

    + * Return distance between {@link Iterator iterators}. * - *

    Calculates the number of elements between first and last.

    + * Calculates the number of elements between first and last. * - *

    If it is a {@link IArrayIterator random-access iterator}, the function uses operator- to calculate this. - * Otherwise, the function uses the increase operator {@link Iterator.next next()} repeatedly.

    + * If it is a {@link IArrayIterator random-access iterator}, the function uses operator- to calculate this. + * Otherwise, the function uses the increase operator {@link Iterator.next next()} repeatedly. * * @param first Iterator pointing to the initial element. * @param last Iterator pointing to the final element. This must be reachable from first. @@ -324,9 +322,9 @@ namespace std ACCESSORS --------------------------------------------------------- */ /** - *

    Advance iterator.

    + * Advance iterator. * - *

    Advances the iterator it by n elements positions.

    + * Advances the iterator it by n elements positions. * * @param it Iterator to be advanced. * @param n Number of element positions to advance. @@ -340,9 +338,9 @@ namespace std } /** - *

    Get iterator to previous element.

    + * Get iterator to previous element. * - *

    Returns an iterator pointing to the element that it would be pointing to if advanced -n positions.

    + * Returns an iterator pointing to the element that it would be pointing to if advanced -n positions. * * @param it Iterator to base position. * @param n Number of element positions offset (1 by default). @@ -356,9 +354,9 @@ namespace std } /** - *

    Get iterator to next element.

    + * Get iterator to next element. * - *

    Returns an iterator pointing to the element that it would be pointing to if advanced n positions.

    + * Returns an iterator pointing to the element that it would be pointing to if advanced n positions. * * @param it Iterator to base position. * @param n Number of element positions offset (1 by default). @@ -375,7 +373,7 @@ namespace std FACTORY --------------------------------------------------------- */ /** - * Iterator to beginning.

    + * Iterator to beginning. * * Returns an iterator pointing to the first element in the sequence. * diff --git a/ts/src/std/List.ts b/ts/src/std/List.ts index 84544ceb..79bead74 100644 --- a/ts/src/std/List.ts +++ b/ts/src/std/List.ts @@ -4,37 +4,37 @@ namespace std.List { - export type iterator = std.ListIterator; - export type reverse_iterator = std.ListReverseIterator; + export type iterator = ListIterator; + export type reverse_iterator = ListReverseIterator; } namespace std { /** - *

    Doubly linked list.

    + * Doubly linked list. * - *

    {@link List}s are sequence containers that allow constant time insert and erase operations anywhere within the - * sequence, and iteration in both directions.

    + * {@link List}s are sequence containers that allow constant time insert and erase operations anywhere within the + * sequence, and iteration in both directions. * - *

    List containers are implemented as doubly-linked lists; Doubly linked lists can store each of the elements they + * List containers are implemented as doubly-linked lists; Doubly linked lists can store each of the elements they * contain in different and unrelated storage locations. The ordering is kept internally by the association to each - * element of a link to the element preceding it and a link to the element following it.

    + * element of a link to the element preceding it and a link to the element following it. * - *

    Compared to other base standard sequence containers (array, vector and deque), lists perform generally better + * Compared to other base standard sequence containers (array, vector and deque), lists perform generally better * in inserting, extracting and moving elements in any position within the container for which an iterator has already - * been obtained, and therefore also in algorithms that make intensive use of these, like sorting algorithms.

    + * been obtained, and therefore also in algorithms that make intensive use of these, like sorting algorithms. * - *

    The main drawback of lists and forward_lists compared to these other sequence containers is that they lack + * The main drawback of lists and forward_lists compared to these other sequence containers is that they lack * direct access to the elements by their position; For example, to access the sixth element in a list, one has to * iterate from a known position (like the beginning or the end) to that position, which takes linear time in the * distance between these. They also consume some extra memory to keep the linking information associated to each - * element (which may be an important factor for large lists of small-sized elements).

    + * element (which may be an important factor for large lists of small-sized elements). * - *

    + * * - *

    + * * - *

    Container properties

    + * ### Container properties *
    *
    Sequence
    *
    Elements in sequence containers are ordered in a strict linear sequence. Individual elements are accessed by @@ -64,25 +64,25 @@ namespace std CONSTURCTORS --------------------------------------------------------- */ /** - *

    Default Constructor.

    + * Default Constructor. * - *

    Constructs an empty container, with no elements.

    + * Constructs an empty container, with no elements. */ public constructor(); /** - *

    Initializer list Constructor.

    + * Initializer list Constructor. * - *

    Constructs a container with a copy of each of the elements in array, in the same order.

    + * Constructs a container with a copy of each of the elements in array, in the same order. * * @param array An array containing elements to be copied and contained. */ public constructor(items: Array); /** - *

    Fill Constructor.

    + * Fill Constructor. * - *

    Constructs a container with n elements. Each element is a copy of val (if provided).

    + * Constructs a container with n elements. Each element is a copy of val (if provided). * * @param n Initial container size (i.e., the number of elements in the container at construction). * @param val Value to fill the container with. Each of the n elements in the container is @@ -91,9 +91,9 @@ namespace std public constructor(size: number, val: T); /** - *

    Copy Constructor.

    + * Copy Constructor. * - *

    Constructs a container with a copy of each of the elements in container, in the same order.

    + * Constructs a container with a copy of each of the elements in container, in the same order. * * @param container Another container object of the same type (with the same class template * arguments T), whose contents are either copied or acquired. @@ -101,10 +101,10 @@ namespace std public constructor(container: List); /** - *

    Range Constructor.

    + * Range Constructor. * - *

    Constructs a container with as many elements as the range (begin, end), with each - * element emplace-constructed from its corresponding element in that range, in the same order.

    + * Constructs a container with as many elements as the range (begin, end), with each + * element emplace-constructed from its corresponding element in that range, in the same order. * * @param begin Input interator of the initial position in a sequence. * @param end Input interator of the final position in a sequence. @@ -230,14 +230,14 @@ namespace std INSERT --------------------------------------------------------- */ /** - *

    Insert an element.

    + * Insert an element. * - *

    The container is extended by inserting a new element before the element at the specified + * The container is extended by inserting a new element before the element at the specified * position. This effectively increases the {@link List.size List size} by the amount of elements - * inserted.

    + * inserted. * - *

    Unlike other standard sequence containers, {@link List} is specifically designed to be efficient - * inserting and removing elements in any position, even in the middle of the sequence.

    + * Unlike other standard sequence containers, {@link List} is specifically designed to be efficient + * inserting and removing elements in any position, even in the middle of the sequence. * * @param position Position in the container where the new element is inserted. * {@link iterator}> is a member type, defined as a @@ -249,14 +249,14 @@ namespace std public insert(position: ListIterator, val: T): ListIterator; /** - *

    Insert elements by repeated filling.

    + * Insert elements by repeated filling. * - *

    The container is extended by inserting a new element before the element at the specified + * The container is extended by inserting a new element before the element at the specified * position. This effectively increases the {@link List.size List size} by the amount of elements - * inserted.

    + * inserted. * - *

    Unlike other standard sequence containers, {@link List} is specifically designed to be efficient - * inserting and removing elements in any position, even in the middle of the sequence.

    + * Unlike other standard sequence containers, {@link List} is specifically designed to be efficient + * inserting and removing elements in any position, even in the middle of the sequence. * * @param position Position in the container where the new elements are inserted. The {@link iterator} is a * member type, defined as a {@link ListIterator bidirectional iterator} type that points to @@ -269,14 +269,14 @@ namespace std public insert(position: ListIterator, size: number, val: T): ListIterator; /** - *

    Insert elements by range iterators.

    + * Insert elements by range iterators. * - *

    The container is extended by inserting a new element before the element at the specified + * The container is extended by inserting a new element before the element at the specified * position. This effectively increases the {@link List.size List size} by the amount of elements - * inserted.

    + * inserted. * - *

    Unlike other standard sequence containers, {@link List} is specifically designed to be efficient - * inserting and removing elements in any position, even in the middle of the sequence.

    + * Unlike other standard sequence containers, {@link List} is specifically designed to be efficient + * inserting and removing elements in any position, even in the middle of the sequence. * * @param position Position in the container where the new elements are inserted. The {@link iterator} is a * member type, defined as a {@link ListIterator bidirectional iterator} type that points to @@ -290,14 +290,14 @@ namespace std (position: ListIterator, begin: InputIterator, end: InputIterator): ListIterator; /** - *

    Insert an element.

    + * Insert an element. * - *

    The container is extended by inserting a new element before the element at the specified + * The container is extended by inserting a new element before the element at the specified * position. This effectively increases the {@link List.size List size} by the amount of elements - * inserted.

    + * inserted. * - *

    Unlike other standard sequence containers, {@link List} is specifically designed to be efficient - * inserting and removing elements in any position, even in the middle of the sequence.

    + * Unlike other standard sequence containers, {@link List} is specifically designed to be efficient + * inserting and removing elements in any position, even in the middle of the sequence. * * @param position Position in the container where the new element is inserted. * {@link iterator}> is a member type, defined as a @@ -309,14 +309,14 @@ namespace std public insert(position: ListReverseIterator, val: T): ListReverseIterator; /** - *

    Insert elements by repeated filling.

    + * Insert elements by repeated filling. * - *

    The container is extended by inserting a new element before the element at the specified + * The container is extended by inserting a new element before the element at the specified * position. This effectively increases the {@link List.size List size} by the amount of elements - * inserted.

    + * inserted. * - *

    Unlike other standard sequence containers, {@link List} is specifically designed to be efficient - * inserting and removing elements in any position, even in the middle of the sequence.

    + * Unlike other standard sequence containers, {@link List} is specifically designed to be efficient + * inserting and removing elements in any position, even in the middle of the sequence. * * @param position Position in the container where the new elements are inserted. The {@link iterator} is a * member type, defined as a {@link ListReverseIterator bidirectional iterator} type that points to @@ -329,14 +329,14 @@ namespace std public insert(position: ListReverseIterator, size: number, val: T): ListReverseIterator; /** - *

    Insert elements by range iterators.

    + * Insert elements by range iterators. * - *

    The container is extended by inserting a new element before the element at the specified + * The container is extended by inserting a new element before the element at the specified * position. This effectively increases the {@link List.size List size} by the amount of elements - * inserted.

    + * inserted. * - *

    Unlike other standard sequence containers, {@link List} is specifically designed to be efficient - * inserting and removing elements in any position, even in the middle of the sequence.

    + * Unlike other standard sequence containers, {@link List} is specifically designed to be efficient + * inserting and removing elements in any position, even in the middle of the sequence. * * @param position Position in the container where the new elements are inserted. The {@link iterator} is a * member type, defined as a {@link ListReverseIterator bidirectional iterator} type that points to @@ -380,14 +380,14 @@ namespace std ERASE --------------------------------------------------------- */ /** - *

    Erase an element.

    + * Erase an element. * - *

    Removes from the {@link List} either a single element; position.

    + * Removes from the {@link List} either a single element; position. * - *

    This effectively reduces the container size by the number of element removed.

    + * This effectively reduces the container size by the number of element removed. * - *

    Unlike other standard sequence containers, {@link List} objects are specifically designed to be - * efficient inserting and removing elements in any position, even in the middle of the sequence.

    + * Unlike other standard sequence containers, {@link List} objects are specifically designed to be + * efficient inserting and removing elements in any position, even in the middle of the sequence. * * @param position Iterator pointing to a single element to be removed from the {@link List}. * @@ -397,14 +397,14 @@ namespace std public erase(position: ListIterator): ListIterator; /** - *

    Erase elements.

    + * Erase elements. * - *

    Removes from the {@link List} container a range of elements.

    + * Removes from the {@link List} container a range of elements. * - *

    This effectively reduces the container {@link size} by the number of elements removed.

    + * This effectively reduces the container {@link size} by the number of elements removed. * - *

    Unlike other standard sequence containers, {@link List} objects are specifically designed to be - * efficient inserting and removing elements in any position, even in the middle of the sequence.

    + * Unlike other standard sequence containers, {@link List} objects are specifically designed to be + * efficient inserting and removing elements in any position, even in the middle of the sequence. * * @param begin An iterator specifying a range of beginning to erase. * @param end An iterator specifying a range of end to erase. @@ -415,14 +415,14 @@ namespace std public erase(begin: ListIterator, end: ListIterator): ListIterator; /** - *

    Erase an element.

    + * Erase an element. * - *

    Removes from the {@link List} either a single element; position.

    + * Removes from the {@link List} either a single element; position. * - *

    This effectively reduces the container size by the number of element removed.

    + * This effectively reduces the container size by the number of element removed. * - *

    Unlike other standard sequence containers, {@link List} objects are specifically designed to be - * efficient inserting and removing elements in any position, even in the middle of the sequence.

    + * Unlike other standard sequence containers, {@link List} objects are specifically designed to be + * efficient inserting and removing elements in any position, even in the middle of the sequence. * * @param position Iterator pointing to a single element to be removed from the {@link List}. * @@ -432,14 +432,14 @@ namespace std public erase(position: ListReverseIterator): ListReverseIterator; /** - *

    Erase elements.

    + * Erase elements. * - *

    Removes from the {@link List} container a range of elements.

    + * Removes from the {@link List} container a range of elements. * - *

    This effectively reduces the container {@link size} by the number of elements removed.

    + * This effectively reduces the container {@link size} by the number of elements removed. * - *

    Unlike other standard sequence containers, {@link List} objects are specifically designed to be - * efficient inserting and removing elements in any position, even in the middle of the sequence.

    + * Unlike other standard sequence containers, {@link List} objects are specifically designed to be + * efficient inserting and removing elements in any position, even in the middle of the sequence. * * @param begin An iterator specifying a range of beginning to erase. * @param end An iterator specifying a range of end to erase. @@ -486,28 +486,28 @@ namespace std UNIQUE & REMOVE (IF) --------------------------------------------------------------- */ /** - *

    Remove duplicate values.

    + * Remove duplicate values. * - *

    Removes all but the first element from every consecutive group of equal elements in the

    + * Removes all but the first element from every consecutive group of equal elements in the * - *

    Notice that an element is only removed from the {@link List} container if it compares equal to the - * element immediately preceding it. Thus, this function is especially useful for sorted lists.

    + * Notice that an element is only removed from the {@link List} container if it compares equal to the + * element immediately preceding it. Thus, this function is especially useful for sorted lists. */ public unique(): void; /** - *

    Remove duplicate values.

    + * Remove duplicate values. * - *

    Removes all but the first element from every consecutive group of equal elements in the

    + * Removes all but the first element from every consecutive group of equal elements in the * - *

    The argument binary_pred is a specific comparison function that determine the uniqueness + * The argument binary_pred is a specific comparison function that determine the uniqueness * of an element. In fact, any behavior can be implemented (and not only an equality comparison), but notice * that the function will call binary_pred(it.value, it.prev().value) for all pairs of elements * (where it is an iterator to an element, starting from the second) and remove it * from the {@link List} if the predicate returns true. * - *

    Notice that an element is only removed from the {@link List} container if it compares equal to the - * element immediately preceding it. Thus, this function is especially useful for sorted lists.

    + * Notice that an element is only removed from the {@link List} container if it compares equal to the + * element immediately preceding it. Thus, this function is especially useful for sorted lists. * * @param binary_pred Binary predicate that, taking two values of the same type than those contained in the * {@link List}, returns true to remove the element passed as first argument @@ -516,13 +516,13 @@ namespace std */ public unique(binary_pred: (left: T, right: T) => boolean): void; - public unique(binary_pred: (left: T, right: T) => boolean = std.equal_to): void + public unique(binary_pred: (left: T, right: T) => boolean = equal_to): void { let it = this.begin().next(); while (!it.equals(this.end())) { - if (std.equal_to(it.value, it.prev().value) == true) + if (equal_to(it.value, it.prev().value) == true) it = this.erase(it); else it = it.next(); @@ -530,16 +530,16 @@ namespace std } /** - *

    Remove elements with specific value.

    + * Remove elements with specific value. * - *

    Removes from the container all the elements that compare equal to val. This calls the - * destructor of these objects and reduces the container {@link size} by the number of elements removed.

    + * Removes from the container all the elements that compare equal to val. This calls the + * destructor of these objects and reduces the container {@link size} by the number of elements removed. * - *

    Unlike member function {@link List.erase}, which erases elements by their position (using an - * iterator), this function ({@link List.remove}) removes elements by their value.

    + * Unlike member function {@link List.erase}, which erases elements by their position (using an + * iterator), this function ({@link List.remove}) removes elements by their value. * - *

    A similar function, {@link List.remove_if}, exists, which allows for a condition other than an - * equality comparison to determine whether an element is removed.

    + * A similar function, {@link List.remove_if}, exists, which allows for a condition other than an + * equality comparison to determine whether an element is removed. * * @param val Value of the elements to be removed. */ @@ -549,7 +549,7 @@ namespace std while (!it.equals(this.end())) { - if (std.equal_to(it.value, val) == true) + if (equal_to(it.value, val) == true) it = this.erase(it); else it = it.next(); @@ -557,15 +557,15 @@ namespace std } /** - *

    Remove elements fulfilling condition.

    + * Remove elements fulfilling condition. * - *

    Removes from the container all the elements for which pred returns true. This + * Removes from the container all the elements for which pred returns true. This * calls the destructor of these objects and reduces the container {@link size} by the number of elements - * removed.

    + * removed. * - *

    The function calls pred(it.value) for each element (where it is an iterator + * The function calls pred(it.value) for each element (where it is an iterator * to that element). Any of the elements in the list for which this returns true, are removed - * from the

    + * from the * * @param pred Unary predicate that, taking a value of the same type as those contained in the forward_list * object, returns true for those values to be removed from the container, and @@ -589,26 +589,26 @@ namespace std MERGE & SPLICE --------------------------------------------------------- */ /** - *

    Merge sorted {@link List Lists}.

    + * Merge sorted {@link List Lists}. * - *

    Merges obj into the {@link List} by transferring all of its elements at their respective + * Merges obj into the {@link List} by transferring all of its elements at their respective * ordered positions into the container (both containers shall already be ordered). - *

    + * * - *

    This effectively removes all the elements in obj (which becomes {@link empty}), and inserts + * This effectively removes all the elements in obj (which becomes {@link empty}), and inserts * them into their ordered position within container (which expands in {@link size} by the number of elements * transferred). The operation is performed without constructing nor destroying any element: they are * transferred, no matter whether obj is an lvalue or an rvalue, or whether the value_type supports - * move-construction or not.

    + * move-construction or not. * - *

    This function requires that the {@link List} containers have their elements already ordered by value + * This function requires that the {@link List} containers have their elements already ordered by value * ({@link less}) before the call. For an alternative on unordered {@link List Lists}, see - * {@link List.splice}.

    + * {@link List.splice}. * - *

    Assuming such ordering, each element of obj is inserted at the position that corresponds to its + * Assuming such ordering, each element of obj is inserted at the position that corresponds to its * value according to the strict weak ordering defined by {@link less}. The resulting order of equivalent * elements is stable (i.e., equivalent elements preserve the relative order they had before the call, and - * existing elements precede those equivalent inserted from obj).

    + * existing elements precede those equivalent inserted from obj). * * The function does nothing if this == obj. * @@ -619,30 +619,30 @@ namespace std public merge(obj: List): void; /** - *

    Merge sorted {@link List Lists}.

    + * Merge sorted {@link List Lists}. * - *

    Merges obj into the {@link List} by transferring all of its elements at their respective + * Merges obj into the {@link List} by transferring all of its elements at their respective * ordered positions into the container (both containers shall already be ordered). - *

    + * * - *

    This effectively removes all the elements in obj (which becomes {@link empty}), and inserts + * This effectively removes all the elements in obj (which becomes {@link empty}), and inserts * them into their ordered position within container (which expands in {@link size} by the number of elements * transferred). The operation is performed without constructing nor destroying any element: they are * transferred, no matter whether obj is an lvalue or an rvalue, or whether the value_type supports - * move-construction or not.

    + * move-construction or not. * - *

    The argument compare is a specific predicate to perform the comparison operation between + * The argument compare is a specific predicate to perform the comparison operation between * elements. This comparison shall produce a strict weak ordering of the elements (i.e., a consistent * transitive comparison, without considering its reflexiveness). * - *

    This function requires that the {@link List} containers have their elements already ordered by + * This function requires that the {@link List} containers have their elements already ordered by * compare before the call. For an alternative on unordered {@link List Lists}, see - * {@link List.splice}.

    + * {@link List.splice}. * - *

    Assuming such ordering, each element of obj is inserted at the position that corresponds to its + * Assuming such ordering, each element of obj is inserted at the position that corresponds to its * value according to the strict weak ordering defined by compare. The resulting order of equivalent * elements is stable (i.e., equivalent elements preserve the relative order they had before the call, and - * existing elements precede those equivalent inserted from obj).

    + * existing elements precede those equivalent inserted from obj). * * The function does nothing if this == obj. * @@ -656,7 +656,7 @@ namespace std */ public merge(obj: List, compare: (left: T, right: T) => boolean): void; - public merge(obj: List, compare: (left: T, right: T) => boolean = std.less): void + public merge(obj: List, compare: (left: T, right: T) => boolean = less): void { if (this == >obj) return; @@ -674,16 +674,16 @@ namespace std } /** - *

    Transfer elements from {@link List} to {@link List}.

    + * Transfer elements from {@link List} to {@link List}. * - *

    Transfers elements from obj into the container, inserting them at position.

    + * Transfers elements from obj into the container, inserting them at position. * - *

    This effectively inserts all elements into the container and removes them from obj, altering + * This effectively inserts all elements into the container and removes them from obj, altering * the sizes of both containers. The operation does not involve the construction or destruction of any * element. They are transferred, no matter whether obj is an lvalue or an rvalue, or whether the - * value_type supports move-construction or not.

    + * value_type supports move-construction or not. * - *

    This first version (1) transfers all the elements of obj into the

    + * This first version (1) transfers all the elements of obj into the * * @param position Position within the container where the elements of obj are inserted. * @param obj A {@link List} object of the same type (i.e., with the same template parameters, T). @@ -691,18 +691,18 @@ namespace std public splice(position: ListIterator, obj: List): void; /** - *

    Transfer an element from {@link List} to {@link List}.

    + * Transfer an element from {@link List} to {@link List}. * - *

    Transfers an element from obj, which is pointed by an {@link ListIterator iterator} it, - * into the container, inserting the element at specified position.

    + * Transfers an element from obj, which is pointed by an {@link ListIterator iterator} it, + * into the container, inserting the element at specified position. * - *

    This effectively inserts an element into the container and removes it from obj, altering the + * This effectively inserts an element into the container and removes it from obj, altering the * sizes of both containers. The operation does not involve the construction or destruction of any element. * They are transferred, no matter whether obj is an lvalue or an rvalue, or whether the value_type - * supports move-construction or not.

    + * supports move-construction or not. * - *

    This second version (2) transfers only the element pointed by it from obj into the - *

    + * This second version (2) transfers only the element pointed by it from obj into the + * * * @param position Position within the container where the element of obj is inserted. * @param obj A {@link List} object of the same type (i.e., with the same template parameters, T). @@ -714,17 +714,17 @@ namespace std public splice(position: ListIterator, obj: List, it: ListIterator): void; /** - *

    Transfer elements from {@link List} to {@link List}.

    + * Transfer elements from {@link List} to {@link List}. * - *

    Transfers elements from obj into the container, inserting them at position.

    + * Transfers elements from obj into the container, inserting them at position. * - *

    This effectively inserts those elements into the container and removes them from obj, altering + * This effectively inserts those elements into the container and removes them from obj, altering * the sizes of both containers. The operation does not involve the construction or destruction of any * element. They are transferred, no matter whether obj is an lvalue or an rvalue, or whether the - * value_type supports move-construction or not.

    + * value_type supports move-construction or not. * - *

    This third version (3) transfers the range [begin, end) from obj into the - *

    + * This third version (3) transfers the range [begin, end) from obj into the + * * * @param position Position within the container where the elements of obj are inserted. * @param obj A {@link List} object of the same type (i.e., with the same template parameters, T). @@ -764,36 +764,36 @@ namespace std SORT --------------------------------------------------------- */ /** - *

    Sort elements in

    + * Sort elements in * - *

    Sorts the elements in the {@link List}, altering their position within the

    + * Sorts the elements in the {@link List}, altering their position within the * - *

    The sorting is performed by applying an algorithm that uses {@link less}. This comparison shall + * The sorting is performed by applying an algorithm that uses {@link less}. This comparison shall * produce a strict weak ordering of the elements (i.e., a consistent transitive comparison, without - * considering its reflexiveness).

    + * considering its reflexiveness). * - *

    The resulting order of equivalent elements is stable: i.e., equivalent elements preserve the relative - * order they had before the call.

    + * The resulting order of equivalent elements is stable: i.e., equivalent elements preserve the relative + * order they had before the call. * - *

    The entire operation does not involve the construction, destruction or copy of any element object. - * Elements are moved within the

    + * The entire operation does not involve the construction, destruction or copy of any element object. + * Elements are moved within the */ public sort(): void; /** - *

    Sort elements in

    + * Sort elements in * - *

    Sorts the elements in the {@link List}, altering their position within the

    + * Sorts the elements in the {@link List}, altering their position within the * - *

    The sorting is performed by applying an algorithm that uses compare. This comparison shall + * The sorting is performed by applying an algorithm that uses compare. This comparison shall * produce a strict weak ordering of the elements (i.e., a consistent transitive comparison, without - * considering its reflexiveness).

    + * considering its reflexiveness). * - *

    The resulting order of equivalent elements is stable: i.e., equivalent elements preserve the relative - * order they had before the call.

    + * The resulting order of equivalent elements is stable: i.e., equivalent elements preserve the relative + * order they had before the call. * - *

    The entire operation does not involve the construction, destruction or copy of any element object. - * Elements are moved within the

    + * The entire operation does not involve the construction, destruction or copy of any element object. + * Elements are moved within the * * @param compare Binary predicate that, taking two values of the same type of those contained in the * {@link List}, returns true if the first argument goes before the second @@ -802,7 +802,7 @@ namespace std */ public sort(compare: (left: T, right: T) => boolean): void; - public sort(compare: (left: T, right: T) => boolean = std.less): void + public sort(compare: (left: T, right: T) => boolean = less): void { this._Quick_sort(this.begin(), this.end().prev(), compare); } @@ -847,17 +847,17 @@ namespace std SWAP --------------------------------------------------------- */ /** - *

    Swap content.

    + * Swap content. * - *

    Exchanges the content of the container by the content of obj, which is another - * {@link List container} object with same type of elements. Sizes and container type may differ.

    + * Exchanges the content of the container by the content of obj, which is another + * {@link List container} object with same type of elements. Sizes and container type may differ. * - *

    After the call to this member function, the elements in this container are those which were in obj + * After the call to this member function, the elements in this container are those which were in obj * before the call, and the elements of obj are those which were in this. All iterators, references and - * pointers remain valid for the swapped objects.

    + * pointers remain valid for the swapped objects. * - *

    Notice that a non-member function exists with the same name, {@link std.swap swap}, overloading that - * algorithm with an optimization that behaves like this member function.

    + * Notice that a non-member function exists with the same name, {@link swap swap}, overloading that + * algorithm with an optimization that behaves like this member function. * * @param obj Another {@link List container} of the same type of elements (i.e., instantiated * with the same template parameter, T) whose content is swapped with that of this @@ -880,11 +880,10 @@ namespace std namespace std { /** - *

    An iterator, node of a List.

    + * An iterator, node of a List. * - *

    + * * - *

    * * @author Jeongho Nam */ @@ -992,11 +991,10 @@ namespace std namespace std { /** - *

    A reverse-iterator of List.

    + * A reverse-iterator of List. * - *

    + * * - *

    * * @param Type of the elements. * diff --git a/ts/src/std/PriorityQueue.ts b/ts/src/std/PriorityQueue.ts index 30791242..2c025f9e 100644 --- a/ts/src/std/PriorityQueue.ts +++ b/ts/src/std/PriorityQueue.ts @@ -3,39 +3,37 @@ namespace std { /** - *

    Priority queue.

    + * Priority queue. * - *

    {@link PriorityQueue Priority queues} are a type of container adaptors, specifically designed such that its + * {@link PriorityQueue Priority queues} are a type of container adaptors, specifically designed such that its * first element is always the greatest of the elements it contains, according to some strict weak ordering - * criterion.

    + * criterion. * - *

    This context is similar to a heap, where elements can be inserted at any moment, and only the - * max heap element can be retrieved (the one at the top in the {@link PriorityQueue priority queue}).

    + * This context is similar to a heap, where elements can be inserted at any moment, and only the + * max heap element can be retrieved (the one at the top in the {@link PriorityQueue priority queue}). * - *

    {@link PriorityQueue Priority queues} are implemented as container adaptors, which are classes that + * {@link PriorityQueue Priority queues} are implemented as container adaptors, which are classes that * use an encapsulated object of a specific container class as its {@link container_ underlying container}, * providing a specific set of member functions to access its elements. Elements are popped from the "back" - * of the specific container, which is known as the top of the {@link PriorityQueue Priority queue}.

    + * of the specific container, which is known as the top of the {@link PriorityQueue Priority queue}. * - *

    The {@link container_ underlying container} may be any of the standard container class templates or some + * The {@link container_ underlying container} may be any of the standard container class templates or some * other specifically designed container class. The container shall be accessible through - * {@link IArrayIterator random access iterators} and support the following operations:

    + * {@link IArrayIterator random access iterators} and support the following operations: * - *
      - *
    • empty()
    • - *
    • size()
    • - *
    • front()
    • - *
    • push_back()
    • - *
    • pop_back()
    • - *
    + * - {@link IArrayContainer.empty empty()} + * - {@link IArrayContainer.size size()} + * - {@link IArrayContainer.front front()} + * - {@link IArrayContainer.push_back push_back()} + * - {@link IArrayContainer.pop_back pop_back()} * - *

    The standard container classes {@link Vector} and {@link Deque} fulfill these requirements. By default, if + * The standard container classes {@link Vector} and {@link Deque} fulfill these requirements. By default, if * no container class is specified for a particular {@link PriorityQueue} class instantiation, the standard - * container {@link Vector} is used.

    + * container {@link Vector} is used. * - *

    Support of {@link IArrayIterator random access iterators} is required to keep a heap structure internally + * Support of {@link IArrayIterator random access iterators} is required to keep a heap structure internally * at all times. This is done automatically by the container adaptor by automatically calling the algorithm - * functions make_heap, push_heap and pop_heap when needed.

    + * functions make_heap, push_heap and pop_heap when needed. * * @param Type of the elements. * @@ -44,21 +42,24 @@ namespace std */ export class PriorityQueue { + //-------- + // The underlying container for implementing the priority queue. + // + // Following standard definition from the C++ committee, the underlying container should be one of + // {@link Vector} or {@link Deque}, however, I've adopted {@link TreeMultiSet} instead of them. Of course, + // there are proper reasons for adapting the {@link TreeMultiSet} even violating standard advice. + // + // Underlying container of {@link PriorityQueue} must keep a condition; the highest (or lowest) + // element must be placed on the terminal node for fast retrieval and deletion. To keep the condition with + // {@link Vector} or {@link Deque}, lots of times will only be spent for re-arranging elements. It calls + // rearrangement functions like make_heap, push_heap and pop_head for rearrangement. + // + // However, the {@link TreeMultiSet} container always keeps arrangment automatically without additional + // operations and it even meets full criteria of {@link PriorityQueue}. Those are the reason why I've adopted + // {@link TreeMultiSet} as the underlying container of {@link PriorityQueue}. + //-------- /** - *

    The underlying container for implementing the priority queue.

    - * - *

    Following standard definition from the C++ committee, the underlying container should be one of - * {@link Vector} or {@link Deque}, however, I've adopted {@link TreeMultiSet} instead of them. Of course, - * there are proper reasons for adapting the {@link TreeMultiSet} even violating standard advice.

    - * - *

    Underlying container of {@link PriorityQueue} must keep a condition; the highest (or lowest) - * element must be placed on the terminal node for fast retrieval and deletion. To keep the condition with - * {@link Vector} or {@link Deque}, lots of times will only be spent for re-arranging elements. It calls - * rearrangement functions like make_heap, push_heap and pop_head for rearrangement.

    - * - *

    However, the {@link TreeMultiSet} container always keeps arrangment automatically without additional - * operations and it even meets full criteria of {@link PriorityQueue}. Those are the reason why I've adopted - * {@link TreeMultiSet} as the underlying container of {@link PriorityQueue}.

    + * @hidden */ private container_: TreeMultiSet; @@ -170,12 +171,12 @@ namespace std ACCESSORS --------------------------------------------------------- */ /** - *

    Return size.

    + * Return size. * - *

    Returns the number of elements in the {@link PriorityQueue}.

    + * Returns the number of elements in the {@link PriorityQueue}. * - *

    This member function effectively calls member {@link IArray.size size} of the - * {@link container_ underlying container} object.

    + * This member function effectively calls member {@link IArrayContainer.size size} of the + * {@link IArrayContainer underlying container} object. * * @return The number of elements in the underlying */ @@ -185,12 +186,12 @@ namespace std } /** - *

    Test whether container is empty.

    + * Test whether container is empty. * - *

    Returns whether the {@link PriorityQueue} is empty: i.e. whether its {@link size} is zero.

    + * Returns whether the {@link PriorityQueue} is empty: i.e. whether its {@link size} is zero. * - *

    This member function effectively calls member {@link IARray.empty empty} of the - * {@link container_ underlying container} object.

    + * This member function effectively calls member {@link IARray.empty empty} of the + * {@link IArrayContainer underlying container} object. */ public empty(): boolean { @@ -201,15 +202,15 @@ namespace std ELEMENTS I/O --------------------------------------------------------- */ /** - *

    Access top element.

    + * Access top element. * - *

    Returns a constant reference to the top element in the {@link PriorityQueue}.

    + * Returns a constant reference to the top element in the {@link PriorityQueue}. * - *

    The top element is the element that compares higher in the {@link PriorityQueue}, and the next that is - * removed from the container when {@link PriorityQueue.pop} is called.

    + * The top element is the element that compares higher in the {@link PriorityQueue}, and the next that is + * removed from the container when {@link PriorityQueue.pop} is called. * - *

    This member function effectively calls member {@link IArray.front front} of the - * {@link container_ underlying container} object.

    + * This member function effectively calls member {@link IArrayContainer.front front} of the + * {@link IArrayContainer underlying container} object. * * @return A reference to the top element in the {@link PriorityQueue}. */ @@ -219,14 +220,14 @@ namespace std } /** - *

    Insert element.

    + * Insert element. * - *

    Inserts a new element in the {@link PriorityQueue}. The content of this new element is initialized to + * Inserts a new element in the {@link PriorityQueue}. The content of this new element is initialized to * val. * - *

    This member function effectively calls the member function {@link IArray.push_back push_back} of the - * {@link container_ underlying container} object, and then reorders it to its location in the heap by calling - * the push_heap algorithm on the range that includes all the elements of the

    + * This member function effectively calls the member function {@link IArrayContainer.push_back push_back} of the + * {@link IArrayContainer underlying container} object, and then reorders it to its location in the heap by calling + * the push_heap algorithm on the range that includes all the elements of the * * @param val Value to which the inserted element is initialized. */ @@ -236,17 +237,17 @@ namespace std } /** - *

    Remove top element.

    + * Remove top element. * - *

    Removes the element on top of the {@link PriorityQueue}, effectively reducing its {@link size} by one. - * The element removed is the one with the highest (or lowest) value.

    + * Removes the element on top of the {@link PriorityQueue}, effectively reducing its {@link size} by one. + * The element removed is the one with the highest (or lowest) value. * - *

    The value of this element can be retrieved before being popped by calling member - * {@link PriorityQueue.top}.

    + * The value of this element can be retrieved before being popped by calling member + * {@link PriorityQueue.top}. * - *

    This member function effectively calls the pop_heap algorithm to keep the heap property of - * {@link PriorityQueue PriorityQueues} and then calls the member function {@link IArray.pop_back pop_back} of - * the {@link container_ underlying container} object to remove the element.

    + * This member function effectively calls the pop_heap algorithm to keep the heap property of + * {@link PriorityQueue PriorityQueues} and then calls the member function {@link IArrayContainer.pop_back pop_back} of + * the {@link IArrayContainer underlying container} object to remove the element. */ public pop(): void { @@ -254,15 +255,15 @@ namespace std } /** - *

    Swap contents.

    + * Swap contents. * - *

    Exchanges the contents of the container adaptor by those of obj, swapping both the - * {@link container_ underlying container} value and their comparison function using the corresponding - * {@link std.swap swap} non-member functions (unqualified).

    + * Exchanges the contents of the container adaptor by those of obj, swapping both the + * {@link IArrayContainer underlying container} value and their comparison function using the corresponding + * {@link swap swap} non-member functions (unqualified). * - *

    This member function has a noexcept specifier that matches the combined noexcept of the - * {@link IArray.swap swap} operations on the {@link container_ underlying container} and the comparison - * functions.

    + * This member function has a noexcept specifier that matches the combined noexcept of the + * {@link IArrayContainer.swap swap} operations on the {@link IArrayContainer underlying container} and the comparison + * functions. * * @param obj {@link PriorityQueue} container adaptor of the same type (i.e., instantiated with the same * template parameters, T). Sizes may differ. diff --git a/ts/src/std/Queue.ts b/ts/src/std/Queue.ts index e27965fe..6c50b867 100644 --- a/ts/src/std/Queue.ts +++ b/ts/src/std/Queue.ts @@ -3,37 +3,33 @@ namespace std { /** - *

    FIFO queue.

    + * FIFO queue. * - *

    {@link Queue}s are a type of container adaptor, specifically designed to operate in a FIFO context + * {@link Queue}s are a type of container adaptor, specifically designed to operate in a FIFO context * (first-in first-out), where elements are inserted into one end of the container and extracted from the other. - *

    * - *

    {@link Queue}s are implemented as containers adaptors, which are classes that use an encapsulated object of + * {@link Queue}s are implemented as containers adaptors, which are classes that use an encapsulated object of * a specific container class as its underlying container, providing a specific set of member functions to access * its elements. Elements are pushed into the {@link IDeque.back back()} of the specific container and popped from - * its {@link IDeque.front front()}.

    + * its {@link IDeque.front front()}. * - *

    {@link container_ The underlying container} may be one of the standard container class template or some + * {@link container_ The underlying container} may be one of the standard container class template or some * other specifically designed container class. This underlying container shall support at least the following - * operations:

    + * operations: * - *
      - *
    • empty
    • - *
    • size
    • - *
    • front
    • - *
    • back
    • - *
    • push_back
    • - *
    • pop_front
    • - *
    + * - {@link IDequeContainer.empty empty} + * - {@link IDequeContainer.size size} + * - {@link IDequeContainer.front front} + * - {@link IDequeContainer.back back} + * - {@link IDequeContainer.push_back push_back} + * - {@link IDequeContainer.pop_front pop_front} * - *

    The standard container classes {@link Deque} and {@link List} fulfill these requirements. + * The standard container classes {@link Deque} and {@link List} fulfill these requirements. * By default, if no container class is specified for a particular {@link Queue} class instantiation, the standard - * container {@link List} is used.

    + * container {@link List} is used. * - *

    + * * - *

    * * @param Type of elements. * @@ -72,11 +68,12 @@ namespace std ACCESSORS --------------------------------------------------------- */ /** - *

    Return size.

    - *

    Returns the number of elements in the {@link Queue}.

    + * Return size. + * + * Returns the number of elements in the {@link Queue}. * - *

    This member function effectively calls member {@link IDeque.size size()} of the - * {@link container_ underlying container} object.

    + * This member function effectively calls member {@link IDeque.size size()} of the + * {@link container_ underlying container} object. * * @return The number of elements in the {@link container_ underlying container}. */ @@ -86,14 +83,15 @@ namespace std } /** - *

    Test whether container is empty.

    - *

    returns whether the {@link Queue} is empty: i.e. whether its size is zero.

    + * Test whether container is empty. + * + * returns whether the {@link Queue} is empty: i.e. whether its size is zero. * - *

    This member function efeectively calls member {@link IDeque.empty empty()} of the - * {@link container_ underlying container} object.

    + * This member function efeectively calls member {@link IDeque.empty empty()} of the + * {@link container_ underlying container} object. * * @return true if the {@link container_ underlying container}'s size is 0, - * false otherwise.

    + * false otherwise. */ public empty(): boolean { @@ -101,14 +99,15 @@ namespace std } /** - *

    Access next element.

    - *

    Returns a value of the next element in the {@link Queue}.

    + * Access next element. + * + * Returns a value of the next element in the {@link Queue}. * - *

    The next element is the "oldest" element in the {@link Queue} and the same element that is popped out - * from the queue when {@link pop Queue.pop()} is called.

    + * The next element is the "oldest" element in the {@link Queue} and the same element that is popped out + * from the queue when {@link pop Queue.pop()} is called. * - *

    This member function effectively calls member {@link IDeque.front front()} of the - * {@link container_ underlying container} object.

    + * This member function effectively calls member {@link IDeque.front front()} of the + * {@link container_ underlying container} object. * * @return A value of the next element in the {@link Queue}. */ @@ -118,13 +117,13 @@ namespace std } /** - *

    Access last element.

    + * Access last element. * - *

    Returns a vaue of the last element in the queue. This is the "newest" element in the queue (i.e. the - * last element pushed into the queue).

    + * Returns a vaue of the last element in the queue. This is the "newest" element in the queue (i.e. the + * last element pushed into the queue). * - *

    This member function effectively calls the member function {@link IDeque.back back()} of the - * {@link container_ underlying container} object.

    + * This member function effectively calls the member function {@link IDeque.back back()} of the + * {@link container_ underlying container} object. * * @return A value of the last element in the {@link Queue}. */ @@ -137,13 +136,13 @@ namespace std ELEMENTS I/O --------------------------------------------------------- */ /** - *

    Insert element.

    + * Insert element. * - *

    Inserts a new element at the end of the {@link Queue}, after its current last element. - * The content of this new element is initialized to val.

    + * Inserts a new element at the end of the {@link Queue}, after its current last element. + * The content of this new element is initialized to val. * - *

    This member function effectively calls the member function {@link IDeque.push_back push_back()} of the - * {@link container_ underlying container} object.

    + * This member function effectively calls the member function {@link IDeque.push_back push_back()} of the + * {@link container_ underlying container} object. * * @param val Value to which the inserted element is initialized. */ @@ -153,15 +152,15 @@ namespace std } /** - *

    Remove next element.

    + * Remove next element. * - *

    Removes the next element in the {@link Queue}, effectively reducing its size by one.

    + * Removes the next element in the {@link Queue}, effectively reducing its size by one. * - *

    The element removed is the "oldest" element in the {@link Queue} whose value can be retrieved by calling - * member {@link front Queue.front()}

    . + * The element removed is the "oldest" element in the {@link Queue} whose value can be retrieved by calling + * member {@link front Queue.front()}. * - *

    This member function effectively calls the member function {@link IDeque.pop_front pop_front()} of the - * {@link container_ underlying container} object.

    + * This member function effectively calls the member function {@link IDeque.pop_front pop_front()} of the + * {@link container_ underlying container} object. */ public pop(): void { @@ -169,15 +168,15 @@ namespace std } /** - *

    Swap contents.

    + * Swap contents. * - *

    Exchanges the contents of the container adaptor (this) by those of obj.

    + * Exchanges the contents of the container adaptor (this) by those of obj. * - *

    This member function calls the non-member function {@link Container.swap swap} (unqualified) to swap - * the {@link container_ underlying containers}.

    + * This member function calls the non-member function {@link Container.swap swap} (unqualified) to swap + * the {@link container_ underlying containers}. * * @param obj Another {@link Queue} container adaptor of the same type (i.e., instantiated with the same - * template parameter, T). Sizes may differ.

    + * template parameter, T). Sizes may differ. */ public swap(obj: Queue): void { diff --git a/ts/src/std/Stack.ts b/ts/src/std/Stack.ts index deae8303..d9172f51 100644 --- a/ts/src/std/Stack.ts +++ b/ts/src/std/Stack.ts @@ -3,35 +3,32 @@ namespace std { /** - *

    LIFO stack.

    + * LIFO stack. * - *

    {@link Stack}s are a type of container adaptor, specifically designed to operate in a LIFO context - * (last-in first-out), where elements are inserted and extracted only from one end of the

    + * {@link Stack}s are a type of container adaptor, specifically designed to operate in a LIFO context + * (last-in first-out), where elements are inserted and extracted only from one end of the * - *

    {@link Stack}s are implemented as containers adaptors, which are classes that use an encapsulated object of + * {@link Stack}s are implemented as containers adaptors, which are classes that use an encapsulated object of * a specific container class as its underlying container, providing a specific set of member functions to * access its elements. Elements are pushed/popped from the {@link ILinearContainer.back back()} of the - * {@link ILinearContainer specific container}, which is known as the top of the {@link Stack}.

    + * {@link ILinearContainer specific container}, which is known as the top of the {@link Stack}. * - *

    {@link container_ The underlying container} may be any of the standard container class templates or some - * other specifically designed container class. The container shall support the following operations:

    + * {@link container_ The underlying container} may be any of the standard container class templates or some + * other specifically designed container class. The container shall support the following operations: * - *
      - *
    • empty
    • - *
    • size
    • - *
    • front
    • - *
    • back
    • - *
    • push_back
    • - *
    • pop_back
    • - *
    + * - {@link ILinearContainer.empty empty} + * - {@link ILinearContainer.size size} + * - {@link ILinearContainer.front front} + * - {@link ILinearContainer.back back} + * - {@link ILinearContainer.push_back push_back} + * - {@link ILinearContainer.pop_back pop_back} * - *

    The standard container classes {@link Vector}, {@link Deque} and {@link List} fulfill these requirements. + * The standard container classes {@link Vector}, {@link Deque} and {@link List} fulfill these requirements. * By default, if no container class is specified for a particular {@link Stack} class instantiation, the standard - * container {@link List} is used.

    + * container {@link List} is used. * - *

    + * * - *

    * * @param Type of elements. * @@ -70,12 +67,12 @@ namespace std ACCESSORS --------------------------------------------------------- */ /** - *

    Return size.

    + * Return size. * - *

    Returns the number of elements in the {@link Stack}.

    + * Returns the number of elements in the {@link Stack}. * - *

    This member function effectively calls member {@link ILinearContainer.size size()} of the - * {@link container_ underlying container} object.

    + * This member function effectively calls member {@link ILinearContainer.size size()} of the + * {@link container_ underlying container} object. * * @return The number of elements in the {@link container_ underlying container}. */ @@ -85,15 +82,15 @@ namespace std } /** - *

    Test whether container is empty.

    + * Test whether container is empty. * - *

    returns whether the {@link Stack} is empty: i.e. whether its size is zero.

    + * returns whether the {@link Stack} is empty: i.e. whether its size is zero. * - *

    This member function effectively calls member {@link ILinearContainer.empty empty()} of the - * {@link container_ underlying container} object.

    + * This member function effectively calls member {@link ILinearContainer.empty empty()} of the + * {@link container_ underlying container} object. * * @return true if the underlying container's size is 0, - * false otherwise.

    + * false otherwise. */ public empty(): boolean { @@ -101,15 +98,15 @@ namespace std } /** - *

    Access next element.

    + * Access next element. * - *

    Returns a value of the top element in the {@link Stack}

    . + * Returns a value of the top element in the {@link Stack}. * - *

    Since {@link Stack}s are last-in first-out containers, the top element is the last element inserted into - * the {@link Stack}.

    + * Since {@link Stack}s are last-in first-out containers, the top element is the last element inserted into + * the {@link Stack}. * - *

    This member function effectively calls member {@link ILinearContainer.back back()} of the - * {@link container_ underlying container} object.

    + * This member function effectively calls member {@link ILinearContainer.back back()} of the + * {@link container_ underlying container} object. * * @return A value of the top element in the {@link Stack}. */ @@ -122,12 +119,12 @@ namespace std ELEMENTS I/O --------------------------------------------------------- */ /** - *

    Insert element.

    + * Insert element. * - *

    Inserts a new element at the top of the {@link Stack}, above its current top element.

    + * Inserts a new element at the top of the {@link Stack}, above its current top element. * - *

    This member function effectively calls the member function - * {@link ILinearContainer.push_back push_back()} of the {@link container_ underlying container} object.

    + * This member function effectively calls the member function + * {@link ILinearContainer.push_back push_back()} of the {@link container_ underlying container} object. * * @param val Value to which the inserted element is initialized. */ @@ -137,15 +134,15 @@ namespace std } /** - *

    Remove top element.

    + * Remove top element. * - *

    Removes the element on top of the {@link Stack}, effectively reducing its size by one.

    + * Removes the element on top of the {@link Stack}, effectively reducing its size by one. * - *

    The element removed is the latest element inserted into the {@link Stack}, whose value can be retrieved - * by calling member {@link top Stack.top()}

    . + * The element removed is the latest element inserted into the {@link Stack}, whose value can be retrieved + * by calling member {@link top Stack.top()}. * - *

    This member function effectively calls the member function {@link ILinearContainer.pop_back pop_back()} - * of the {@link container_ underlying container} object.

    + * This member function effectively calls the member function {@link ILinearContainer.pop_back pop_back()} + * of the {@link container_ underlying container} object. */ public pop(): void { @@ -153,15 +150,15 @@ namespace std } /** - *

    Swap contents.

    + * Swap contents. * - *

    Exchanges the contents of the container adaptor (this) by those of obj.

    + * Exchanges the contents of the container adaptor (this) by those of obj. * - *

    This member function calls the non-member function {@link Container.swap swap} (unqualified) to swap - * the {@link container_ underlying containers}.

    + * This member function calls the non-member function {@link Container.swap swap} (unqualified) to swap + * the {@link container_ underlying containers}. * * @param obj Another {@link Stack} container adaptor of the same type (i.e., instantiated with the same - * template parameter, T). Sizes may differ.

    + * template parameter, T). Sizes may differ. */ public swap(obj: Stack): void { diff --git a/ts/src/std/SystemError.ts b/ts/src/std/SystemError.ts index b0cac70a..fbc9369d 100644 --- a/ts/src/std/SystemError.ts +++ b/ts/src/std/SystemError.ts @@ -6,17 +6,17 @@ namespace std { /** - *

    System error exception.

    + * System error exception. * - *

    This class defines the type of objects thrown as exceptions to report conditions originating during + * This class defines the type of objects thrown as exceptions to report conditions originating during * runtime from the operating system or other low-level application program interfaces which have an - * associated {@link ErrorCode}.

    + * associated {@link ErrorCode}. * - *

    The class inherits from {@link RuntimeError}, to which it adds an {@link ErrorCode} as - * member code (and defines a specialized what member).

    + * The class inherits from {@link RuntimeError}, to which it adds an {@link ErrorCode} as + * member code (and defines a specialized what member). * - *

    - *

    + * + * * * @reference http://www.cplusplus.com/reference/system_error/system_error * @author Jeongho Nam @@ -73,12 +73,12 @@ namespace std ACCESSORS --------------------------------------------------------- */ /** - *

    Get error code.

    + * Get error code. * - *

    Returns the {@link ErrorCode} object associated with the exception.

    + * Returns the {@link ErrorCode} object associated with the exception. * - *

    This value is either the {@link ErrorCode} passed to the construction or its equivalent - * (if constructed with a value and a {@link category}.

    + * This value is either the {@link ErrorCode} passed to the construction or its equivalent + * (if constructed with a value and a {@link category}. * * @return The {@link ErrorCode} associated with the object. */ @@ -92,20 +92,20 @@ namespace std namespace std { /** - *

    Error category.

    + * Error category. * - *

    This type serves as a base class for specific category types.

    + * This type serves as a base class for specific category types. * - *

    Category types are used to identify the source of an error. They also define the relation between + * Category types are used to identify the source of an error. They also define the relation between * {@link ErrorCode} and {@link ErrorCondition}objects of its category, as well as the message set for {@link ErrorCode} * objects. * - *

    Objects of these types have no distinct values and are not-copyable and not-assignable, and thus can only be + * Objects of these types have no distinct values and are not-copyable and not-assignable, and thus can only be * passed by reference. As such, only one object of each of these types shall exist, each uniquely identifying its own - * category: all error codes and conditions of a same category shall return a reference to same object.

    + * category: all error codes and conditions of a same category shall return a reference to same object. * - *

    - *

    + * + * * * @reference http://www.cplusplus.com/reference/system_error/error_category * @author Jeongho Nam @@ -126,11 +126,11 @@ namespace std ACCESSORS --------------------------------------------------------- */ /** - *

    Return category name.

    + * Return category name. * - *

    In derived classes, the function returns a string naming the category.

    + * In derived classes, the function returns a string naming the category. * - *

    In {@link ErrorCategory}, it is a pure virtual member function.

    + * In {@link ErrorCategory}, it is a pure virtual member function. * *
      *
    • In the {@link GenericCategory} object, it returns "generic".
    • @@ -143,17 +143,17 @@ namespace std public abstract name(): string; /** - *

      Error message.

      + * Error message. * - *

      In derived classes, the function returns a string object with a message describing the error condition - * denoted by val.

      + * In derived classes, the function returns a string object with a message describing the error condition + * denoted by val. * - *

      In {@link ErrorCategory}, it is a pure virtual member function.

      + * In {@link ErrorCategory}, it is a pure virtual member function. * - *

      This function is called both by {@link ErrorCode.message ErrorCode.message()} and + * This function is called both by {@link ErrorCode.message ErrorCode.message()} and * {@link ErrorCondition.message ErrorCondition.message()} to obtain the corresponding message in the * {@link category}. Therefore, numerical values used by custom error codes and - * {@link ErrorCondition error conditions} should only match for a category if they describe the same error.

      + * {@link ErrorCondition error conditions} should only match for a category if they describe the same error. * * @param val A numerical value identifying an error condition. * If the {@link ErrorCategory} object is the {@link GenericCategory}, this argument is equivalent to an @@ -167,20 +167,20 @@ namespace std OPERATORS --------------------------------------------------------- */ /** - *

      Default error condition.

      + * Default error condition. * - *

      Returns the default {@link ErrorCondition}object of this category that is associated with the - * {@link ErrorCode} identified by a value of val.

      + * Returns the default {@link ErrorCondition}object of this category that is associated with the + * {@link ErrorCode} identified by a value of val. * - *

      Its definition in the base class {@link ErrorCategory} returns the same as constructing an + * Its definition in the base class {@link ErrorCategory} returns the same as constructing an * {@link ErrorCondition} object with: * - *

      new ErrorCondition(val, *this);

      + * new ErrorCondition(val, *this); * - *

      As a virtual member function, this behavior can be overriden in derived classes.

      + * As a virtual member function, this behavior can be overriden in derived classes. * - *

      This function is called by the default definition of member {@link equivalent equivalent()}, which is used to - * compare {@link ErrorCondition error conditions} with error codes.

      + * This function is called by the default definition of member {@link equivalent equivalent()}, which is used to + * compare {@link ErrorCondition error conditions} with error codes. * * @param val A numerical value identifying an error condition. * @@ -192,18 +192,18 @@ namespace std } /** - *

      Check error code equivalence.

      + * Check error code equivalence. * - *

      Checks whether, for the category, an {@link ErrorCode error code} is equivalent to an - * {@link ErrorCondition error condition.

      + * Checks whether, for the category, an {@link ErrorCode error code} is equivalent to an + * {@link ErrorCondition error condition. * - *

      This function is called by the overloads of comparison operators when an {@link ErrorCondition} object is + * This function is called by the overloads of comparison operators when an {@link ErrorCondition} object is * compared to an {@link ErrorCode} object to check for equality or inequality. If either one of those objects' * {@link ErrorCategory categories} considers the other equivalent using this function, they are considered - * equivalent by the operator.

      + * equivalent by the operator. * - *

      As a virtual member function, this behavior can be overridden in derived classes to define a different - * correspondence mechanism for each {@link ErrorCategory} type.

      + * As a virtual member function, this behavior can be overridden in derived classes to define a different + * correspondence mechanism for each {@link ErrorCategory} type. * * @param val_code A numerical value identifying an error code. * @param cond An object of an {@link ErrorCondition} type. @@ -213,18 +213,18 @@ namespace std public equivalent(val_code: number, cond: ErrorCondition): boolean; /** - *

      Check error code equivalence.

      + * Check error code equivalence. * - *

      Checks whether, for the category, an {@link ErrorCode error code} is equivalent to an - * {@link ErrorCondition error condition.

      + * Checks whether, for the category, an {@link ErrorCode error code} is equivalent to an + * {@link ErrorCondition error condition. * - *

      This function is called by the overloads of comparison operators when an {@link ErrorCondition} object is + * This function is called by the overloads of comparison operators when an {@link ErrorCondition} object is * compared to an {@link ErrorCode} object to check for equality or inequality. If either one of those objects' * {@link ErrorCategory categories} considers the other equivalent using this function, they are considered - * equivalent by the operator.

      + * equivalent by the operator. * - *

      As a virtual member function, this behavior can be overridden in derived classes to define a different - * correspondence mechanism for each {@link ErrorCategory} type.

      + * As a virtual member function, this behavior can be overridden in derived classes to define a different + * correspondence mechanism for each {@link ErrorCategory} type. * * @param code An object of an {@link ErrorCode} type. * @param val_cond A numerical value identifying an error code. @@ -240,14 +240,14 @@ namespace std let val_code: number = args[0]; let cond: ErrorCondition = args[1]; - return std.equal_to(this.default_error_condition(val_code), cond); + return equal_to(this.default_error_condition(val_code), cond); } else { let code: ErrorCode = args[0]; let valcond: number = args[1]; - return std.equal_to(this, code.category()) && code.value() == valcond; + return equal_to(this, code.category()) && code.value() == valcond; } } } @@ -256,24 +256,24 @@ namespace std namespace std { /** - *

      Error condition.

      + * Error condition. * - *

      Objects of this type hold a condition {@link value} associated with a {@link category}.

      + * Objects of this type hold a condition {@link value} associated with a {@link category}. * - *

      Objects of this type describe errors in a generic way so that they may be portable across different + * Objects of this type describe errors in a generic way so that they may be portable across different * systems. This is in contrast with {@link ErrorCode} objects, that may contain system-specific - * information.

      + * information. * - *

      Because {@link ErrorCondition}objects can be compared with error_code objects directly by using + * Because {@link ErrorCondition}objects can be compared with error_code objects directly by using * relational operators, {@link ErrorCondition}objects are generally used to check whether * a particular {@link ErrorCode} obtained from the system matches a specific error condition no matter - * the system.

      + * the system. * - *

      The {@link ErrorCategory categories} associated with the {@link ErrorCondition} and the - * {@link ErrorCode} define the equivalences between them.

      + * The {@link ErrorCategory categories} associated with the {@link ErrorCondition} and the + * {@link ErrorCode} define the equivalences between them. * - *

      - *

      + * + * * * @reference http://www.cplusplus.com/reference/system_error/error_condition * @author Jeongho Nam @@ -307,19 +307,19 @@ namespace std namespace std { /** - *

      Error code.

      + * Error code. * - *

      Objects of this type hold an error code {@link value} associated with a {@link category}.

      + * Objects of this type hold an error code {@link value} associated with a {@link category}. * - *

      The operating system and other low-level applications and libraries generate numerical error codes to + * The operating system and other low-level applications and libraries generate numerical error codes to * represent possible results. These numerical values may carry essential information for a specific platform, - * but be non-portable from one platform to another.

      + * but be non-portable from one platform to another. * - *

      Objects of this class associate such numerical codes to {@link ErrorCategory error categories}, so that they - * can be interpreted when needed as more abstract (and portable) {@link ErrorCondition error conditions}.

      + * Objects of this class associate such numerical codes to {@link ErrorCategory error categories}, so that they + * can be interpreted when needed as more abstract (and portable) {@link ErrorCondition error conditions}. * - *

      - *

      + * + * * * @reference http://www.cplusplus.com/reference/system_error/error_code * @author Jeongho Nam diff --git a/ts/src/std/TreeMap.ts b/ts/src/std/TreeMap.ts index 8004fb70..d5bee611 100644 --- a/ts/src/std/TreeMap.ts +++ b/ts/src/std/TreeMap.ts @@ -4,37 +4,37 @@ namespace std.TreeMap { - export type iterator = std.MapIterator; - export type reverse_iterator = std.MapReverseIterator; + export type iterator = MapIterator; + export type reverse_iterator = MapReverseIterator; } namespace std { /** - *

      Tree-structured map, std::map of STL.

      + * Tree-structured map, std::map of STL. * - *

      {@link TreeMap TreeMaps} are associative containers that store elements formed by a combination of a - * key value (Key) and a mapped value (T), following order.

      + * {@link TreeMap TreeMaps} are associative containers that store elements formed by a combination of a + * key value (Key) and a mapped value (T), following order. * - *

      In a {@link TreeMap}, the key values are generally used to sort and uniquely identify the elements, + * In a {@link TreeMap}, the key values are generally used to sort and uniquely identify the elements, * while the mapped values store the content associated to this key. The types of key and * mapped value may differ, and are grouped together in member type value_type, which is a {@link Pair} - * type combining both:

      + * type combining both: * - *

      typedef Pair value_type;

      + * typedef Pair value_type; * - *

      Internally, the elements in a {@link TreeMap} are always sorted by its key following a + * Internally, the elements in a {@link TreeMap} are always sorted by its key following a * strict weak ordering criterion indicated by its internal comparison method {@link less}. * - *

      {@link TreeMap} containers are generally slower than {@link HashMap HashMap} containers to access individual - * elements by their key, but they allow the direct iteration on subsets based on their order.

      + * {@link TreeMap} containers are generally slower than {@link HashMap HashMap} containers to access individual + * elements by their key, but they allow the direct iteration on subsets based on their order. * - *

      {@link TreeMap}s are typically implemented as binary search trees.

      + * {@link TreeMap}s are typically implemented as binary search trees. * - *

      + * *

      * - *

      Container properties

      + * ### Container properties *
      *
      Associative
      *
      Elements in associative containers are referenced by their key and not by their absolute @@ -216,7 +216,7 @@ namespace std { let node = this.tree_.find(key); - if (node == null || std.equal_to(node.value.first, key) == false) + if (node == null || equal_to(node.value.first, key) == false) return this.end(); else return node.value; @@ -278,8 +278,8 @@ namespace std let node = this.tree_.find(pair.first); // IF EQUALS, THEN RETURN FALSE - if (node != null && std.equal_to(node.value.first, pair.first) == true) - return std.make_pair(node.value, false); + if (node != null && equal_to(node.value.first, pair.first) == true) + return make_pair(node.value, false); // INSERTS let it: MapIterator; @@ -295,7 +295,7 @@ namespace std it = this["data_"].insert(it, pair); this._Handle_insert(it, it.next()); // POST-PROCESS - return std.make_pair(it, true); + return make_pair(it, true); } /** @@ -369,17 +369,17 @@ namespace std SWAP --------------------------------------------------------- */ /** - *

      Swap content.

      + * Swap content. * - *

      Exchanges the content of the container by the content of obj, which is another - * {@link TreeMap map} of the same type. Sizes abd container type may differ.

      + * Exchanges the content of the container by the content of obj, which is another + * {@link TreeMap map} of the same type. Sizes abd container type may differ. * - *

      After the call to this member function, the elements in this container are those which were + * After the call to this member function, the elements in this container are those which were * in obj before the call, and the elements of obj are those which were in this. All - * iterators, references and pointers remain valid for the swapped objects.

      + * iterators, references and pointers remain valid for the swapped objects. * - *

      Notice that a non-member function exists with the same name, {@link std.swap swap}, overloading that - * algorithm with an optimization that behaves like this member function.

      + * Notice that a non-member function exists with the same name, {@link swap swap}, overloading that + * algorithm with an optimization that behaves like this member function. * * @param obj Another {@link TreeMap map container} of the same type of elements as this (i.e., * with the same template parameters, Key and T) whose content is swapped diff --git a/ts/src/std/TreeMultiMap.ts b/ts/src/std/TreeMultiMap.ts index 5d7799b5..9fbf4453 100644 --- a/ts/src/std/TreeMultiMap.ts +++ b/ts/src/std/TreeMultiMap.ts @@ -4,39 +4,39 @@ namespace std.TreeMultiMap { - export type iterator = std.MapIterator; - export type reverse_iterator = std.MapReverseIterator; + export type iterator = MapIterator; + export type reverse_iterator = MapReverseIterator; } namespace std { /** - *

      Tree-structured multiple-key map.

      + * Tree-structured multiple-key map. * - *

      {@link TreeMultiMap TreeMultiMaps} are associative containers that store elements formed by a combination of + * {@link TreeMultiMap TreeMultiMaps} are associative containers that store elements formed by a combination of * a key value and a mapped value, following a specific order, and where multiple elements can - * have equivalent keys.

      + * have equivalent keys. * - *

      In a {@link TreeMultiMap}, the key values are generally used to sort and uniquely identify + * In a {@link TreeMultiMap}, the key values are generally used to sort and uniquely identify * the elements, while the mapped values store the content associated to this key. The types of * key and mapped value may differ, and are grouped together in member type - * value_type, which is a {@link Pair} type combining both:

      + * value_type, which is a {@link Pair} type combining both: * - *

      typedef Pair value_type;

      + * typedef Pair value_type; * - *

      Internally, the elements in a {@link TreeMultiMap}are always sorted by its key following a - * strict weak ordering criterion indicated by its internal comparison method (of {@link less}).

      + * Internally, the elements in a {@link TreeMultiMap}are always sorted by its key following a + * strict weak ordering criterion indicated by its internal comparison method (of {@link less}). * - *

      {@link TreeMultiMap}containers are generally slower than {@link HashMap} containers + * {@link TreeMultiMap}containers are generally slower than {@link HashMap} containers * to access individual elements by their key, but they allow the direct iteration on subsets based - * on their order.

      + * on their order. * - *

      {@link TreeMultiMap TreeMultiMaps} are typically implemented as binary search trees.

      + * {@link TreeMultiMap TreeMultiMaps} are typically implemented as binary search trees. * - *

      < + * < * img src="http://samchon.github.io/tstl/images/design/class_diagram/map_containers.png" style="max-width: 100%" />

      * - *

      Container properties

      + * ### Container properties *
      *
      Associative
      *
      @@ -223,7 +223,7 @@ namespace std { let node = this.tree_.find(key); - if (node == null || std.equal_to(node.value.first, key) == false) + if (node == null || equal_to(node.value.first, key) == false) return this.end(); else return node.value; @@ -237,7 +237,7 @@ namespace std let it = this.find(key); let cnt: number = 0; - for (; !it.equals(this.end()) && std.equal_to(it.first, key); it = it.next()) + for (; !it.equals(this.end()) && equal_to(it.first, key); it = it.next()) cnt++; return cnt; @@ -303,7 +303,7 @@ namespace std { it = this.end(); } - else if (std.equal_to(node.value.first, pair.first) == true) + else if (equal_to(node.value.first, pair.first) == true) { it = node.value.next(); } @@ -338,8 +338,8 @@ namespace std let compare = this.key_comp(); // hint <= current && current <= next - if ((compare(hint.first, pair.first) || std.equal_to(hint.first, pair.first)) - && (hint.next().equals(this.end()) || (compare(pair.first, hint.next().first) || std.equal_to(pair.first, hint.next().first)))) + if ((compare(hint.first, pair.first) || equal_to(hint.first, pair.first)) + && (hint.next().equals(this.end()) || (compare(pair.first, hint.next().first) || equal_to(pair.first, hint.next().first)))) { /////// // RIGHT HINT @@ -395,17 +395,17 @@ namespace std SWAP --------------------------------------------------------- */ /** - *

      Swap content.

      + * Swap content. * - *

      Exchanges the content of the container by the content of obj, which is another - * {@link TreeMapMulti map} of the same type. Sizes abd container type may differ.

      + * Exchanges the content of the container by the content of obj, which is another + * {@link TreeMapMulti map} of the same type. Sizes abd container type may differ. * - *

      After the call to this member function, the elements in this container are those which were + * After the call to this member function, the elements in this container are those which were * in obj before the call, and the elements of obj are those which were in this. All - * iterators, references and pointers remain valid for the swapped objects.

      + * iterators, references and pointers remain valid for the swapped objects. * - *

      Notice that a non-member function exists with the same name, {@link std.swap swap}, overloading that - * algorithm with an optimization that behaves like this member function.

      + * Notice that a non-member function exists with the same name, {@link swap swap}, overloading that + * algorithm with an optimization that behaves like this member function. * * @param obj Another {@link TreeMapMulti map container} of the same type of elements as this (i.e., * with the same template parameters, Key and T) whose content is swapped diff --git a/ts/src/std/TreeMultiSet.ts b/ts/src/std/TreeMultiSet.ts index f30fefdd..583d2856 100644 --- a/ts/src/std/TreeMultiSet.ts +++ b/ts/src/std/TreeMultiSet.ts @@ -4,36 +4,36 @@ namespace std.TreeMultiSet { - export type iterator = std.SetIterator; - export type reverse_iterator = std.SetReverseIterator; + export type iterator = SetIterator; + export type reverse_iterator = SetReverseIterator; } namespace std { /** - *

      Tree-structured multiple-key set.

      + * Tree-structured multiple-key set. * - *

      {@link TreeMultiSet TreeMultiSets} are containers that store elements following a specific order, and - * where multiple elements can have equivalent values.

      + * {@link TreeMultiSet TreeMultiSets} are containers that store elements following a specific order, and + * where multiple elements can have equivalent values. * - *

      In a {@link TreeMultiSet}, the value of an element also identifies it (the value is itself + * In a {@link TreeMultiSet}, the value of an element also identifies it (the value is itself * the key, of type T). The value of the elements in a {@link TreeMultiSet} cannot * be modified once in the container (the elements are always const), but they can be inserted or removed - * from the container.

      + * from the container. * - *

      Internally, the elements in a {@link TreeMultiSet TreeMultiSets} are always sorted following a strict - * weak ordering criterion indicated by its internal comparison method (of {@link IComparable.less less}).

      + * Internally, the elements in a {@link TreeMultiSet TreeMultiSets} are always sorted following a strict + * weak ordering criterion indicated by its internal comparison method (of {@link IComparable.less less}). * - *

      {@link TreeMultiSet} containers are generally slower than {@link HashMultiSet} containers + * {@link TreeMultiSet} containers are generally slower than {@link HashMultiSet} containers * to access individual elements by their key, but they allow the direct iteration on subsets based on - * their order.

      + * their order. * - *

      {@link TreeMultiSet TreeMultiSets} are typically implemented as binary search trees.

      + * {@link TreeMultiSet TreeMultiSets} are typically implemented as binary search trees. * - *

      + * *

      * - *

      Container properties

      + * ### Container properties *
      *
      Associative
      *
      @@ -197,7 +197,7 @@ namespace std { var node = this.tree_.find(val); - if (node == null || std.equal_to(val, node.value.value) == false) + if (node == null || equal_to(val, node.value.value) == false) return this.end(); else return node.value; @@ -211,7 +211,7 @@ namespace std let it = this.find(val); let cnt: number = 0; - for (; !it.equals(this.end()) && std.equal_to(it.value, val); it = it.next()) + for (; !it.equals(this.end()) && equal_to(it.value, val); it = it.next()) cnt++; return cnt; @@ -257,14 +257,6 @@ namespace std return this.tree_.equal_range(val); } - ///** - // * @hidden - // */ - //public _Get_tree(): base.AtomicTree - //{ - // return this.tree_; - //} - /* ========================================================= ELEMENTS I/O - INSERT @@ -286,7 +278,7 @@ namespace std { it = this.end(); } - else if (std.equal_to(node.value.value, val) == true) + else if (equal_to(node.value.value, val) == true) { it = node.value.next(); } @@ -321,8 +313,8 @@ namespace std let compare = this.tree_.key_comp(); // hint <= current && current <= next - if ((compare(hint.value, val) || std.equal_to(hint.value, val)) - && (hint.next().equals(this.end()) || (compare(val, hint.next().value) || std.equal_to(val, hint.next().value)))) + if ((compare(hint.value, val) || equal_to(hint.value, val)) + && (hint.next().equals(this.end()) || (compare(val, hint.next().value) || equal_to(val, hint.next().value)))) { /////// // RIGHT HINT @@ -378,17 +370,17 @@ namespace std SWAP --------------------------------------------------------- */ /** - *

      Swap content.

      + * Swap content. * - *

      Exchanges the content of the container by the content of obj, which is another - * {@link TreeMultiSet set} of the same type. Sizes abd container type may differ.

      + * Exchanges the content of the container by the content of obj, which is another + * {@link TreeMultiSet set} of the same type. Sizes abd container type may differ. * - *

      After the call to this member function, the elements in this container are those which were + * After the call to this member function, the elements in this container are those which were * in obj before the call, and the elements of obj are those which were in this. All - * iterators, references and pointers remain valid for the swapped objects.

      + * iterators, references and pointers remain valid for the swapped objects. * - *

      Notice that a non-member function exists with the same name, {@link std.swap swap}, overloading that - * algorithm with an optimization that behaves like this member function.

      + * Notice that a non-member function exists with the same name, {@link swap swap}, overloading that + * algorithm with an optimization that behaves like this member function. * * @param obj Another {@link TreeMultiSet set container} of the same type of elements as this (i.e., * with the same template parameters, Key and T) whose content is swapped diff --git a/ts/src/std/TreeSet.ts b/ts/src/std/TreeSet.ts index 2d4b5d0d..8c47e365 100644 --- a/ts/src/std/TreeSet.ts +++ b/ts/src/std/TreeSet.ts @@ -4,35 +4,35 @@ namespace std.TreeSet { - export type iterator = std.SetIterator; - export type reverse_iterator = std.SetReverseIterator; + export type iterator = SetIterator; + export type reverse_iterator = SetReverseIterator; } namespace std { /** - *

      Tree-structured set, std::set of STL.

      + * Tree-structured set, std::set of STL. * - *

      {@link TreeSet}s are containers that store unique elements following a specific order.

      + * {@link TreeSet}s are containers that store unique elements following a specific order. * - *

      In a {@link TreeSet}, the value of an element also identifies it (the value is itself the + * In a {@link TreeSet}, the value of an element also identifies it (the value is itself the * key, of type T), and each value must be unique. The value of the elements in a * {@link TreeSet} cannot be modified once in the container (the elements are always const), but they - * can be inserted or removed from the container.

      + * can be inserted or removed from the container. * - *

      Internally, the elements in a {@link TreeSet} are always sorted following a specific strict weak - * ordering criterion indicated by its internal comparison method (of {@link less}).

      + * Internally, the elements in a {@link TreeSet} are always sorted following a specific strict weak + * ordering criterion indicated by its internal comparison method (of {@link less}). * - *

      {@link TreeSet} containers are generally slower than {@link HashSet} containers to access + * {@link TreeSet} containers are generally slower than {@link HashSet} containers to access * individual elements by their key, but they allow the direct iteration on subsets based on their - * order.

      + * order. * - *

      {@link TreeSet}s are typically implemented as binary search trees.

      + * {@link TreeSet}s are typically implemented as binary search trees. * - *

      + * *

      * - *

      Container properties

      + * ### Container properties *
      *
      Associative
      *
      @@ -196,7 +196,7 @@ namespace std { let node = this.tree_.find(val); - if (node == null || std.equal_to(node.value.value, val) == false) + if (node == null || equal_to(node.value.value, val) == false) return this.end(); else return node.value; @@ -258,7 +258,7 @@ namespace std let node = this.tree_.find(val); // IF EQUALS, THEN RETURN FALSE - if (node != null && std.equal_to(node.value.value, val) == true) + if (node != null && equal_to(node.value.value, val) == true) return make_pair(node.value, false); // FIND NODE @@ -348,17 +348,17 @@ namespace std SWAP --------------------------------------------------------- */ /** - *

      Swap content.

      + * Swap content. * - *

      Exchanges the content of the container by the content of obj, which is another - * {@link TreeSet set} of the same type. Sizes abd container type may differ.

      + * Exchanges the content of the container by the content of obj, which is another + * {@link TreeSet set} of the same type. Sizes abd container type may differ. * - *

      After the call to this member function, the elements in this container are those which were + * After the call to this member function, the elements in this container are those which were * in obj before the call, and the elements of obj are those which were in this. All - * iterators, references and pointers remain valid for the swapped objects.

      + * iterators, references and pointers remain valid for the swapped objects. * - *

      Notice that a non-member function exists with the same name, {@link std.swap swap}, overloading that - * algorithm with an optimization that behaves like this member function.

      + * Notice that a non-member function exists with the same name, {@link swap swap}, overloading that + * algorithm with an optimization that behaves like this member function. * * @param obj Another {@link TreeSet set container} of the same type of elements as this (i.e., * with the same template parameters, Key and T) whose content is swapped diff --git a/ts/src/std/Utility.ts b/ts/src/std/Utility.ts index 40565555..0d9e381b 100644 --- a/ts/src/std/Utility.ts +++ b/ts/src/std/Utility.ts @@ -3,9 +3,9 @@ namespace std { /** - *

      Running on Node.

      + * Running on Node. * - *

      Test whether the JavaScript is running on Node.

      + * Test whether the JavaScript is running on Node. * * @references http://stackoverflow.com/questions/17575790/environment-detection-node-js-or-browser */ @@ -20,11 +20,11 @@ namespace std } /** - *

      Pair of values.

      + * Pair of values. * - *

      This class couples together a pair of values, which may be of different types (T1 and + * This class couples together a pair of values, which may be of different types (T1 and * T2). The individual values can be accessed through its public members {@link first} and - * {@link second}.

      + * {@link second}. * * @param Type of member {@link first}. * @param Type of member {@link second}. @@ -35,12 +35,12 @@ namespace std export class Pair implements IComparable> { /** - *

      A first value in the Pair.

      + * A first value in the Pair. */ public first: T1; /** - *

      A second value in the Pair.

      + * A second value in the Pair. */ public second: T2; @@ -48,7 +48,7 @@ namespace std CONSTRUCTORS --------------------------------------------------------- */ /** - *

      Construct from pair values.

      + * Construct from pair values. * * @param first The first value of the Pair * @param second The second value of the Pair @@ -63,19 +63,20 @@ namespace std COMPARISON --------------------------------------------------------- */ /** - *

      Whether a Pair is equal with the Pair.

      - *

      Compare each first and second value of two Pair(s) and returns whether they are equal or not.

      + * Whether a Pair is equal with the Pair. * - *

      If stored key and value in a Pair are not number or string but an object like a class or struct, + * Compare each first and second value of two Pair(s) and returns whether they are equal or not. + * + * If stored key and value in a Pair are not number or string but an object like a class or struct, * the comparison will be executed by a member method (SomeObject)::equals(). If the object does not have - * the member method equal_to(), only address of pointer will be compared.

      + * the member method equal_to(), only address of pointer will be compared. * * @param obj A Map to compare * @return Indicates whether equal or not. */ public equals(pair: Pair): boolean { - return std.equal_to(this.first, pair.first) && std.equal_to(this.second, pair.second); + return equal_to(this.first, pair.first) && equal_to(this.second, pair.second); } /** @@ -83,23 +84,23 @@ namespace std */ public less(pair: Pair): boolean { - if (std.equal_to(this.first, pair.first) == false) - return std.less(this.first, pair.first); + if (equal_to(this.first, pair.first) == false) + return less(this.first, pair.first); else - return std.less(this.second, pair.second); + return less(this.second, pair.second); } } /** - *

      Construct {@link Pair} object.

      + * Construct {@link Pair} object. * - *

      Constructs a {@link Pair} object with its {@link Pair.first first} element set to x and its - * {@link Pair.second second} element set to y.

      + * Constructs a {@link Pair} object with its {@link Pair.first first} element set to x and its + * {@link Pair.second second} element set to y. * - *

      The template types can be implicitly deduced from the arguments passed to {@link make_pair}.

      + * The template types can be implicitly deduced from the arguments passed to {@link make_pair}. * - *

      {@link Pair} objects can be constructed from other {@link Pair} objects containing different types, if the - * respective types are implicitly convertible.

      + * {@link Pair} objects can be constructed from other {@link Pair} objects containing different types, if the + * respective types are implicitly convertible. * * @param x Value for member {@link Pair.first first}. * @param y Value for member {@link Pair.second second}. diff --git a/ts/src/std/Vector.ts b/ts/src/std/Vector.ts index c2045212..95c01884 100644 --- a/ts/src/std/Vector.ts +++ b/ts/src/std/Vector.ts @@ -4,38 +4,37 @@ namespace std.Vector { - export type iterator = std.VectorIterator; - export type reverse_iterator = std.VectorReverseIterator; + export type iterator = VectorIterator; + export type reverse_iterator = VectorReverseIterator; } namespace std { /** - *

      Vector, the dynamic array.

      + * Vector, the dynamic array. * - *

      {@link Vector}s are sequence containers representing arrays that can change in size.

      + * {@link Vector}s are sequence containers representing arrays that can change in size. * - *

      Just like arrays, {@link Vector}s use contiguous storage locations for their elements, which means that + * Just like arrays, {@link Vector}s use contiguous storage locations for their elements, which means that * their elements can also be accessed using offsets on regular pointers to its elements, and just as efficiently * as in arrays. But unlike arrays, their size can change dynamically, with their storage being handled - * automatically by the container.

      + * automatically by the container. * - *

      Internally, {@link Vector}s use a dynamically allocated array to store their elements. This array may need + * Internally, {@link Vector}s use a dynamically allocated array to store their elements. This array may need * to be reallocated in order to grow in size when new elements are inserted, which implies allocating a new * array and moving all elements to it. This is a relatively expensive task in terms of processing time, and - * thus, {@link Vector}s do not reallocate each time an element is added to the container.

      + * thus, {@link Vector}s do not reallocate each time an element is added to the container. * - *

      Compared to the other dynamic sequence containers ({@link Deque}s, {@link List}s), {@link Vector Vectors} + * Compared to the other dynamic sequence containers ({@link Deque}s, {@link List}s), {@link Vector Vectors} * are very efficient accessing its elements (just like arrays) and relatively efficient adding or removing * elements from its end. For operations that involve inserting or removing elements at positions other than the * end, they perform worse than the others, and have less consistent iterators and references than {@link List}s. - *

      * - *

      + * * - *

      + * * - *

      Container properties

      + * ### Container properties *
      *
      Sequence
      *
      @@ -87,9 +86,9 @@ namespace std CONSTURCTORS --------------------------------------------------------- */ /** - *

      Default Constructor.

      + * Default Constructor. * - *

      Constructs an empty container, with no elements.

      + * Constructs an empty container, with no elements. */ public constructor(); @@ -99,18 +98,18 @@ namespace std public constructor(array: Array); /** - *

      Initializer list Constructor.

      + * Initializer list Constructor. * - *

      Constructs a container with a copy of each of the elements in array, in the same order.

      + * Constructs a container with a copy of each of the elements in array, in the same order. * * @param array An array containing elements to be copied and contained. */ public constructor(n: number); /** - *

      Fill Constructor.

      + * Fill Constructor. * - *

      Constructs a container with n elements. Each element is a copy of val (if provided).

      + * Constructs a container with n elements. Each element is a copy of val (if provided). * * @param n Initial container size (i.e., the number of elements in the container at construction). * @param val Value to fill the container with. Each of the n elements in the container is @@ -119,9 +118,9 @@ namespace std public constructor(n: number, val: T); /** - *

      Copy Constructor.

      + * Copy Constructor. * - *

      Constructs a container with a copy of each of the elements in container, in the same order.

      + * Constructs a container with a copy of each of the elements in container, in the same order. * * @param container Another container object of the same type (with the same class template * arguments T), whose contents are either copied or acquired. @@ -129,10 +128,10 @@ namespace std public constructor(container: Vector); /** - *

      Range Constructor.

      + * Range Constructor. * - *

      Constructs a container with as many elements as the range (begin, end), with each - * element emplace-constructed from its corresponding element in that range, in the same order.

      + * Constructs a container with as many elements as the range (begin, end), with each + * element emplace-constructed from its corresponding element in that range, in the same order. * * @param begin Input interator of the initial position in a sequence. * @param end Input interator of the final position in a sequence. @@ -282,7 +281,7 @@ namespace std if (index < this.size()) return this.data_[index]; else - throw new std.OutOfRange("Target index is greater than Vector's size."); + throw new OutOfRange("Target index is greater than Vector's size."); } /** @@ -291,7 +290,7 @@ namespace std public set(index: number, val: T): T { if (index >= this.size()) - throw new std.OutOfRange("Target index is greater than Vector's size."); + throw new OutOfRange("Target index is greater than Vector's size."); let prev: T = this.data_[index]; this.data_[index] = val; @@ -352,15 +351,15 @@ namespace std } /** - *

      Insert an element.

      + * Insert an element. * - *

      The {@link Vector} is extended by inserting new element before the element at the specified - * position, effectively increasing the container size by one.

      + * The {@link Vector} is extended by inserting new element before the element at the specified + * position, effectively increasing the container size by one. * - *

      Because {@link Vector}s use an Array as their underlying storage, inserting element in + * Because {@link Vector}s use an Array as their underlying storage, inserting element in * positions other than the {@link end end()} causes the container to relocate all the elements that were * after position to its new position. This is generally an inefficient operation compared to the one - * performed for the same operation by other kinds of sequence containers (such as {@link List}).

      + * performed for the same operation by other kinds of sequence containers (such as {@link List}). * * @param position Position in the {@link Vector} where the new element is inserted. * {@link iterator} is a member type, defined as a @@ -372,12 +371,12 @@ namespace std public insert(position: VectorIterator, val: T): VectorIterator; /** - *

      Insert elements by repeated filling.

      + * Insert elements by repeated filling. * - *

      The {@link Vector} is extended by inserting new elements before the element at the specified - * position, effectively increasing the container size by the number of elements inserted.

      + * The {@link Vector} is extended by inserting new elements before the element at the specified + * position, effectively increasing the container size by the number of elements inserted. * - *

      Because {@link Vector}s use an Array as their underlying storage, inserting elements in + * Because {@link Vector}s use an Array as their underlying storage, inserting elements in * positions other than the {@link end end()} causes the container to relocate all the elements that were * after position to their new positions. This is generally an inefficient operation compared to the * one performed for the same operation by other kinds of sequence containers (such as {@link List}). @@ -393,13 +392,13 @@ namespace std public insert(position: VectorIterator, n: number, val: T): VectorIterator; /** - *

      Insert elements by range iterators.

      + * Insert elements by range iterators. * - *

      The {@link Vector} is extended by inserting new elements before the element at the specified + * The {@link Vector} is extended by inserting new elements before the element at the specified * position, effectively increasing the container size by the number of elements inserted by range - * iterators.

      + * iterators. * - *

      Because {@link Vector}s use an Array as their underlying storage, inserting elements in + * Because {@link Vector}s use an Array as their underlying storage, inserting elements in * positions other than the {@link end end()} causes the container to relocate all the elements that were * after position to their new positions. This is generally an inefficient operation compared to the * one performed for the same operation by other kinds of sequence containers (such as {@link List}). @@ -416,15 +415,15 @@ namespace std (position: VectorIterator, begin: InputIterator, end: InputIterator): VectorIterator; /** - *

      Insert an element.

      + * Insert an element. * - *

      The {@link Vector} is extended by inserting new element before the element at the specified - * position, effectively increasing the container size by one.

      + * The {@link Vector} is extended by inserting new element before the element at the specified + * position, effectively increasing the container size by one. * - *

      Because {@link Vector}s use an Array as their underlying storage, inserting element in + * Because {@link Vector}s use an Array as their underlying storage, inserting element in * positions other than the {@link end end()} causes the container to relocate all the elements that were * after position to its new position. This is generally an inefficient operation compared to the one - * performed for the same operation by other kinds of sequence containers (such as {@link List}).

      + * performed for the same operation by other kinds of sequence containers (such as {@link List}). * * @param position Position in the {@link Vector} where the new element is inserted. * {@link iterator} is a member type, defined as a @@ -436,12 +435,12 @@ namespace std public insert(position: VectorReverseIterator, val: T): VectorReverseIterator; /** - *

      Insert elements by repeated filling.

      + * Insert elements by repeated filling. * - *

      The {@link Vector} is extended by inserting new elements before the element at the specified - * position, effectively increasing the container size by the number of elements inserted.

      + * The {@link Vector} is extended by inserting new elements before the element at the specified + * position, effectively increasing the container size by the number of elements inserted. * - *

      Because {@link Vector}s use an Array as their underlying storage, inserting elements in + * Because {@link Vector}s use an Array as their underlying storage, inserting elements in * positions other than the {@link end end()} causes the container to relocate all the elements that were * after position to their new positions. This is generally an inefficient operation compared to the * one performed for the same operation by other kinds of sequence containers (such as {@link List}). @@ -457,13 +456,13 @@ namespace std public insert(position: VectorReverseIterator, n: number, val: T): VectorReverseIterator; /** - *

      Insert elements by range iterators.

      + * Insert elements by range iterators. * - *

      The {@link Vector} is extended by inserting new elements before the element at the specified + * The {@link Vector} is extended by inserting new elements before the element at the specified * position, effectively increasing the container size by the number of elements inserted by range - * iterators.

      + * iterators. * - *

      Because {@link Vector}s use an Array as their underlying storage, inserting elements in + * Because {@link Vector}s use an Array as their underlying storage, inserting elements in * positions other than the {@link end end()} causes the container to relocate all the elements that were * after position to their new positions. This is generally an inefficient operation compared to the * one performed for the same operation by other kinds of sequence containers (such as {@link List}). @@ -595,16 +594,16 @@ namespace std } /** - *

      Erase element.

      + * Erase element. * - *

      Removes from the {@link Vector} either a single element; position.

      + * Removes from the {@link Vector} either a single element; position. * - *

      This effectively reduces the container size by the number of element removed.

      + * This effectively reduces the container size by the number of element removed. * - *

      Because {@link Vector}s use an Array as their underlying storage, erasing an element in + * Because {@link Vector}s use an Array as their underlying storage, erasing an element in * position other than the {@link end end()} causes the container to relocate all the elements after the * segment erased to their new positions. This is generally an inefficient operation compared to the one - * performed for the same operation by other kinds of sequence containers (such as {@link List}).

      + * performed for the same operation by other kinds of sequence containers (such as {@link List}). * * @param position Iterator pointing to a single element to be removed from the {@link Vector}. * @@ -615,16 +614,16 @@ namespace std public erase(position: VectorIterator): VectorIterator; /** - *

      Erase element.

      + * Erase element. * - *

      Removes from the Vector either a single element; position.

      + * Removes from the Vector either a single element; position. * - *

      This effectively reduces the container size by the number of elements removed.

      + * This effectively reduces the container size by the number of elements removed. * - *

      Because {@link Vector}s use an Array as their underlying storage, erasing elements in + * Because {@link Vector}s use an Array as their underlying storage, erasing elements in * position other than the {@link end end()} causes the container to relocate all the elements after the * segment erased to their new positions. This is generally an inefficient operation compared to the one - * performed for the same operation by other kinds of sequence containers (such as {@link List}).

      + * performed for the same operation by other kinds of sequence containers (such as {@link List}). * * @param begin An iterator specifying a range of beginning to erase. * @param end An iterator specifying a range of end to erase. @@ -636,16 +635,16 @@ namespace std public erase(first: VectorIterator, last: VectorIterator): VectorIterator; /** - *

      Erase element.

      + * Erase element. * - *

      Removes from the {@link Vector} either a single element; position.

      + * Removes from the {@link Vector} either a single element; position. * - *

      This effectively reduces the container size by the number of element removed.

      + * This effectively reduces the container size by the number of element removed. * - *

      Because {@link Vector}s use an Array as their underlying storage, erasing an element in + * Because {@link Vector}s use an Array as their underlying storage, erasing an element in * position other than the {@link end end()} causes the container to relocate all the elements after the * segment erased to their new positions. This is generally an inefficient operation compared to the one - * performed for the same operation by other kinds of sequence containers (such as {@link List}).

      + * performed for the same operation by other kinds of sequence containers (such as {@link List}). * * @param position Iterator pointing to a single element to be removed from the {@link Vector}. * @@ -656,16 +655,16 @@ namespace std public erase(position: VectorReverseIterator): VectorReverseIterator; /** - *

      Erase element.

      + * Erase element. * - *

      Removes from the Vector either a single element; position.

      + * Removes from the Vector either a single element; position. * - *

      This effectively reduces the container size by the number of elements removed.

      + * This effectively reduces the container size by the number of elements removed. * - *

      Because {@link Vector}s use an Array as their underlying storage, erasing elements in + * Because {@link Vector}s use an Array as their underlying storage, erasing elements in * position other than the {@link end end()} causes the container to relocate all the elements after the * segment erased to their new positions. This is generally an inefficient operation compared to the one - * performed for the same operation by other kinds of sequence containers (such as {@link List}).

      + * performed for the same operation by other kinds of sequence containers (such as {@link List}). * * @param begin An iterator specifying a range of beginning to erase. * @param end An iterator specifying a range of end to erase. @@ -727,17 +726,17 @@ namespace std SWAP --------------------------------------------------------------- */ /** - *

      Swap content.

      + * Swap content. * - *

      Exchanges the content of the container by the content of obj, which is another - * {@link Vector container} object with same type of elements. Sizes and container type may differ.

      + * Exchanges the content of the container by the content of obj, which is another + * {@link Vector container} object with same type of elements. Sizes and container type may differ. * - *

      After the call to this member function, the elements in this container are those which were in obj + * After the call to this member function, the elements in this container are those which were in obj * before the call, and the elements of obj are those which were in this. All iterators, references and - * pointers remain valid for the swapped objects.

      + * pointers remain valid for the swapped objects. * - *

      Notice that a non-member function exists with the same name, {@link std.swap swap}, overloading that - * algorithm with an optimization that behaves like this member function.

      + * Notice that a non-member function exists with the same name, {@link swap swap}, overloading that + * algorithm with an optimization that behaves like this member function. * * @param obj Another {@link Vector container} of the same type of elements (i.e., instantiated * with the same template parameter, T) whose content is swapped with that of this @@ -763,11 +762,10 @@ namespace std namespace std { /** - *

      An iterator of Vector.

      + * An iterator of Vector. * - *

      + * * - *

      * * @param Type of the elements. * @@ -786,11 +784,12 @@ namespace std CONSTRUCTORS --------------------------------------------------------- */ /** - *

      Construct from the source {@link Vector container}.

      + * Construct from the source {@link Vector container}. * - *

      Note

      - *

      Do not create the iterator directly, by yourself.

      - *

      Use {@link Vector.begin begin()}, {@link Vector.end end()} in {@link Vector container} instead.

      + * #### Note + * Do not create the iterator directly, by yourself. + * + * Use {@link Vector.begin begin()}, {@link Vector.end end()} in {@link Vector container} instead. * * @param source The source {@link Vector container} to reference. * @param index Sequence number of the element in the source {@link Vector}. @@ -912,11 +911,10 @@ namespace std namespace std { /** - *

      A reverse-iterator of Vector.

      + * A reverse-iterator of Vector. * - *

      + * * - *

      * * @param Type of the elements. * diff --git a/ts/src/std/base/Container.ts b/ts/src/std/base/Container.ts index e0f4cae0..f8f2d0de 100644 --- a/ts/src/std/base/Container.ts +++ b/ts/src/std/base/Container.ts @@ -3,13 +3,13 @@ namespace std.base { /** - *

      An abstract container.

      + * An abstract container. * - *

      + * * - *

      + * * - *

      Container properties

      + * ### Container properties *
      *
      Sequence
      *
      Elements in sequence containers are ordered in a strict linear sequence. Individual elements are @@ -47,10 +47,10 @@ namespace std.base ASSIGN & CLEAR --------------------------------------------------------- */ /** - *

      Assign new content to content.

      + * Assign new content to content. * - *

      Assigns new contents to the container, replacing its current contents, and modifying its - * {@link size} accordingly.

      + * Assigns new contents to the container, replacing its current contents, and modifying its + * {@link size} accordingly. * * @param begin Input interator of the initial position in a sequence. * @param end Input interator of the final position in a sequence. @@ -59,9 +59,9 @@ namespace std.base (begin: InputIterator, end: InputIterator): void; /** - *

      Clear content.

      + * Clear content. * - *

      Removes all elements from the Container, leaving the container with a size of 0.

      + * Removes all elements from the Container, leaving the container with a size of 0. */ public clear(): void { @@ -72,67 +72,67 @@ namespace std.base GETTERS --------------------------------------------------------------- */ /** - *

      Return iterator to beginning.

      + * Return iterator to beginning. * - *

      Returns an iterator referring the first element in the

      + * Returns an iterator referring the first element in the * - *

      Note

      - *

      If the container is {@link empty}, the returned iterator is same with {@link end end()}.

      + * #### Note + * If the container is {@link empty}, the returned iterator is same with {@link end end()}. * * @return An iterator to the first element in the The iterator containes the first element's value. */ public abstract begin(): Iterator; /** - *

      Return iterator to end.

      - *

      Returns an iterator referring to the past-the-end element in the

      + * Return iterator to end. + * Returns an iterator referring to the past-the-end element in the * - *

      The past-the-end element is the theoretical element that would follow the last element in the - * It does not point to any element, and thus shall not be dereferenced.

      + * The past-the-end element is the theoretical element that would follow the last element in the + * It does not point to any element, and thus shall not be dereferenced. * - *

      Because the ranges used by functions of the Container do not include the element reference by their + * Because the ranges used by functions of the Container do not include the element reference by their * closing iterator, this function is often used in combination with {@link Container}.{@link begin} to - * specify a range including all the elements in the container.

      + * specify a range including all the elements in the container. * - *

      Note

      - *

      Returned iterator from {@link Container}.{@link end} does not refer any element. Trying to accessing - * element by the iterator will cause throwing exception ({@link OutOfRange}).

      + * #### Note + * Returned iterator from {@link Container}.{@link end} does not refer any element. Trying to accessing + * element by the iterator will cause throwing exception ({@link OutOfRange}). * - *

      If the container is {@link empty}, this function returns the same as {@link Container}.{@link begin}. - *

      + * If the container is {@link empty}, this function returns the same as {@link Container}.{@link begin}. + * * * @return An iterator to the end element in the */ public abstract end(): Iterator; /** - *

      Return {@link ReverseIterator reverse iterator} to reverse beginning.

      + * Return {@link ReverseIterator reverse iterator} to reverse beginning. * - *

      Returns a {@link ReverseIterator reverse iterator} pointing to the last element in the container (i.e., - * its reverse beginning).

      + * Returns a {@link ReverseIterator reverse iterator} pointing to the last element in the container (i.e., + * its reverse beginning). * - *

      {@link ReverseIterator reverse iterators} iterate backwards: increasing them moves them towards the - * beginning of the

      + * {@link ReverseIterator reverse iterators} iterate backwards: increasing them moves them towards the + * beginning of the * - *

      {@link rbegin} points to the element right before the one that would be pointed to by member {@link end}. - *

      + * {@link rbegin} points to the element right before the one that would be pointed to by member {@link end}. + * * * @return A {@link ReverseIterator reverse iterator} to the reverse beginning of the sequence */ - public abstract rbegin(): base.IReverseIterator; + public abstract rbegin(): IReverseIterator; /** - *

      Return {@link ReverseIterator reverse iterator} to reverse end.

      + * Return {@link ReverseIterator reverse iterator} to reverse end. * - *

      Returns a {@link ReverseIterator reverse iterator} pointing to the theoretical element preceding the - * first element in the container (which is considered its reverse end).

      + * Returns a {@link ReverseIterator reverse iterator} pointing to the theoretical element preceding the + * first element in the container (which is considered its reverse end). * - *

      The range between {@link Container}.{@link rbegin} and {@link Container}.{@link rend} contains all + * The range between {@link Container}.{@link rbegin} and {@link Container}.{@link rend} contains all * the elements of the container (in reverse order). * * @return A {@link ReverseIterator reverse iterator} to the reverse end of the sequence */ - public abstract rend(): base.IReverseIterator; + public abstract rend(): IReverseIterator; /** * Return the number of elements in the {@link Container}. @@ -142,11 +142,11 @@ namespace std.base public abstract size(): number; /** - *

      Test whether the container is empty.

      - *

      Returns whether the container is empty (i.e. whether its size is 0).

      + * Test whether the container is empty. + * Returns whether the container is empty (i.e. whether its size is 0). * - *

      This function does not modify the container in any way. To clear the content of the container, - * see {@link clear clear()}.

      + * This function does not modify the container in any way. To clear the content of the container, + * see {@link clear clear()}. * * @return true if the container size is 0, false otherwise. */ @@ -163,9 +163,9 @@ namespace std.base INSERT --------------------------------------------------------- */ /** - *

      Insert elements.

      + * Insert elements. * - *

      Appends new elements to the container, and returns the new size of the

      + * Appends new elements to the container, and returns the new size of the * * @param items New elements to insert. * @@ -174,11 +174,11 @@ namespace std.base public abstract push(...items: T[]): number; /** - *

      Insert an element.

      + * Insert an element. * - *

      The container is extended by inserting a new element before the element at the specified + * The container is extended by inserting a new element before the element at the specified * position. This effectively increases the {@link Container.size container size} by the amount of - * elements inserted.

      + * elements inserted. * * @param position Position in the {@link Container} where the new element is inserted. * {@link iterator} is a member type, defined as a {@link Iterator random access iterator} @@ -192,11 +192,11 @@ namespace std.base ERASE --------------------------------------------------------- */ /** - *

      Erase an element.

      + * Erase an element. * - *

      Removes from the container a single element.

      + * Removes from the container a single element. * - *

      This effectively reduces the container size by the number of element removed.

      + * This effectively reduces the container size by the number of element removed. * * @param position Iterator pointing to a single element to be removed from the Container. * @@ -207,11 +207,11 @@ namespace std.base public abstract erase(position: Iterator): Iterator; /** - *

      Erase elements.

      + * Erase elements. * - *

      Removes from the container a range of elements.

      + * Removes from the container a range of elements. * - *

      This effectively reduces the container size by the number of elements removed.

      + * This effectively reduces the container size by the number of elements removed. * * @param begin An iterator specifying a range of beginning to erase. * @param end An iterator specifying a range of end to erase. @@ -226,17 +226,17 @@ namespace std.base UTILITIES --------------------------------------------------------------- */ /** - *

      Swap content.

      + * Swap content. * - *

      Exchanges the content of the container by the content of obj, which is another - * {@link Container container} object with same type of elements. Sizes and container type may differ.

      + * Exchanges the content of the container by the content of obj, which is another + * {@link Container container} object with same type of elements. Sizes and container type may differ. * - *

      After the call to this member function, the elements in this container are those which were in obj + * After the call to this member function, the elements in this container are those which were in obj * before the call, and the elements of obj are those which were in this. All iterators, references and - * pointers remain valid for the swapped objects.

      + * pointers remain valid for the swapped objects. * - *

      Notice that a non-member function exists with the same name, {@link std.swap swap}, overloading that - * algorithm with an optimization that behaves like this member function.

      + * Notice that a non-member function exists with the same name, {@link swap swap}, overloading that + * algorithm with an optimization that behaves like this member function. * * @param obj Another {@link Container container} of the same type of elements (i.e., instantiated * with the same template parameter, T) whose content is swapped with that of this @@ -252,7 +252,7 @@ namespace std.base } export interface IReverseIterator - extends ReverseIterator, Iterator, IReverseIterator> + extends ReverseIterator, Iterator, IReverseIterator> { } } \ No newline at end of file diff --git a/ts/src/std/base/ErrorInstance.ts b/ts/src/std/base/ErrorInstance.ts index 31caa032..83a8df78 100644 --- a/ts/src/std/base/ErrorInstance.ts +++ b/ts/src/std/base/ErrorInstance.ts @@ -3,21 +3,21 @@ namespace std.base { /** - *

      An abstract error instance.

      + * An abstract error instance. * - *

      {@link ErrorInstance} is an abstract class of {@link ErrorCode} and {@link ErrorCondition} - * holding an error instance's identifier {@link value}, associated with a {@link category}.

      + * {@link ErrorInstance} is an abstract class of {@link ErrorCode} and {@link ErrorCondition} + * holding an error instance's identifier {@link value}, associated with a {@link category}. * - *

      The operating system and other low-level applications and libraries generate numerical error codes to + * The operating system and other low-level applications and libraries generate numerical error codes to * represent possible results. These numerical values may carry essential information for a specific platform, - * but be non-portable from one platform to another.

      + * but be non-portable from one platform to another. * - *

      Objects of this class associate such numerical codes to {@link ErrorCategory error categories}, + * Objects of this class associate such numerical codes to {@link ErrorCategory error categories}, * so that they can be interpreted when needed as more abstract (and portable) - * {@link ErrorCondition error conditions}.

      + * {@link ErrorCondition error conditions}. * - *

      - *

      + * + * * * @author Jeongho Nam */ @@ -55,9 +55,9 @@ namespace std.base } /** - *

      Assign error instance.

      + * Assign error instance. * - *

      Assigns the {@link ErrorCode} object a value of val associated with the {@link ErrorCategory}.

      + * Assigns the {@link ErrorCode} object a value of val associated with the {@link ErrorCategory}. * * @param val A numerical value identifying an error instance. * @param category A reference to an {@link ErrorCategory} object. @@ -69,10 +69,10 @@ namespace std.base } /** - *

      Clear error instance.

      + * Clear error instance. * - *

      Clears the value in the {@link ErrorCode} object so that it is set to a value of 0 of the - * {@link ErrorCategory.systemCategory ErrorCategory.systemCategory()} (indicating no error).

      + * Clears the value in the {@link ErrorCode} object so that it is set to a value of 0 of the + * {@link ErrorCategory.systemCategory ErrorCategory.systemCategory()} (indicating no error). */ public clear(): void { @@ -83,9 +83,9 @@ namespace std.base ACCESSORS --------------------------------------------------------- */ /** - *

      Get category.

      + * Get category. * - *

      Returns a reference to the {@link ErrorCategory} associated with the {@link ErrorCode} object.

      + * Returns a reference to the {@link ErrorCategory} associated with the {@link ErrorCode} object. * * @return A reference to a non-copyable object of a type derived from {@link ErrorCategory}. */ @@ -95,9 +95,9 @@ namespace std.base } /** - *

      Error value.

      + * Error value. * - *

      Returns the error value associated with the {@link ErrorCode} object.

      + * Returns the error value associated with the {@link ErrorCode} object. * * @return The error value. */ @@ -107,15 +107,15 @@ namespace std.base } /** - *

      Get message.

      + * Get message. * - *

      Returns the message associated with the error instance.

      + * Returns the message associated with the error instance. * - *

      Error messages are defined by the {@link category} the error instance belongs to.

      + * Error messages are defined by the {@link category} the error instance belongs to. * - *

      This function returns the same as if the following member was called:

      + * This function returns the same as if the following member was called: * - *

      category().message(value())

      + * category().message(value()) * * @return A string object with the message associated with the {@link ErrorCode}. */ @@ -128,16 +128,16 @@ namespace std.base } /** - *

      Default error condition.

      + * Default error condition. * - *

      Returns the default {@link ErrorCondition}object associated with the {@link ErrorCode} object.

      + * Returns the default {@link ErrorCondition}object associated with the {@link ErrorCode} object. * - *

      This function returns the same as if the following member was called:

      + * This function returns the same as if the following member was called: * - *

      category().default_error_condition(value())

      + * category().default_error_condition(value()) * - *

      {@link ErrorCategory.default_error_condition ErrorCategory.default_error_condition()} - * is a virtual member function, that can operate differently for each category.

      + * {@link ErrorCategory.default_error_condition ErrorCategory.default_error_condition()} + * is a virtual member function, that can operate differently for each category. * * @return An {@link ErrorCondition}object that corresponds to the {@link ErrorCode} object. */ @@ -153,11 +153,11 @@ namespace std.base OPERATORS --------------------------------------------------------- */ /** - *

      Convert to bool.

      + * Convert to bool. * - *

      Returns whether the error instance has a numerical {@link value} other than 0.

      + * Returns whether the error instance has a numerical {@link value} other than 0. * - *

      If it is zero (which is generally used to represent no error), the function returns false, otherwise it returns true.

      + * If it is zero (which is generally used to represent no error), the function returns false, otherwise it returns true. * * @return true if the error's numerical value is not zero. * false otherwise. diff --git a/ts/src/std/base/MapContainer.ts b/ts/src/std/base/MapContainer.ts index cd3ef7a5..58c152c5 100644 --- a/ts/src/std/base/MapContainer.ts +++ b/ts/src/std/base/MapContainer.ts @@ -5,27 +5,27 @@ namespace std.base { /** - *

      An abstract map.

      + * An abstract map. * - *

      {@link MapContainer MapContainers} are associative containers that store elements formed by a combination + * {@link MapContainer MapContainers} are associative containers that store elements formed by a combination * of a key value (Key) and a mapped value (T), and which allows for fast retrieval - * of individual elements based on their keys.

      + * of individual elements based on their keys. * - *

      In a {@link MapContainer}, the key values are generally used to identify the elements, while the + * In a {@link MapContainer}, the key values are generally used to identify the elements, while the * mapped values store the content associated to this key. The types of key and * mapped value may differ, and are grouped together in member type value_type, which is a - * {@link Pair} type combining both:

      + * {@link Pair} type combining both: * - *

      typedef pair value_type;

      + * typedef pair value_type; * - *

      {@link MapContainer} stores elements, keeps sequence and enables indexing by inserting elements into a + * {@link MapContainer} stores elements, keeps sequence and enables indexing by inserting elements into a * {@link List} and registering {@link ListIterator iterators} of the {@link data_ list container} to an index - * table like {@link RBTree tree} or {@link HashBuckets hash-table}.

      + * table like {@link RBTree tree} or {@link HashBuckets hash-table}. * - *

      - *

      + * + * * - *

      Container properties

      + * ### Container properties *
      *
      Associative
      *
      @@ -94,16 +94,16 @@ namespace std.base ITERATOR --------------------------------------------------------- */ /** - *

      Get iterator to element.

      + * Get iterator to element. * - *

      Searches the container for an element with a identifier equivalent to key and returns an - * iterator to it if found, otherwise it returns an iterator to {@link end end()}.

      + * Searches the container for an element with a identifier equivalent to key and returns an + * iterator to it if found, otherwise it returns an iterator to {@link end end()}. * - *

      Two keys are considered equivalent if the container's comparison object returns false reflexively - * (i.e., no matter the order in which the elements are passed as arguments).

      + * Two keys are considered equivalent if the container's comparison object returns false reflexively + * (i.e., no matter the order in which the elements are passed as arguments). * - *

      Another member functions, {@link has has()} and {@link count count()}, can be used to just check - * whether a particular key exists.

      + * Another member functions, {@link has has()} and {@link count count()}, can be used to just check + * whether a particular key exists. * * @param key Key to be searched for * @return An iterator to the element, if an element with specified key is found, or @@ -112,12 +112,12 @@ namespace std.base public abstract find(key: Key): MapIterator; /** - *

      Return iterator to beginning.

      + * Return iterator to beginning. * - *

      Returns an iterator referring the first element in the

      + * Returns an iterator referring the first element in the * - *

      Note

      - *

      If the container is {@link empty}, the returned iterator is same with {@link end end()}.

      + * #### Note + * If the container is {@link empty}, the returned iterator is same with {@link end end()}. * * @return An iterator to the first element in the The iterator containes the first element's value. */ @@ -127,21 +127,21 @@ namespace std.base } /** - *

      Return iterator to end.

      - *

      Returns an iterator referring to the past-the-end element in the

      + * Return iterator to end. + * Returns an iterator referring to the past-the-end element in the * - *

      The past-the-end element is the theoretical element that would follow the last element in the - * It does not point to any element, and thus shall not be dereferenced.

      + * The past-the-end element is the theoretical element that would follow the last element in the + * It does not point to any element, and thus shall not be dereferenced. * - *

      Because the ranges used by functions of the container do not include the element reference by their + * Because the ranges used by functions of the container do not include the element reference by their * closing iterator, this function is often used in combination with {@link MapContainer}.{@link begin} to - * specify a range including all the elements in the

      + * specify a range including all the elements in the * - *

      Note

      - *

      Returned iterator from {@link MapContainer}.{@link end} does not refer any element. Trying to accessing - * element by the iterator will cause throwing exception ({@link OutOfRange}).

      + * #### Note + * Returned iterator from {@link MapContainer}.{@link end} does not refer any element. Trying to accessing + * element by the iterator will cause throwing exception ({@link OutOfRange}). * - *

      If the container is {@link empty}, this function returns the same as {@link begin}.

      + * If the container is {@link empty}, this function returns the same as {@link begin}. * * @return An iterator to the end element in the */ @@ -151,16 +151,16 @@ namespace std.base } /** - *

      Return {@link MapReverseIterator reverse iterator} to reverse beginning.

      + * Return {@link MapReverseIterator reverse iterator} to reverse beginning. * - *

      Returns a {@link MapReverseIterator reverse iterator} pointing to the last element in the container - * (i.e., its reverse beginning).

      + * Returns a {@link MapReverseIterator reverse iterator} pointing to the last element in the container + * (i.e., its reverse beginning). * * {@link MapReverseIterator Reverse iterators} iterate backwards: increasing them moves them towards the - * beginning of the container.

      + * beginning of the container. * - *

      {@link rbegin} points to the element preceding the one that would be pointed to by member {@link end}. - *

      7 + * {@link rbegin} points to the element preceding the one that would be pointed to by member {@link end}. + *7 * * @return A {@link MapReverseIterator reverse iterator} to the reverse beginning of the sequence * @@ -171,14 +171,14 @@ namespace std.base } /** - *

      Return {@link MapReverseIterator reverse iterator} to reverse end.

      + * Return {@link MapReverseIterator reverse iterator} to reverse end. * - *

      Returns a {@link MapReverseIterator reverse iterator} pointing to the theoretical element right before + * Returns a {@link MapReverseIterator reverse iterator} pointing to the theoretical element right before * the first element in the {@link MapContainer map container} (which is considered its reverse end). - *

      + * * - *

      The range between {@link MapContainer}.{@link rbegin} and {@link MapContainer}.{@link rend} contains - * all the elements of the container (in reverse order).

      + * The range between {@link MapContainer}.{@link rbegin} and {@link MapContainer}.{@link rend} contains + * all the elements of the container (in reverse order). * * @return A {@link MapReverseIterator reverse iterator} to the reverse end of the sequence */ @@ -191,9 +191,9 @@ namespace std.base ELEMENTS --------------------------------------------------------- */ /** - *

      Whether have the item or not.

      + * Whether have the item or not. * - *

      Indicates whether a map has an item having the specified identifier.

      + * Indicates whether a map has an item having the specified identifier. * * @param key Key value of the element whose mapped value is accessed. * @@ -205,9 +205,9 @@ namespace std.base } /** - *

      Count elements with a specific key.

      + * Count elements with a specific key. * - *

      Searches the container for elements whose key is key and returns the number of elements found.

      + * Searches the container for elements whose key is key and returns the number of elements found. * * @param key Key value to be searched for. * @@ -345,10 +345,10 @@ namespace std.base } /** - *

      Insert an element.

      + * Insert an element. * - *

      Extends the container by inserting a new element, effectively increasing the container {@link size} - * by the number of element inserted (zero or one).

      + * Extends the container by inserting a new element, effectively increasing the container {@link size} + * by the number of element inserted (zero or one). * * @param hint Hint for the position where the element can be inserted. * @param pair A single argument of a {@link Pair} type with a value for the *key* as @@ -361,10 +361,10 @@ namespace std.base public insert(hint: MapIterator, pair: Pair): MapIterator; /** - *

      Insert an element.

      + * Insert an element. * - *

      Extends the container by inserting a new element, effectively increasing the container {@link size} - * by the number of element inserted (zero or one).

      + * Extends the container by inserting a new element, effectively increasing the container {@link size} + * by the number of element inserted (zero or one). * * @param hint Hint for the position where the element can be inserted. * @param pair A single argument of a {@link Pair} type with a value for the *key* as @@ -377,10 +377,10 @@ namespace std.base public insert(hint: MapReverseIterator, pair: Pair): MapReverseIterator; /** - *

      Insert an element.

      + * Insert an element. * - *

      Extends the container by inserting new elements, effectively increasing the container {@link size} - * by the number of elements inserted.

      + * Extends the container by inserting new elements, effectively increasing the container {@link size} + * by the number of elements inserted. * * @param hint Hint for the position where the element can be inserted. * @param tuple Tuple represensts the {@link Pair} to be inserted as an element. @@ -392,10 +392,10 @@ namespace std.base (hint: MapIterator, tuple: [L, U]): MapIterator; /** - *

      Insert an element.

      + * Insert an element. * - *

      Extends the container by inserting new elements, effectively increasing the container {@link size} - * by the number of elements inserted.

      + * Extends the container by inserting new elements, effectively increasing the container {@link size} + * by the number of elements inserted. * * @param hint Hint for the position where the element can be inserted. * @param tuple Tuple represensts the {@link Pair} to be inserted as an element. @@ -407,10 +407,10 @@ namespace std.base (hint: MapReverseIterator, tuple: [L, U]): MapReverseIterator; /** - *

      Insert elements from range iterators.

      + * Insert elements from range iterators. * - *

      Extends the container by inserting new elements, effectively increasing the container {@link size} by - * the number of elements inserted.

      + * Extends the container by inserting new elements, effectively increasing the container {@link size} by + * the number of elements inserted. * * @param begin Input iterator specifying initial position of a range of elements. * @param end Input iterator specifying final position of a range of elements. @@ -496,36 +496,36 @@ namespace std.base ERASE --------------------------------------------------------- */ /** - *

      Erase an elemet by key.

      + * Erase an elemet by key. * - *

      Removes from the {@link MapContainer map container} a single element.

      + * Removes from the {@link MapContainer map container} a single element. * - *

      This effectively reduces the container {@link size} by the number of element removed (zero or one), - * which are destroyed.

      + * This effectively reduces the container {@link size} by the number of element removed (zero or one), + * which are destroyed. * * @param key Key of the element to be removed from the {@link MapContainer}. */ public erase(key: Key): number; /** - *

      Erase an elemet by iterator.

      + * Erase an elemet by iterator. * - *

      Removes from the {@link MapContainer map container} a single element.

      + * Removes from the {@link MapContainer map container} a single element. * - *

      This effectively reduces the container {@link size} by the number of element removed (zero or one), - * which are destroyed.

      + * This effectively reduces the container {@link size} by the number of element removed (zero or one), + * which are destroyed. * * @param it Iterator specifying position winthin the {@link MapContainer map contaier} to be removed. */ public erase(it: MapIterator): MapIterator; /** - *

      Erase elements by range iterators.

      + * Erase elements by range iterators. * - *

      Removes from the {@link MapContainer map container} a range of elements.

      + * Removes from the {@link MapContainer map container} a range of elements. * - *

      This effectively reduces the container {@link size} by the number of elements removed, which are - * destroyed.

      + * This effectively reduces the container {@link size} by the number of elements removed, which are + * destroyed. * * @param begin An iterator specifying initial position of a range within {@link MApContainer map container} * to be removed. @@ -537,24 +537,24 @@ namespace std.base public erase(begin: MapIterator, end: MapIterator): MapIterator; /** - *

      Erase an elemet by iterator.

      + * Erase an elemet by iterator. * - *

      Removes from the {@link MapContainer map container} a single element.

      + * Removes from the {@link MapContainer map container} a single element. * - *

      This effectively reduces the container {@link size} by the number of element removed (zero or one), - * which are destroyed.

      + * This effectively reduces the container {@link size} by the number of element removed (zero or one), + * which are destroyed. * * @param it Iterator specifying position winthin the {@link MapContainer map contaier} to be removed. */ public erase(it: MapReverseIterator): MapReverseIterator; /** - *

      Erase elements by range iterators.

      + * Erase elements by range iterators. * - *

      Removes from the {@link MapContainer map container} a range of elements.

      + * Removes from the {@link MapContainer map container} a range of elements. * - *

      This effectively reduces the container {@link size} by the number of elements removed, which are - * destroyed.

      + * This effectively reduces the container {@link size} by the number of elements removed, which are + * destroyed. * * @param begin An iterator specifying initial position of a range within {@link MApContainer map container} * to be removed. @@ -710,10 +710,10 @@ namespace std.base namespace std { /** - *

      An iterator of {@link MapContainer map container}.

      + * An iterator of {@link MapContainer map container}. * - *

      - *

      + * + * * * @author Jeongho Nam */ @@ -808,7 +808,7 @@ namespace std */ public less(obj: MapIterator): boolean { - return std.less(this.first, obj.first); + return less(this.first, obj.first); } /** @@ -824,7 +824,7 @@ namespace std */ public hashCode(): number { - return std.hash(this.first); + return hash(this.first); } /** @@ -837,10 +837,10 @@ namespace std } /** - *

      A reverse-iterator of {@link MapContainer map container}.

      + * A reverse-iterator of {@link MapContainer map container}. * - *

      - *

      + * + * * * @author Jeongho Nam */ diff --git a/ts/src/std/base/MultiMap.ts b/ts/src/std/base/MultiMap.ts index e0d97b74..3bef9391 100644 --- a/ts/src/std/base/MultiMap.ts +++ b/ts/src/std/base/MultiMap.ts @@ -5,27 +5,27 @@ namespace std.base { /** - *

      An abstract multi-map.

      + * An abstract multi-map. * - *

      {@link MultiMap MultiMaps} are associative containers that store elements formed by a combination of a + * {@link MultiMap MultiMaps} are associative containers that store elements formed by a combination of a * key value (Key) and a mapped value (T), and which allows for fast retrieval of - * individual elements based on their keys.

      + * individual elements based on their keys. * - *

      In a {@link MapContainer}, the key values are generally used to identify the elements, while the + * In a {@link MapContainer}, the key values are generally used to identify the elements, while the * mapped values store the content associated to this key. The types of key and * mapped value may differ, and are grouped together in member type value_type, which is a - * {@link Pair} type combining both:

      + * {@link Pair} type combining both: * - *

      typedef pair value_type;

      + * typedef pair value_type; * - *

      {@link UniqueMap} stores elements, keeps sequence and enables indexing by inserting elements into a + * {@link UniqueMap} stores elements, keeps sequence and enables indexing by inserting elements into a * {@link List} and registering {@link ListIterator iterators} of the {@link data_ list container} to an index - * table like {@link RBTree tree} or {@link HashBuckets hash-table}.

      + * table like {@link RBTree tree} or {@link HashBuckets hash-table}. * - *

      - *

      + * + * * - *

      Container properties

      + * ### Container properties *
      *
      Associative
      *
      @@ -95,14 +95,14 @@ namespace std.base if (args.length == 1) return this._Insert_by_pair(args[0]); else - return this._Insert_by_pair(std.make_pair(args[0], args[1])); + return this._Insert_by_pair(make_pair(args[0], args[1])); } /** - *

      Insert elements.

      + * Insert elements. * - *

      Extends the container by inserting new elements, effectively increasing the container {@link size} by - * the number of elements inserted.

      + * Extends the container by inserting new elements, effectively increasing the container {@link size} by + * the number of elements inserted. * * @param pair A single argument of a {@link Pair} type with a value for the *key* as * {@link Pair.first first} member, and a *value* for the mapped value as @@ -113,10 +113,10 @@ namespace std.base public insert(pair: Pair): MapIterator; /** - *

      Insert elements.

      + * Insert elements. * - *

      Extends the container by inserting new elements, effectively increasing the container {@link size} by - * the number of elements inserted.

      + * Extends the container by inserting new elements, effectively increasing the container {@link size} by + * the number of elements inserted. * * @param tuple Tuple represensts the {@link Pair} to be inserted as an element. * diff --git a/ts/src/std/base/MultiSet.ts b/ts/src/std/base/MultiSet.ts index b41c76f9..edf9a467 100644 --- a/ts/src/std/base/MultiSet.ts +++ b/ts/src/std/base/MultiSet.ts @@ -5,23 +5,23 @@ namespace std.base { /** - *

      An abstract set.

      + * An abstract set. * - *

      {@link SetContainer SetContainers} are containers that store elements allowing fast retrieval of - * individual elements based on their value.

      + * {@link SetContainer SetContainers} are containers that store elements allowing fast retrieval of + * individual elements based on their value. * - *

      In an {@link SetContainer}, the value of an element is at the same time its key, used to + * In an {@link SetContainer}, the value of an element is at the same time its key, used to * identify it. Keys are immutable, therefore, the elements in an {@link SetContainer} cannot be - * modified once in the container - they can be inserted and removed, though.

      + * modified once in the container - they can be inserted and removed, though. * - *

      {@link SetContainer} stores elements, keeps sequence and enables indexing by inserting elements into a + * {@link SetContainer} stores elements, keeps sequence and enables indexing by inserting elements into a * {@link List} and registering {@link ListIterator iterators} of the {@link data_ list container} to an index - * table like {@link RBTree tree} or {@link HashBuckets hash-table}.

      + * table like {@link RBTree tree} or {@link HashBuckets hash-table}. * - *

      - *

      + * + * * - *

      Container properties

      + * ### Container properties *
      *
      Associative
      *
      @@ -48,10 +48,10 @@ namespace std.base INSERT --------------------------------------------------------- */ /** - *

      Insert an element.

      + * Insert an element. * - *

      Extends the container by inserting new elements, effectively increasing the container {@link size} by - * the number of elements inserted.

      + * Extends the container by inserting new elements, effectively increasing the container {@link size} by + * the number of elements inserted. * * @param key Value to be inserted as an element. * diff --git a/ts/src/std/base/SetContainer.ts b/ts/src/std/base/SetContainer.ts index 4668a32a..8852aea0 100644 --- a/ts/src/std/base/SetContainer.ts +++ b/ts/src/std/base/SetContainer.ts @@ -5,23 +5,23 @@ namespace std.base { /** - *

      An abstract set.

      + * An abstract set. * - *

      {@link SetContainer SetContainers} are containers that store elements allowing fast retrieval of - * individual elements based on their value.

      + * {@link SetContainer SetContainers} are containers that store elements allowing fast retrieval of + * individual elements based on their value. * - *

      In an {@link SetContainer}, the value of an element is at the same time its key, used to + * In an {@link SetContainer}, the value of an element is at the same time its key, used to * identify it. Keys are immutable, therefore, the elements in an {@link SetContainer} cannot be - * modified once in the container - they can be inserted and removed, though.

      + * modified once in the container - they can be inserted and removed, though. * - *

      {@link SetContainer} stores elements, keeps sequence and enables indexing by inserting elements into a + * {@link SetContainer} stores elements, keeps sequence and enables indexing by inserting elements into a * {@link List} and registering {@link ListIterator iterators} of the {@link data_ list container} to an index - * table like {@link RBTree tree} or {@link HashBuckets hash-table}.

      + * table like {@link RBTree tree} or {@link HashBuckets hash-table}. * - *

      - *

      + * + * * - *

      Container properties

      + * ### Container properties *
      *
      Associative
      *
      @@ -42,12 +42,12 @@ namespace std.base extends Container { /** - *

      {@link List} storing elements.

      + * {@link List} storing elements. * - *

      Storing elements and keeping those sequence of the {@link SetContainer} are implemented by + * Storing elements and keeping those sequence of the {@link SetContainer} are implemented by * {@link data_ this list container}. Implementing index-table is also related with {@link data_ this list} * by storing {@link ListIterator iterators} ({@link SetIterator} references {@link ListIterator}) who are - * created from {@link data_ here}.

      + * created from {@link data_ here}. */ private data_: _SetElementList; @@ -92,13 +92,13 @@ namespace std.base ITERATOR --------------------------------------------------------- */ /** - *

      Get iterator to element.

      + * Get iterator to element. * - *

      Searches the container for an element with key as value and returns an iterator to it if found, - * otherwise it returns an iterator to {@link end end()} (the element past the end of the container).

      + * Searches the container for an element with key as value and returns an iterator to it if found, + * otherwise it returns an iterator to {@link end end()} (the element past the end of the container). * - *

      Another member function, {@link count count()}, can be used to just check whether a particular element - * exists.

      + * Another member function, {@link count count()}, can be used to just check whether a particular element + * exists. * * @param key Key to be searched for. * @@ -143,9 +143,9 @@ namespace std.base ELEMENTS --------------------------------------------------------- */ /** - *

      Whether have the item or not.

      + * Whether have the item or not. * - *

      Indicates whether a set has an item having the specified identifier.

      + * Indicates whether a set has an item having the specified identifier. * * @param key Key value of the element whose mapped value is accessed. * @@ -157,9 +157,9 @@ namespace std.base } /** - *

      Count elements with a specific key.

      + * Count elements with a specific key. * - *

      Searches the container for elements with a value of k and returns the number of elements found.

      + * Searches the container for elements with a value of k and returns the number of elements found. * * @param key Value of the elements to be counted. * @@ -205,10 +205,10 @@ namespace std.base } /** - *

      Insert an element with hint.

      + * Insert an element with hint. * - *

      Extends the container by inserting new elements, effectively increasing the container size by the - * number of elements inserted.

      + * Extends the container by inserting new elements, effectively increasing the container size by the + * number of elements inserted. * * @param hint Hint for the position where the element can be inserted. * @param val Value to be inserted as an element. @@ -219,10 +219,10 @@ namespace std.base public insert(hint: SetIterator, val: T): SetIterator; /** - *

      Insert an element with hint.

      + * Insert an element with hint. * - *

      Extends the container by inserting new elements, effectively increasing the container size by the - * number of elements inserted.

      + * Extends the container by inserting new elements, effectively increasing the container size by the + * number of elements inserted. * * @param hint Hint for the position where the element can be inserted. * @param val Value to be inserted as an element. @@ -233,10 +233,10 @@ namespace std.base public insert(hint: SetReverseIterator, val: T): SetReverseIterator; /** - *

      Insert elements with a range of a

      + * Insert elements with a range of a * - *

      Extends the container by inserting new elements, effectively increasing the container size by the - * number of elements inserted.

      + * Extends the container by inserting new elements, effectively increasing the container size by the + * number of elements inserted. * * @param begin An iterator specifying range of the begining element. * @param end An iterator specifying range of the ending element. @@ -300,10 +300,10 @@ namespace std.base ERASE --------------------------------------------------------- */ /** - *

      Erase an element.

      - *

      Removes from the set container the elements whose value is key.

      + * Erase an element. + * Removes from the set container the elements whose value is key. * - *

      This effectively reduces the container size by the number of elements removed.

      + * This effectively reduces the container size by the number of elements removed. * * @param key Value of the elements to be erased. * @@ -317,10 +317,10 @@ namespace std.base public erase(it: SetIterator): SetIterator; /** - *

      Erase elements.

      - *

      Removes from the set container a range of elements..

      + * Erase elements. + * Removes from the set container a range of elements.. * - *

      This effectively reduces the container size by the number of elements removed.

      + * This effectively reduces the container size by the number of elements removed. * * @param begin An iterator specifying a range of beginning to erase. * @param end An iterator specifying a range of end to erase. @@ -333,10 +333,10 @@ namespace std.base public erase(it: SetReverseIterator): SetReverseIterator; /** - *

      Erase elements.

      - *

      Removes from the set container a range of elements..

      + * Erase elements. + * Removes from the set container a range of elements.. * - *

      This effectively reduces the container size by the number of elements removed.

      + * This effectively reduces the container size by the number of elements removed. * * @param begin An iterator specifying a range of beginning to erase. * @param end An iterator specifying a range of end to erase. @@ -489,10 +489,10 @@ namespace std.base namespace std { /** - *

      An iterator of a Set.

      + * An iterator of a Set. * - *

      - *

      + * + * * * @author Jeongho Nam */ @@ -504,11 +504,12 @@ namespace std CONSTRUCTORS --------------------------------------------------------- */ /** - *

      Construct from source and index number.

      + * Construct from source and index number. * - *

      Note

      - *

      Do not create iterator directly.

      - *

      Use begin(), find() or end() in Map instead.

      + * #### Note + * Do not create iterator directly. + * + * Use begin(), find() or end() in Map instead. * * @param map The source Set to reference. * @param index Sequence number of the element in the source Set. @@ -561,7 +562,7 @@ namespace std */ public less(obj: SetIterator): boolean { - return std.less(this.value, obj.value); + return less(this.value, obj.value); } /** @@ -577,7 +578,7 @@ namespace std */ public hashCode(): number { - return std.hash(this.value); + return hash(this.value); } /** @@ -590,10 +591,10 @@ namespace std } /** - *

      A reverse-iterator of Set.

      + * A reverse-iterator of Set. * - *

      - *

      + * + * * * @param Type of the elements. * diff --git a/ts/src/std/base/UniqueMap.ts b/ts/src/std/base/UniqueMap.ts index 93a1b3c5..050ce2fb 100644 --- a/ts/src/std/base/UniqueMap.ts +++ b/ts/src/std/base/UniqueMap.ts @@ -5,27 +5,27 @@ namespace std.base { /** - *

      An abstract unique-map.

      + * An abstract unique-map. * - *

      {@link UniqueMap UniqueMaps} are associative containers that store elements formed by a combination of a + * {@link UniqueMap UniqueMaps} are associative containers that store elements formed by a combination of a * key value (Key) and a mapped value (T), and which allows for fast retrieval of - * individual elements based on their keys.

      + * individual elements based on their keys. * - *

      In a {@link MapContainer}, the key values are generally used to uniquely identify the elements, + * In a {@link MapContainer}, the key values are generally used to uniquely identify the elements, * while the mapped values store the content associated to this key. The types of key and * mapped value may differ, and are grouped together in member type value_type, which is a - * {@link Pair} type combining both:

      + * {@link Pair} type combining both: * - *

      typedef pair value_type;

      + * typedef pair value_type; * - *

      {@link UniqueMap} stores elements, keeps sequence and enables indexing by inserting elements into a + * {@link UniqueMap} stores elements, keeps sequence and enables indexing by inserting elements into a * {@link List} and registering {@link ListIterator iterators} of the {@link data_ list container} to an index - * table like {@link RBTree tree} or {@link HashBuckets hash-table}.

      + * table like {@link RBTree tree} or {@link HashBuckets hash-table}. * - *

      - *

      + * + * * - *

      Container properties

      + * ### Container properties *
      *
      Associative
      *
      @@ -63,9 +63,9 @@ namespace std.base } /** - *

      Get an element

      + * Get an element * - *

      Returns a reference to the mapped value of the element identified with key.

      + * Returns a reference to the mapped value of the element identified with key. * * @param key Key value of the element whose mapped value is accessed. * @@ -83,10 +83,10 @@ namespace std.base } /** - *

      Set an item as the specified identifier.

      + * Set an item as the specified identifier. * - *

      If the identifier is already in map, change value of the identifier. If not, then insert the object - * with the identifier.

      + * If the identifier is already in map, change value of the identifier. If not, then insert the object + * with the identifier. * * @param key Key value of the element whose mapped value is accessed. * @param val Value, the item. @@ -155,21 +155,21 @@ namespace std.base if (args.length == 1) return this._Insert_by_pair(args[0]); else - return this._Insert_by_pair(std.make_pair(args[0], args[1])); + return this._Insert_by_pair(make_pair(args[0], args[1])); } /** - *

      Insert an element.

      + * Insert an element. * - *

      Extends the container by inserting new elements, effectively increasing the container {@link size} by - * one.

      + * Extends the container by inserting new elements, effectively increasing the container {@link size} by + * one. * - *

      Because element keys in a {@link UniqueMap} are unique, the insertion operation checks whether + * Because element keys in a {@link UniqueMap} are unique, the insertion operation checks whether * each inserted element has a key equivalent to the one of an element already in the container, and * if so, the element is not inserted, returning an iterator to this existing element (if the function - * returns a value).

      + * returns a value). * - *

      For a similar container allowing for duplicate elements, see {@link MultiMap}.

      + * For a similar container allowing for duplicate elements, see {@link MultiMap}. * * @param pair A single argument of a {@link Pair} type with a value for the *key* as * {@link Pair.first first} member, and a *value* for the mapped value as @@ -183,17 +183,17 @@ namespace std.base public insert(pair: Pair): Pair, boolean>; /** - *

      Insert an element.

      + * Insert an element. * - *

      Extends the container by inserting a new element, effectively increasing the container size by the - * number of elements inserted.

      + * Extends the container by inserting a new element, effectively increasing the container size by the + * number of elements inserted. * - *

      Because element keys in a {@link UniqueMap} are unique, the insertion operation checks whether + * Because element keys in a {@link UniqueMap} are unique, the insertion operation checks whether * each inserted element has a key equivalent to the one of an element already in the container, and * if so, the element is not inserted, returning an iterator to this existing element (if the function - * returns a value).

      + * returns a value). * - *

      For a similar container allowing for duplicate elements, see {@link MultiMap}.

      + * For a similar container allowing for duplicate elements, see {@link MultiMap}. * * @param tuple Tuple represensts the {@link Pair} to be inserted as an element. * @@ -239,16 +239,16 @@ namespace std.base } /** - *

      Insert or assign an element.

      + * Insert or assign an element. * - *

      Inserts an element or assigns to the current element if the key already exists.

      + * Inserts an element or assigns to the current element if the key already exists. * - *

      Because element keys in a {@link UniqueMap} are unique, the insertion operation checks whether + * Because element keys in a {@link UniqueMap} are unique, the insertion operation checks whether * each inserted element has a key equivalent to the one of an element already in the container, and * if so, the element is assigned, returning an iterator to this existing element (if the function returns a - * value).

      + * value). * - *

      For a similar container allowing for duplicate elements, see {@link MultiMap}.

      + * For a similar container allowing for duplicate elements, see {@link MultiMap}. * * @param key The key used both to look up and to insert if not found. * @param value Value, the item. @@ -261,16 +261,16 @@ namespace std.base public insert_or_assign(key: Key, value: T): Pair, boolean>; /** - *

      Insert or assign an element.

      + * Insert or assign an element. * - *

      Inserts an element or assigns to the current element if the key already exists.

      + * Inserts an element or assigns to the current element if the key already exists. * - *

      Because element keys in a {@link UniqueMap} are unique, the insertion operation checks whether + * Because element keys in a {@link UniqueMap} are unique, the insertion operation checks whether * each inserted element has a key equivalent to the one of an element already in the container, and * if so, the element is assigned, returning an iterator to this existing element (if the function returns a - * value).

      + * value). * - *

      For a similar container allowing for duplicate elements, see {@link MultiMap}.

      + * For a similar container allowing for duplicate elements, see {@link MultiMap}. * * @param hint Hint for the position where the element can be inserted. * @param key The key used both to look up and to insert if not found. @@ -282,16 +282,16 @@ namespace std.base public insert_or_assign(hint: MapIterator, key: Key, value: T): MapIterator; /** - *

      Insert or assign an element.

      + * Insert or assign an element. * - *

      Inserts an element or assigns to the current element if the key already exists.

      + * Inserts an element or assigns to the current element if the key already exists. * - *

      Because element keys in a {@link UniqueMap} are unique, the insertion operation checks whether + * Because element keys in a {@link UniqueMap} are unique, the insertion operation checks whether * each inserted element has a key equivalent to the one of an element already in the container, and * if so, the element is assigned, returning an iterator to this existing element (if the function returns a - * value).

      + * value). * - *

      For a similar container allowing for duplicate elements, see {@link MultiMap}.

      + * For a similar container allowing for duplicate elements, see {@link MultiMap}. * * @param hint Hint for the position where the element can be inserted. * @param key The key used both to look up and to insert if not found. @@ -339,11 +339,11 @@ namespace std.base let it = this.find(key); if (it.equals(this.end()) == true) - return this._Insert_by_pair(std.make_pair(key, value)); + return this._Insert_by_pair(make_pair(key, value)); else { it.second = value; - return std.make_pair(it, false); + return make_pair(it, false); } } @@ -359,9 +359,9 @@ namespace std.base ERASE --------------------------------------------------------- */ /** - *

      Extract an element.

      + * Extract an element. * - *

      Extracts the element pointed to by key and erases it from the {@link UniqueMap}.

      + * Extracts the element pointed to by key and erases it from the {@link UniqueMap}. * * @param key Key value of the element whose mapped value is accessed. * @@ -370,9 +370,9 @@ namespace std.base public extract(key: Key): Pair; /** - *

      Extract an element.

      + * Extract an element. * - *

      Extracts the element pointed to by key and erases it from the {@link UniqueMap}.

      + * Extracts the element pointed to by key and erases it from the {@link UniqueMap}. * * @param it An iterator pointing an element to extract. * @@ -382,9 +382,9 @@ namespace std.base public extract(it: MapIterator): MapIterator; /** - *

      Extract an element.

      + * Extract an element. * - *

      Extracts the element pointed to by key and erases it from the {@link UniqueMap}.

      + * Extracts the element pointed to by key and erases it from the {@link UniqueMap}. * * @param it An iterator pointing an element to extract. * diff --git a/ts/src/std/base/UniqueSet.ts b/ts/src/std/base/UniqueSet.ts index 5c15f0b2..eb43ee6e 100644 --- a/ts/src/std/base/UniqueSet.ts +++ b/ts/src/std/base/UniqueSet.ts @@ -5,23 +5,23 @@ namespace std.base { /** - *

      An abstract set.

      + * An abstract set. * - *

      {@link SetContainer SetContainers} are containers that store elements allowing fast retrieval of - * individual elements based on their value.

      + * {@link SetContainer SetContainers} are containers that store elements allowing fast retrieval of + * individual elements based on their value. * - *

      In an {@link SetContainer}, the value of an element is at the same time its key, used to uniquely + * In an {@link SetContainer}, the value of an element is at the same time its key, used to uniquely * identify it. Keys are immutable, therefore, the elements in an {@link SetContainer} cannot be modified - * once in the container - they can be inserted and removed, though.

      + * once in the container - they can be inserted and removed, though. * - *

      {@link SetContainer} stores elements, keeps sequence and enables indexing by inserting elements into a + * {@link SetContainer} stores elements, keeps sequence and enables indexing by inserting elements into a * {@link List} and registering {@link ListIterator iterators} of the {@link data_ list container} to an index - * table like {@link RBTree tree} or {@link HashBuckets hash-table}.

      + * table like {@link RBTree tree} or {@link HashBuckets hash-table}. * - *

      - *

      + * + * * - *

      Container properties

      + * ### Container properties *
      *
      Associative
      *
      @@ -59,16 +59,16 @@ namespace std.base INSERT --------------------------------------------------------- */ /** - *

      Insert an element.

      + * Insert an element. * - *

      Extends the container by inserting new elements, effectively increasing the container {@link size} by - * the number of element inserted (zero or one).

      + * Extends the container by inserting new elements, effectively increasing the container {@link size} by + * the number of element inserted (zero or one). * - *

      Because elements in a {@link UniqueSet UniqueSets} are unique, the insertion operation checks whether + * Because elements in a {@link UniqueSet UniqueSets} are unique, the insertion operation checks whether * each inserted element is equivalent to an element already in the container, and if so, the element is not - * inserted, returning an iterator to this existing element (if the function returns a value).

      + * inserted, returning an iterator to this existing element (if the function returns a value). * - *

      For a similar container allowing for duplicate elements, see {@link MultiSet}.

      + * For a similar container allowing for duplicate elements, see {@link MultiSet}. * * @param key Value to be inserted as an element. * @@ -104,9 +104,9 @@ namespace std.base ERASE --------------------------------------------------------- */ /** - *

      Extract an element.

      + * Extract an element. * - *

      Extracts the element pointed to by val and erases it from the {@link UniqueSet}.

      + * Extracts the element pointed to by val and erases it from the {@link UniqueSet}. * * @param val Value to be extracted. * @@ -115,9 +115,9 @@ namespace std.base public extract(val: T): T; /** - *

      Extract an element.

      + * Extract an element. * - *

      Extracts the element pointed to by key and erases it from the {@link UniqueMap}.

      + * Extracts the element pointed to by key and erases it from the {@link UniqueMap}. * * @param it An iterator pointing an element to extract. * @@ -127,9 +127,9 @@ namespace std.base public extract(it: SetIterator): SetIterator; /** - *

      Extract an element.

      + * Extract an element. * - *

      Extracts the element pointed to by key and erases it from the {@link UniqueMap}.

      + * Extracts the element pointed to by key and erases it from the {@link UniqueMap}. * * @param it An iterator pointing an element to extract. * diff --git a/ts/src/std/base/_ListContainer.ts b/ts/src/std/base/_ListContainer.ts index cd47f38a..5d8cf221 100644 --- a/ts/src/std/base/_ListContainer.ts +++ b/ts/src/std/base/_ListContainer.ts @@ -202,14 +202,14 @@ namespace std.base } /** - *

      Insert an element.

      + * Insert an element. * - *

      The container is extended by inserting a new element before the element at the specified + * The container is extended by inserting a new element before the element at the specified * position. This effectively increases the {@link List.size List size} by the amount of elements - * inserted.

      + * inserted. * - *

      Unlike other standard sequence containers, {@link List} is specifically designed to be efficient - * inserting and removing elements in any position, even in the middle of the sequence.

      + * Unlike other standard sequence containers, {@link List} is specifically designed to be efficient + * inserting and removing elements in any position, even in the middle of the sequence. * * @param position Position in the container where the new element is inserted. * {@link iterator}> is a member type, defined as a @@ -221,14 +221,14 @@ namespace std.base public insert(position: BidirectionalIterator, val: T): BidirectionalIterator; /** - *

      Insert elements by repeated filling.

      + * Insert elements by repeated filling. * - *

      The container is extended by inserting a new element before the element at the specified + * The container is extended by inserting a new element before the element at the specified * position. This effectively increases the {@link List.size List size} by the amount of elements - * inserted.

      + * inserted. * - *

      Unlike other standard sequence containers, {@link List} is specifically designed to be efficient - * inserting and removing elements in any position, even in the middle of the sequence.

      + * Unlike other standard sequence containers, {@link List} is specifically designed to be efficient + * inserting and removing elements in any position, even in the middle of the sequence. * * @param position Position in the container where the new elements are inserted. The {@link iterator} is a * member type, defined as a {@link ListIterator bidirectional iterator} type that points to @@ -241,14 +241,14 @@ namespace std.base public insert(position: BidirectionalIterator, size: number, val: T): BidirectionalIterator; /** - *

      Insert elements by range iterators.

      + * Insert elements by range iterators. * - *

      The container is extended by inserting a new element before the element at the specified + * The container is extended by inserting a new element before the element at the specified * position. This effectively increases the {@link List.size List size} by the amount of elements - * inserted.

      + * inserted. * - *

      Unlike other standard sequence containers, {@link List} is specifically designed to be efficient - * inserting and removing elements in any position, even in the middle of the sequence.

      + * Unlike other standard sequence containers, {@link List} is specifically designed to be efficient + * inserting and removing elements in any position, even in the middle of the sequence. * * @param position Position in the container where the new elements are inserted. The {@link iterator} is a * member type, defined as a {@link ListIterator bidirectional iterator} type that points to @@ -372,14 +372,14 @@ namespace std.base ERASE --------------------------------------------------------- */ /** - *

      Erase an element.

      + * Erase an element. * - *

      Removes from the {@link List} either a single element; position.

      + * Removes from the {@link List} either a single element; position. * - *

      This effectively reduces the container size by the number of element removed.

      + * This effectively reduces the container size by the number of element removed. * - *

      Unlike other standard sequence containers, {@link List} objects are specifically designed to be - * efficient inserting and removing elements in any position, even in the middle of the sequence.

      + * Unlike other standard sequence containers, {@link List} objects are specifically designed to be + * efficient inserting and removing elements in any position, even in the middle of the sequence. * * @param position Iterator pointing to a single element to be removed from the {@link List}. * @@ -389,14 +389,14 @@ namespace std.base public erase(position: BidirectionalIterator): BidirectionalIterator; /** - *

      Erase elements.

      + * Erase elements. * - *

      Removes from the {@link List} container a range of elements.

      + * Removes from the {@link List} container a range of elements. * - *

      This effectively reduces the container {@link size} by the number of elements removed.

      + * This effectively reduces the container {@link size} by the number of elements removed. * - *

      Unlike other standard sequence containers, {@link List} objects are specifically designed to be - * efficient inserting and removing elements in any position, even in the middle of the sequence.

      + * Unlike other standard sequence containers, {@link List} objects are specifically designed to be + * efficient inserting and removing elements in any position, even in the middle of the sequence. * * @param begin An iterator specifying a range of beginning to erase. * @param end An iterator specifying a range of end to erase. @@ -437,17 +437,17 @@ namespace std.base SWAP --------------------------------------------------------- */ /** - *

      Swap content.

      + * Swap content. * - *

      Exchanges the content of the container by the content of obj, which is another - * {@link List container} object with same type of elements. Sizes and container type may differ.

      + * Exchanges the content of the container by the content of obj, which is another + * {@link List container} object with same type of elements. Sizes and container type may differ. * - *

      After the call to this member function, the elements in this container are those which were in obj + * After the call to this member function, the elements in this container are those which were in obj * before the call, and the elements of obj are those which were in this. All iterators, references and - * pointers remain valid for the swapped objects.

      + * pointers remain valid for the swapped objects. * - *

      Notice that a non-member function exists with the same name, {@link std.swap swap}, overloading that - * algorithm with an optimization that behaves like this member function.

      + * Notice that a non-member function exists with the same name, {@link swap swap}, overloading that + * algorithm with an optimization that behaves like this member function. * * @param obj Another {@link List container} of the same type of elements (i.e., instantiated * with the same template parameter, T) whose content is swapped with that of this @@ -458,9 +458,9 @@ namespace std.base /** * @inheritdoc */ - public swap(obj: base.Container): void; + public swap(obj: Container): void; - public swap(obj: _ListContainer | base.Container): void + public swap(obj: _ListContainer | Container): void { if (obj instanceof _ListContainer) { diff --git a/ts/src/std/base/hash/_HashBuckets.ts b/ts/src/std/base/hash/_HashBuckets.ts index 28dcc4a8..1887abc3 100644 --- a/ts/src/std/base/hash/_HashBuckets.ts +++ b/ts/src/std/base/hash/_HashBuckets.ts @@ -85,7 +85,7 @@ namespace std.base public hash_index(val: T): number { - return std.hash(val) % this.buckets_.size(); + return hash(val) % this.buckets_.size(); } /* --------------------------------------------------------- diff --git a/ts/src/std/base/hash/_MapHashBuckets.ts b/ts/src/std/base/hash/_MapHashBuckets.ts index 4400f3ed..9f453c44 100644 --- a/ts/src/std/base/hash/_MapHashBuckets.ts +++ b/ts/src/std/base/hash/_MapHashBuckets.ts @@ -21,11 +21,11 @@ namespace std.base public find(key: K): MapIterator { - let index = std.hash(key) % this.size(); + let index = hash(key) % this.size(); let bucket = this.at(index); for (let i: number = 0; i < bucket.size(); i++) - if (std.equal_to(bucket.at(i).first, key)) + if (equal_to(bucket.at(i).first, key)) return bucket.at(i); return this.map_.end(); diff --git a/ts/src/std/base/hash/_SetHashBuckets.ts b/ts/src/std/base/hash/_SetHashBuckets.ts index 6cd18b04..d03be1af 100644 --- a/ts/src/std/base/hash/_SetHashBuckets.ts +++ b/ts/src/std/base/hash/_SetHashBuckets.ts @@ -21,11 +21,11 @@ namespace std.base public find(val: T): SetIterator { - let index = std.hash(val) % this.size(); + let index = hash(val) % this.size(); let bucket = this.at(index); for (let i: number = 0; i < bucket.size(); i++) - if (std.equal_to(bucket.at(i).value, val)) + if (equal_to(bucket.at(i).value, val)) return bucket.at(i); return this.set_.end(); diff --git a/ts/src/std/base/interfaces/IArrayContainer.ts b/ts/src/std/base/interfaces/IArrayContainer.ts index 34452310..747786ca 100644 --- a/ts/src/std/base/interfaces/IArrayContainer.ts +++ b/ts/src/std/base/interfaces/IArrayContainer.ts @@ -1,39 +1,39 @@ namespace std.base { /** - *

      Array Container.

      + * Array Container. * - *

      {@link IArrayContainer} is an interface for sequence containers representing arrays that can change in + * {@link IArrayContainer} is an interface for sequence containers representing arrays that can change in * {@link size}. However, compared to arrays, {@link IArrayContainer} objectss consume more memory in exchange for - * the ability to manage storage and grow dynamically in an efficient way.

      + * the ability to manage storage and grow dynamically in an efficient way. * - *

      Both {@link Vector Vectors} and {@link Deque Deques} who implemented {@link IArrayContainer} provide a very + * Both {@link Vector Vectors} and {@link Deque Deques} who implemented {@link IArrayContainer} provide a very * similar interface and can be used for similar purposes, but internally both work in quite different ways: * While {@link Vector Vectors} use a single array that needs to be occasionally reallocated for growth, the * elements of a {@link Deque} can be scattered in different chunks of storage, with the container keeping the * necessary information internally to provide direct access to any of its elements in constant time and with a * uniform sequential interface (through iterators). Therefore, {@link Deque Deques} are a little more complex * internally than {@link Vector Vectors}, but this allows them to grow more efficiently under certain - * circumstances, especially with very long sequences, where reallocations become more expensive.

      + * circumstances, especially with very long sequences, where reallocations become more expensive. * - *

      Both {@link Vector Vectors} and {@link Deque Deques} provide a very similar interface and can be used for + * Both {@link Vector Vectors} and {@link Deque Deques} provide a very similar interface and can be used for * similar purposes, but internally both work in quite different ways: While {@link Vector Vectors} use a single * array that needs to be occasionally reallocated for growth, the elements of a {@link Deque} can be scattered * in different chunks of storage, with the container keeping the necessary information internally to provide * direct access to any of its elements in constant time and with a uniform sequential interface (through * iterators). Therefore, {@link Deque Deques} are a little more complex internally than {@link Vector Vectors}, * but this allows them to grow more efficiently under certain circumstances, especially with very long - * sequences, where reallocations become more expensive.

      + * sequences, where reallocations become more expensive. * - *

      For operations that involve frequent insertion or removals of elements at positions other than the + * For operations that involve frequent insertion or removals of elements at positions other than the * beginning or the end, {@link IArrayContainer} objects perform worse and have less consistent iterators and references - * than {@link List Lists}

      . + * than {@link List Lists}. * - *

      + * * - *

      + * * - *

      Container properties

      + * ### Container properties *
      *
      Sequence
      *
      @@ -59,12 +59,12 @@ ACCESSORS --------------------------------------------------------- */ /** - *

      Access element.

      - *

      Returns a value to the element at position index in the {@link IArrayContainer container}.

      + * Access element. + * Returns a value to the element at position index in the {@link IArrayContainer container}.

      * - *

      The function automatically checks whether index is within the bounds of valid elements + * The function automatically checks whether index is within the bounds of valid elements * in the {@link IArrayContainer container}, throwing an {@link OutOfRange} exception if it is not (i.e., - * if index is greater or equal than its {@link size}).

      + * if index is greater or equal than its {@link size}). * * @param index Position of an element in the * If this is greater than or equal to the {@link IArrayContainer container} {@link size}, an @@ -76,13 +76,13 @@ at(index: number): T; /** - *

      Modify element.

      - *

      Replaces an element at the specified position (index) in this {@link IArrayContainer container} - * with the specified element (val).

      + * Modify element. + * Replaces an element at the specified position (index) in this {@link IArrayContainer container} + * with the specified element (val). * - *

      The function automatically checks whether index is within the bounds of valid elements + * The function automatically checks whether index is within the bounds of valid elements * in the {@link IArrayContainer container}, throwing an {@link OutOfRange} exception if it is not (i.e., if - * index is greater or equal than its {@link size}).

      + * index is greater or equal than its {@link size}). * * @.param index A specified position of the value to replace. * @param val A value to be stored at the specified position. @@ -93,21 +93,20 @@ } /** - *

      Random-access iterator.

      + * Random-access iterator. * - *

      {@link IArrayIterator Random-access iterators} are iterators that can be used to access elements at an + * {@link IArrayIterator Random-access iterators} are iterators that can be used to access elements at an * arbitrary offset position relative to the element they point to, offering the same functionality as pointers. - *

      * - *

      {@link IArrayIterator Random-access iterators} are the most complete iterators in terms of functionality. - * All pointer types are also valid {@link IArrayIterator random-access iterators}.

      + * {@link IArrayIterator Random-access iterators} are the most complete iterators in terms of functionality. + * All pointer types are also valid {@link IArrayIterator random-access iterators}. * - *

      There is not a single type of {@link IArrayIterator random-access iterator}: Each container may define its - * own specific iterator type able to iterate through it and access its elements.

      + * There is not a single type of {@link IArrayIterator random-access iterator}: Each container may define its + * own specific iterator type able to iterate through it and access its elements. * - *

      + * * - *

      + * * * @reference http://www.cplusplus.com/reference/iterator/RandomAccessIterator * @author Jeongho Nam diff --git a/ts/src/std/base/interfaces/IDequeContainer.ts b/ts/src/std/base/interfaces/IDequeContainer.ts index a160d2fe..de414c79 100644 --- a/ts/src/std/base/interfaces/IDequeContainer.ts +++ b/ts/src/std/base/interfaces/IDequeContainer.ts @@ -1,11 +1,11 @@ namespace std.base { /** - *

      An interface for deque

      + * An interface for deque * - *

      + * * - *

      + * * * @author Jeongho Nam */ @@ -13,21 +13,21 @@ extends ILinearContainer { /** - *

      Insert element at beginning.

      + * Insert element at beginning. * - *

      Inserts a new element at the beginning of the {@link IDeque container}, right before its + * Inserts a new element at the beginning of the {@link IDeque container}, right before its * current first element. This effectively increases the {@link IDeque container} {@link size} by - * one.

      + * one. * * @param val Value to be inserted as an element. */ push_front(val: T): void; /** - *

      Delete first element.

      + * Delete first element. * - *

      Removes the first element in the {@link IDeque container}, effectively reducing its - * {@link size} by one.

      + * Removes the first element in the {@link IDeque container}, effectively reducing its + * {@link size} by one. */ pop_front(): void; } diff --git a/ts/src/std/base/interfaces/IHashMap.ts b/ts/src/std/base/interfaces/IHashMap.ts index cdde7970..101854e7 100644 --- a/ts/src/std/base/interfaces/IHashMap.ts +++ b/ts/src/std/base/interfaces/IHashMap.ts @@ -1,28 +1,28 @@ namespace std.base { /** - *

      Common interface for hash map.

      + * Common interface for hash map. * - *

      {@link IHashMap}s are associative containers that store elements formed by the combination of - * a key value and a mapped value.

      + * {@link IHashMap}s are associative containers that store elements formed by the combination of + * a key value and a mapped value. * - *

      In an {@link IHashMap}, the key value is generally used to uniquely identify the + * In an {@link IHashMap}, the key value is generally used to uniquely identify the * element, while the mapped value is an object with the content associated to this key. - * Types of key and mapped value may differ.

      + * Types of key and mapped value may differ. * - *

      Internally, the elements in the {@link IHashMap} are not sorted in any particular order with + * Internally, the elements in the {@link IHashMap} are not sorted in any particular order with * respect to either their key or mapped values, but organized into buckets depending on * their hash values to allow for fast access to individual elements directly by their key values - * (with a constant average time complexity on average).

      + * (with a constant average time complexity on average). * - *

      Elements with equivalent keys are grouped together in the same bucket and in such a way that - * an iterator can iterate through all of them. Iterators in the container are doubly linked iterators.

      + * Elements with equivalent keys are grouped together in the same bucket and in such a way that + * an iterator can iterate through all of them. Iterators in the container are doubly linked iterators. * - *

      + * * - *

      + * * - *

      Container properties

      + * ### Container properties *
      *
      Associative
      *
      Elements in associative containers are referenced by their key and not by their absolute @@ -49,33 +49,33 @@ extends MapContainer { /** - *

      Return number of buckets.

      + * Return number of buckets. * - *

      Returns the number of buckets in the {@link IHashMap} container.

      + * Returns the number of buckets in the {@link IHashMap} container. * - *

      A bucket is a slot in the container's internal hash table to which elements are assigned based on the - * hash value of their key.

      + * A bucket is a slot in the container's internal hash table to which elements are assigned based on the + * hash value of their key. * - *

      The number of buckets influences directly the {@link load_factor load factor} of the container's hash + * The number of buckets influences directly the {@link load_factor load factor} of the container's hash * table (and thus the probability of collision). The container automatically increases the number of buckets to * keep the load factor below a specific threshold (its {@link max_load_factor}), causing a {@link rehash} each - * time the number of buckets needs to be increased.

      + * time the number of buckets needs to be increased. * * @return The current amount of buckets. */ bucket_count(): number; /** - *

      Return bucket size.

      + * Return bucket size. * - *

      Returns the number of elements in bucket n.

      + * Returns the number of elements in bucket n. * - *

      A bucket is a slot in the container's internal hash table to which elements are assigned based on the hash - * value of their key.

      + * A bucket is a slot in the container's internal hash table to which elements are assigned based on the hash + * value of their key. * - *

      The number of elements in a bucket influences the time it takes to access a particular element in the + * The number of elements in a bucket influences the time it takes to access a particular element in the * bucket. The container automatically increases the number of buckets to keep the {@link load_cator load factor} - * (which is the average bucket size) below its {@link max_load_factor}.

      + * (which is the average bucket size) below its {@link max_load_factor}. * * @param n Bucket number. This shall be lower than {@link bucket_count}. * @@ -84,99 +84,99 @@ bucket_size(n: number): number; /** - *

      Get maximum load factor.

      + * Get maximum load factor. * - *

      Returns the current maximum load factor for the {@link HashMultiMap} container.

      + * Returns the current maximum load factor for the {@link HashMultiMap} container. * - *

      The load factor is the ratio between the number of elements in the container (its {@link size}) and the - * number of buckets ({@link bucket_count}).

      + * The load factor is the ratio between the number of elements in the container (its {@link size}) and the + * number of buckets ({@link bucket_count}). * - *

      By default, {@link HashMultiMap} containers have a {@link max_load_factor} of 1.0.

      + * By default, {@link HashMultiMap} containers have a {@link max_load_factor} of 1.0. * - *

      The load factor influences the probability of collision in the hash table (i.e., the probability of two + * The load factor influences the probability of collision in the hash table (i.e., the probability of two * elements being located in the same bucket). The container uses the value of max_load_factor as the threshold - * that forces an increase in the number of buckets (and thus causing a {@link rehash}).

      + * that forces an increase in the number of buckets (and thus causing a {@link rehash}). * - *

      Note though, that implementations may impose an upper limit on the number of buckets (see - * {@link max_bucket_count}), which may force the container to ignore the {@link max_load_factor}.

      + * Note though, that implementations may impose an upper limit on the number of buckets (see + * {@link max_bucket_count}), which may force the container to ignore the {@link max_load_factor}. * * @return The current load factor. */ max_load_factor(): number; /** - *

      Set maximum load factor.

      + * Set maximum load factor. * - *

      Sets z as the cnew maximum load factor for the {@link HashMultiMap} container.

      + * Sets z as the cnew maximum load factor for the {@link HashMultiMap} container. * - *

      The load factor is the ratio between the number of elements in the container (its {@link size}) and the - * number of buckets ({@link bucket_count}).

      + * The load factor is the ratio between the number of elements in the container (its {@link size}) and the + * number of buckets ({@link bucket_count}). * - *

      By default, {@link HashMultiMap} containers have a {@link max_load_factor} of 1.0.

      + * By default, {@link HashMultiMap} containers have a {@link max_load_factor} of 1.0. * - *

      The load factor influences the probability of collision in the hash table (i.e., the probability of two + * The load factor influences the probability of collision in the hash table (i.e., the probability of two * elements being located in the same bucket). The container uses the value of max_load_factor as the threshold - * that forces an increase in the number of buckets (and thus causing a {@link rehash}).

      + * that forces an increase in the number of buckets (and thus causing a {@link rehash}). * - *

      Note though, that implementations may impose an upper limit on the number of buckets (see - * {@link max_bucket_count}), which may force the container to ignore the {@link max_load_factor}.

      + * Note though, that implementations may impose an upper limit on the number of buckets (see + * {@link max_bucket_count}), which may force the container to ignore the {@link max_load_factor}. * * @param z The new maximum load factor. */ max_load_factor(z: number): void; /** - *

      Locate element's bucket.

      + * Locate element's bucket. * - *

      Returns the bucket number where the element with key is located.

      + * Returns the bucket number where the element with key is located. * - *

      A bucket is a slot in the container's internal hash table to which elements are assigned based on the - * hash value of their key. Buckets are numbered from 0 to ({@link bucket_count} - 1).

      + * A bucket is a slot in the container's internal hash table to which elements are assigned based on the + * hash value of their key. Buckets are numbered from 0 to ({@link bucket_count} - 1). * - *

      Individual elements in a bucket can be accessed by means of the range iterators returned by - * {@link begin} and {@link end}.

      + * Individual elements in a bucket can be accessed by means of the range iterators returned by + * {@link begin} and {@link end}. * * @param key Key whose bucket is to be located. */ bucket(key: Key): number; /** - *

      Request a capacity change.

      + * Request a capacity change. * - *

      Sets the number of buckets in the container ({@link bucket_count}) to the most appropriate to contain at - * least n elements.

      + * Sets the number of buckets in the container ({@link bucket_count}) to the most appropriate to contain at + * least n elements. * - *

      If n is greater than the current {@link bucket_count} multiplied by the {@link max_load_factor}, - * the container's {@link bucket_count} is increased and a {@link rehash} is forced.

      + * If n is greater than the current {@link bucket_count} multiplied by the {@link max_load_factor}, + * the container's {@link bucket_count} is increased and a {@link rehash} is forced. * - *

      If n is lower than that, the function may have no effect.

      + * If n is lower than that, the function may have no effect. * * @param n The number of elements requested as minimum capacity. */ reserve(n: number): void; /** - *

      Set number of buckets.

      + * Set number of buckets. * - *

      Sets the number of buckets in the container to n or more.

      + * Sets the number of buckets in the container to n or more. * - *

      If n is greater than the current number of buckets in the container ({@link bucket_count}), a + * If n is greater than the current number of buckets in the container ({@link bucket_count}), a * {@link HashBuckets.rehash rehash} is forced. The new {@link bucket_count bucket count} can either be equal or - * greater than n.

      + * greater than n. * - *

      If n is lower than the current number of buckets in the container ({@link bucket_count}), the + * If n is lower than the current number of buckets in the container ({@link bucket_count}), the * function may have no effect on the {@link bucket_count bucket count} and may not force a - * {@link HashBuckets.rehash rehash}.

      + * {@link HashBuckets.rehash rehash}. * - *

      A {@link HashBuckets.rehash rehash} is the reconstruction of the hash table: All the elements in the + * A {@link HashBuckets.rehash rehash} is the reconstruction of the hash table: All the elements in the * container are rearranged according to their hash value into the new set of buckets. This may alter the order - * of iteration of elements within the container.

      + * of iteration of elements within the container. * - *

      {@link HashBuckets.rehash Rehashes} are automatically performed by the container whenever its - * {@link load_factor load factor} is going to surpass its {@link max_load_factor} in an operation.

      + * {@link HashBuckets.rehash Rehashes} are automatically performed by the container whenever its + * {@link load_factor load factor} is going to surpass its {@link max_load_factor} in an operation. * - *

      Notice that this function expects the number of buckets as argument. A similar function exists, - * {@link reserve}, that expects the number of elements in the container as argument.

      + * Notice that this function expects the number of buckets as argument. A similar function exists, + * {@link reserve}, that expects the number of elements in the container as argument. * * @param n The minimum number of buckets for the container hash table. */ diff --git a/ts/src/std/base/interfaces/IHashSet.ts b/ts/src/std/base/interfaces/IHashSet.ts index 5ba8162d..e2f73b07 100644 --- a/ts/src/std/base/interfaces/IHashSet.ts +++ b/ts/src/std/base/interfaces/IHashSet.ts @@ -1,28 +1,28 @@ namespace std.base { /** - *

      A common interface for hash set.

      + * A common interface for hash set. * - *

      {@link IHashSet}s are containers that store unique elements in no particular order, and which - * allow for fast retrieval of individual elements based on their value.

      + * {@link IHashSet}s are containers that store unique elements in no particular order, and which + * allow for fast retrieval of individual elements based on their value. * - *

      In an {@link IHashSet}, the value of an element is at the same time its key, that + * In an {@link IHashSet}, the value of an element is at the same time its key, that * identifies it uniquely. Keys are immutable, therefore, the elements in an {@link IHashSet} cannot be - * modified once in the container - they can be inserted and removed, though.

      + * modified once in the container - they can be inserted and removed, though. * - *

      Internally, the elements in the {@link IHashSet} are not sorted in any particular order, but + * Internally, the elements in the {@link IHashSet} are not sorted in any particular order, but * organized into buckets depending on their hash values to allow for fast access to individual elements - * directly by their values (with a constant average time complexity on average).

      + * directly by their values (with a constant average time complexity on average). * - *

      {@link IHashSet} containers are faster than {@link TreeSet} containers to access individual + * {@link IHashSet} containers are faster than {@link TreeSet} containers to access individual * elements by their key, although they are generally less efficient for range iteration through a - * subset of their elements.

      + * subset of their elements. * - *

      + * * - *

      + * * - *

      Container properties

      + * ### Container properties *
      *
      Associative
      *
      Elements in associative containers are referenced by their key and not by their absolute @@ -46,33 +46,33 @@ extends SetContainer { /** - *

      Return number of buckets.

      + * Return number of buckets. * - *

      Returns the number of buckets in the {@link IHashSet} container.

      + * Returns the number of buckets in the {@link IHashSet} container. * - *

      A bucket is a slot in the container's internal hash table to which elements are assigned based on the - * hash value of their key.

      + * A bucket is a slot in the container's internal hash table to which elements are assigned based on the + * hash value of their key. * - *

      The number of buckets influences directly the {@link load_factor load factor} of the container's hash + * The number of buckets influences directly the {@link load_factor load factor} of the container's hash * table (and thus the probability of collision). The container automatically increases the number of buckets to * keep the load factor below a specific threshold (its {@link max_load_factor}), causing a {@link rehash} each - * time the number of buckets needs to be increased.

      + * time the number of buckets needs to be increased. * * @return The current amount of buckets. */ bucket_count(): number; /** - *

      Return bucket size.

      + * Return bucket size. * - *

      Returns the number of elements in bucket n.

      + * Returns the number of elements in bucket n. * - *

      A bucket is a slot in the container's internal hash table to which elements are assigned based on the hash - * value of their key.

      + * A bucket is a slot in the container's internal hash table to which elements are assigned based on the hash + * value of their key. * - *

      The number of elements in a bucket influences the time it takes to access a particular element in the + * The number of elements in a bucket influences the time it takes to access a particular element in the * bucket. The container automatically increases the number of buckets to keep the {@link load_cator load factor} - * (which is the average bucket size) below its {@link max_load_factor}.

      + * (which is the average bucket size) below its {@link max_load_factor}. * * @param n Bucket number. This shall be lower than {@link bucket_count}. * @@ -81,99 +81,99 @@ bucket_size(n: number): number; /** - *

      Get maximum load factor.

      + * Get maximum load factor. * - *

      Returns the current maximum load factor for the {@link HashMultiMap} container.

      + * Returns the current maximum load factor for the {@link HashMultiMap} container. * - *

      The load factor is the ratio between the number of elements in the container (its {@link size}) and the - * number of buckets ({@link bucket_count}).

      + * The load factor is the ratio between the number of elements in the container (its {@link size}) and the + * number of buckets ({@link bucket_count}). * - *

      By default, {@link HashMultiMap} containers have a {@link max_load_factor} of 1.0.

      + * By default, {@link HashMultiMap} containers have a {@link max_load_factor} of 1.0. * - *

      The load factor influences the probability of collision in the hash table (i.e., the probability of two + * The load factor influences the probability of collision in the hash table (i.e., the probability of two * elements being located in the same bucket). The container uses the value of max_load_factor as the threshold - * that forces an increase in the number of buckets (and thus causing a {@link rehash}).

      + * that forces an increase in the number of buckets (and thus causing a {@link rehash}). * - *

      Note though, that implementations may impose an upper limit on the number of buckets (see - * {@link max_bucket_count}), which may force the container to ignore the {@link max_load_factor}.

      + * Note though, that implementations may impose an upper limit on the number of buckets (see + * {@link max_bucket_count}), which may force the container to ignore the {@link max_load_factor}. * * @return The current load factor. */ max_load_factor(): number; /** - *

      Set maximum load factor.

      + * Set maximum load factor. * - *

      Sets z as the cnew maximum load factor for the {@link HashMultiMap} container.

      + * Sets z as the cnew maximum load factor for the {@link HashMultiMap} container. * - *

      The load factor is the ratio between the number of elements in the container (its {@link size}) and the - * number of buckets ({@link bucket_count}).

      + * The load factor is the ratio between the number of elements in the container (its {@link size}) and the + * number of buckets ({@link bucket_count}). * - *

      By default, {@link HashMultiMap} containers have a {@link max_load_factor} of 1.0.

      + * By default, {@link HashMultiMap} containers have a {@link max_load_factor} of 1.0. * - *

      The load factor influences the probability of collision in the hash table (i.e., the probability of two + * The load factor influences the probability of collision in the hash table (i.e., the probability of two * elements being located in the same bucket). The container uses the value of max_load_factor as the threshold - * that forces an increase in the number of buckets (and thus causing a {@link rehash}).

      + * that forces an increase in the number of buckets (and thus causing a {@link rehash}). * - *

      Note though, that implementations may impose an upper limit on the number of buckets (see - * {@link max_bucket_count}), which may force the container to ignore the {@link max_load_factor}.

      + * Note though, that implementations may impose an upper limit on the number of buckets (see + * {@link max_bucket_count}), which may force the container to ignore the {@link max_load_factor}. * * @param z The new maximum load factor. */ max_load_factor(z: number): void; /** - *

      Locate element's bucket.

      + * Locate element's bucket. * - *

      Returns the bucket number where the element with key is located.

      + * Returns the bucket number where the element with key is located. * - *

      A bucket is a slot in the container's internal hash table to which elements are assigned based on the - * hash value of their key. Buckets are numbered from 0 to ({@link bucket_count} - 1).

      + * A bucket is a slot in the container's internal hash table to which elements are assigned based on the + * hash value of their key. Buckets are numbered from 0 to ({@link bucket_count} - 1). * - *

      Individual elements in a bucket can be accessed by means of the range iterators returned by - * {@link begin} and {@link end}.

      + * Individual elements in a bucket can be accessed by means of the range iterators returned by + * {@link begin} and {@link end}. * * @param key Key whose bucket is to be located. */ bucket(key: T): number; /** - *

      Request a capacity change.

      + * Request a capacity change. * - *

      Sets the number of buckets in the container ({@link bucket_count}) to the most appropriate to contain at - * least n elements.

      + * Sets the number of buckets in the container ({@link bucket_count}) to the most appropriate to contain at + * least n elements. * - *

      If n is greater than the current {@link bucket_count} multiplied by the {@link max_load_factor}, - * the container's {@link bucket_count} is increased and a {@link rehash} is forced.

      + * If n is greater than the current {@link bucket_count} multiplied by the {@link max_load_factor}, + * the container's {@link bucket_count} is increased and a {@link rehash} is forced. * - *

      If n is lower than that, the function may have no effect.

      + * If n is lower than that, the function may have no effect. * * @param n The number of elements requested as minimum capacity. */ reserve(n: number): void; /** - *

      Set number of buckets.

      + * Set number of buckets. * - *

      Sets the number of buckets in the container to n or more.

      + * Sets the number of buckets in the container to n or more. * - *

      If n is greater than the current number of buckets in the container ({@link bucket_count}), a + * If n is greater than the current number of buckets in the container ({@link bucket_count}), a * {@link HashBuckets.rehash rehash} is forced. The new {@link bucket_count bucket count} can either be equal or - * greater than n.

      + * greater than n. * - *

      If n is lower than the current number of buckets in the container ({@link bucket_count}), the + * If n is lower than the current number of buckets in the container ({@link bucket_count}), the * function may have no effect on the {@link bucket_count bucket count} and may not force a - * {@link HashBuckets.rehash rehash}.

      + * {@link HashBuckets.rehash rehash}. * - *

      A {@link HashBuckets.rehash rehash} is the reconstruction of the hash table: All the elements in the + * A {@link HashBuckets.rehash rehash} is the reconstruction of the hash table: All the elements in the * container are rearranged according to their hash value into the new set of buckets. This may alter the order - * of iteration of elements within the container.

      + * of iteration of elements within the container. * - *

      {@link HashBuckets.rehash Rehashes} are automatically performed by the container whenever its - * {@link load_factor load factor} is going to surpass its {@link max_load_factor} in an operation.

      + * {@link HashBuckets.rehash Rehashes} are automatically performed by the container whenever its + * {@link load_factor load factor} is going to surpass its {@link max_load_factor} in an operation. * - *

      Notice that this function expects the number of buckets as argument. A similar function exists, - * {@link reserve}, that expects the number of elements in the container as argument.

      + * Notice that this function expects the number of buckets as argument. A similar function exists, + * {@link reserve}, that expects the number of elements in the container as argument. * * @param n The minimum number of buckets for the container hash table. */ diff --git a/ts/src/std/base/interfaces/ILinearContainer.ts b/ts/src/std/base/interfaces/ILinearContainer.ts index c42224f7..6f709ee8 100644 --- a/ts/src/std/base/interfaces/ILinearContainer.ts +++ b/ts/src/std/base/interfaces/ILinearContainer.ts @@ -1,11 +1,11 @@ namespace std.base { /** - *

      An interface for linear containers.

      + * An interface for linear containers. * - *

      + * * - *

      + * * * @author Jeonngho Nam */ @@ -22,10 +22,10 @@ (begin: InputIterator, end: InputIterator): void; /** - *

      Assign container content.

      + * Assign container content. * - *

      Assigns new contents to the {@link IList container}, replacing its current contents, - * and modifying its {@link size} accordingly.

      + * Assigns new contents to the {@link IList container}, replacing its current contents, + * and modifying its {@link size} accordingly. * * @param n New size for the * @param val Value to fill the container with. Each of the n elements in the container will @@ -37,26 +37,26 @@ ACCESSORS --------------------------------------------------------- */ /** - *

      Access first element.

      - *

      Returns a value of the first element in the {@link IList container}.

      + * Access first element. + * Returns a value of the first element in the {@link IList container}. * - *

      Unlike member {@link end end()}, which returns an iterator just past this element, - * this function returns a direct value.

      + * Unlike member {@link end end()}, which returns an iterator just past this element, + * this function returns a direct value. * - *

      Calling this function on an {@link empty} {@link IList container} causes undefined behavior.

      + * Calling this function on an {@link empty} {@link IList container} causes undefined behavior. * * @return A value of the first element of the {@link IList container}. */ front(): T; /** - *

      Access last element.

      - *

      Returns a value of the last element in the {@link IList container}.

      + * Access last element. + * Returns a value of the last element in the {@link IList container}. * - *

      Unlike member {@link end end()}, which returns an iterator just past this element, - * this function returns a direct value.

      + * Unlike member {@link end end()}, which returns an iterator just past this element, + * this function returns a direct value. * - *

      Calling this function on an {@link empty} {@link IList container} causes undefined behavior.

      + * Calling this function on an {@link empty} {@link IList container} causes undefined behavior. * * @return A value of the last element of the {@link IList container}. */ @@ -66,29 +66,29 @@ ELEMENTS I/O --------------------------------------------------------- */ /** - *

      Add element at the end.

      + * Add element at the end. * - *

      Adds a new element at the end of the {@link IList container}, after its current last element. - * This effectively increases the {@link IList container} {@link size} by one.

      + * Adds a new element at the end of the {@link IList container}, after its current last element. + * This effectively increases the {@link IList container} {@link size} by one. * * @param val Value to be copied to the new element. */ push_back(val: T): void; /** - *

      Delete last element.

      + * Delete last element. * - *

      Removes the last element in the {@link IList container}, effectively reducing the - * {@link IList container} {@link size} by one.

      + * Removes the last element in the {@link IList container}, effectively reducing the + * {@link IList container} {@link size} by one. */ pop_back(): void; /** - *

      Insert an element.

      + * Insert an element. * - *

      The {@link IList conatiner} is extended by inserting new element before the element at the + * The {@link IList conatiner} is extended by inserting new element before the element at the * specified position, effectively increasing the {@link IList container} {@link size} by - * one.

      + * one. * * @param position Position in the {@link IList container} where the new elements are inserted. * {@link iterator} is a member type, defined as a {@link iterator random access iterator} @@ -100,11 +100,11 @@ insert(position: Iterator, val: T): Iterator; /** - *

      Insert elements by range iterators.

      + * Insert elements by range iterators. * - *

      The {@link IList container} is extended by inserting new elements before the element at the + * The {@link IList container} is extended by inserting new elements before the element at the * specified position, effectively increasing the {@link IList container} {@link size} by - * the number of repeating elements n.

      + * the number of repeating elements
      n. * * @param position Position in the {@link IList container} where the new elements are inserted. * {@link iterator} is a member type, defined as a {@link iterator random access iterator} @@ -117,11 +117,11 @@ insert(position: Iterator, n: number, val: T): Iterator; /** - *

      Insert elements by range iterators.

      + * Insert elements by range iterators. * - *

      The {@link IList container} is extended by inserting new elements before the element at the + * The {@link IList container} is extended by inserting new elements before the element at the * specified position, effectively increasing the {@link IList container} {@link size} by - * the number of elements inserted by range iterators.

      + * the number of elements inserted by range iterators. * * @param position Position in the {@link IList container} where the new elements are inserted. * {@link iterator} is a member type, defined as a {@link iterator random access iterator} diff --git a/ts/src/std/base/interfaces/ITreeMap.ts b/ts/src/std/base/interfaces/ITreeMap.ts index d0a0d2fd..f3148ca8 100644 --- a/ts/src/std/base/interfaces/ITreeMap.ts +++ b/ts/src/std/base/interfaces/ITreeMap.ts @@ -1,31 +1,31 @@ namespace std.base { /** - *

      Common interface for tree-structured map.

      + * Common interface for tree-structured map. * - *

      {@link ITreeMap ITreeMaps} are associative containers that store elements formed by a combination of - * a key value and a mapped value, following a specific order.

      + * {@link ITreeMap ITreeMaps} are associative containers that store elements formed by a combination of + * a key value and a mapped value, following a specific order. * - *

      In a {@link ITreeMap}, the key values are generally used to sort and uniquely identify + * In a {@link ITreeMap}, the key values are generally used to sort and uniquely identify * the elements, while the mapped values store the content associated to this key. The types of * key and mapped value may differ, and are grouped together in member type - * value_type, which is a {@link Pair} type combining both:

      + * value_type, which is a {@link Pair} type combining both: * - *

      typedef Pair value_type;

      + * typedef Pair value_type; * - *

      Internally, the elements in a {@link ITreeMap}are always sorted by its key following a - * strict weak ordering criterion indicated by its internal comparison method (of {@link less}).

      + * Internally, the elements in a {@link ITreeMap}are always sorted by its key following a + * strict weak ordering criterion indicated by its internal comparison method (of {@link less}). * - *

      {@link ITreeMap}containers are generally slower than {@link IHashMap} containers + * {@link ITreeMap}containers are generally slower than {@link IHashMap} containers * to access individual elements by their key, but they allow the direct iteration on subsets based - * on their order.

      + * on their order. * - *

      {@link ITreeMap TreeMultiMaps} are typically implemented as binary search trees.

      + * {@link ITreeMap TreeMultiMaps} are typically implemented as binary search trees. * - *

      - *

      + * + * * - *

      Container properties

      + * ### Container properties *
      *
      Associative
      *
      Elements in associative containers are referenced by their key and not by their absolute @@ -50,61 +50,61 @@ extends MapContainer { /** - *

      Return key comparison function.

      + * Return key comparison function. * - *

      Returns a references of the comparison function used by the container to compare keys.

      + * Returns a references of the comparison function used by the container to compare keys. * - *

      The comparison object of a {@link ITreeMap tree-map object} is set on + * The comparison object of a {@link ITreeMap tree-map object} is set on * {@link TreeMap.constructor construction}. Its type (Key) is the last parameter of the * {@link ITreeMap.constructor constructors}. By default, this is a {@link less} function, which returns the same - * as operator<.

      + * as operator<. * - *

      This function determines the order of the elements in the container: it is a function pointer that takes + * This function determines the order of the elements in the container: it is a function pointer that takes * two arguments of the same type as the element keys, and returns true if the first argument * is considered to go before the second in the strict weak ordering it defines, and false otherwise. - *

      + * * - *

      Two keys are considered equivalent if {@link key_comp} returns false reflexively (i.e., no - * matter the order in which the keys are passed as arguments).

      + * Two keys are considered equivalent if {@link key_comp} returns false reflexively (i.e., no + * matter the order in which the keys are passed as arguments). * * @return The comparison function. */ key_comp(): (x: Key, y: Key) => boolean; /** - *

      Return value comparison function.

      + * Return value comparison function. * - *

      Returns a comparison function that can be used to compare two elements to get whether the key of the first - * one goes before the second.

      + * Returns a comparison function that can be used to compare two elements to get whether the key of the first + * one goes before the second. * - *

      The arguments taken by this function object are of member type std.Pair (defined in + * The arguments taken by this function object are of member type Pair (defined in * {@link ITreeMap}), but the mapped type (T) part of the value is not taken into consideration in this - * comparison.

      + * comparison. * - *

      This comparison class returns true if the {@link Pair.first key} of the first argument + * This comparison class returns true if the {@link Pair.first key} of the first argument * is considered to go before that of the second (according to the strict weak ordering specified by the - * container's comparison function, {@link key_comp}), and false otherwise.

      + * container's comparison function, {@link key_comp}), and false otherwise. * * @return The comparison function for element values. */ value_comp(): (x: Pair, y: Pair) => boolean; /** - *

      Return iterator to lower bound.

      + * Return iterator to lower bound. * - *

      Returns an iterator pointing to the first element in the container whose key is not considered to - * go before k (i.e., either it is equivalent or goes after).

      + * Returns an iterator pointing to the first element in the container whose key is not considered to + * go before k (i.e., either it is equivalent or goes after). * - *

      The function uses its internal comparison object (key_comp) to determine this, returning an - * iterator to the first element for which key_comp(k, element_key) would return false.

      + * The function uses its internal comparison object (key_comp) to determine this, returning an + * iterator to the first element for which key_comp(k, element_key) would return false. * - *

      If the {@link ITreeMap} class is instantiated with the default comparison type ({@link less}), - * the function returns an iterator to the first element whose key is not less than k

      . + * If the {@link ITreeMap} class is instantiated with the default comparison type ({@link less}), + * the function returns an iterator to the first element whose key is not less than k. * - *

      A similar member function, {@link upper_bound}, has the same behavior as {@link lower_bound}, except + * A similar member function, {@link upper_bound}, has the same behavior as {@link lower_bound}, except * in the case that the {@link ITreeMap} contains an element with a key equivalent to k: In this * case, {@link lower_bound} returns an iterator pointing to that element, whereas {@link upper_bound} - * returns an iterator pointing to the next element.

      + * returns an iterator pointing to the next element. * * @param k Key to search for. * @@ -114,21 +114,21 @@ lower_bound(key: Key): MapIterator; /** - *

      Return iterator to upper bound.

      + * Return iterator to upper bound. * - *

      Returns an iterator pointing to the first element in the container whose key is considered to - * go after k

      . + * Returns an iterator pointing to the first element in the container whose key is considered to + * go after k. * - *

      The function uses its internal comparison object (key_comp) to determine this, returning an - * iterator to the first element for which key_comp(k, element_key) would return true.

      + * The function uses its internal comparison object (key_comp) to determine this, returning an + * iterator to the first element for which key_comp(k, element_key) would return true. * - *

      If the {@link ITreeMap} class is instantiated with the default comparison type ({@link less}), - * the function returns an iterator to the first element whose key is greater than k

      . + * If the {@link ITreeMap} class is instantiated with the default comparison type ({@link less}), + * the function returns an iterator to the first element whose key is greater than k. * - *

      A similar member function, {@link lower_bound}, has the same behavior as {@link upper_bound}, except + * A similar member function, {@link lower_bound}, has the same behavior as {@link upper_bound}, except * in the case that the map contains an element with a key equivalent to k: In this case * {@link lower_bound} returns an iterator pointing to that element, whereas {@link upper_bound} returns an - * iterator pointing to the next element.

      + * iterator pointing to the next element. * * @param k Key to search for. * @@ -138,17 +138,17 @@ upper_bound(key: Key): MapIterator; /** - *

      Get range of equal elements.

      + * Get range of equal elements. * - *

      Returns the bounds of a range that includes all the elements in the container which have a key - * equivalent to k

      . + * Returns the bounds of a range that includes all the elements in the container which have a key + * equivalent to k. * - *

      If no matches are found, the range returned has a length of zero, with both iterators pointing to + * If no matches are found, the range returned has a length of zero, with both iterators pointing to * the first element that has a key considered to go after k according to the container's internal - * comparison object (key_comp).

      + * comparison object (key_comp). * - *

      Two keys are considered equivalent if the container's comparison object returns false reflexively - * (i.e., no matter the order in which the keys are passed as arguments).

      + * Two keys are considered equivalent if the container's comparison object returns false reflexively + * (i.e., no matter the order in which the keys are passed as arguments). * * @param k Key to search for. * diff --git a/ts/src/std/base/interfaces/ITreeSet.ts b/ts/src/std/base/interfaces/ITreeSet.ts index 3dd904a4..bda6fc80 100644 --- a/ts/src/std/base/interfaces/ITreeSet.ts +++ b/ts/src/std/base/interfaces/ITreeSet.ts @@ -1,28 +1,28 @@ namespace std.base { /** - *

      A common interface for tree-structured set.

      + * A common interface for tree-structured set. * - *

      {@link ITreeSet TreeMultiSets} are containers that store elements following a specific order.

      + * {@link ITreeSet TreeMultiSets} are containers that store elements following a specific order. * - *

      In a {@link ITreeSet}, the value of an element also identifies it (the value is itself + * In a {@link ITreeSet}, the value of an element also identifies it (the value is itself * the key, of type T). The value of the elements in a {@link ITreeSet} cannot * be modified once in the container (the elements are always const), but they can be inserted or removed - * from the

      + * from the * - *

      Internally, the elements in a {@link ITreeSet TreeMultiSets} are always sorted following a strict - * weak ordering criterion indicated by its internal comparison method (of {@link IComparable.less less}).

      + * Internally, the elements in a {@link ITreeSet TreeMultiSets} are always sorted following a strict + * weak ordering criterion indicated by its internal comparison method (of {@link IComparable.less less}). * - *

      {@link ITreeSet} containers are generally slower than {@link IHashSet} containers + * {@link ITreeSet} containers are generally slower than {@link IHashSet} containers * to access individual elements by their key, but they allow the direct iteration on subsets based on - * their order.

      + * their order. * - *

      {@link ITreeSet TreeMultiSets} are typically implemented as binary search trees.

      + * {@link ITreeSet TreeMultiSets} are typically implemented as binary search trees. * - *

      - *

      + * + * * - *

      Container properties

      + * ### Container properties *
      *
      Associative
      *
      @@ -50,65 +50,65 @@ extends SetContainer { /** - *

      Return comparison function.

      + * Return comparison function. * - *

      Returns a copy of the comparison function used by the container.

      + * Returns a copy of the comparison function used by the container. * - *

      By default, this is a {@link less} object, which returns the same as operator<.

      + * By default, this is a {@link less} object, which returns the same as operator<. * - *

      This object determines the order of the elements in the container: it is a function pointer or a function + * This object determines the order of the elements in the container: it is a function pointer or a function * object that takes two arguments of the same type as the container elements, and returns true if * the first argument is considered to go before the second in the strict weak ordering it - * defines, and false otherwise.

      + * defines, and false otherwise. * - *

      Two elements of a {@link ITreeSet} are considered equivalent if {@link key_comp} returns false - * reflexively (i.e., no matter the order in which the elements are passed as arguments).

      + * Two elements of a {@link ITreeSet} are considered equivalent if {@link key_comp} returns false + * reflexively (i.e., no matter the order in which the elements are passed as arguments). * - *

      In {@link ITreeSet} containers, the keys to sort the elements are the values (T) themselves, - * therefore {@link key_comp} and its sibling member function {@link value_comp} are equivalent.

      + * In {@link ITreeSet} containers, the keys to sort the elements are the values (T) themselves, + * therefore {@link key_comp} and its sibling member function {@link value_comp} are equivalent. * * @return The comparison function. */ key_comp(): (x: T, y: T) => boolean; /** - *

      Return comparison function.

      + * Return comparison function. * - *

      Returns a copy of the comparison function used by the container.

      + * Returns a copy of the comparison function used by the container. * - *

      By default, this is a {@link less} object, which returns the same as operator<.

      + * By default, this is a {@link less} object, which returns the same as operator<. * - *

      This object determines the order of the elements in the container: it is a function pointer or a function + * This object determines the order of the elements in the container: it is a function pointer or a function * object that takes two arguments of the same type as the container elements, and returns true if * the first argument is considered to go before the second in the strict weak ordering it - * defines, and false otherwise.

      + * defines, and false otherwise. * - *

      Two elements of a {@link ITreeSet} are considered equivalent if {@link key_comp} returns false - * reflexively (i.e., no matter the order in which the elements are passed as arguments).

      + * Two elements of a {@link ITreeSet} are considered equivalent if {@link key_comp} returns false + * reflexively (i.e., no matter the order in which the elements are passed as arguments). * - *

      In {@link ITreeSet} containers, the keys to sort the elements are the values (T) themselves, - * therefore {@link key_comp} and its sibling member function {@link value_comp} are equivalent.

      + * In {@link ITreeSet} containers, the keys to sort the elements are the values (T) themselves, + * therefore {@link key_comp} and its sibling member function {@link value_comp} are equivalent. * * @return The comparison function. */ value_comp(): (x: T, y: T) => boolean; /** - *

      Return iterator to lower bound.

      + * Return iterator to lower bound. * - *

      Returns an iterator pointing to the first element in the container which is not considered to - * go before val (i.e., either it is equivalent or goes after).

      + * Returns an iterator pointing to the first element in the container which is not considered to + * go before val (i.e., either it is equivalent or goes after). * - *

      The function uses its internal comparison object (key_comp) to determine this, returning an - * iterator to the first element for which key_comp(element,val) would return false.

      + * The function uses its internal comparison object (key_comp) to determine this, returning an + * iterator to the first element for which key_comp(element,val) would return false. * - *

      If the {@link ITreeSet} class is instantiated with the default comparison type ({@link less}), - * the function returns an iterator to the first element that is not less than val.

      + * If the {@link ITreeSet} class is instantiated with the default comparison type ({@link less}), + * the function returns an iterator to the first element that is not less than val. - *

      A similar member function, {@link upper_bound}, has the same behavior as {@link lower_bound}, except + * A similar member function, {@link upper_bound}, has the same behavior as {@link lower_bound}, except * in the case that the {@link ITreeSet} contains elements equivalent to val: In this case * {@link lower_bound} returns an iterator pointing to the first of such elements, whereas - * {@link upper_bound} returns an iterator pointing to the element following the last.

      + * {@link upper_bound} returns an iterator pointing to the element following the last. * * @param val Value to compare. * @@ -118,21 +118,21 @@ lower_bound(val: T): SetIterator; /** - *

      Return iterator to upper bound.

      + * Return iterator to upper bound. * - *

      Returns an iterator pointing to the first element in the container which is considered to go after - * val.

      + * Returns an iterator pointing to the first element in the container which is considered to go after + * val. - *

      The function uses its internal comparison object (key_comp) to determine this, returning an - * iterator to the first element for which key_comp(val,element) would return true.

      + * The function uses its internal comparison object (key_comp) to determine this, returning an + * iterator to the first element for which key_comp(val,element) would return true. - *

      If the {@code ITreeSet} class is instantiated with the default comparison type (less), the - * function returns an iterator to the first element that is greater than val.

      + * If the {@code ITreeSet} class is instantiated with the default comparison type (less), the + * function returns an iterator to the first element that is greater than val. * - *

      A similar member function, {@link lower_bound}, has the same behavior as {@link upper_bound}, except + * A similar member function, {@link lower_bound}, has the same behavior as {@link upper_bound}, except * in the case that the {@ITreeSet} contains elements equivalent to val: In this case * {@link lower_bound} returns an iterator pointing to the first of such elements, whereas - * {@link upper_bound} returns an iterator pointing to the element following the last.

      + * {@link upper_bound} returns an iterator pointing to the element following the last. * * @param val Value to compare. * @@ -142,17 +142,17 @@ upper_bound(val: T): SetIterator; /** - *

      Get range of equal elements.

      + * Get range of equal elements. * - *

      Returns the bounds of a range that includes all the elements in the container that are equivalent - * to val.

      + * Returns the bounds of a range that includes all the elements in the container that are equivalent + * to val. * - *

      If no matches are found, the range returned has a length of zero, with both iterators pointing to + * If no matches are found, the range returned has a length of zero, with both iterators pointing to * the first element that is considered to go after val according to the container's - * internal comparison object (key_comp).

      + * internal comparison object (key_comp). * - *

      Two elements of a multiset are considered equivalent if the container's comparison object returns - * false reflexively (i.e., no matter the order in which the elements are passed as arguments).

      + * Two elements of a multiset are considered equivalent if the container's comparison object returns + * false reflexively (i.e., no matter the order in which the elements are passed as arguments). * * @param key Value to search for. * diff --git a/ts/src/std/base/tree/_MapTree.ts b/ts/src/std/base/tree/_MapTree.ts index c09585b1..7af9ecc8 100644 --- a/ts/src/std/base/tree/_MapTree.ts +++ b/ts/src/std/base/tree/_MapTree.ts @@ -16,7 +16,7 @@ namespace std.base /* --------------------------------------------------------- CONSTRUCTOR --------------------------------------------------------- */ - public constructor(map: ITreeMap, compare: (x: Key, y: Key) => boolean = std.less) + public constructor(map: ITreeMap, compare: (x: Key, y: Key) => boolean = less) { super(); @@ -50,7 +50,7 @@ namespace std.base { let newNode: _XTreeNode> = null; - if (std.equal_to(key, node.value.first)) + if (equal_to(key, node.value.first)) break; // EQUALS, MEANS MATCHED, THEN TERMINATE else if (this.compare_(key, node.value.first)) newNode = node.left; // LESS, THEN TO THE LEFT @@ -73,7 +73,7 @@ namespace std.base --------------------------------------------------------- */ public lower_bound(key: Key): MapIterator { - let node: base._XTreeNode> = this.find(key); + let node: _XTreeNode> = this.find(key); if (node == null) return this.map_.end(); @@ -82,7 +82,7 @@ namespace std.base else { let it = node.value; - while (!std.equal_to(it, this.map_.end()) && this.compare_(it.first, key)) + while (!equal_to(it, this.map_.end()) && this.compare_(it.first, key)) it = it.next(); return it; @@ -91,14 +91,14 @@ namespace std.base public upper_bound(key: Key): MapIterator { - let node: base._XTreeNode> = this.find(key); + let node: _XTreeNode> = this.find(key); if (node == null) return this.map_.end(); else { let it = node.value; - while (!std.equal_to(it, this.map_.end()) && (std.equal_to(it.first, key) || this.compare_(it.first, key))) + while (!equal_to(it, this.map_.end()) && (equal_to(it.first, key) || this.compare_(it.first, key))) it = it.next(); return it; @@ -107,7 +107,7 @@ namespace std.base public equal_range(key: Key): Pair, MapIterator> { - return std.make_pair(this.lower_bound(key), this.upper_bound(key)); + return make_pair(this.lower_bound(key), this.upper_bound(key)); } /* --------------------------------------------------------- @@ -131,7 +131,7 @@ namespace std.base public is_equal_to(left: MapIterator, right: MapIterator): boolean { - return std.equal_to(left.first, right.first); + return equal_to(left.first, right.first); } public is_less(left: MapIterator, right: MapIterator): boolean diff --git a/ts/src/std/base/tree/_SetTree.ts b/ts/src/std/base/tree/_SetTree.ts index 4a76f915..96a4ecbf 100644 --- a/ts/src/std/base/tree/_SetTree.ts +++ b/ts/src/std/base/tree/_SetTree.ts @@ -19,7 +19,7 @@ namespace std.base /** * Default Constructor. */ - public constructor(set: ITreeSet, compare: (x: T, y: T) => boolean = std.less) + public constructor(set: ITreeSet, compare: (x: T, y: T) => boolean = less) { super(); @@ -53,7 +53,7 @@ namespace std.base { let newNode: _XTreeNode> = null; - if (std.equal_to(val, node.value.value)) + if (equal_to(val, node.value.value)) break; // EQUALS, MEANS MATCHED, THEN TERMINATE else if (this.compare_(val, node.value.value)) newNode = node.left; // LESS, THEN TO THE LEFT @@ -76,16 +76,16 @@ namespace std.base --------------------------------------------------------- */ public lower_bound(val: T): SetIterator { - let node: base._XTreeNode> = this.find(val); + let node: _XTreeNode> = this.find(val); if (node == null) return this.set_.end(); - else if (std.equal_to(node.value.value, val)) + else if (equal_to(node.value.value, val)) return node.value; else { let it: SetIterator = node.value; - while (!std.equal_to(it, this.set_.end()) && this.compare_(it.value, val)) + while (!equal_to(it, this.set_.end()) && this.compare_(it.value, val)) it = it.next(); return it; @@ -94,14 +94,14 @@ namespace std.base public upper_bound(val: T): SetIterator { - let node: base._XTreeNode> = this.find(val); + let node: _XTreeNode> = this.find(val); if (node == null) return this.set_.end(); else { let it: SetIterator = node.value; - while (!std.equal_to(it, this.set_.end()) && (std.equal_to(it.value, val) || this.compare_(it.value, val))) + while (!equal_to(it, this.set_.end()) && (equal_to(it.value, val) || this.compare_(it.value, val))) it = it.next(); return it; @@ -110,7 +110,7 @@ namespace std.base public equal_range(val: T): Pair, SetIterator> { - return std.make_pair(this.lower_bound(val), this.upper_bound(val)); + return make_pair(this.lower_bound(val), this.upper_bound(val)); } /* --------------------------------------------------------- @@ -128,7 +128,7 @@ namespace std.base public is_equal_to(left: SetIterator, right: SetIterator): boolean { - return std.equal_to(left, right); + return equal_to(left, right); } public is_less(left: SetIterator, right: SetIterator): boolean diff --git a/ts/src/std/example/test_algorithm.ts b/ts/src/std/example/test_algorithm.ts index 6bf18272..d19ee487 100644 --- a/ts/src/std/example/test_algorithm.ts +++ b/ts/src/std/example/test_algorithm.ts @@ -1,4 +1,4 @@ -namespace std.example +namespace example { export function test_algorithm(): void { diff --git a/ts/src/std/example/test_all.ts b/ts/src/std/example/test_all.ts index a0e1f279..75a7e7e6 100644 --- a/ts/src/std/example/test_all.ts +++ b/ts/src/std/example/test_all.ts @@ -2,20 +2,20 @@ /// -namespace std.example +namespace example { export function test_all(): void { console.log("TEST ALL"); - for (let key in std.example) - if (key != "test_all" && (std.example as any)[key] instanceof Function) + for (let key in example) + if (key != "test_all" && (example as any)[key] instanceof Function) { console.log("==================================================="); console.log(" " + key); console.log("==================================================="); - (std.example as any)[key](); + (example as any)[key](); } } } \ No newline at end of file diff --git a/ts/src/std/example/test_bind.ts b/ts/src/std/example/test_bind.ts index 40b22f1d..ef17c6c3 100644 --- a/ts/src/std/example/test_bind.ts +++ b/ts/src/std/example/test_bind.ts @@ -1,6 +1,6 @@ /// -namespace std.example +namespace example { export function test_bind(): void { diff --git a/ts/src/std/example/test_deque.ts b/ts/src/std/example/test_deque.ts index f8da8594..453b5746 100644 --- a/ts/src/std/example/test_deque.ts +++ b/ts/src/std/example/test_deque.ts @@ -1,10 +1,10 @@ /// -namespace std.example +namespace example { export function test_deque(): void { - let deque: Deque = new Deque(); + let deque: std.Deque = new std.Deque(); for (let i: number = 0; i < 10; i++) deque.push_back(i); diff --git a/ts/src/std/example/test_exception.ts b/ts/src/std/example/test_exception.ts index a929d564..7e946032 100644 --- a/ts/src/std/example/test_exception.ts +++ b/ts/src/std/example/test_exception.ts @@ -1,16 +1,16 @@ /// -namespace std.example +namespace example { export function test_exception(): void { try { - throw new Exception("Some exception"); + throw new std.Exception("Some exception"); } catch (exception) { - console.log((exception as Exception).what()); + console.log((exception as std.Exception).what()); } } } \ No newline at end of file diff --git a/ts/src/std/example/test_for_each.ts b/ts/src/std/example/test_for_each.ts index 1bc3c951..9aad9e2f 100644 --- a/ts/src/std/example/test_for_each.ts +++ b/ts/src/std/example/test_for_each.ts @@ -1,6 +1,6 @@ /// -namespace std.example +namespace example { export function test_for_each() { diff --git a/ts/src/std/example/test_hash_map.ts b/ts/src/std/example/test_hash_map.ts index 0f34d75d..9c68e85e 100644 --- a/ts/src/std/example/test_hash_map.ts +++ b/ts/src/std/example/test_hash_map.ts @@ -1,6 +1,6 @@ /// -namespace std.example +namespace example { export function test_hash_map(): void { diff --git a/ts/src/std/example/test_list.ts b/ts/src/std/example/test_list.ts index d918f499..f8eedbb9 100644 --- a/ts/src/std/example/test_list.ts +++ b/ts/src/std/example/test_list.ts @@ -2,7 +2,7 @@ /// -namespace std.example +namespace example { export function test_list(): void { @@ -20,9 +20,8 @@ namespace std.example it = list.begin().advance(6); it = list.erase(it, it.advance(3)); // erase from 6 to 9 - //console.log(it.value); // print 9 - console.log(it.equals(list.end())); - + console.log(it.value); // print 9 + console.log("-------------------------------------"); for (let it = list.begin(); !it.equals(list.end()); it = it.next()) console.log(it.value); diff --git a/ts/src/std/example/test_reverse_iterator.ts b/ts/src/std/example/test_reverse_iterator.ts index 2308aa26..093545f6 100644 --- a/ts/src/std/example/test_reverse_iterator.ts +++ b/ts/src/std/example/test_reverse_iterator.ts @@ -1,16 +1,16 @@ /// -namespace std.example +namespace example { export function test_reverse_iterator(): void { console.log("Test Reverse Iterator"); - let vec: Vector = new Vector([0, 1, 2, 3, 4]); - let list: List = new List(vec.begin(), vec.end()); - let deque: Deque = new Deque(vec.begin(), vec.end()); + let vec: std.Vector = new std.Vector([0, 1, 2, 3, 4]); + let list: std.List = new std.List(vec.begin(), vec.end()); + let deque: std.Deque = new std.Deque(vec.begin(), vec.end()); - let set: HashSet = new HashSet(vec.begin(), vec.end()); - let map: HashMap = new HashMap([[1, 1], [2, 2], [3, 3], [4, 4], [5, 5]]); + let set: std.HashSet = new std.HashSet(vec.begin(), vec.end()); + let map: std.HashMap = new std.HashMap([[1, 1], [2, 2], [3, 3], [4, 4], [5, 5]]); console.log(vec.rbegin().advance(2).value, vec.end().advance(-3).value); @@ -27,10 +27,10 @@ namespace std.example reverse_iterate(set); console.log("HashMap's Reverse Iterator"); - reverse_iterate>(map); + reverse_iterate>(map); } - function reverse_iterate(container: base.Container): void + function reverse_iterate(container: std.base.Container): void { for (let it = container.rbegin(); !it.equals(container.rend()); it = it.next()) console.log(it.value); diff --git a/ts/src/std/example/test_sorting.ts b/ts/src/std/example/test_sorting.ts index 7825a938..35d05d42 100644 --- a/ts/src/std/example/test_sorting.ts +++ b/ts/src/std/example/test_sorting.ts @@ -1,6 +1,6 @@ /// -namespace std.example +namespace example { export function sorting(): void { diff --git a/ts/src/std/example/test_tree_map.ts b/ts/src/std/example/test_tree_map.ts index 8a721445..b30f5209 100644 --- a/ts/src/std/example/test_tree_map.ts +++ b/ts/src/std/example/test_tree_map.ts @@ -1,10 +1,10 @@ /// -namespace std.example +namespace example { export function test_tree_map(): void { - let map: TreeMap = new std.TreeMap(); + let map: std.TreeMap = new std.TreeMap(); map.insert(["first", 1]); map.insert(["second", 2]); diff --git a/ts/src/std/example/test_tree_set.ts b/ts/src/std/example/test_tree_set.ts index e46b7df0..8838d13c 100644 --- a/ts/src/std/example/test_tree_set.ts +++ b/ts/src/std/example/test_tree_set.ts @@ -1,6 +1,6 @@ /// -namespace std.example +namespace example { export function tree_set(): void {