Utils

Lore. Utils

A utility class containing static methods.

Constructor

new Utils()

Source:

Methods

(static) arrayContains(array, value) → {boolean}

Source:

Checks whether or not an array contains a given value.

Parameters:
Name Type Description
array Array

An array.

value object

An object.

Returns:

A boolean whether or not the array contains the value.

Type
boolean

(static) concatTypedArrays(arrA, arrB) → {TypedArray}

Source:

Concatinate two typed arrays.

Parameters:
Name Type Description
arrA TypedArray

A typed array.

arrB TypedArray

A typed array.

Returns:

The concatinated typed array.

Type
TypedArray

(static) extend() → {object}

Source:

Merges two objects, overriding probierties set in both objects in the first one.

Returns:

The merged object.

Type
object

(static) isFloat(n)

Source:

Checks whether or not the number is a float.

Parameters:
Name Type Description
n number

A number.

Returns:

A boolean whether or not the number is a float.

(static) isInt(n)

Source:

Checks whether or not the number is an integer.

Parameters:
Name Type Description
n number

A number.

Returns:

A boolean whether or not the number is an integer.

(static) jsonp(url, callback)

Source:

A helper method enabling JSONP requests to an url.

Parameters:
Name Type Description
url String

An url.

callback function

The callback to be called when the data is loaded.

(static) mergePointDistances(a, b) → {object}

Source:

An utility method to merge two point distance objects containing arrays of indices and squared distances.

Parameters:
Name Type Description
a object

An object in the form of { indices: TypedArray, distancesSq: TypedArray }.

b object

An object in the form of { indices: TypedArray, distancesSq: TypedArray }.

Returns:

The object with merged indices and squared distances.

Type
object

(static) msb(n) → {Number}

Source:

Get the most significant bit (MSB) of a number.

Parameters:
Name Type Description
n Number

A number.

Returns:

The most significant bit (0 or 1).

Type
Number