Classes
Methods
(static) createDenseMatrix(rows, columns, contents, optionsopt) → {ScranMatrix}
- Source:
Create a dense matrix from an existing Wasm-allocated buffer.
Parameters:
Name | Type | Attributes | Default | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
rows |
number | Number of rows. |
|||||||||||||||||
columns |
number | Number of columns. |
|||||||||||||||||
contents |
Float64WasmArray | Array of matrix contents. |
|||||||||||||||||
options |
object |
<optional> |
{}
|
Optional parameters. Properties
|
Returns:
A ScranMatrix containing the matrix contents.
- Type
- ScranMatrix
clone() → {ScranMatrix}
- Source:
Returns:
A clone of the current ScranMatrix instance. This can be freed independently of the current instance.
- Type
- ScranMatrix
column(i, optionsopt) → {Float64Array}
- Source:
Parameters:
Name | Type | Attributes | Default | Description | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
i |
number | Index of the column to extract.
This should be a non-negative integer less than |
||||||||||||
options |
object |
<optional> |
{}
|
Optional parameters. Properties
|
Returns:
An array containing the contents of column i
.
If buffer
was supplied, the returned array is a view into it.
Note that this may be invalidated on the next allocation on the Wasm heap.
- Type
- Float64Array
free()
- Source:
Free the memory on the Wasm heap for this.#matrix. This invalidates this object and all of its references.
isSparse() → {boolean}
- Source:
Returns:
Whether the matrix is sparse.
- Type
- boolean
numberOfColumns() → {number}
- Source:
Returns:
Number of columns in the matrix.
- Type
- number
numberOfRows() → {number}
- Source:
Returns:
Number of rows in the matrix.
- Type
- number
row(i, optionsopt) → {Float64Array}
- Source:
Parameters:
Name | Type | Attributes | Default | Description | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
i |
number | Index of the row to extract.
This should be a non-negative integer less than |
||||||||||||
options |
object |
<optional> |
{}
|
Optional parameters. Properties
|
Returns:
An array containing the contents of row i
.
If buffer
was supplied, the returned array is a view into it.
Note that this may be invalidated on the next allocation on the Wasm heap.
- Type
- Float64Array