TSparseMtx Class

Source: sparse.cs · Assembly: Dew.Math

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

NameTypeDescription
ActualItersInt32Returns the number of actual iterations performed by Dew.Math.TSparseMtx.Solve.
AutoClearReportBooleanDefines if call to Solve will clear the report.
BackErrorDoubleHolds the backward or iterative stopping criteria.
BlockEndBooleanReturns true, if the currrent subrange of the vector was also the last subrange in the vector.
CacheIndexInt32For internal use only. Read to get the index of this object in object cache.
CapacityInt64Sizing the object will not allocate less than Capacity.
CapacityInBytesInt64Sizing the object will not allocate less than CapacityInBytes.
CapacityInElementsInt64Sizing the object will not allocate less than CapacityInElements.
CapacityStepDoubleSpecifies increment step for the Capacity property.
CaptionStringCaption.
ColsInt32Number of columns in the sparse matrix.
ComplexBooleanDefines if object values are complex.
ConditionCheckBooleanEnables/disable inline condition checking.
ConvergenceCheckTConvergenceCheckConvergence criteria for iterative method.
CValueTSparseCValue2DAllows setting and getting complex values.
DirtyBooleanTrue after object property changes.
DontStripZerosBooleanPrevents 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.
IsDoubleBooleanDefines the precision (single or double) of the floating point operations.
IsSubRangeBooleanSet 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.
LengthInt32Defines the length in number of samples.
MaxItersInt32Upper limit for number of iterations.
MtxErrorStringHolds the error string, if an error has occurred.
NonZerosInt32Defines the number of non-zero elements in the sparse matrix.
OnSetSizeTMtxNotifyEventCalled when object size changes.
PardisoTPardisoSettingsThe pardiso sparse solver settings.
PoolIndexInt32Internal.
PrecisionTPrecisionDefines the precision used by streaming routines.
RefinmentItersInt32Defines number of refinement steps the Dew.Math.TSparseMtx.Solve method should try.
ReportLevelTReportLevelDefines how detailed report will be printed.
RoundingTRoundingDefines the rounding used by streaming routines.
RowsInt32Number of rows in the sparse matrix.
SCValueTSparseSCValue2DAllows setting and getting single complex values.
SparseBlockSizeInt32The 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.
SValueTSparseSValue2DAllows setting and getting single values.
TagInt32Stores an integer value as part of a TMtxVec object.
TaucsTTaucsSettingsThe Taucs sparse solver settings.
ToleranceDoubleDefines the tolerance for iterative method.
ValueTSparseValue2DAllows setting and getting value at position Row and Col.
ValuesSerializationStringProvides serializatin of object content.
VectorCountInt32Defines maximum number of vectors used in some iterative methods.
ZeroToleranceDoubleThe tolerance used by Dew.Math.TMtxVec.IsEqual.

Methods

NameDescription
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).
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.
BandedToSparseConverts banded matrix to modified compressed column sparse matrix format.
BinarySearch (2)Finds a match for X in sorted object values using binary search.
BlockFinishDeinitializes block processing before the final block is processed.
BlockInit (3)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.
ClearSets vector size to zero.
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 (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.
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 Dew.Math.TMtxVecBase.Select.
DisableSubrangePrevents calls to Dew.Math.TMtxVecBase.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 Dew.Math.TMtxVecBase.Select.
EnableSubrangeEnables 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^).
ExpandSymmetricForm 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.
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.
FreeToCacheFrees the object.
GetObjectToByteArrayCopies object to an array of bytes.
GetSchemaReturns 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.
IsEqualSizeCompares matrix size.
IsPinnedReturns true of the working memory is pinned.
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)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.
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 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.
PCValues1DObtaines a pointer to the complex value of the vector at Index.
PhaseSpectrum (2)The phase angles (spectrum) of object elements.
PinPin down internal data structures for GC.
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 all calling vector elements to complex power Exponent in-place.
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.
ReadHeaderReads the header information from a stream to object.
ReadValuesRead values content from stream to object.
ReadXmlRead 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.
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)Root mean squared of all non-zero elements.
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 all calling object elements with a complex Value in-place.
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.
SDataIndexReturns an index pointing to element at Index for double data.
Sec (4)Secant.
Sech (4)Hyperbolic secant.
Select (2)Resets the selection.
SelectAllResets any defined selection.
SetCplxSets object complex values.
SetDoubleSets object values (double).
SetFullRangeResets subrange defined with SetSubRange.
SetFullRangeLevelPops the current subrange stack one level up.
SetIntegerSets object values (integer).
SetIt (2)Sets object values.
SetObjectFromByteArrayReads the properties of the object from the array of bytes.
SetSingleSets object values (single).
SetSubIndexDefines 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.
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 (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.
SparseToBandedConvert sparse matrix to banded matrix.
SparseToDenseConvert sparse matrix to banded matrix.
SparseToTriplets (3)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.
Subsubtract two sparse matrices.
SubRangeLevelReturns the current subrange stack level.
Sum (5)Sums vector values.
Sumc (2)Sum (complex value).
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)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.
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.
UnPinUnpin internal data structures for GC.
UpperTriangleExtract upper part of the Mtx.
ValuesToStringsConvert matrix values to strings.
WriteHeader (2)Convert matrix values to strings.
WriteValuesWrites the header information for the calling vector to a stream.
WriteXmlWrite the object to the .NET XML stream.
ZeroThreshReduces the number of non-zeros.

Events

NameDescription
OnSetSizeEventCalled when object size changes.