class TSparseMtx : public 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...
Constructors
| Name | Description |
|---|---|
| TSparseMtx |
Destructors
| Name | Description |
|---|---|
| ~TSparseMtx |
Properties
| Name | Type | Description |
|---|---|---|
| ActualIters | int | Returns the number of actual iterations performed by TSparseMtx::Solve. |
| ActualSize | long long | For internal use only. Read to get the amount of memory allocated in number of doubles (8byte packs). |
| AutoClearReport | bool | Defines if call to Solve will clear the report. |
| AutoPattern | bool | |
| BackError | double | Holds the backward or iterative stopping criteria. |
| BlockEnd | bool | Returns true, if the currrent subrange of the vector was also the last subrange in the vector. |
| CacheIndex | int | For internal use only. Read to get the index of this object in object cache. |
| Capacity | long long | Sizing the object will not allocate less than Capacity. |
| CapacityInBytes | long long | Sizing the object will not allocate less than CapacityInBytes. |
| CapacityInElements | long long | Sizing the object will not allocate less than CapacityInElements. |
| CapacityStep | double | Specifies increment step for the Capacity property. |
| Caption | DewString | Caption. |
| Cols | int | Number of columns in the sparse matrix. |
| Complex | bool | Defines if object values are complex. |
| ComplexValues | DewString | |
| ConditionCheck | bool | Enables/disable inline condition checking. |
| ConvergenceCheck | TConvergenceCheck | Convergence criteria for iterative method. |
| CValue | TSparseCValue2D* | Allows setting and getting complex values. |
| Dirty | bool | True after object property changes. |
| DontStripZeros | bool | 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. |
| FloatPrecisionLock | bool | |
| IsDouble | bool | Defines the precision (single or double) of the floating point operations. |
| IsSubRange | bool | 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 | int | Defines the length in number of samples. |
| MaxIters | int | Upper limit for number of iterations. |
| MtxError | DewString | Holds the error string, if an error has occurred. |
| MtxVecType | TMtxVecType | |
| NonZeros | int | 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 | int | Internal. |
| Precision | TPrecision | Defines the precision used by streaming routines. |
| RealValues | DewString | |
| RefinmentIters | int | Defines number of refinement steps the TSparseMtx::Solve method should try. |
| ReportLevel | TReportLevel | Defines how detailed report will be printed. |
| Rounding | TRounding | Defines the rounding used by streaming routines. |
| Rows | int | Number of rows in the sparse matrix. |
| SCValue | TSparseSCValue2D* | Allows setting and getting single complex values. |
| SparseBlockSize | int | 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 | int | 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. |
| VectorCount | int | Defines maximum number of vectors used in some iterative methods. |
| ZeroTolerance | double | The tolerance used by TSparseMtx::IsEqual. |
Methods
| Name | Description |
|---|---|
| Abs (4) | Absolute values. |
| Add (2) | Sums two sparse matrices (A+B). |
| AddRef | |
| AddSplit (2) | Construct sparse matrxix by summing lower, upper triangluar part and the diagonal. |
| 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. |
| Assign | |
| BandedToSparse | Converts banded matrix to modified compressed column sparse matrix format. |
| BinarySearch (8) | Finds a match for X in sorted object values using binary search. |
| BlockFinish | Deinitializes block processing before the final block is processed. |
| BlockInit (4) | 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 | |
| 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 (7) | Copy object values. |
| CopyFromArray (14) | Copies values from an array. |
| CopyTo (7) | Copy and convert values to TVecInt. |
| 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. |
| CreateCached | |
| Csc (4) | Cosecant. |
| Csch (4) | Hyperbolic cosecant. |
| CValues | |
| CValues1D | |
| 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 TSparseMtx::Select. |
| DisableSubrange | Prevents calls to TSparseMtx::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 TSparseMtx::Select. |
| EnableSubrange | Enables calls to TSparseMtx::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) | Extends a real object to a complex object. |
| Find (2) | Finds a match for X in object values. |
| 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. |
| FreeCached | |
| 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 | |
| get_CValues | |
| get_CValues1D | |
| get_SCValues | |
| get_SCValues1D | |
| get_SValues | |
| get_SValues1D | |
| get_Values | |
| get_Values1D | |
| GetCapacity | |
| GetCapacityInElements | |
| GetMtxCValue | |
| GetMtxSCValue | |
| GetObjectToByteArray | Copies object to an array of bytes. |
| GetSValue | |
| GetValue | |
| ImagPart (2) | Gets the imaginary part of a complex object. |
| IntPower (2) | Power (integer exponent). |
| Inv (11) | Inverse elements. |
| InvCbrt (4) | The inverse of cube root 1/(v)^1/3. |
| InvSqrt (4) | The inverse of square root 1/(v)^1/2. |
| IsComplex | |
| IsEqual (8) | Compares two objects. |
| IsEqualSize | Compares matrix size. |
| 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) | Copies those values from MaskVec, at which aMask is different from 0. |
| MaskNot (3) | Copies those values from MaskVecNot, 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 object elements with Value. |
| 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 data. |
| PCValues1D | Obtaines a pointer to the complex value of the vector at Index. |
| PhaseSpectrum (2) | The phase angles (spectrum) of object elements. |
| 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 base object elements to any power. |
| 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. |
| RangeCheck | |
| RangeCheckComplex | |
| ReadHeader | |
| ReadValues | Read values content from stream to object. |
| RealPart (2) | Gets real part of complex object values. |
| RealToCplx (2) | Constructs a complex object from two real objects. |
| Release | |
| Rem (4) | The Reminder after division X/Y. |
| Replace (8) | Search and replace a 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) | Calculate the RMS for calling object elements [Index]..[Index+Len-1] in-place. |
| 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 object elements with Value. |
| 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. |
| SCValues | |
| SCValues1D | |
| SDataIndex | Returns an index pointing to element at Index for double data. |
| Sec (4) | Secant. |
| Sech (4) | Hyperbolic secant. |
| Select (2) | Selects a set of elements from the vector. |
| SelectAll | Resets any defined selection. |
| set_CValues | |
| set_CValues1D | |
| set_SCValues | |
| set_SCValues1D | |
| set_SValues | |
| set_SValues1D | |
| set_Values | |
| set_Values1D | |
| SetCapacity | |
| SetCapacityInElements | |
| SetCplx | Sets object complex values. |
| SetDouble (2) | Sets object values (double). |
| SetFullRange | Resets subrange defined with SetSubRange. |
| SetFullRangeLevel | Pops the current subrange stack one level up. |
| SetInteger (2) | Sets object values (integer). |
| SetIsDouble | |
| SetIt (2) | Sets object values. |
| SetMtxCValue | |
| SetMtxSCValue | |
| SetNonZeros | |
| SetObjectFromByteArray | Reads the properties of the object from the array of bytes. |
| SetSingle (2) | Sets object values (single). |
| SetSubIndex | Defines a subarray. |
| SetSubRange (3) | Defines a sub vector/matrix. |
| SetSubRangeLevel (2) | Defines a sub vector/matrix and pushes any previous subranges on to a stack. |
| SetSValue | |
| SetVal (4) | Initialize elements to Value. |
| SetValue | |
| 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 (6) | Size the object. |
| 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 (5) | 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 | Subract two sparse matrices. |
| SubRangeLevel | Returns the current subrange stack level. |
| Sum (5) | Sums vector values. |
| Sumc (2) | Sum (complex value). |
| SValues | |
| SValues1D | |
| 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) | Threshold top and bottom centered around zero. |
| ThreshAbsLT (4) | Threshold top and bottom centered around zero. |
| ThreshBottom (4) | Threshold bottom operation. |
| ThresholdGT (8) | Threshold greater than operation. |
| ThresholdGT_LT (4) | Threshold greater than and less than operation. |
| ThresholdLT (8) | Threshold less than operation. |
| ThreshTop (4) | Threshold top operation. |
| Transp (3) | Transpose sparse matrix in-place. |
| TripletsToSparse (5) | 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. |
| UpperTriangle | Extract upper part of the Mtx. |
| ValidateCplxArrayIndexes | |
| ValidateParams (4) | |
| ValidateParams2 | |
| ValidateParamsPrecision (3) | |
| ValidateRealArrayIndexes | |
| Values | |
| Values1D | |
| ValuesToStrings | Convert matrix values to strings. |
| WriteHeader (2) | Writes the header information for the calling vector to a stream. |
| WriteValues (2) | Writes the header information for the calling vector to a stream. |
| ZeroThresh | Reduces the number of non-zeros. |
Operators
| Name | Description |
|---|---|
| operator!= (2) | Returns true, if Left and Right do not have equal Length and Values. |
| operator* (4) | Multiply all elements in Left with corresponding elements in Right. |
| operator+ (4) | Add coresponding elements in Left and Right. |
| operator- (4) | Subtract coresponding elements in Right from Left. |
| operator/ (4) | Divide all elements in Left with coresponding elements in Right. |
| operator== (2) | Returns true, if Left and Right are of equal Length and Values. |
| operator[] |
Fields
| Name | Type | Description |
|---|---|---|
| AI | DewArray<int> | |
| Alfa | TCplx | Additional parameter for certain Lapack methods. |
| Ap | DewArray<int> | |
| Beta | TCplx | Additional parameter for certain Lapack methods. |
| CData | DewArray<double> | |
| Control | DewArray<double> | |
| fRefCount | int | |
| Info | DewArray<double> | |
| SCData | DewArray<float> | |
| sControl | DewArray<float> | |
| SData | DewArray<double> | |
| sInfo | DewArray<float> | |
| SSData | DewArray<float> | |
| ThreadID | long long |