public class TSparseMtx : TMtxVec
Encapsulates sparse matrix properties and methods/operations.
The class encapsulates sparse matrix properties and methods/operations like sparse matrix addition, subtraction, multiplication, mixed operations with dense vectors and matrices, three types of sparse linear system solvers:
- Umfpack,
- Pardiso
- Iterative
The class also includes different matrix storage format conversion methods and more...
Properties
| Name | Type | Description |
|---|---|---|
| ActualIters | Int32 | Returns the number of actual iterations performed by Dew.Math.TSparseMtx.Solve. |
| AutoClearReport | Boolean | Defines if call to Solve will clear the report. |
| BackError | Double | Holds the backward or iterative stopping criteria. |
| BlockEnd | Boolean | Returns true, if the currrent subrange of the vector was also the last subrange in the vector. |
| CacheIndex | Int32 | For internal use only. Read to get the index of this object in object cache. |
| Capacity | Int64 | Sizing the object will not allocate less than Capacity. |
| CapacityInBytes | Int64 | Sizing the object will not allocate less than CapacityInBytes. |
| CapacityInElements | Int64 | Sizing the object will not allocate less than CapacityInElements. |
| CapacityStep | Double | Specifies increment step for the Capacity property. |
| Caption | String | Caption. |
| Cols | Int32 | Number of columns in the sparse matrix. |
| Complex | Boolean | Defines if object values are complex. |
| ConditionCheck | Boolean | Enables/disable inline condition checking. |
| ConvergenceCheck | TConvergenceCheck | Convergence criteria for iterative method. |
| CValue | TSparseCValue2D | Allows setting and getting complex values. |
| Dirty | Boolean | True after object property changes. |
| DontStripZeros | Boolean | Prevents zeros to be stripped. |
| First | Double | First element in object Values array. |
| Firstc | TCplx | First element in object CValues array. |
| FloatPrecision | TMtxFloatPrecision | Defines the precision (single, float) and type (real, complex) of the floating point operations. |
| IsDouble | Boolean | Defines the precision (single or double) of the floating point operations. |
| IsSubRange | Boolean | Set to true after the SetSubIndex or SetSubRange call. |
| IterativeMethod | TIterativeMethod | Defines the iterative method for solving system of equations. |
| Last | Double | Last element in object Values array. |
| Lastc | TCplx | Last complex element in object CValues array. |
| Length | Int32 | Defines the length in number of samples. |
| MaxIters | Int32 | Upper limit for number of iterations. |
| MtxError | String | Holds the error string, if an error has occurred. |
| NonZeros | Int32 | Defines the number of non-zero elements in the sparse matrix. |
| OnSetSize | TMtxNotifyEvent | Called when object size changes. |
| Pardiso | TPardisoSettings | The pardiso sparse solver settings. |
| PoolIndex | Int32 | Internal. |
| Precision | TPrecision | Defines the precision used by streaming routines. |
| RefinmentIters | Int32 | Defines number of refinement steps the Dew.Math.TSparseMtx.Solve method should try. |
| ReportLevel | TReportLevel | Defines how detailed report will be printed. |
| Rounding | TRounding | Defines the rounding used by streaming routines. |
| Rows | Int32 | Number of rows in the sparse matrix. |
| SCValue | TSparseSCValue2D | Allows setting and getting single complex values. |
| SparseBlockSize | Int32 | The size of the block as used by UmfPack. |
| SparsePattern | TSparsePattern | Defines the pattern used when solving a system of linear equations. |
| SparseSolver | TSparseSolver | Specifies the sparse matrix solver to use. |
| SparseSystem | TSparseSystem | Defines the system to be solved by the Solve method. |
| SValue | TSparseSValue2D | Allows setting and getting single values. |
| Tag | Int32 | Stores an integer value as part of a TMtxVec object. |
| Taucs | TTaucsSettings | The Taucs sparse solver settings. |
| Tolerance | Double | Defines the tolerance for iterative method. |
| Value | TSparseValue2D | Allows setting and getting value at position Row and Col. |
| ValuesSerialization | String | Provides serializatin of object content. |
| VectorCount | Int32 | Defines maximum number of vectors used in some iterative methods. |
| ZeroTolerance | Double | The tolerance used by Dew.Math.TMtxVec.IsEqual. |
Methods
| Name | Description |
|---|---|
| Abs (4) | Absolute values. |
| Add (2) | Add the content of the calling sparse matrix to the dense matrix Y. |
| AddSplit (2) | Sums up the sparse matrix from its lower (LoweTriang) and upper triangle (UpperTriang). |
| Adjung | Adjungate operation. |
| ArcCos (4) | The inverse cosine. |
| ArcCosh (4) | Inverse hyperbolic cosine. |
| ArcCot (4) | Inverse cotangens. |
| ArcCoth (4) | Inverse hyperbolic cotangens. |
| ArcCsc (4) | Inverse cosecant. |
| ArcCsch (4) | Inverse hyperbolic cosecant. |
| ArcSec (4) | Inverse secant. |
| ArcSech (4) | Inverse hyperbolic secant. |
| ArcSin (4) | The inverse sine. |
| ArcSinh (4) | Inverse hyperbolic sine. |
| ArcTan (4) | Inverse tangens. |
| ArcTan2 (2) | Inverse tangens of Y/X. |
| ArcTanh (4) | Inverse hyperbolic tangens. |
| BandedToSparse | Converts banded matrix to modified compressed column sparse matrix format. |
| BinarySearch (2) | Finds a match for X in sorted object values using binary search. |
| BlockFinish | Deinitializes block processing before the final block is processed. |
| BlockInit (3) | Initializes block processing. |
| BlockNext | Obtains the next subrange of the data. |
| BlockSubRangeLevel | Returns the current subrange stack level used by block processing functions. |
| CartToPolar (2) | Converts elements from cartesian to polar coordinate form. |
| Cbrt (4) | The cube root. |
| CDataIndex | Returns an index pointing to element at Index for TCplx data. |
| Ceil (4) | Rounds towards positive infinity. |
| Clear | Sets vector size to zero. |
| CondDisable | Saves the current value of ConditionCheck property and sets it to false. |
| CondEnable | Sets the ConditionCheck property to whatever it was before the CondDisable was used. |
| Conj (4) | Conjugate. |
| ConjMul | Conjugate Sparse2 and matrix multiply it with Sparse1. |
| Copy (6) | Copies sparse matrix from Src to the calling object. |
| CopyFromArray (14) | Copies values from an array. |
| CopyTo (6) | Copies sparse matrix from Src to the calling object. |
| CopyToArray (14) | Copy values to an array. |
| Cos (4) | Cosine. |
| Cosh (4) | Hyperbolic cosine. |
| Cot (4) | Cotangens. |
| Coth (4) | Hyperbolic cotangens. |
| CplxToReal (2) | Split complex calling object in real and imaginary part. |
| Csc (4) | Cosecant. |
| Csch (4) | Hyperbolic cosecant. |
| DegToRad (4) | DegToRad converts degrees to radians. |
| DenseToSparse | Convert dense matrix to sparse matrix format. |
| Diag | Copies the kk-th diagonal of TSparseMtx to the Vec object. |
| DiagonalsCount | Calculates the number of diagonals above and below main diagonal. |
| DisableSelect | Prevents calls to Dew.Math.TMtxVecBase.Select. |
| DisableSubrange | Prevents calls to Dew.Math.TMtxVecBase.SetSubRange. |
| DivideElem | Divide individual elements of sparse matrices. |
| EigSym | Computes eigenvalues and eigenvectors for symmetric (hermitian) sparse matrix. |
| EigSymGen | Computes eigenvalues and eigenvectors for generalized symmetric (hermitian) sparse problem. |
| EigSymGenLargest | Computes generalized largest eigenvalues and eigenvectors for symmetric sparse matrix. |
| EigSymGenSmallest | Computes smallest generalized eigenvalues and eigenvectors for a symmetric sparse matrix. |
| EigSymLargest | Computes largest eigenvalues and eigenvectors for symmetric sparse matrix. |
| EigSymSmallest | Computes smallest eigenvalues and eigenvectors for a symmetric sparse matrix. |
| EnableSelect | Enables calls to Dew.Math.TMtxVecBase.Select. |
| EnableSubrange | Enables calls to Dew.Math.TMtxVecBase.SetSubRange. |
| Equal (2) | Compares two sparse matrices. |
| Erf (4) | Error functon of values. |
| Erfc (4) | Complementary error functon of values. |
| ErfcInv (4) | Calculates the inverse complementary error function for all calling object elements in-place. |
| ErfInv (4) | Inverse error functon of values. |
| Exp (4) | Exponent (e^). |
| Exp10 (4) | Exponent base 10 (10^). |
| Exp2 (4) | Exponent base 2 (2^). |
| ExpandSymmetric | Form a full symmetric matrix from upper half with diagonal included. |
| Expj (3) | A complex exponential e^(j*Omega)). |
| ExtendToComplex (3) | Extend Vec object to complex calling object. |
| Find (2) | Compare complex value X with all calling object elements. |
| FixAngle (4) | Sets angle in [-2PI,2PI]. |
| Flip (4) | Flips the real and imaginary part of complex numbers. |
| FlipConj (4) | Flips the real and imaginary part of complex numbers and conjugates the complex numbers. |
| Floor (4) | Rounds towards negative infinity. |
| Frac (4) | Fractional part of values. |
| FreeNumeric | Frees the numeric object used by the Umfpack. |
| FreePardiso | Frees the memory of the Pardiso solver. |
| FreeSymbolic | Frees the symbolic object used by the Umfpack. |
| FreeTaucs | Releases factorization stored by taucs. |
| FreeToCache | Frees the object. |
| GetObjectToByteArray | Copies object to an array of bytes. |
| GetSchema | Returns null. |
| ImagPart (2) | Gets the imaginary part of a complex object. |
| IntPower (2) | Calculate the power Base^(Exponent) for all Base object elements. |
| Inv (9) | The inverse matrix. |
| InvCbrt (4) | The inverse of cube root 1/(v)^1/3. |
| InvSqrt (4) | The inverse of square root 1/(v)^1/2. |
| IsEqual (8) | Compares complex Value with all calling object elements. |
| IsEqualSize | Compares matrix size. |
| IsPinned | Returns true of the working memory is pinned. |
| Ln (4) | Natural logarithm. |
| LoadFromFile | Reads the header information and the values array content from the file. |
| LoadFromMatrixMarketFile | Loads the matrix stored in a matrix market file format. |
| LoadFromStream | Save component to the .NET framework Stream. |
| Log10 (4) | Log base 10. |
| Log2 (4) | Log base 2. |
| LogN (4) | Log base N. |
| LowerTriangle | Extract lower part of the Mtx. |
| Mag (4) | Magnitude. |
| Mask (3) | Assigns Value at indexes of the calling object, at which aMask is different from 0. |
| MaskNot (3) | Assigns Value at indexes of the calling object, at which aMask is equal to 0. |
| Max | Maximum of all non-zero elements. |
| Maxc | Maximum of all non-zero complex elements. |
| Mean | Average of all non-zero elements. |
| MeanAndStdDev (2) | Returns the standard deviation of all calling object elements. |
| Meanc | Average of all non-zero complex elements. |
| Min | Minimum of all non-zero elements. |
| Minc | Minimum of all non-zero complex elements. |
| Mul (9) | Multiply two sparse matrices (matrix multiplication). |
| MulI (4) | Multiply elements by imaginary unit I. |
| MulLeft (2) | Multiply the sparse matrix from left. |
| MulRight (2) | Multiply the sparse matrix from right. |
| Normalize (12) | Normalize by subtracting a complex constant SubOffset from Vec elements and dividing the result by complex constant DivFactor. |
| PCValues1D | Obtaines a pointer to the complex value of the vector at Index. |
| PhaseSpectrum (2) | The phase angles (spectrum) of object elements. |
| Pin | Pin down internal data structures for GC. |
| PixelDownSample | Reduces dense matrix for screen display (bitmap) to show the non-zero pattern. |
| PolarToCart (2) | Converts the polar magnitude/phase pairs to cartesian pairs. |
| Power (7) | Raises all calling vector elements to complex power Exponent in-place. |
| PowerSpectrum (2) | The power spectrum from object complex values. |
| PowerVec | Raises Base object elements to Exponent object elements power. |
| PrecisionEPS | Returns machine constant depending on value of FloatPrecision property. |
| PrecisionMaxValue | Returns maximum floating point number depending on the value of FloatPrecision property. |
| PrecisionMinValue | Minimum floating point number. |
| PrecisionSqrtEPS | Sqrt(EPS) machine constant depending on value of FloatPrecision property. |
| Product (6) | Elements product. |
| Productc (2) | Elements product. |
| PSCValues1D | Obtaines a pointer to the complex value of the vector at Index. |
| PSValues1D | Obtains a pointer to the real value of the vector at Index. |
| PValues1D | Obtains a pointer to the real value of the vector at Index. |
| RadToDeg (4) | RadToDeg converts radians to degrees. |
| RandGauss (3) | The pseudo random sample generator with Gaussian distribution. |
| RandomShuffle | Randomly shuffles the content of the vector. |
| RandomSparse | Creates quadratic non-complex non-singular sparse matrix. |
| RandUniform (3) | The pseudo random sample generator with continuous uniform distribution. |
| ReadHeader | Reads the header information from a stream to object. |
| ReadValues | Read values content from stream to object. |
| ReadXml | Read the object from the .NET XML stream. |
| RealPart (2) | Gets real part of complex object values. |
| RealToCplx (2) | Constructs a complex object from two real objects. |
| Rem (4) | The Reminder after division X/Y. |
| Replace (4) | Search and replace a complex value. |
| Reset | Resets object properties to default values. |
| ResidualNorm | The residual norm of the solution of the system of linear equations A*X=B. |
| Resize | Resizes the sparse matrix to a new number of non-zeros. |
| RMS (2) | Root mean squared of all non-zero elements. |
| Round (5) | Elements rounded to the nearest whole number. |
| SaveToFile | Write object header and values to a file. |
| SaveToMatrixMarketFile | Saves the matrix in matrix market file format. |
| SaveToStream | Load the component from the .NET framework Stream. |
| Scale (4) | Multiply all calling object elements with a complex Value in-place. |
| Scatter | Scatter object elements. |
| ScatterByIncr | Scatters Src elements starting at Offset and with Increment to the calling object. |
| ScatterByIndexes | Scatters Src elements defined with indices stored in Indexes to the calling object. |
| ScatterByMask | Scatters Src elements defined with the Mask to the calling object. |
| SDataIndex | Returns an index pointing to element at Index for double data. |
| Sec (4) | Secant. |
| Sech (4) | Hyperbolic secant. |
| Select (2) | Resets the selection. |
| SelectAll | Resets any defined selection. |
| SetCplx | Sets object complex values. |
| SetDouble | Sets object values (double). |
| SetFullRange | Resets subrange defined with SetSubRange. |
| SetFullRangeLevel | Pops the current subrange stack one level up. |
| SetInteger | Sets object values (integer). |
| SetIt (2) | Sets object values. |
| SetObjectFromByteArray | Reads the properties of the object from the array of bytes. |
| SetSingle | Sets object values (single). |
| SetSubIndex | Defines a subarray. |
| SetSubRange (3) | Sets the subarray size to full size. |
| SetSubRangeLevel (2) | Defines a sub vector/matrix of Src and pushes any previous subranges on to a stack. |
| SetVal (4) | Set all calling object complex elements to complex Value. |
| SetZero (2) | Initializes object elements to zero. |
| Sgn (4) | Computes signum function of calling object elements. |
| SgnMul | Signum. |
| Sign (4) | Changes elements sign. |
| Sin (4) | Sine function. |
| SinCos (2) | Sine and cosine. |
| Sinh (4) | Hyperbolic sine. |
| SinhCosh (2) | Hyperbolic sine and cosine. |
| Size (4) | Sets sparse matrix size to match Src with new aFloatPrecision. |
| SizeToArray (8) | Sizes the array. |
| Solve (2) | Direct solve. |
| SolveIterative (2) | Solve the system A*X = B by using one of the iterative methods. |
| SparseToBanded | Convert sparse matrix to banded matrix. |
| SparseToDense | Convert sparse matrix to banded matrix. |
| SparseToTriplets (3) | Convert sparse matrix to triplets. |
| Split | Split sparse matrix into lower triangle, main diagonal and upper triangle. |
| Sqr (4) | Square. |
| Sqrt (4) | Square root. |
| StdDev (6) | Standard deviation. |
| StringsToValues | Convert strings to specific matrix format. |
| StructurizeSymmetric | Required by Pardiso solver to solve for general matrices. |
| Sub | subtract two sparse matrices. |
| SubRangeLevel | Returns the current subrange stack level. |
| Sum (5) | Sums vector values. |
| Sumc (2) | Sum (complex value). |
| SvdSymLargest | Computes largest singular values and signular vectors for symmetric sparse matrix. |
| SvdSymSmallest | Computes smallest singular values and signular ectors for a symmetric sparse matrix. |
| Tan (4) | Tangens. |
| Tanh (4) | Hyperbolic tangens. |
| ThreshAbsGT (4) | Perform threshold operation on all Src object values. |
| ThreshAbsLT (4) | Perform threshold operation on all Src object values. |
| ThreshBottom (4) | Perform threshold operation on all Src object values. |
| ThresholdGT (8) | Perform "greater than" threshold operation for complex numbers on all Vec object values. |
| ThresholdGT_LT (4) | Perform "greater than and less than" threshold operation on all Vec object values. |
| ThresholdLT (8) | Perform "less than" threshold operation for complex numbers on all Vec object values. |
| ThreshTop (4) | Perform threshold operation on all Src object values. |
| Transp (3) | Transpose sparse matrix in-place. |
| TripletsToSparse (3) | Convert triplets to sparse format. |
| TripletsToSparseAndFlush | Construct a sparse matrix by specifying the position of each element in dense matrix. |
| Trunc (5) | Rounds a real number towards zero. |
| TruncAndFrac (2) | Rounds a real number towards zero and returns the fractional part. |
| UnPin | Unpin internal data structures for GC. |
| UpperTriangle | Extract upper part of the Mtx. |
| ValuesToStrings | Convert matrix values to strings. |
| WriteHeader (2) | Convert matrix values to strings. |
| WriteValues | Writes the header information for the calling vector to a stream. |
| WriteXml | Write the object to the .NET XML stream. |
| ZeroThresh | Reduces the number of non-zeros. |
Events
| Name | Description |
|---|---|
| OnSetSizeEvent | Called when object size changes. |