Namespaces

Types in MathNet.Numerics.LinearAlgebra.Storage

Type SparseCompressedRowMatrixStorage<T>

Namespace MathNet.Numerics.LinearAlgebra.Storage

Parent MatrixStorage<T>

Static Functions

Methods

Properties

Fields

Public Static Functions

SparseCompressedRowMatrixStorage<T> OfArray(T[,] array)

SparseCompressedRowMatrixStorage<T> OfColumnArrays(T[][] data)

SparseCompressedRowMatrixStorage<T> OfColumnEnumerables(int rows, int columns, IEnumerable<IEnumerable<T>> data)

SparseCompressedRowMatrixStorage<T> OfColumnMajorList(int rows, int columns, IList<T> data)

SparseCompressedRowMatrixStorage<T> OfColumnVectors(VectorStorage`1[] data)

SparseCompressedRowMatrixStorage<T> OfCompressedSparseColumnFormat(int rows, int columns, int valueCount, Int32[] rowIndices, Int32[] columnPointers, T[] values)

Create a new sparse matrix storage from a compressed sparse column (CSC) format. This new storage will be independent from the given arrays. A new memory block will be allocated.
Duplicate entries will be summed together and explicit zeros will be not intentionally removed.
Parameters
int rows

The number of rows.

int columns

The number of columns.

int valueCount

The number of stored values including explicit zeros.

Int32[] rowIndices

The row index array of the compressed sparse column format.

Int32[] columnPointers

The column pointer array of the compressed sparse column format.

T[] values

The data array of the compressed sparse column format.

Return
SparseCompressedRowMatrixStorage<T>

The sparse storage from the compressed sparse column format.

SparseCompressedRowMatrixStorage<T> OfCompressedSparseRowFormat(int rows, int columns, int valueCount, Int32[] rowPointers, Int32[] columnIndices, T[] values)

Create a new sparse storage from a compressed sparse row (CSR) format. This new storage will be independent from the given arrays. A new memory block will be allocated for storing the matrix.
Duplicate entries will be summed together and explicit zeros will be not intentionally removed.
Parameters
int rows

The number of rows.

int columns

The number of columns.

int valueCount

The number of stored values including explicit zeros.

Int32[] rowPointers

The row pointer array of the compressed sparse row format.

Int32[] columnIndices

The column index array of the compressed sparse row format.

T[] values

The data array of the compressed sparse row format.

Return
SparseCompressedRowMatrixStorage<T>

The sparse storage from the compressed sparse row format.

SparseCompressedRowMatrixStorage<T> OfCoordinateFormat(int rows, int columns, int valueCount, Int32[] rowIndices, Int32[] columnIndices, T[] values)

Create a new sparse storage from a coordinate (COO) format. This new storage will be independent from the given arrays. A new memory block will be allocated for storing the matrix.
Duplicate entries will be summed together and explicit zeros will be not intentionally removed.
Parameters
int rows

The number of rows.

int columns

The number of columns.

int valueCount

The number of stored values including explicit zeros.

Int32[] rowIndices

The row index array of the coordinate format.

Int32[] columnIndices

The column index array of the coordinate format.

T[] values

The data array of the coordinate format.

Return
SparseCompressedRowMatrixStorage<T>

The sparse storage from the coordinate format.

SparseCompressedRowMatrixStorage<T> OfDiagonalInit(int rows, int columns, Func<int, T> init)

SparseCompressedRowMatrixStorage<T> OfIndexedEnumerable(int rows, int columns, IEnumerable<Tuple<int, int, T>> data)

SparseCompressedRowMatrixStorage<T> OfInit(int rows, int columns, Func<int, int, T> init)

SparseCompressedRowMatrixStorage<T> OfMatrix(MatrixStorage<T> matrix)

SparseCompressedRowMatrixStorage<T> OfRowArrays(T[][] data)

SparseCompressedRowMatrixStorage<T> OfRowEnumerables(int rows, int columns, IEnumerable<IEnumerable<T>> data)

SparseCompressedRowMatrixStorage<T> OfRowMajorEnumerable(int rows, int columns, IEnumerable<T> data)

SparseCompressedRowMatrixStorage<T> OfRowVectors(VectorStorage`1[] data)

SparseCompressedRowMatrixStorage<T> OfValue(int rows, int columns, T value)

Public Methods

T[,] AsArray()

T[][] AsColumnArrays()

T[] AsColumnMajorArray()

T[][] AsRowArrays()

T[] AsRowMajorArray()

T At(int row, int column)

Retrieves the requested element without range checking.
Not range-checked.
Parameters
int row

The row of the element.

int column

The column of the element.

Return
T

The requested element.

void At(int row, int column, T value)

Sets the element without range checking.
WARNING: This method is not thread safe. Use "lock" with it and be sure to avoid deadlocks.
Parameters
int row

The row of the element.

int column

The column of the element.

T value

The value to set the element to.

void Clear(int rowIndex, int rowCount, int columnIndex, int columnCount)

void Clear()

void ClearColumns(Int32[] columnIndices)

void ClearRows(Int32[] rowIndices)

void CopyColumnTo(VectorStorage<T> target, int columnIndex, ExistingData existingData)

void CopyRowTo(VectorStorage<T> target, int rowIndex, ExistingData existingData)

void CopySubColumnTo(VectorStorage<T> target, int columnIndex, int sourceRowIndex, int targetRowIndex, int rowCount, ExistingData existingData)

void CopySubMatrixTo(MatrixStorage<T> target, int sourceRowIndex, int targetRowIndex, int rowCount, int sourceColumnIndex, int targetColumnIndex, int columnCount, ExistingData existingData)

void CopySubRowTo(VectorStorage<T> target, int rowIndex, int sourceColumnIndex, int targetColumnIndex, int columnCount, ExistingData existingData)

void CopyTo(MatrixStorage<T> target, ExistingData existingData)

IEnumerable<T> Enumerate()

IEnumerable<ValueTuple<int, int, T>> EnumerateIndexed()

IEnumerable<T> EnumerateNonZero()

IEnumerable<ValueTuple<int, int, T>> EnumerateNonZeroIndexed()

bool Equals(object obj)

Determines whether the specified Object is equal to the current Object.
Parameters
object obj

The Object to compare with the current Object.

Return
bool

true if the specified Object is equal to the current Object ; otherwise, false.

bool Equals(MatrixStorage<T> other)

Indicates whether the current object is equal to another object of the same type.
Parameters
MatrixStorage<T> other

An object to compare with this object.

Return
bool

true if the current object is equal to the other parameter; otherwise, false.

Tuple<int, int, T> Find(Func<T, bool> predicate, Zeros zeros)

Tuple<int, int, T, TOther> Find2<TOther>(MatrixStorage<T> other, Func<T, TOther, bool> predicate, Zeros zeros)

int FindItem(int row, int column)

Find item Index in nonZeroValues array
WARNING: This method is not thread safe. Use "lock" with it and be sure to avoid deadlocks
Parameters
int row

Matrix row index

int column

Matrix column index

Return
int

Item index

TState Fold2<TOther, TState>(MatrixStorage<T> other, Func<TState, T, TOther, TState> f, TState state, Zeros zeros)

void FoldByColumn<TU>(TU[] target, Func<TU, T, TU> f, Func<TU, int, TU> finalize, TU[] state, Zeros zeros)

The state array will not be modified, unless it is the same instance as the target array (which is allowed).

void FoldByRow<TU>(TU[] target, Func<TU, T, TU> f, Func<TU, int, TU> finalize, TU[] state, Zeros zeros)

The state array will not be modified, unless it is the same instance as the target array (which is allowed).

int GetHashCode()

Returns a hash code for this instance.
Return
int

A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.

Type GetType()

bool IsMutableAt(int row, int column)

True if the specified field can be set to any value. False if the field is fixed, like an off-diagonal field on a diagonal matrix.

void Map2To(MatrixStorage<T> target, MatrixStorage<T> other, Func<T, T, T> f, Zeros zeros, ExistingData existingData)

void MapIndexedInplace(Func<int, int, T, T> f, Zeros zeros)

void MapIndexedTo<TU>(MatrixStorage<T> target, Func<int, int, T, TU> f, Zeros zeros, ExistingData existingData)

void MapInplace(Func<T, T> f, Zeros zeros)

void MapSubMatrixIndexedTo<TU>(MatrixStorage<T> target, Func<int, int, T, TU> f, int sourceRowIndex, int targetRowIndex, int rowCount, int sourceColumnIndex, int targetColumnIndex, int columnCount, Zeros zeros, ExistingData existingData)

void MapTo<TU>(MatrixStorage<T> target, Func<T, TU> f, Zeros zeros, ExistingData existingData)

void Normalize()

void NormalizeDuplicates()

Eliminate duplicate entries by adding them together.

void NormalizeOrdering()

void NormalizeZeros()

void PopulateExplicitZerosOnDiagonal()

Fill zeros explicitly on the diagonal entries as required by the Intel MKL direct sparse solver.

T[,] ToArray()

T[][] ToColumnArrays()

T[] ToColumnMajorArray()

T[][] ToRowArrays()

T[] ToRowMajorArray()

string ToString()

void TransposeTo(MatrixStorage<T> target, ExistingData existingData)

Public Properties

bool IsDense get;

True if the matrix storage format is dense.

bool IsFullyMutable get;

True if all fields of this matrix can be set to any value. False if some fields are fixed, like on a diagonal matrix.

T Item get; set;

int ValueCount get;

Gets the number of non zero elements in the matrix.
Value:

Public fields

Int32[] RowPointers

The array containing the row indices of the existing rows. Element "i" of the array gives the index of the element in the Values array that is first non-zero element in a row "i". The last value is equal to ValueCount, so that the number of non-zero entries in row "i" is always given by RowPointers[i+i] - RowPointers[i]. This array thus has length RowCount+1.
return Int32[]

Int32[] ColumnIndices

An array containing the column indices of the non-zero values. Element "j" of the array is the number of the column in matrix that contains the j-th value in the Values array.
return Int32[]

T[] Values

Array that contains the non-zero elements of matrix. Values of the non-zero elements of matrix are mapped into the values array using the row-major storage mapping described in a compressed sparse row (CSR) format.
return T[]

int RowCount

return int

int ColumnCount

return int