Interface ISparseMatrix<T>
Describes a sparse matrix that return elements that have links to neighboring non-zero elements.
Inherited Members
Namespace: SpiceSharp.Algebra
Assembly: SpiceSharp.dll
Syntax
public interface ISparseMatrix<T> : IMatrix<T>
Type Parameters
Name | Description |
---|---|
T |
Properties
ElementCount
Gets the number of elements in the matrix.
Declaration
int ElementCount { get; }
Property Value
Type | Description |
---|---|
int | The element count. |
Methods
FindDiagonalElement(int)
Finds the ISparseMatrixElement<T> on the diagonal.
Declaration
ISparseMatrixElement<T> FindDiagonalElement(int index)
Parameters
Type | Name | Description |
---|---|---|
int | index | The index. |
Returns
Type | Description |
---|---|
ISparseMatrixElement<T> | The matrix element if it exists; otherwise |
Exceptions
Type | Condition |
---|---|
ArgumentOutOfRangeException | Thrown if |
FindElement(MatrixLocation)
Finds a pointer to the matrix element at the specified row and column. If
the element doesn't exist, null
is returned.
Declaration
Element<T> FindElement(MatrixLocation location)
Parameters
Type | Name | Description |
---|---|---|
MatrixLocation | location | The matrix location. |
Returns
Type | Description |
---|---|
Element<T> | The matrix element if it exists; otherwise |
GetElement(MatrixLocation)
Gets a pointer to the matrix element at the specified row and column. If the element doesn't exist, it is created.
Declaration
Element<T> GetElement(MatrixLocation location)
Parameters
Type | Name | Description |
---|---|---|
MatrixLocation | location | The matrix location. |
Returns
Type | Description |
---|---|
Element<T> | The matrix element. |
GetFirstInColumn(int)
Gets the first non-default ISparseMatrixElement<T> in the specified column.
Declaration
ISparseMatrixElement<T> GetFirstInColumn(int column)
Parameters
Type | Name | Description |
---|---|---|
int | column | The column index. |
Returns
Type | Description |
---|---|
ISparseMatrixElement<T> | The matrix element. |
Exceptions
Type | Condition |
---|---|
ArgumentOutOfRangeException | Thrown if |
GetFirstInRow(int)
Gets the first non-default ISparseMatrixElement<T> in the specified row.
Declaration
ISparseMatrixElement<T> GetFirstInRow(int row)
Parameters
Type | Name | Description |
---|---|---|
int | row | The row index. |
Returns
Type | Description |
---|---|
ISparseMatrixElement<T> | The matrix element. |
Exceptions
Type | Condition |
---|---|
ArgumentOutOfRangeException | Thrown if |
GetLastInColumn(int)
Gets the last non-default ISparseMatrixElement<T> in the specified column.
Declaration
ISparseMatrixElement<T> GetLastInColumn(int column)
Parameters
Type | Name | Description |
---|---|---|
int | column | The column index. |
Returns
Type | Description |
---|---|
ISparseMatrixElement<T> | The matrix element. |
Exceptions
Type | Condition |
---|---|
ArgumentOutOfRangeException | Thrown if |
GetLastInRow(int)
Gets the last non-default ISparseMatrixElement<T> in the specified row.
Declaration
ISparseMatrixElement<T> GetLastInRow(int row)
Parameters
Type | Name | Description |
---|---|---|
int | row | The row index. |
Returns
Type | Description |
---|---|
ISparseMatrixElement<T> | The matrix element. |
Exceptions
Type | Condition |
---|---|
ArgumentOutOfRangeException | Thrown if |
RemoveElement(MatrixLocation)
Removes a matrix element at the specified row and column. If the element
doesn't exist, this method returns false
.
Declaration
bool RemoveElement(MatrixLocation location)
Parameters
Type | Name | Description |
---|---|---|
MatrixLocation | location | The location. |
Returns
Type | Description |
---|---|
bool |
|