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
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,48 @@

/* eslint-disable max-lines */

import dchebyshev = require( '@stdlib/stats/strided/distances/dchebyshev' );
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 dminkowski = require( '@stdlib/stats/strided/distances/dminkowski' );
import dsquaredEuclidean = require( '@stdlib/stats/strided/distances/dsquared-euclidean' );

/**
* Interface describing the `distances` namespace.
*/
interface Namespace {
/**
* Computes the Chebyshev 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 Chebyshev 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.dchebyshev( 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.dchebyshev.ndarray( x.length, x, 1, 0, y, 1, 0 );
* // returns 9.0
*/
dchebyshev: typeof dchebyshev;

/**
* Computes the city block (Manhattan) distance between two double-precision floating-point strided arrays.
*
Expand Down Expand Up @@ -150,6 +182,37 @@ interface Namespace {
*/
deuclidean: typeof deuclidean;

/**
* Computes the Minkowski distance between two double-precision floating-point strided arrays.
*
* @param N - number of indexed elements
* @param p - order of the Minkowski norm
* @param x - first input array
* @param strideX - `x` stride length
* @param y - second input array
* @param strideY - `y` stride length
* @returns Minkowski 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.dminkowski( x.length, 3, x, 1, y, 1 );
* // returns ~11.543
*
* @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.dminkowski.ndarray( x.length, 3, x, 1, 0, y, 1, 0 );
* // returns ~11.543
*/
dminkowski: typeof dminkowski;

/**
* Computes the squared Euclidean distance between two double-precision floating-point strided arrays.
*
Expand Down