TSparseMtx Class

Header: Dew.Math/sparse.h · Cross-compiler
tObjectTMtxVecBaseTMtxVecSampleTMtxVecTSparseMtx

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

NameDescription
TSparseMtx

Destructors

NameDescription
~TSparseMtx

Properties

NameTypeDescription
ActualItersintReturns the number of actual iterations performed by TSparseMtx::Solve.
ActualSizelong longFor internal use only. Read to get the amount of memory allocated in number of doubles (8byte packs).
AutoClearReportboolDefines if call to Solve will clear the report.
AutoPatternbool
BackErrordoubleHolds the backward or iterative stopping criteria.
BlockEndboolReturns true, if the currrent subrange of the vector was also the last subrange in the vector.
CacheIndexintFor internal use only. Read to get the index of this object in object cache.
Capacitylong longSizing the object will not allocate less than Capacity.
CapacityInByteslong longSizing the object will not allocate less than CapacityInBytes.
CapacityInElementslong longSizing the object will not allocate less than CapacityInElements.
CapacityStepdoubleSpecifies increment step for the Capacity property.
CaptionDewStringCaption.
ColsintNumber of columns in the sparse matrix.
ComplexboolDefines if object values are complex.
ComplexValuesDewString
ConditionCheckboolEnables/disable inline condition checking.
ConvergenceCheckTConvergenceCheckConvergence criteria for iterative method.
CValueTSparseCValue2D*Allows setting and getting complex values.
DirtyboolTrue after object property changes.
DontStripZerosboolPrevents zeros to be stripped.
FirstdoubleFirst element in object Values array.
FirstcTCplxFirst element in object CValues array.
FloatPrecisionTMtxFloatPrecisionDefines the precision (single, float) and type (real, complex) of the floating point operations.
FloatPrecisionLockbool
IsDoubleboolDefines the precision (single or double) of the floating point operations.
IsSubRangeboolSet to true after the SetSubIndex or SetSubRange call.
IterativeMethodTIterativeMethodDefines the iterative method for solving system of equations.
LastdoubleLast element in object Values array.
LastcTCplxLast complex element in object CValues array.
LengthintDefines the length in number of samples.
MaxItersintUpper limit for number of iterations.
MtxErrorDewStringHolds the error string, if an error has occurred.
MtxVecTypeTMtxVecType
NonZerosintDefines the number of non-zero elements in the sparse matrix.
OnSetSizeTMtxNotifyEventCalled when object size changes.
PardisoTPardisoSettings*The pardiso sparse solver settings.
PoolIndexintInternal.
PrecisionTPrecisionDefines the precision used by streaming routines.
RealValuesDewString
RefinmentItersintDefines number of refinement steps the TSparseMtx::Solve method should try.
ReportLevelTReportLevelDefines how detailed report will be printed.
RoundingTRoundingDefines the rounding used by streaming routines.
RowsintNumber of rows in the sparse matrix.
SCValueTSparseSCValue2D*Allows setting and getting single complex values.
SparseBlockSizeintThe size of the block as used by UmfPack.
SparsePatternTSparsePatternDefines the pattern used when solving a system of linear equations.
SparseSolverTSparseSolverSpecifies the sparse matrix solver to use.
SparseSystemTSparseSystemDefines the system to be solved by the Solve method.
SValueTSparseSValue2D*Allows setting and getting single values.
TagintStores an integer value as part of a TMtxVec object.
TaucsTTaucsSettings*The Taucs sparse solver settings.
TolerancedoubleDefines the tolerance for iterative method.
ValueTSparseValue2D*Allows setting and getting value at position Row and Col.
VectorCountintDefines maximum number of vectors used in some iterative methods.
ZeroTolerancedoubleThe tolerance used by TSparseMtx::IsEqual.

Methods

NameDescription
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.
AdjungAdjungate 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
BandedToSparseConverts banded matrix to modified compressed column sparse matrix format.
BinarySearch (8)Finds a match for X in sorted object values using binary search.
BlockFinishDeinitializes block processing before the final block is processed.
BlockInit (4)Initializes block processing.
BlockNextObtains the next subrange of the data.
BlockSubRangeLevelReturns 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.
CDataIndexReturns an index pointing to element at Index for TCplx data.
Ceil (4)Rounds towards positive infinity.
Clear
CondDisableSaves the current value of ConditionCheck property and sets it to false.
CondEnableSets the ConditionCheck property to whatever it was before the CondDisable was used.
Conj (4)Conjugate.
ConjMulConjugate 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.
DenseToSparseConvert dense matrix to sparse matrix format.
DiagCopies the kk-th diagonal of TSparseMtx to the Vec object.
DiagonalsCountCalculates the number of diagonals above and below main diagonal.
DisableSelectPrevents calls to TSparseMtx::Select.
DisableSubrangePrevents calls to TSparseMtx::SetSubRange.
DivideElemDivide individual elements of sparse matrices.
EigSymComputes eigenvalues and eigenvectors for symmetric (hermitian) sparse matrix.
EigSymGenComputes eigenvalues and eigenvectors for generalized symmetric (hermitian) sparse problem.
EigSymGenLargestComputes generalized largest eigenvalues and eigenvectors for symmetric sparse matrix.
EigSymGenSmallestComputes smallest generalized eigenvalues and eigenvectors for a symmetric sparse matrix.
EigSymLargestComputes largest eigenvalues and eigenvectors for symmetric sparse matrix.
EigSymSmallestComputes smallest eigenvalues and eigenvectors for a symmetric sparse matrix.
EnableSelectEnables calls to TSparseMtx::Select.
EnableSubrangeEnables 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^).
ExpandSymmetricForm 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
FreeNumericFrees the numeric object used by the Umfpack.
FreePardisoFrees the memory of the Pardiso solver.
FreeSymbolicFrees the symbolic object used by the Umfpack.
FreeTaucsReleases 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
GetObjectToByteArrayCopies 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.
IsEqualSizeCompares matrix size.
Ln (4)Natural logarithm.
LoadFromFileReads the header information and the values array content from the file.
LoadFromMatrixMarketFileLoads the matrix stored in a matrix market file format.
LoadFromStreamSave component to the .NET framework Stream.
Log10 (4)Log base 10.
Log2 (4)Log base 2.
LogN (4)Log base N.
LowerTriangleExtract 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.
MaxMaximum of all non-zero elements.
MaxcMaximum of all non-zero complex elements.
MeanAverage of all non-zero elements.
MeanAndStdDev (2)Returns the standard deviation of all calling object elements.
MeancAverage of all non-zero complex elements.
MinMinimum of all non-zero elements.
MincMinimum 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.
PCValues1DObtaines a pointer to the complex value of the vector at Index.
PhaseSpectrum (2)The phase angles (spectrum) of object elements.
PixelDownSampleReduces 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.
PowerVecRaises Base object elements to Exponent object elements power.
PrecisionEPSReturns machine constant depending on value of FloatPrecision property.
PrecisionMaxValueReturns maximum floating point number depending on the value of FloatPrecision property.
PrecisionMinValueMinimum floating point number.
PrecisionSqrtEPSSqrt(EPS) machine constant depending on value of FloatPrecision property.
Product (6)Elements product.
Productc (2)Elements product.
PSCValues1DObtaines a pointer to the complex value of the vector at Index.
PSValues1DObtains a pointer to the real value of the vector at Index.
PValues1DObtains 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.
RandomShuffleRandomly shuffles the content of the vector.
RandomSparseCreates quadratic non-complex non-singular sparse matrix.
RandUniform (3)The pseudo random sample generator with continuous uniform distribution.
RangeCheck
RangeCheckComplex
ReadHeader
ReadValuesRead 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.
ResetResets object properties to default values.
ResidualNormThe residual norm of the solution of the system of linear equations A*X=B.
ResizeResizes 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.
SaveToFileWrite object header and values to a file.
SaveToMatrixMarketFileSaves the matrix in matrix market file format.
SaveToStreamLoad the component from the .NET framework Stream.
Scale (4)Multiply object elements with Value.
ScatterScatter object elements.
ScatterByIncrScatters Src elements starting at Offset and with Increment to the calling object.
ScatterByIndexesScatters Src elements defined with indices stored in Indexes to the calling object.
ScatterByMaskScatters Src elements defined with the Mask to the calling object.
SCValues
SCValues1D
SDataIndexReturns 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.
SelectAllResets any defined selection.
set_CValues
set_CValues1D
set_SCValues
set_SCValues1D
set_SValues
set_SValues1D
set_Values
set_Values1D
SetCapacity
SetCapacityInElements
SetCplxSets object complex values.
SetDouble (2)Sets object values (double).
SetFullRangeResets subrange defined with SetSubRange.
SetFullRangeLevelPops the current subrange stack one level up.
SetInteger (2)Sets object values (integer).
SetIsDouble
SetIt (2)Sets object values.
SetMtxCValue
SetMtxSCValue
SetNonZeros
SetObjectFromByteArrayReads the properties of the object from the array of bytes.
SetSingle (2)Sets object values (single).
SetSubIndexDefines 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.
SgnMulSignum.
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.
SparseToBandedConvert sparse matrix to banded matrix.
SparseToDenseConvert sparse matrix to banded matrix.
SparseToTriplets (5)Convert sparse matrix to triplets.
SplitSplit sparse matrix into lower triangle, main diagonal and upper triangle.
Sqr (4)Square.
Sqrt (4)Square root.
StdDev (6)Standard deviation.
StringsToValuesConvert strings to specific matrix format.
StructurizeSymmetricRequired by Pardiso solver to solve for general matrices.
SubSubract two sparse matrices.
SubRangeLevelReturns the current subrange stack level.
Sum (5)Sums vector values.
Sumc (2)Sum (complex value).
SValues
SValues1D
SvdSymLargestComputes largest singular values and signular vectors for symmetric sparse matrix.
SvdSymSmallestComputes 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.
TripletsToSparseAndFlushConstruct 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.
UpperTriangleExtract upper part of the Mtx.
ValidateCplxArrayIndexes
ValidateParams (4)
ValidateParams2
ValidateParamsPrecision (3)
ValidateRealArrayIndexes
Values
Values1D
ValuesToStringsConvert 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.
ZeroThreshReduces the number of non-zeros.

Operators

NameDescription
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

NameTypeDescription
AIDewArray<int>
AlfaTCplxAdditional parameter for certain Lapack methods.
ApDewArray<int>
BetaTCplxAdditional parameter for certain Lapack methods.
CDataDewArray<double>
ControlDewArray<double>
fRefCountint
InfoDewArray<double>
SCDataDewArray<float>
sControlDewArray<float>
SDataDewArray<double>
sInfoDewArray<float>
SSDataDewArray<float>
ThreadIDlong long