Click or drag to resize
SparseMatrix Class
A general real sparse matrix intended to be efficiently and easily updated.
Inheritance Hierarchy
SystemObject
  Imsl.MathSparseMatrix

Namespace: Imsl.Math
Assembly: ImslCS (in ImslCS.dll) Version: 6.5.2.0
Syntax
[SerializableAttribute]
public class SparseMatrix

The SparseMatrix type exposes the following members.

Constructors
Methods
  NameDescription
Public methodStatic memberAdd
Performs element-wise addition of two real sparse matrices A, B of type SparseMatrix,  C \leftarrow \alpha A + \beta B.
Public methodCheckSquareMatrix
Check that the matrix is square.
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodFrobeniusNorm
Returns the Frobenius norm of the matrix.
Public methodGet
Returns the value of an element in the matrix.
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodInfinityNorm
Returns the infinity norm of the matrix.
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodMultiply(Double)
Multiply the matrix by a vector.
Public methodStatic memberMultiply(Double, SparseMatrix)
Multiply row array x and sparse matrix A, x^TA .
Public methodStatic memberMultiply(SparseMatrix, SparseMatrix)
Multiply two sparse matrices,  C \leftarrow AB.
Public methodStatic memberMultiply(SparseMatrix, Double)
Multiply sparse matrix A and column array x, A x.
Public methodStatic memberMultiplySymmetric
Multiply sparse symmetric matrix A and column vector x.
Public methodOneNorm
Returns the matrix one norm of the sparse matrix.
Public methodPlusEquals
Adds a value to an element in the matrix.
Public methodSet
Sets the value of an element in the matrix.
Public methodToDenseMatrix
Returns the sparse matrix as a dense matrix.
Public methodToSparseArray
Returns the sparse matrix in the SparseArray form.
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Public methodTranspose
Returns the transpose of the matrix.
Top
Properties
  NameDescription
Public propertyNumberOfColumns
The number of columns in the matrix.
Public propertyNumberOfNonZeros
The number of nonzeros in the matrix.
Public propertyNumberOfRows
The number of rows in the matrix.
Top
Remarks

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.

See Also