Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
184 changes: 182 additions & 2 deletions lib/node_modules/@stdlib/stats/strided/distances/docs/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,196 @@

/* eslint-disable max-lines */

import dchebychev = require( '@stdlib/stats/strided/distances/dchebychev' );
import dcityblock = require( '@stdlib/stats/strided/distances/dcityblock' );
import dcosineDistance = require( '@stdlib/stats/strided/distances/dcosine-distance' );
import dcosineSimilarity = require( '@stdlib/stats/strided/distances/dcosine-similarity' );
import deuclidean = require( '@stdlib/stats/strided/distances/deuclidean' );
import dsquaredEuclidean = require( '@stdlib/stats/strided/distances/dsquared-euclidean' );

/**
* Interface describing a namespace.
* Interface describing the `distances` namespace.
*/
interface Namespace {
/**
* TODO
* Computes the Chebychev distance between two double-precision floating-point strided arrays.
*
* @param N - number of indexed elements
* @param x - first input array
* @param strideX - `x` stride length
* @param y - second input array
* @param strideY - `y` stride length
* @returns Chebychev distance
*
* @example
* var Float64Array = require( '@stdlib/array/float64' );
*
* var x = new Float64Array( [ 4.0, 2.0, -3.0, 5.0, -1.0 ] );
* var y = new Float64Array( [ 2.0, 6.0, -1.0, -4.0, 8.0 ] );
*
* var z = ns.dchebychev( x.length, x, 1, y, 1 );
* // returns 9.0
*
* @example
* var Float64Array = require( '@stdlib/array/float64' );
*
* var x = new Float64Array( [ 4.0, 2.0, -3.0, 5.0, -1.0 ] );
* var y = new Float64Array( [ 2.0, 6.0, -1.0, -4.0, 8.0 ] );
*
* var z = ns.dchebychev.ndarray( x.length, x, 1, 0, y, 1, 0 );
* // returns 9.0
*/
dchebychev: typeof dchebychev;

/**
* Computes the city block (Manhattan) distance between two double-precision floating-point strided arrays.
*
* @param N - number of indexed elements
* @param x - first input array
* @param strideX - `x` stride length
* @param y - second input array
* @param strideY - `y` stride length
* @returns city block (Manhattan) distance
*
* @example
* var Float64Array = require( '@stdlib/array/float64' );
*
* var x = new Float64Array( [ 4.0, 2.0, -3.0, 5.0, -1.0 ] );
* var y = new Float64Array( [ 2.0, 6.0, -1.0, -4.0, 8.0 ] );
*
* var z = ns.dcityblock( x.length, x, 1, y, 1 );
* // returns 26.0
*
* @example
* var Float64Array = require( '@stdlib/array/float64' );
*
* var x = new Float64Array( [ 4.0, 2.0, -3.0, 5.0, -1.0 ] );
* var y = new Float64Array( [ 2.0, 6.0, -1.0, -4.0, 8.0 ] );
*
* var z = ns.dcityblock.ndarray( x.length, x, 1, 0, y, 1, 0 );
* // returns 26.0
*/
dcityblock: typeof dcityblock;

/**
* Computes the cosine distance between two double-precision floating-point strided arrays.
*
* @param N - number of indexed elements
* @param x - first input array
* @param strideX - `x` stride length
* @param y - second input array
* @param strideY - `y` stride length
* @returns cosine distance
*
* @example
* var Float64Array = require( '@stdlib/array/float64' );
*
* var x = new Float64Array( [ 4.0, 2.0, -3.0, 5.0, -1.0 ] );
* var y = new Float64Array( [ 2.0, 6.0, -1.0, -4.0, 8.0 ] );
*
* var z = ns.dcosineDistance( x.length, x, 1, y, 1 );
* // returns ~1.061
*
* @example
* var Float64Array = require( '@stdlib/array/float64' );
*
* var x = new Float64Array( [ 4.0, 2.0, -3.0, 5.0, -1.0 ] );
* var y = new Float64Array( [ 2.0, 6.0, -1.0, -4.0, 8.0 ] );
*
* var z = ns.dcosineDistance.ndarray( x.length, x, 1, 0, y, 1, 0 );
* // returns ~1.061
*/
dcosineDistance: typeof dcosineDistance;

/**
* Computes the cosine similarity of two double-precision floating-point strided arrays.
*
* @param N - number of indexed elements
* @param x - first input array
* @param strideX - `x` stride length
* @param y - second input array
* @param strideY - `y` stride length
* @returns cosine similarity
*
* @example
* var Float64Array = require( '@stdlib/array/float64' );
*
* var x = new Float64Array( [ 4.0, 2.0, -3.0, 5.0, -1.0 ] );
* var y = new Float64Array( [ 2.0, 6.0, -1.0, -4.0, 8.0 ] );
*
* var z = ns.dcosineSimilarity( x.length, x, 1, y, 1 );
* // returns ~-0.061
*
* @example
* var Float64Array = require( '@stdlib/array/float64' );
*
* var x = new Float64Array( [ 4.0, 2.0, -3.0, 5.0, -1.0 ] );
* var y = new Float64Array( [ 2.0, 6.0, -1.0, -4.0, 8.0 ] );
*
* var z = ns.dcosineSimilarity.ndarray( x.length, x, 1, 0, y, 1, 0 );
* // returns ~-0.061
*/
dcosineSimilarity: typeof dcosineSimilarity;

/**
* Computes the Euclidean distance between two double-precision floating-point strided arrays.
*
* @param N - number of indexed elements
* @param x - first input array
* @param strideX - `x` stride length
* @param y - second input array
* @param strideY - `y` stride length
* @returns Euclidean distance
*
* @example
* var Float64Array = require( '@stdlib/array/float64' );
*
* var x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] );
* var y = new Float64Array( [ 2.0, 1.0, 2.0, 1.0, -2.0, 2.0, 3.0, 4.0 ] );
*
* var z = ns.deuclidean( x.length, x, 1, y, 1 );
* // returns ~8.485
*
* @example
* var Float64Array = require( '@stdlib/array/float64' );
*
* var x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] );
* var y = new Float64Array( [ 2.0, 1.0, 2.0, 1.0, -2.0, 2.0, 3.0, 4.0 ] );
*
* var z = ns.deuclidean.ndarray( x.length, x, 1, 0, y, 1, 0 );
* // returns ~8.485
*/
deuclidean: typeof deuclidean;

/**
* Computes the squared Euclidean distance between two double-precision floating-point strided arrays.
*
* @param N - number of indexed elements
* @param x - first input array
* @param strideX - `x` stride length
* @param y - second input array
* @param strideY - `y` stride length
* @returns squared Euclidean distance
*
* @example
* var Float64Array = require( '@stdlib/array/float64' );
*
* var x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] );
* var y = new Float64Array( [ 2.0, 1.0, 2.0, 1.0, -2.0, 2.0, 3.0, 4.0 ] );
*
* var z = ns.dsquaredEuclidean( x.length, x, 1, y, 1 );
* // returns 72.0
*
* @example
* var Float64Array = require( '@stdlib/array/float64' );
*
* var x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] );
* var y = new Float64Array( [ 2.0, 1.0, 2.0, 1.0, -2.0, 2.0, 3.0, 4.0 ] );
*
* var z = ns.dsquaredEuclidean.ndarray( x.length, x, 1, 0, y, 1, 0 );
* // returns 72.0
*/
dsquaredEuclidean: typeof dsquaredEuclidean;
}

/**
Expand Down