DenseMatrix

DenseMatrix

Dense matrix of numbers. Not really a Bioconductor-exclusive data structure, but we need this at a minimum for the SummarizedExperiment to be useful.

Constructors of DataFrame subclasses should be callable with no arguments, possibly creating an empty object with no properties. This will be used by the _bioconductor_CLONE, _bioconductor_COMBINE_ROWS, _bioconductor_COMBINE_COLUMNS and _bioconductor_SLICE_2D methods to return an instance of the subclass.

Constructor

new DenseMatrix(numberOfRows, numberOfColumns, values, optionsopt)

Source:
Parameters:
Name Type Attributes Default Description
numberOfRows number

Number of rows, duh.

numberOfColumns number

Number of columns.

values TypedArray

1-dimensional array of the matrix contents. This should have length equal to the product of numberOfRows and numberOfColumns.

options Object <optional>
{}

Optional parameters.

Properties
Name Type Attributes Default Description
columnMajor boolean <optional>
true

Whether values represents a column-major layout.

Classes

DenseMatrix

Methods

column(i, optionsopt) → {TypedArray}

Source:

Retrieve the contents of a particular column.

Parameters:
Name Type Attributes Default Description
i number

Index of the column of interest.

options Object <optional>
{}

Optional parameters.

Properties
Name Type Attributes Default Description
allowView boolean <optional>
false

Whether to allow a view to be returned, if possible.

Returns:

Contents of the column i. This may be a view on the array returned by values, if permitted by the layout.

Type
TypedArray

isColumnMajor() → {boolean}

Source:
Returns:

Whether the matrix is column-major.

Type
boolean

numberOfColumns() → {number}

Source:
Returns:

Number of columns.

Type
number

numberOfRows() → {number}

Source:
Returns:

Number of rows.

Type
number

row(i, optionsopt) → {TypedArray}

Source:

Retrieve the contents of a particular row.

Parameters:
Name Type Attributes Default Description
i number

Index of the row of interest.

options Object <optional>
{}

Optional parameters.

Properties
Name Type Attributes Default Description
allowView boolean <optional>
false

Whether to allow a view to be returned, if possible.

Returns:

Contents of the row i. This may be a view on the array returned by values, if permitted by the layout.

Type
TypedArray

setColumn(i, values, optionsopt) → {DenseMatrix}

Source:
Parameters:
Name Type Attributes Default Description
i number

Column index to set.

values TypedArray

Column contents, of length equal to the number of rows in this DenseMatrix.

options Object <optional>
{}

Optional parameters.

Properties
Name Type Attributes Default Description
inPlace boolean <optional>
false

Whether to mutate this DenseMatrix instance in place. If false, a new instance is returned.

Returns:

The DenseMatrix after modifying the matrix contents. If inPlace = true, this is a reference to the current instance, otherwise a new instance is created and returned.

Type
DenseMatrix

setRow(i, values, optionsopt) → {DenseMatrix}

Source:
Parameters:
Name Type Attributes Default Description
i number

Row index to set.

values TypedArray

Row contents, of length equal to the number of columns in this DenseMatrix.

options Object <optional>
{}

Optional parameters.

Properties
Name Type Attributes Default Description
inPlace boolean <optional>
false

Whether to mutate this DenseMatrix instance in place. If false, a new instance is returned.

Returns:

The DenseMatrix after modifying the matrix contents. If inPlace = true, this is a reference to the current instance, otherwise a new instance is created and returned.

Type
DenseMatrix

setValues(values, optionsopt) → {DenseMatrix}

Source:
Parameters:
Name Type Attributes Default Description
values TypedArray

1-dimensional array of matrix contents, of the same length as the array returned by values.

options Object <optional>
{}

Optional parameters.

Properties
Name Type Attributes Default Description
inPlace boolean <optional>
false

Whether to mutate this DenseMatrix instance in place. If false, a new instance is returned.

Returns:

The DenseMatrix after modifying the matrix contents. If inPlace = true, this is a reference to the current instance, otherwise a new instance is created and returned.

Type
DenseMatrix

values() → {TypedArray}

Source:
Returns:

Matrix contents as a 1-dimensional array.

Type
TypedArray