splits

splits

Collection of functions to be used for splitting data across HydroCompute

Source:

Methods

(static) divideIntoSubmatrices(params) → {Array}

Divides a matrix into submatrices.

Parameters:
Name Type Description
params object

The parameters for dividing the matrix.

Properties
Name Type Description
data Array

The matrix to divide.

k number

The number of rows for each submatrix.

l number

The number of columns for each submatrix.

Source:
Returns:
  • An array of submatrices.
Type
Array

(static) join(params) → {Array}

Joins chunks of data together.

Parameters:
Name Type Description
params object

The parameters for joining the chunks.

Properties
Name Type Description
chunks Array

An array of chunks to join.

Source:
Returns:
  • The joined array of chunks.
Type
Array

(static) main(name, data) → {*}

Runs a specific split function based on the provided name and data.

Parameters:
Name Type Description
name string

The name of the split function to run.

data *

The data to pass to the split function.

Source:
Throws:
  • If the split function is not found.
Type
NotImplemented
Returns:
  • The result of the split function.
Type
*

(static) split1DArray(params) → {Array}

Splits a 1D array into N different chunks.

Parameters:
Name Type Description
params object

The parameters for splitting the array.

Properties
Name Type Description
data Array

The 1D array of data.

n number

The number of chunks to create.

Source:
Returns:
  • An array of chunks.
Type
Array

(static) splitMatrix(params) → {Array}

Splits a matrix into two submatrices.

Parameters:
Name Type Description
params object

The parameters for splitting the matrix.

Properties
Name Type Description
data Array

The matrix to split.

n number

The number of rows for the first submatrix.

m number

The number of columns for the first submatrix.

Source:
Returns:
  • An array containing the two submatrices.
Type
Array

(static) splitmDArray(params) → {Array}

Splits each array from a 2D matrix into N different chunks.

Parameters:
Name Type Description
params object

The parameters for splitting the matrix.

Properties
Name Type Description
data Array

The 2D matrix of data.

n number

The number of chunks to create.

Source:
Returns:
  • An array of chunks.
Type
Array