SparseMatrix Class |
Namespace: Imsl.Math
The SparseMatrix type exposes the following members.
Name | Description | |
---|---|---|
SparseMatrix(SparseMatrix) |
Creates a new instance of SparseMatrix which is a copy of another SparseMatrix object.
| |
SparseMatrix(SparseMatrixSparseArray) |
Constructs a sparse matrix from a SparseArray.
| |
SparseMatrix(Int32, Int32) |
Creates a new instance of SparseMatrix. Initially this is the
zero matrix.
| |
SparseMatrix(Int32, Int32, Int32, Double) |
Constructs a sparse matrix from SparseArray data.
|
Name | Description | |
---|---|---|
Add |
Performs element-wise addition of two real sparse matrices
A, B of type SparseMatrix,
| |
CheckSquareMatrix |
Check that the matrix is square.
| |
Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.) | |
Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) | |
FrobeniusNorm |
Returns the Frobenius norm of the matrix.
| |
Get |
Returns the value of an element in the matrix.
| |
GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
InfinityNorm |
Returns the infinity norm of the matrix.
| |
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | |
Multiply(Double) |
Multiply the matrix by a vector.
| |
Multiply(Double, SparseMatrix) |
Multiply row array x and sparse matrix A,
.
| |
Multiply(SparseMatrix, SparseMatrix) |
Multiply two sparse matrices, .
| |
Multiply(SparseMatrix, Double) |
Multiply sparse matrix A and column array x,
.
| |
MultiplySymmetric |
Multiply sparse symmetric matrix A and column vector x.
| |
OneNorm |
Returns the matrix one norm of the sparse matrix.
| |
PlusEquals |
Adds a value to an element in the matrix.
| |
Set |
Sets the value of an element in the matrix.
| |
ToDenseMatrix |
Returns the sparse matrix as a dense matrix.
| |
ToSparseArray |
Returns the sparse matrix in the SparseArray form.
| |
ToString | Returns a string that represents the current object. (Inherited from Object.) | |
Transpose |
Returns the transpose of the matrix.
|
Name | Description | |
---|---|---|
NumberOfColumns |
The number of columns in the matrix.
| |
NumberOfNonZeros |
The number of nonzeros in the matrix.
| |
NumberOfRows |
The number of rows in the matrix.
|
A SparseMatrix can be constructed from a set of arrays, or it can be abstractly created as an empty array and then incrementally built into final form. It is usually easier to create an empty SparseMatrix of a set size and then use the Set method to set the elements of the array. When setting the elements of the sparse array, their positions should be thought of as their positions in the dense array. Elements can be set in any order, but only the elements actually set are stored.
This class includes methods to update the sparse matrix. There are also methods to multiply a sparse matrix and a vector or to multiply two sparse matrices. To solve a sparse linear system use SparseCholesky or SuperLU.