working rss feed to nostr publish
This commit is contained in:
+77
@@ -0,0 +1,77 @@
|
||||
/**
|
||||
* @packageDocumentation
|
||||
* @module std.experimental
|
||||
*/
|
||||
import { UniqueTreeMap } from "../../internal/container/associative/UniqueTreeMap";
|
||||
import { MapElementVector } from "../../internal/container/associative/MapElementVector";
|
||||
import { IPair } from "../../utility/IPair";
|
||||
import { IForwardIterator } from "../../iterator/IForwardIterator";
|
||||
import { Comparator } from "../../internal/functional/Comparator";
|
||||
/**
|
||||
* Unique-key Map based on sorted array.
|
||||
*
|
||||
* @author Jeongho Nam - https://github.com/samchon
|
||||
*/
|
||||
export declare class FlatMap<Key, T> extends UniqueTreeMap<Key, T, FlatMap<Key, T>, FlatMap.Iterator<Key, T>, FlatMap.ReverseIterator<Key, T>> {
|
||||
private key_comp_;
|
||||
/**
|
||||
* Default Constructor.
|
||||
*
|
||||
* @param comp A binary function predicates *x* element would be placed before *y*. When returns `true`, then *x* precedes *y*. Note that, because *equality* is predicated by `!comp(x, y) && !comp(y, x)`, the function must not cover the *equality* like `<=` or `>=`. It must exclude the *equality* like `<` or `>`. Default is {@link less}.
|
||||
*/
|
||||
constructor(comp?: Comparator<Key>);
|
||||
/**
|
||||
* Initializer Constructor.
|
||||
*
|
||||
* @param items Items to assign.
|
||||
* @param comp A binary function predicates *x* element would be placed before *y*. When returns `true`, then *x* precedes *y*. Note that, because *equality* is predicated by `!comp(x, y) && !comp(y, x)`, the function must not cover the *equality* like `<=` or `>=`. It must exclude the *equality* like `<` or `>`. Default is {@link less}.
|
||||
*/
|
||||
constructor(items: IPair<Key, T>[], comp?: Comparator<Key>);
|
||||
/**
|
||||
* Copy Constructor.
|
||||
*
|
||||
* @param obj Object to copy.
|
||||
*/
|
||||
constructor(obj: FlatMap<Key, T>);
|
||||
/**
|
||||
* Range Constructor.
|
||||
*
|
||||
* @param first Input iterator of the first position.
|
||||
* @param last Input iterator of the last position.
|
||||
* @param comp A binary function predicates *x* element would be placed before *y*. When returns `true`, then *x* precedes *y*. Note that, because *equality* is predicated by `!comp(x, y) && !comp(y, x)`, the function must not cover the *equality* like `<=` or `>=`. It must exclude the *equality* like `<` or `>`. Default is {@link less}.
|
||||
*/
|
||||
constructor(first: Readonly<IForwardIterator<IPair<Key, T>>>, last: Readonly<IForwardIterator<IPair<Key, T>>>, comp?: Comparator<Key>);
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
swap(obj: FlatMap<Key, T>): void;
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
nth(index: number): FlatMap.Iterator<Key, T>;
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
key_comp(): Comparator<Key>;
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
lower_bound(key: Key): FlatMap.Iterator<Key, T>;
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
upper_bound(key: Key): FlatMap.Iterator<Key, T>;
|
||||
private _Capsule_key;
|
||||
protected _Handle_insert({}: {}, {}: {}): void;
|
||||
protected _Handle_erase({}: {}, {}: {}): void;
|
||||
}
|
||||
/**
|
||||
*
|
||||
*/
|
||||
export declare namespace FlatMap {
|
||||
type Iterator<Key, T> = MapElementVector.Iterator<Key, T, true, FlatMap<Key, T>>;
|
||||
type ReverseIterator<Key, T> = MapElementVector.ReverseIterator<Key, T, true, FlatMap<Key, T>>;
|
||||
const Iterator: typeof MapElementVector.Iterator;
|
||||
const ReverseIterator: typeof MapElementVector.ReverseIterator;
|
||||
const __MODULE = "experimental";
|
||||
}
|
||||
+136
@@ -0,0 +1,136 @@
|
||||
"use strict";
|
||||
var __extends = (this && this.__extends) || (function () {
|
||||
var extendStatics = function (d, b) {
|
||||
extendStatics = Object.setPrototypeOf ||
|
||||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
||||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
||||
return extendStatics(d, b);
|
||||
};
|
||||
return function (d, b) {
|
||||
if (typeof b !== "function" && b !== null)
|
||||
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
||||
extendStatics(d, b);
|
||||
function __() { this.constructor = d; }
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
})();
|
||||
var __read = (this && this.__read) || function (o, n) {
|
||||
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
||||
if (!m) return o;
|
||||
var i = m.call(o), r, ar = [], e;
|
||||
try {
|
||||
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
||||
}
|
||||
catch (error) { e = { error: error }; }
|
||||
finally {
|
||||
try {
|
||||
if (r && !r.done && (m = i["return"])) m.call(i);
|
||||
}
|
||||
finally { if (e) throw e.error; }
|
||||
}
|
||||
return ar;
|
||||
};
|
||||
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
||||
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
||||
if (ar || !(i in from)) {
|
||||
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
||||
ar[i] = from[i];
|
||||
}
|
||||
}
|
||||
return to.concat(ar || Array.prototype.slice.call(from));
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.FlatMap = void 0;
|
||||
//================================================================
|
||||
/**
|
||||
* @packageDocumentation
|
||||
* @module std.experimental
|
||||
*/
|
||||
//================================================================
|
||||
var UniqueTreeMap_1 = require("../../internal/container/associative/UniqueTreeMap");
|
||||
var ITreeContainer_1 = require("../../internal/container/associative/ITreeContainer");
|
||||
var MapElementVector_1 = require("../../internal/container/associative/MapElementVector");
|
||||
var binary_search_1 = require("../../algorithm/binary_search");
|
||||
/**
|
||||
* Unique-key Map based on sorted array.
|
||||
*
|
||||
* @author Jeongho Nam - https://github.com/samchon
|
||||
*/
|
||||
var FlatMap = /** @class */ (function (_super) {
|
||||
__extends(FlatMap, _super);
|
||||
function FlatMap() {
|
||||
var args = [];
|
||||
for (var _i = 0; _i < arguments.length; _i++) {
|
||||
args[_i] = arguments[_i];
|
||||
}
|
||||
var _this =
|
||||
// INITIALIZATION
|
||||
_super.call(this, function (thisArg) { return new MapElementVector_1.MapElementVector(thisArg); }) || this;
|
||||
// OVERLOADINGS
|
||||
ITreeContainer_1.ITreeContainer.construct.apply(ITreeContainer_1.ITreeContainer, __spreadArray([_this,
|
||||
FlatMap,
|
||||
function (comp) {
|
||||
_this.key_comp_ = comp;
|
||||
}], __read(args), false));
|
||||
return _this;
|
||||
}
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
FlatMap.prototype.swap = function (obj) {
|
||||
var _a, _b;
|
||||
// SWAP CONTENTS
|
||||
_a = __read([obj.data_, this.data_], 2), this.data_ = _a[0], obj.data_ = _a[1];
|
||||
MapElementVector_1.MapElementVector._Swap_associative(this.data_, obj.data_);
|
||||
// SWAP COMPARATORS
|
||||
_b = __read([obj.key_comp_, this.key_comp_], 2), this.key_comp_ = _b[0], obj.key_comp_ = _b[1];
|
||||
};
|
||||
/* ---------------------------------------------------------
|
||||
ACCESSORS
|
||||
--------------------------------------------------------- */
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
FlatMap.prototype.nth = function (index) {
|
||||
return this.data_.nth(index);
|
||||
};
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
FlatMap.prototype.key_comp = function () {
|
||||
return this.key_comp_;
|
||||
};
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
FlatMap.prototype.lower_bound = function (key) {
|
||||
return (0, binary_search_1.lower_bound)(this.begin(), this.end(), this._Capsule_key(key), this.value_comp());
|
||||
};
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
FlatMap.prototype.upper_bound = function (key) {
|
||||
return (0, binary_search_1.upper_bound)(this.begin(), this.end(), this._Capsule_key(key), this.value_comp());
|
||||
};
|
||||
FlatMap.prototype._Capsule_key = function (key) {
|
||||
return { first: key };
|
||||
};
|
||||
/* ---------------------------------------------------------
|
||||
POST-PROCESS
|
||||
--------------------------------------------------------- */
|
||||
FlatMap.prototype._Handle_insert = function (_a, _b) { };
|
||||
FlatMap.prototype._Handle_erase = function (_a, _b) { };
|
||||
return FlatMap;
|
||||
}(UniqueTreeMap_1.UniqueTreeMap));
|
||||
exports.FlatMap = FlatMap;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
(function (FlatMap) {
|
||||
// BODY
|
||||
FlatMap.Iterator = MapElementVector_1.MapElementVector.Iterator;
|
||||
FlatMap.ReverseIterator = MapElementVector_1.MapElementVector.ReverseIterator;
|
||||
FlatMap.__MODULE = "experimental";
|
||||
})(FlatMap = exports.FlatMap || (exports.FlatMap = {}));
|
||||
exports.FlatMap = FlatMap;
|
||||
//# sourceMappingURL=FlatMap.js.map
|
||||
+77
@@ -0,0 +1,77 @@
|
||||
/**
|
||||
* @packageDocumentation
|
||||
* @module std.experimental
|
||||
*/
|
||||
import { MultiTreeMap } from "../../internal/container/associative/MultiTreeMap";
|
||||
import { MapElementVector } from "../../internal/container/associative/MapElementVector";
|
||||
import { IPair } from "../../utility/IPair";
|
||||
import { IForwardIterator } from "../../iterator/IForwardIterator";
|
||||
import { Comparator } from "../../internal/functional/Comparator";
|
||||
/**
|
||||
* Multiple-key Map based on sorted array.
|
||||
*
|
||||
* @author Jeongho Nam - https://github.com/samchon
|
||||
*/
|
||||
export declare class FlatMultiMap<Key, T> extends MultiTreeMap<Key, T, FlatMultiMap<Key, T>, FlatMultiMap.Iterator<Key, T>, FlatMultiMap.ReverseIterator<Key, T>> {
|
||||
private key_comp_;
|
||||
/**
|
||||
* Default Constructor.
|
||||
*
|
||||
* @param comp A binary function predicates *x* element would be placed before *y*. When returns `true`, then *x* precedes *y*. Note that, because *equality* is predicated by `!comp(x, y) && !comp(y, x)`, the function must not cover the *equality* like `<=` or `>=`. It must exclude the *equality* like `<` or `>`. Default is {@link less}.
|
||||
*/
|
||||
constructor(comp?: Comparator<Key>);
|
||||
/**
|
||||
* Initializer Constructor.
|
||||
*
|
||||
* @param items Items to assign.
|
||||
* @param comp A binary function predicates *x* element would be placed before *y*. When returns `true`, then *x* precedes *y*. Note that, because *equality* is predicated by `!comp(x, y) && !comp(y, x)`, the function must not cover the *equality* like `<=` or `>=`. It must exclude the *equality* like `<` or `>`. Default is {@link less}.
|
||||
*/
|
||||
constructor(items: IPair<Key, T>[], comp?: Comparator<Key>);
|
||||
/**
|
||||
* Copy Constructor.
|
||||
*
|
||||
* @param obj Object to copy.
|
||||
*/
|
||||
constructor(obj: FlatMultiMap<Key, T>);
|
||||
/**
|
||||
* Range Constructor.
|
||||
*
|
||||
* @param first Input iterator of the first position.
|
||||
* @param last Input iterator of the last position.
|
||||
* @param comp A binary function predicates *x* element would be placed before *y*. When returns `true`, then *x* precedes *y*. Note that, because *equality* is predicated by `!comp(x, y) && !comp(y, x)`, the function must not cover the *equality* like `<=` or `>=`. It must exclude the *equality* like `<` or `>`. Default is {@link less}.
|
||||
*/
|
||||
constructor(first: Readonly<IForwardIterator<IPair<Key, T>>>, last: Readonly<IForwardIterator<IPair<Key, T>>>, comp?: Comparator<Key>);
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
swap(obj: FlatMultiMap<Key, T>): void;
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
nth(index: number): FlatMultiMap.Iterator<Key, T>;
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
key_comp(): Comparator<Key>;
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
lower_bound(key: Key): FlatMultiMap.Iterator<Key, T>;
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
upper_bound(key: Key): FlatMultiMap.Iterator<Key, T>;
|
||||
private _Capsule_key;
|
||||
protected _Handle_insert({}: {}, {}: {}): void;
|
||||
protected _Handle_erase({}: {}, {}: {}): void;
|
||||
}
|
||||
/**
|
||||
*
|
||||
*/
|
||||
export declare namespace FlatMultiMap {
|
||||
type Iterator<Key, T> = MapElementVector.Iterator<Key, T, false, FlatMultiMap<Key, T>>;
|
||||
type ReverseIterator<Key, T> = MapElementVector.ReverseIterator<Key, T, false, FlatMultiMap<Key, T>>;
|
||||
const Iterator: typeof MapElementVector.Iterator;
|
||||
const ReverseIterator: typeof MapElementVector.ReverseIterator;
|
||||
const __MODULE = "experimental";
|
||||
}
|
||||
+136
@@ -0,0 +1,136 @@
|
||||
"use strict";
|
||||
var __extends = (this && this.__extends) || (function () {
|
||||
var extendStatics = function (d, b) {
|
||||
extendStatics = Object.setPrototypeOf ||
|
||||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
||||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
||||
return extendStatics(d, b);
|
||||
};
|
||||
return function (d, b) {
|
||||
if (typeof b !== "function" && b !== null)
|
||||
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
||||
extendStatics(d, b);
|
||||
function __() { this.constructor = d; }
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
})();
|
||||
var __read = (this && this.__read) || function (o, n) {
|
||||
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
||||
if (!m) return o;
|
||||
var i = m.call(o), r, ar = [], e;
|
||||
try {
|
||||
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
||||
}
|
||||
catch (error) { e = { error: error }; }
|
||||
finally {
|
||||
try {
|
||||
if (r && !r.done && (m = i["return"])) m.call(i);
|
||||
}
|
||||
finally { if (e) throw e.error; }
|
||||
}
|
||||
return ar;
|
||||
};
|
||||
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
||||
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
||||
if (ar || !(i in from)) {
|
||||
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
||||
ar[i] = from[i];
|
||||
}
|
||||
}
|
||||
return to.concat(ar || Array.prototype.slice.call(from));
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.FlatMultiMap = void 0;
|
||||
//================================================================
|
||||
/**
|
||||
* @packageDocumentation
|
||||
* @module std.experimental
|
||||
*/
|
||||
//================================================================
|
||||
var MultiTreeMap_1 = require("../../internal/container/associative/MultiTreeMap");
|
||||
var ITreeContainer_1 = require("../../internal/container/associative/ITreeContainer");
|
||||
var MapElementVector_1 = require("../../internal/container/associative/MapElementVector");
|
||||
var binary_search_1 = require("../../algorithm/binary_search");
|
||||
/**
|
||||
* Multiple-key Map based on sorted array.
|
||||
*
|
||||
* @author Jeongho Nam - https://github.com/samchon
|
||||
*/
|
||||
var FlatMultiMap = /** @class */ (function (_super) {
|
||||
__extends(FlatMultiMap, _super);
|
||||
function FlatMultiMap() {
|
||||
var args = [];
|
||||
for (var _i = 0; _i < arguments.length; _i++) {
|
||||
args[_i] = arguments[_i];
|
||||
}
|
||||
var _this =
|
||||
// INITIALIZATION
|
||||
_super.call(this, function (thisArg) { return new MapElementVector_1.MapElementVector(thisArg); }) || this;
|
||||
// OVERLOADINGS
|
||||
ITreeContainer_1.ITreeContainer.construct.apply(ITreeContainer_1.ITreeContainer, __spreadArray([_this,
|
||||
FlatMultiMap,
|
||||
function (comp) {
|
||||
_this.key_comp_ = comp;
|
||||
}], __read(args), false));
|
||||
return _this;
|
||||
}
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
FlatMultiMap.prototype.swap = function (obj) {
|
||||
var _a, _b;
|
||||
// SWAP CONTENTS
|
||||
_a = __read([obj.data_, this.data_], 2), this.data_ = _a[0], obj.data_ = _a[1];
|
||||
MapElementVector_1.MapElementVector._Swap_associative(this.data_, obj.data_);
|
||||
// SWAP COMPARATORS
|
||||
_b = __read([obj.key_comp_, this.key_comp_], 2), this.key_comp_ = _b[0], obj.key_comp_ = _b[1];
|
||||
};
|
||||
/* ---------------------------------------------------------
|
||||
ACCESSORS
|
||||
--------------------------------------------------------- */
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
FlatMultiMap.prototype.nth = function (index) {
|
||||
return this.data_.nth(index);
|
||||
};
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
FlatMultiMap.prototype.key_comp = function () {
|
||||
return this.key_comp_;
|
||||
};
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
FlatMultiMap.prototype.lower_bound = function (key) {
|
||||
return (0, binary_search_1.lower_bound)(this.begin(), this.end(), this._Capsule_key(key), this.value_comp());
|
||||
};
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
FlatMultiMap.prototype.upper_bound = function (key) {
|
||||
return (0, binary_search_1.upper_bound)(this.begin(), this.end(), this._Capsule_key(key), this.value_comp());
|
||||
};
|
||||
FlatMultiMap.prototype._Capsule_key = function (key) {
|
||||
return { first: key };
|
||||
};
|
||||
/* ---------------------------------------------------------
|
||||
POST-PROCESS
|
||||
--------------------------------------------------------- */
|
||||
FlatMultiMap.prototype._Handle_insert = function (_a, _b) { };
|
||||
FlatMultiMap.prototype._Handle_erase = function (_a, _b) { };
|
||||
return FlatMultiMap;
|
||||
}(MultiTreeMap_1.MultiTreeMap));
|
||||
exports.FlatMultiMap = FlatMultiMap;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
(function (FlatMultiMap) {
|
||||
// BODY
|
||||
FlatMultiMap.Iterator = MapElementVector_1.MapElementVector.Iterator;
|
||||
FlatMultiMap.ReverseIterator = MapElementVector_1.MapElementVector.ReverseIterator;
|
||||
FlatMultiMap.__MODULE = "experimental";
|
||||
})(FlatMultiMap = exports.FlatMultiMap || (exports.FlatMultiMap = {}));
|
||||
exports.FlatMultiMap = FlatMultiMap;
|
||||
//# sourceMappingURL=FlatMultiMap.js.map
|
||||
+75
@@ -0,0 +1,75 @@
|
||||
/**
|
||||
* @packageDocumentation
|
||||
* @module std.experimental
|
||||
*/
|
||||
import { MultiTreeSet } from "../../internal/container/associative/MultiTreeSet";
|
||||
import { SetElementVector } from "../../internal/container/associative/SetElementVector";
|
||||
import { IForwardIterator } from "../../iterator/IForwardIterator";
|
||||
import { Comparator } from "../../internal/functional/Comparator";
|
||||
/**
|
||||
* Multiple-key Set based on sorted array.
|
||||
*
|
||||
* @author Jeongho Nam - https://github.com/samchon
|
||||
*/
|
||||
export declare class FlatMultiSet<Key> extends MultiTreeSet<Key, FlatMultiSet<Key>, FlatMultiSet.Iterator<Key>, FlatMultiSet.ReverseIterator<Key>> {
|
||||
private key_comp_;
|
||||
/**
|
||||
* Default Constructor.
|
||||
*
|
||||
* @param comp A binary function predicates *x* element would be placed before *y*. When returns `true`, then *x* precedes *y*. Note that, because *equality* is predicated by `!comp(x, y) && !comp(y, x)`, the function must not cover the *equality* like `<=` or `>=`. It must exclude the *equality* like `<` or `>`. Default is {@link less}.
|
||||
*/
|
||||
constructor(comp?: Comparator<Key>);
|
||||
/**
|
||||
* Initializer Constructor.
|
||||
*
|
||||
* @param items Items to assign.
|
||||
* @param comp A binary function predicates *x* element would be placed before *y*. When returns `true`, then *x* precedes *y*. Note that, because *equality* is predicated by `!comp(x, y) && !comp(y, x)`, the function must not cover the *equality* like `<=` or `>=`. It must exclude the *equality* like `<` or `>`. Default is {@link less}.
|
||||
*/
|
||||
constructor(items: Key[], comp?: Comparator<Key>);
|
||||
/**
|
||||
* Copy Constructor.
|
||||
*
|
||||
* @param obj Object to copy.
|
||||
*/
|
||||
constructor(obj: FlatMultiSet<Key>);
|
||||
/**
|
||||
* Range Constructor.
|
||||
*
|
||||
* @param first Input iterator of the first position.
|
||||
* @param last Input iterator of the last position.
|
||||
* @param comp A binary function predicates *x* element would be placed before *y*. When returns `true`, then *x* precedes *y*. Note that, because *equality* is predicated by `!comp(x, y) && !comp(y, x)`, the function must not cover the *equality* like `<=` or `>=`. It must exclude the *equality* like `<` or `>`. Default is {@link less}.
|
||||
*/
|
||||
constructor(first: Readonly<IForwardIterator<Key>>, last: Readonly<IForwardIterator<Key>>, comp?: Comparator<Key>);
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
swap(obj: FlatMultiSet<Key>): void;
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
nth(index: number): FlatMultiSet.Iterator<Key>;
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
key_comp(): Comparator<Key>;
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
lower_bound(key: Key): FlatMultiSet.Iterator<Key>;
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
upper_bound(key: Key): FlatMultiSet.Iterator<Key>;
|
||||
protected _Handle_insert({}: {}, {}: {}): void;
|
||||
protected _Handle_erase({}: {}, {}: {}): void;
|
||||
}
|
||||
/**
|
||||
*
|
||||
*/
|
||||
export declare namespace FlatMultiSet {
|
||||
type Iterator<Key> = SetElementVector.Iterator<Key, false, FlatMultiSet<Key>>;
|
||||
type ReverseIterator<Key> = SetElementVector.ReverseIterator<Key, false, FlatMultiSet<Key>>;
|
||||
const Iterator: typeof SetElementVector.Iterator;
|
||||
const ReverseIterator: typeof SetElementVector.ReverseIterator;
|
||||
const __MODULE = "experimental";
|
||||
}
|
||||
+133
@@ -0,0 +1,133 @@
|
||||
"use strict";
|
||||
var __extends = (this && this.__extends) || (function () {
|
||||
var extendStatics = function (d, b) {
|
||||
extendStatics = Object.setPrototypeOf ||
|
||||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
||||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
||||
return extendStatics(d, b);
|
||||
};
|
||||
return function (d, b) {
|
||||
if (typeof b !== "function" && b !== null)
|
||||
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
||||
extendStatics(d, b);
|
||||
function __() { this.constructor = d; }
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
})();
|
||||
var __read = (this && this.__read) || function (o, n) {
|
||||
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
||||
if (!m) return o;
|
||||
var i = m.call(o), r, ar = [], e;
|
||||
try {
|
||||
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
||||
}
|
||||
catch (error) { e = { error: error }; }
|
||||
finally {
|
||||
try {
|
||||
if (r && !r.done && (m = i["return"])) m.call(i);
|
||||
}
|
||||
finally { if (e) throw e.error; }
|
||||
}
|
||||
return ar;
|
||||
};
|
||||
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
||||
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
||||
if (ar || !(i in from)) {
|
||||
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
||||
ar[i] = from[i];
|
||||
}
|
||||
}
|
||||
return to.concat(ar || Array.prototype.slice.call(from));
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.FlatMultiSet = void 0;
|
||||
//================================================================
|
||||
/**
|
||||
* @packageDocumentation
|
||||
* @module std.experimental
|
||||
*/
|
||||
//================================================================
|
||||
var MultiTreeSet_1 = require("../../internal/container/associative/MultiTreeSet");
|
||||
var ITreeContainer_1 = require("../../internal/container/associative/ITreeContainer");
|
||||
var SetElementVector_1 = require("../../internal/container/associative/SetElementVector");
|
||||
var binary_search_1 = require("../../algorithm/binary_search");
|
||||
/**
|
||||
* Multiple-key Set based on sorted array.
|
||||
*
|
||||
* @author Jeongho Nam - https://github.com/samchon
|
||||
*/
|
||||
var FlatMultiSet = /** @class */ (function (_super) {
|
||||
__extends(FlatMultiSet, _super);
|
||||
function FlatMultiSet() {
|
||||
var args = [];
|
||||
for (var _i = 0; _i < arguments.length; _i++) {
|
||||
args[_i] = arguments[_i];
|
||||
}
|
||||
var _this =
|
||||
// INITIALIZATION
|
||||
_super.call(this, function (thisArg) { return new SetElementVector_1.SetElementVector(thisArg); }) || this;
|
||||
// OVERLOADINGS
|
||||
ITreeContainer_1.ITreeContainer.construct.apply(ITreeContainer_1.ITreeContainer, __spreadArray([_this,
|
||||
FlatMultiSet,
|
||||
function (comp) {
|
||||
_this.key_comp_ = comp;
|
||||
}], __read(args), false));
|
||||
return _this;
|
||||
}
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
FlatMultiSet.prototype.swap = function (obj) {
|
||||
var _a, _b;
|
||||
// SWAP CONTENTS
|
||||
_a = __read([obj.data_, this.data_], 2), this.data_ = _a[0], obj.data_ = _a[1];
|
||||
SetElementVector_1.SetElementVector._Swap_associative(this.data_, obj.data_);
|
||||
// SWAP COMPARATORS
|
||||
_b = __read([obj.key_comp_, this.key_comp_], 2), this.key_comp_ = _b[0], obj.key_comp_ = _b[1];
|
||||
};
|
||||
/* ---------------------------------------------------------
|
||||
ACCESSORS
|
||||
--------------------------------------------------------- */
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
FlatMultiSet.prototype.nth = function (index) {
|
||||
return this.data_.nth(index);
|
||||
};
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
FlatMultiSet.prototype.key_comp = function () {
|
||||
return this.key_comp_;
|
||||
};
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
FlatMultiSet.prototype.lower_bound = function (key) {
|
||||
return (0, binary_search_1.lower_bound)(this.begin(), this.end(), key, this.value_comp());
|
||||
};
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
FlatMultiSet.prototype.upper_bound = function (key) {
|
||||
return (0, binary_search_1.upper_bound)(this.begin(), this.end(), key, this.value_comp());
|
||||
};
|
||||
/* ---------------------------------------------------------
|
||||
POST-PROCESS
|
||||
--------------------------------------------------------- */
|
||||
FlatMultiSet.prototype._Handle_insert = function (_a, _b) { };
|
||||
FlatMultiSet.prototype._Handle_erase = function (_a, _b) { };
|
||||
return FlatMultiSet;
|
||||
}(MultiTreeSet_1.MultiTreeSet));
|
||||
exports.FlatMultiSet = FlatMultiSet;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
(function (FlatMultiSet) {
|
||||
// BODY
|
||||
FlatMultiSet.Iterator = SetElementVector_1.SetElementVector.Iterator;
|
||||
FlatMultiSet.ReverseIterator = SetElementVector_1.SetElementVector.ReverseIterator;
|
||||
FlatMultiSet.__MODULE = "experimental";
|
||||
})(FlatMultiSet = exports.FlatMultiSet || (exports.FlatMultiSet = {}));
|
||||
exports.FlatMultiSet = FlatMultiSet;
|
||||
//# sourceMappingURL=FlatMultiSet.js.map
|
||||
+75
@@ -0,0 +1,75 @@
|
||||
/**
|
||||
* @packageDocumentation
|
||||
* @module std.experimental
|
||||
*/
|
||||
import { UniqueTreeSet } from "../../internal/container/associative/UniqueTreeSet";
|
||||
import { SetElementVector } from "../../internal/container/associative/SetElementVector";
|
||||
import { IForwardIterator } from "../../iterator/IForwardIterator";
|
||||
import { Comparator } from "../../internal/functional/Comparator";
|
||||
/**
|
||||
* Unique-key Set based on sorted array.
|
||||
*
|
||||
* @author Jeongho Nam - https://github.com/samchon
|
||||
*/
|
||||
export declare class FlatSet<Key> extends UniqueTreeSet<Key, FlatSet<Key>, FlatSet.Iterator<Key>, FlatSet.ReverseIterator<Key>> {
|
||||
private key_comp_;
|
||||
/**
|
||||
* Default Constructor.
|
||||
*
|
||||
* @param comp A binary function predicates *x* element would be placed before *y*. When returns `true`, then *x* precedes *y*. Note that, because *equality* is predicated by `!comp(x, y) && !comp(y, x)`, the function must not cover the *equality* like `<=` or `>=`. It must exclude the *equality* like `<` or `>`. Default is {@link less}.
|
||||
*/
|
||||
constructor(comp?: Comparator<Key>);
|
||||
/**
|
||||
* Initializer Constructor.
|
||||
*
|
||||
* @param items Items to assign.
|
||||
* @param comp A binary function predicates *x* element would be placed before *y*. When returns `true`, then *x* precedes *y*. Note that, because *equality* is predicated by `!comp(x, y) && !comp(y, x)`, the function must not cover the *equality* like `<=` or `>=`. It must exclude the *equality* like `<` or `>`. Default is {@link less}.
|
||||
*/
|
||||
constructor(items: Key[], comp?: Comparator<Key>);
|
||||
/**
|
||||
* Copy Constructor.
|
||||
*
|
||||
* @param obj Object to copy.
|
||||
*/
|
||||
constructor(obj: FlatSet<Key>);
|
||||
/**
|
||||
* Range Constructor.
|
||||
*
|
||||
* @param first Input iterator of the first position.
|
||||
* @param last Input iterator of the last position.
|
||||
* @param comp A binary function predicates *x* element would be placed before *y*. When returns `true`, then *x* precedes *y*. Note that, because *equality* is predicated by `!comp(x, y) && !comp(y, x)`, the function must not cover the *equality* like `<=` or `>=`. It must exclude the *equality* like `<` or `>`. Default is {@link less}.
|
||||
*/
|
||||
constructor(first: Readonly<IForwardIterator<Key>>, last: Readonly<IForwardIterator<Key>>, comp?: Comparator<Key>);
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
swap(obj: FlatSet<Key>): void;
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
nth(index: number): FlatSet.Iterator<Key>;
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
key_comp(): Comparator<Key>;
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
lower_bound(key: Key): FlatSet.Iterator<Key>;
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
upper_bound(key: Key): FlatSet.Iterator<Key>;
|
||||
protected _Handle_insert({}: {}, {}: {}): void;
|
||||
protected _Handle_erase({}: {}, {}: {}): void;
|
||||
}
|
||||
/**
|
||||
*
|
||||
*/
|
||||
export declare namespace FlatSet {
|
||||
type Iterator<Key> = SetElementVector.Iterator<Key, true, FlatSet<Key>>;
|
||||
type ReverseIterator<Key> = SetElementVector.ReverseIterator<Key, true, FlatSet<Key>>;
|
||||
const Iterator: typeof SetElementVector.Iterator;
|
||||
const ReverseIterator: typeof SetElementVector.ReverseIterator;
|
||||
const __MODULE = "experimental";
|
||||
}
|
||||
+133
@@ -0,0 +1,133 @@
|
||||
"use strict";
|
||||
var __extends = (this && this.__extends) || (function () {
|
||||
var extendStatics = function (d, b) {
|
||||
extendStatics = Object.setPrototypeOf ||
|
||||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
||||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
||||
return extendStatics(d, b);
|
||||
};
|
||||
return function (d, b) {
|
||||
if (typeof b !== "function" && b !== null)
|
||||
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
||||
extendStatics(d, b);
|
||||
function __() { this.constructor = d; }
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
})();
|
||||
var __read = (this && this.__read) || function (o, n) {
|
||||
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
||||
if (!m) return o;
|
||||
var i = m.call(o), r, ar = [], e;
|
||||
try {
|
||||
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
||||
}
|
||||
catch (error) { e = { error: error }; }
|
||||
finally {
|
||||
try {
|
||||
if (r && !r.done && (m = i["return"])) m.call(i);
|
||||
}
|
||||
finally { if (e) throw e.error; }
|
||||
}
|
||||
return ar;
|
||||
};
|
||||
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
||||
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
||||
if (ar || !(i in from)) {
|
||||
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
||||
ar[i] = from[i];
|
||||
}
|
||||
}
|
||||
return to.concat(ar || Array.prototype.slice.call(from));
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.FlatSet = void 0;
|
||||
//================================================================
|
||||
/**
|
||||
* @packageDocumentation
|
||||
* @module std.experimental
|
||||
*/
|
||||
//================================================================
|
||||
var UniqueTreeSet_1 = require("../../internal/container/associative/UniqueTreeSet");
|
||||
var ITreeContainer_1 = require("../../internal/container/associative/ITreeContainer");
|
||||
var SetElementVector_1 = require("../../internal/container/associative/SetElementVector");
|
||||
var binary_search_1 = require("../../algorithm/binary_search");
|
||||
/**
|
||||
* Unique-key Set based on sorted array.
|
||||
*
|
||||
* @author Jeongho Nam - https://github.com/samchon
|
||||
*/
|
||||
var FlatSet = /** @class */ (function (_super) {
|
||||
__extends(FlatSet, _super);
|
||||
function FlatSet() {
|
||||
var args = [];
|
||||
for (var _i = 0; _i < arguments.length; _i++) {
|
||||
args[_i] = arguments[_i];
|
||||
}
|
||||
var _this =
|
||||
// INITIALIZATION
|
||||
_super.call(this, function (thisArg) { return new SetElementVector_1.SetElementVector(thisArg); }) || this;
|
||||
// OVERLOADINGS
|
||||
ITreeContainer_1.ITreeContainer.construct.apply(ITreeContainer_1.ITreeContainer, __spreadArray([_this,
|
||||
FlatSet,
|
||||
function (comp) {
|
||||
_this.key_comp_ = comp;
|
||||
}], __read(args), false));
|
||||
return _this;
|
||||
}
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
FlatSet.prototype.swap = function (obj) {
|
||||
var _a, _b;
|
||||
// SWAP CONTENTS
|
||||
_a = __read([obj.data_, this.data_], 2), this.data_ = _a[0], obj.data_ = _a[1];
|
||||
SetElementVector_1.SetElementVector._Swap_associative(this.data_, obj.data_);
|
||||
// SWAP COMPARATORS
|
||||
_b = __read([obj.key_comp_, this.key_comp_], 2), this.key_comp_ = _b[0], obj.key_comp_ = _b[1];
|
||||
};
|
||||
/* ---------------------------------------------------------
|
||||
ACCESSORS
|
||||
--------------------------------------------------------- */
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
FlatSet.prototype.nth = function (index) {
|
||||
return this.data_.nth(index);
|
||||
};
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
FlatSet.prototype.key_comp = function () {
|
||||
return this.key_comp_;
|
||||
};
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
FlatSet.prototype.lower_bound = function (key) {
|
||||
return (0, binary_search_1.lower_bound)(this.begin(), this.end(), key, this.value_comp());
|
||||
};
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
FlatSet.prototype.upper_bound = function (key) {
|
||||
return (0, binary_search_1.upper_bound)(this.begin(), this.end(), key, this.value_comp());
|
||||
};
|
||||
/* ---------------------------------------------------------
|
||||
POST-PROCESS
|
||||
--------------------------------------------------------- */
|
||||
FlatSet.prototype._Handle_insert = function (_a, _b) { };
|
||||
FlatSet.prototype._Handle_erase = function (_a, _b) { };
|
||||
return FlatSet;
|
||||
}(UniqueTreeSet_1.UniqueTreeSet));
|
||||
exports.FlatSet = FlatSet;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
(function (FlatSet) {
|
||||
// BODY
|
||||
FlatSet.Iterator = SetElementVector_1.SetElementVector.Iterator;
|
||||
FlatSet.ReverseIterator = SetElementVector_1.SetElementVector.ReverseIterator;
|
||||
FlatSet.__MODULE = "experimental";
|
||||
})(FlatSet = exports.FlatSet || (exports.FlatSet = {}));
|
||||
exports.FlatSet = FlatSet;
|
||||
//# sourceMappingURL=FlatSet.js.map
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
/**
|
||||
* @packageDocumentation
|
||||
* @module std.experimental
|
||||
*/
|
||||
export * from "./FlatSet";
|
||||
export * from "./FlatMultiSet";
|
||||
export * from "./FlatMap";
|
||||
export * from "./FlatMultiMap";
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
"use strict";
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
||||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
//================================================================
|
||||
/**
|
||||
* @packageDocumentation
|
||||
* @module std.experimental
|
||||
*/
|
||||
//================================================================
|
||||
__exportStar(require("./FlatSet"), exports);
|
||||
__exportStar(require("./FlatMultiSet"), exports);
|
||||
__exportStar(require("./FlatMap"), exports);
|
||||
__exportStar(require("./FlatMultiMap"), exports);
|
||||
//# sourceMappingURL=index.js.map
|
||||
Reference in New Issue
Block a user