/** @import {InputType} from "../index.js" */ /** @import {ParametersTopoMap} from "./index.js" */ /** * TopoMap * * A 0-dimensional Homology Preserving Projection of High-Dimensional Data. * It aims to preserve the topological structure of the data by maintaining * the connectivity of a minimum spanning tree. * * @class * @template {InputType} T * @extends DR * @category Dimensionality Reduction */ export class TopoMap extends DR { /** * @template {InputType} T * @param {T} X * @param {Partial} parameters * @returns {T} */ static transform(X: T_1, parameters: Partial): T_1; /** * @template {InputType} T * @param {T} X * @param {Partial} parameters * @returns {Generator} */ static generator( X: T_1, parameters: Partial, ): Generator; /** * @template {InputType} T * @param {T} X * @param {Partial} parameters * @returns {Promise} */ static transform_async( X: T_1, parameters: Partial, ): Promise; /** * TopoMap: A 0-dimensional Homology Preserving Projection of High-Dimensional Data. * * @param {T} X - The high-dimensional data. * @param {Partial} parameters - Object containing parameterization of the DR method. * @see {@link https://arxiv.org/pdf/2009.01512.pdf} */ constructor(X: T, parameters: Partial); _distance_matrix: Matrix; /** * @private * @param {number} i * @param {number} j * @param {import("../metrics/index.js").Metric} metric * @returns {number} */ private __lazy_distance_matrix; /** * Computes the minimum spanning tree, using a given metric * * @private * @param {import("../metrics/index.js").Metric} metric * @see {@link https://en.wikipedia.org/wiki/Kruskal%27s_algorithm} */ private _make_minimum_spanning_tree; _disjoint_set: DisjointSet> | undefined; /** Initializes TopoMap. Sets all projcted points to zero, and computes a minimum spanning tree. */ init(): this; _Emst: number[][] | undefined; /** * Returns true if Point C is left of line AB. * * @private * @param {Float64Array} PointA - Point A of line AB * @param {Float64Array} PointB - Point B of line AB * @param {Float64Array} PointC - Point C * @returns {boolean} */ private __hull_cross; /** * Computes the convex hull of the set of Points S * * @private * @param {Float64Array[]} S - Set of Points. * @returns {Float64Array[]} Convex hull of S. Starts at the bottom-most point and continues counter-clockwise. * @see {@link https://en.wikibooks.org/wiki/Algorithm_Implementation/Geometry/Convex_hull/Monotone_chain#JavaScript} */ private __hull; /** * Finds the angle to rotate Point A and B to lie on a line parallel to the x-axis. * * @private * @param {Float64Array} PointA * @param {Float64Array} PointB * @returns {{ sin: number; cos: number }} Object containing the sinus- and cosinus-values for a rotation. */ private __findAngle; /** * @private * @param {Float64Array[]} hull * @param {Float64Array} p * @param {boolean} topEdge * @returns {{ sin: number; cos: number; tx: number; ty: number }} */ private __align_hull; /** * @private * @param {Float64Array} Point - The point which should get transformed. * @param {{ sin: number; cos: number; tx: number; ty: number }} Transformation - Contains the values for * translation and rotation. */ private __transform; /** * Calls `__transform` for each point in Set C * * @private * @param {Float64Array[]} C - Set of points. * @param {{ sin: number; cos: number; tx: number; ty: number }} t - Transform object. * @param {number} yOffset - Value to offset set C. */ private __transform_component; /** * @private * @param {Float64Array} root_u - Root of component u * @param {Float64Array} root_v - Root of component v * @param {Float64Array} p_u - Point u * @param {Float64Array} p_v - Point v * @param {number} w - Edge weight w * @param {DisjointSet} components - The disjoint set containing the components */ private __align_components; /** * Transforms the inputdata `X` to dimensionality 2. * * @returns {T} */ transform(): T; /** * Transforms the inputdata `X` to dimensionality 2. * * @returns {Generator} */ generator(): Generator; } import type { InputType } from "../index.js"; import type { ParametersTopoMap } from "./index.js"; import { DR } from "./DR.js"; import { Matrix } from "../matrix/index.js"; import { DisjointSet } from "../datastructure/index.js"; //# sourceMappingURL=TopoMap.d.ts.map