SparseDoubleMatrix Type

Sparse matrix class

Constructors

Constructor Description

SparseDoubleMatrix(numberOfRows, numberOfColumns)

Full Usage: SparseDoubleMatrix(numberOfRows, numberOfColumns)

Parameters:
    numberOfRows : int - Number of rows
    numberOfColumns : int - Number of columns

Constructor for SparseMatrix class

numberOfRows : int

Number of rows

numberOfColumns : int

Number of columns

SparseDoubleMatrix(m, n, matrixItems, matrixIndices, _count)

Full Usage: SparseDoubleMatrix(m, n, matrixItems, matrixIndices, _count)

Parameters:
    m : int
    n : int
    matrixItems : float[][]
    matrixIndices : int[][]
    _count : int[]

m : int
n : int
matrixItems : float[][]
matrixIndices : int[][]
_count : int[]

Instance members

Instance member Description

this.Clear

Full Usage: this.Clear

Sets all elements of the sparse matrix to zero.

this.Clone

Full Usage: this.Clone

Returns: SparseDoubleMatrix

Returns: SparseDoubleMatrix

this.ColumnCount

Full Usage: this.ColumnCount

Returns: int n, the number of columns.
Modifiers: abstract

Get column dimension.

Returns: int

n, the number of columns.

this.Count

Full Usage: this.Count

Returns: int[]

Returns: int[]

this.DenseMatrix

Full Usage: this.DenseMatrix

Returns: DoubleMatrix A matrix equivalent

Dense version of a sparse matrix

Returns: DoubleMatrix

A matrix equivalent

this.GetIndicesOfRow

Full Usage: this.GetIndicesOfRow

Parameters:
    row : int -

Returns: int[]

Get the valid indices for a given row.

row : int

Returns: int[]

this.GetRow

Full Usage: this.GetRow

Parameters:
    i : int - Row index

Returns: SparseDoubleVector The ith row as a SparseVector

Accessor method for ith row

i : int

Row index

Returns: SparseDoubleVector

The ith row as a SparseVector

this.IsBandMatrix

Full Usage: this.IsBandMatrix

Returns: bool * int * int

Determines whether this sparse matrix is a band matrix, and determines the lower and upper band width.

Returns: bool * int * int

this.IsLowerTriangular

Full Usage: this.IsLowerTriangular

Returns: bool true or false

Check if the current matrix is lower triangular

Returns: bool

true or false

this.[arg1, arg2]

Full Usage: this.[arg1, arg2]

Parameters:
    arg0 : int

Returns: int (i,j)th element
Modifiers: abstract

Accessor method for (i,j)th element

arg0 : int
Returns: int

(i,j)th element

this.MapSparseIncludingDiagonal

Full Usage: this.MapSparseIncludingDiagonal

Parameters:
    f : Func<float, int, int, float> - The mapping function. First arg is the element of the source matrix, 2nd arg is the row, 3rd arg the column number.
    result : SparseDoubleMatrix - The resulting sparse matrix.

Maps the present elements of this matrix (and additionally the diagonal elements, independently if they are present or not), via a evaluation function to a resulting sparse matrix.

f : Func<float, int, int, float>

The mapping function. First arg is the element of the source matrix, 2nd arg is the row, 3rd arg the column number.

result : SparseDoubleMatrix

The resulting sparse matrix.

this.Mul

Full Usage: this.Mul

Parameters:
    s : float - Scaling factor

Returns: SparseDoubleMatrix Scaled sparse matrix

Matrix multiplication by a scalar

s : float

Scaling factor

Returns: SparseDoubleMatrix

Scaled sparse matrix

this.RowCount

Full Usage: this.RowCount

Returns: int m, the number of rows
Modifiers: abstract

Get row dimension.

Returns: int

m, the number of rows

this.ScaleRow

Full Usage: this.ScaleRow

Parameters:
    i : int - Index of the row to be scaled
    j1 : int - Lowest column entry to scale
    j2 : int - High column entry to scale
    sf : float - Scale factor

Method to rescale a row of a Sparse Matrix

i : int

Index of the row to be scaled

j1 : int

Lowest column entry to scale

j2 : int

High column entry to scale

sf : float

Scale factor

this.SetRow

Full Usage: this.SetRow

Parameters:

i : int
value : SparseDoubleVector

this.SolveLower

Full Usage: this.SolveLower

Parameters:
Returns: DoubleVector

Forward substitution routine for solving Lx = b, where L is a lower-triangular matrix

b : IReadOnlyList<float>

Returns: DoubleVector

this.SwitchRows

Full Usage: this.SwitchRows

Parameters:
    i : int
    j : int

Switch rows of a sparse matrix

i : int
j : int

this.Transpose

Full Usage: this.Transpose

Returns: SparseDoubleMatrix New matrix that is the transposed of the original.

Tranpose of sparse matrix

Returns: SparseDoubleMatrix

New matrix that is the transposed of the original.

this.minus B

Full Usage: this.minus B

Parameters:
Returns: SparseDoubleMatrix The result A - B

Matrix subtraction for a sparse matrix

B : SparseDoubleMatrix

The matrix to subtract

Returns: SparseDoubleMatrix

The result A - B

this.plus B

Full Usage: this.plus B

Parameters:
Returns: SparseDoubleMatrix The result A + B

Matrix addition for a sparse matrix

B : SparseDoubleMatrix

The matrix to add

Returns: SparseDoubleMatrix

The result A + B

this.times v

Full Usage: this.times v

Parameters:
Returns: DoubleVector

Matrix multiplication

v : IReadOnlyList<float>

Vector

Returns: DoubleVector

this.times s

Full Usage: this.times s

Parameters:
    s : float - Scalar

Returns: SparseDoubleMatrix Scaled sparse matrix

Matrix multiplication by a scalar

s : float

Scalar

Returns: SparseDoubleMatrix

Scaled sparse matrix

this.times B

Full Usage: this.times B

Parameters:
Returns: SparseDoubleMatrix A * B where A is current sparce matrix

Matrix right multiplication by a matrix

B : SparseDoubleMatrix

Scaling factor

Returns: SparseDoubleMatrix

A * B where A is current sparce matrix

this.timesRight v

Full Usage: this.timesRight v

Parameters:
Returns: DoubleVector y

Matrix multiplication, y = v * A

v : IReadOnlyList<float>

Vector

Returns: DoubleVector

y

Static members

Static member Description

m * v

Full Usage: m * v

Parameters:
Returns: DoubleVector

Matrix multiplication

m : SparseDoubleMatrix

v : IReadOnlyList<float>

Vector

Returns: DoubleVector

v * m

Full Usage: v * m

Parameters:
Returns: DoubleVector

Matrix multiplication

v : IReadOnlyList<float>

Vector

m : SparseDoubleMatrix

Returns: DoubleVector

A * s

Full Usage: A * s

Parameters:
Returns: SparseDoubleMatrix Scaled sparse matrix

Matrix multiplication by a scalar

A : SparseDoubleMatrix

Sparse Matrix

s : float

Scalar

Returns: SparseDoubleMatrix

Scaled sparse matrix

A * B

Full Usage: A * B

Parameters:
Returns: SparseDoubleMatrix

A : SparseDoubleMatrix
B : SparseDoubleMatrix
Returns: SparseDoubleMatrix

A + B

Full Usage: A + B

Parameters:
Returns: SparseDoubleMatrix A + B

C = A + B

A : SparseDoubleMatrix

first matrix

B : SparseDoubleMatrix

another matrix

Returns: SparseDoubleMatrix

A + B

A - B

Full Usage: A - B

Parameters:
Returns: SparseDoubleMatrix The result A - B

Matrix subtraction for a sparse matrix

A : SparseDoubleMatrix

The matrix from which to subtract

B : SparseDoubleMatrix

The matrix to subtract

Returns: SparseDoubleMatrix

The result A - B

SparseDoubleMatrix.Identity(m, n)

Full Usage: SparseDoubleMatrix.Identity(m, n)

Parameters:
    m : int - Row dimension
    n : int - Column dimension

Returns: SparseDoubleMatrix An m x n sparse identity matrix

Identity matrix in sparse form

m : int

Row dimension

n : int

Column dimension

Returns: SparseDoubleMatrix

An m x n sparse identity matrix