Click or drag to resize

SparseMatrixBuilderT Class

Class SparseMatrixBuilder{T} serves as the base class for the sparse matrix builder classes of specific types. This class implements the interface System.Collections.Generic.IDictionary{IntPair,T}, providing matrix-like row/column indexing for setting and retrieving values. Only nonzero values are stored.
Inheritance Hierarchy
SystemObject
  CenterSpace.NMath.CoreSparseMatrixBuilderT

Namespace:  CenterSpace.NMath.Core
Assembly:  NMath (in NMath.dll) Version: 7.3
Syntax
[SerializableAttribute]
public class SparseMatrixBuilder<T> : ICloneable, 
	IDictionary<IntPair, T>, ICollection<KeyValuePair<IntPair, T>>, 
	IEnumerable<KeyValuePair<IntPair, T>>, IEnumerable
where T : new()

Type Parameters

T
Data type of the sparse matrix values.

The SparseMatrixBuilderT type exposes the following members.

Constructors
Properties
  NameDescription
Public propertyCount
Gets the number of stored nonzero values.
Public propertyIsReadOnly
Gets a value indicating whether collection is read-only.
Public propertyItemIntPair
Gets and sets the value at the row, column indices specifed in the key.
Public propertyItemInt32, Int32
Returns the values stored at the specified zero-based row and column indices. Note that even though only nonzero values are stored, the indexer will always return a value. If there is no value associated with the given indices, zero is returned.
Public propertyKeys
Gets a collection of the the row, column pairs with nonzero values.
Public propertyNumberNonZero
Gets the number of nonzero stored values.
Public propertyValues
Gets a collection of all the nonzero values.
Top
Methods
  NameDescription
Public methodAdd(KeyValuePairIntPair, T)
Adds the given value at the given row, column indices.
Public methodAdd(IntPair, T)
Adds the given value at the row, column indices specified by the IntPair argument.
Public methodClear
Clears all stored nonzero values.
Public methodClone
Constructs a deep copy of self.
Public methodContains
Determines if the collection contains a specified value at at specified row, column indices.
Public methodContainsKey
Method for determining if there is a nonzero value at the row, column indices specified by the given key.
Public methodCopyTo
Copies the nonzero values to an Array, starting at a particular Array index.
Public methodGetEnumerator
Returns an enumerator that iterates through the collection of nonzero values.
Public methodRemove(IntPair)
Removes a value at the specified row, column indices.
Public methodRemove(KeyValuePairIntPair, T)
Removes the specified value at the specified row, column indices.
Public methodRemove(Int32, Int32)
Removes a value at the specified row, column indices.
Public methodTryGetValue
Get the value at the specified row, column index pair.
Top
Fields
  NameDescription
Protected fieldnonzeroValues_
The Non-zero sparse matrix values.
Protected fieldStatic memberZERO
The zero value for type T.
Top
See Also