TMtx Class

Header: Dew.Math/MtxVec.h · Cross-compiler
tObjectTMtxVecBaseTMtxVecSampleTMtxVecTDenseMtxVecTMtx

class TMtx : public TDenseMtxVec;

Two dimensional array - matrix.

Use the matrix class to perform matix operations like multiplication addition, subtraction, solve a system of linear equations, compute eigenvalues, singular value decomposition, least squares solution, 2D FFT's, parallel 1D FFT's and more.

Constructors

NameDescription
TMtx (2)Create a new TMtx object.

Destructors

NameDescription
~TMtx

Properties

NameTypeDescription
ActualSizelong longFor internal use only. Read to get the amount of memory allocated in number of doubles (8byte packs).
AutoMtxTypeboolDefines if matrix type will be checked automatically.
BackErrordoubleThe component-wise backward error.
BalanceTBalanceTypeDefines matrix balancing method.
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.
ColsintDefines the number of matrix columns.
ComplexboolDefines if object values are complex.
ComplexValuesDewString
ConditionCheckboolEnables/disable inline condition checking.
ConditionNrdoubleStores the condition number reciprocial value after the call to LUSolve.
ConditionNumberTConditionNumberDefines the norm used to compute the condition number.
DirtyboolTrue after object property changes.
FFTOddLengthboolDefines if FFT transform length is odd.
FFTScrambledboolLeave FFT scrambeled.
FFTStorageFormatTFFTStorageFormatThe FFT storage format.
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
ForwErrordoubleThe component-wise forward error.
InfointThe info parameter as returned by the last called LAPACK function.
IsDoubleboolDefines the precision (single or double) of the floating point operations.
IsSubRangeboolSet to true after the SetSubIndex or SetSubRange call.
LastdoubleLast element in object Values array.
LastcTCplxLast complex element in object CValues array.
LeadingColsintDefines the number of leading columns.
LengthintDefines the length in number of samples.
MtxErrorDewStringThe type of the error condition signaled by LAPACK.
MtxVecTypeTMtxVecType
OnSetSizeTMtxNotifyEventCalled when object size changes.
PoolIndexintInternal.
PrecisionTPrecisionDefines the precision used by streaming routines.
QuadraticboolTrue, if matrix is quadratic (rows=cols).
RealValuesDewString
RefineSolutionboolEnables/disables the refining of the solution of the system of linear equations.
RoundingTRoundingDefines the rounding used by streaming routines.
RowsintDefines the number of matrix rows.
SubDiagintSets/reads the number of subdiagonals in banded matrices.
SuperDiagintSets/reads the number of superdiagonals in banded matrices.
TagintStores an integer value as part of a TMtxVec object.
TriangleFormTTriangleFormDetermine which part (upper or lower) of the symmetric, hermitian or triangular matrix is set.
TriangleUnitboolDetermine, if the matrix is unit triangular.
ZeroTolerancedoubleThe tolerance used by TMtx::IsEqual.

Methods

NameDescription
Abs (4)Absolute values.
Add (18)Adds Value to object elements.
AddAndMul (50)Compute (X + Y)*Z
AddDiagAdds (main) diagonal matrix to the calling matrix.
AddProduct (2)Add a product of two vectors.
AddRef
AddScaled (25)Add each of Vec elements to corresponding elements in the calling object.
AddScaledC (8)Compute X + Y*yScale + zScalar
AddScaledSqr (8)Compute sqr(X + Y*yScale)
AddTensorProdCalculates the tensor product of two vectors and adds the result to calling matrix.
Adjung (2)Adjungate matrix.
Adopt
AdoptSingle
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
BandedToDenseConvert banded matrix to dense.
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.
CDataIndex (2)Returns an index pointing to element at Index for TCplx data.
Ceil (4)Rounds towards positive infinity.
CholeskyTest if the matrix is semi positive definite.
Clear
ColExchangeExchange matrix columns.
ColPermutePermute the columns of the Src matrix.
ConcatConcatenate an array of matrices to single matrix.
ConcatHorz (2)Concenates an array of matrices horizontally.
ConcatVert (2)Concenates an array of matrices vertically.
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.
ConjMul (4)Conjugate and multiply.
Copy (7)Copy object values.
CopyFromArray (25)Copies values from an array.
CopyTo (5)Copy and convert values to TVecInt.
CopyToArray (18)Copy values to an array.
CopyVec (2)Copies values from vector to a matrix.
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
CreateFromCacheObtain a pointer to a matrix from object cache.
Csc (4)Cosecant.
Csch (4)Hyperbolic cosecant.
CumProduct (2)Calculate the cumulative product for all Vec elements.
CumSum (4)Cumulative sum.
CValues (2)
CValues1D
DCTThe forward discrete cosine transform (DCT).
DefaultArray2D
DegToRad (4)DegToRad converts degrees to radians.
DenseToBandedConvert dense matrix to banded.
DetectMtxTypeDetermines type of the matrix.
Determinant (2)Determinant of squared matrix.
DiagSets the matrix diagonal to values from the vector.
DifferenceDifference.
DisableSelectPrevents calls to TMtx::Select.
DisableSubrangePrevents calls to TMtx::SetSubRange.
Disown (3)Disowns a pointer to an array from matrix Values1D.
DivAndAdd (22)Compute X/Y + Z
DivAndSub (22)Compute X/Y - Z
Divide (14)Compute X / (Y*Z)
DivideBy (8)Divide Value with elements of the calling object and store the result in the calling object.
DivideC (4)Compute X / (Y*zScale)
DivideVec (3)Same as the TMtx::Divide method.
DotProd (2)Scalar product of two real arrays.
DotProdc (5)Scalar product of two complex arrays.
DownSampleDownsamples object values.
Eig (4)Calculates matrix eigenvalues and eigenvectors.
EigGen (3)Computes generalized eigenvalues and eigenvectors of a non-symmetric matrix.
EigSchure (2)Computes eigenvalues and optionally Schure matrix
EigSchureGen (2)Computes generalized eigenvalues and Schur vectors of a non-symmetric matrix.
EigSym (3)Computes eigenvalues of a symmetric (Hermitian) matrix between minimum and maximum.
EigSymGen (6)Computes all the eigenvalues, and optionally, the eigenvectors of a generalized symmetric-definite eigenproblem.
EigSymRange (2)Computes eigenvalues and eigenvectors of a symmetric (Hermitian) matrix between min and max index.
EnableSelectEnables calls to TMtx::Select.
EnableSubrangeEnables calls to TMtx::SetSubRange.
Equal (2)Compares two 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^).
Expj (3)A complex exponential e^(j*Omega)).
ExtendToComplex (3)Extends a real object to a complex object.
Eye (3)Constructs an eye matrix.
FFTFast Furier Transformation (FFT) from complex to complex or from real to complex.
FFT1D (2)Forward parallel in-place 1D FFT.
FFT1DFromReal (2)Forward parallel in-place 1D FFT from real to complex.
FFT2D (2)Forward two-dimensional Fast Fourier Transformation from real/complex to complex.
FFT2DFromReal (2)Forward two-dimentional Fast Fourier Transformation for real numbers.
FFTFromRealThe forward Fast Fourier Transformation (FFT) from real to complex.
Filter2D (3)Applies 2D filtering
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.
FlipHor (2)Flips the matrix elements horizontally.
FlipVer (2)Flips the matrix elements vertically
Floor (4)Rounds towards negative infinity.
Frac (4)Fractional part of values.
FreeCached
FreeToCache
get_CValues (2)
get_CValues1D
get_DefaultArray
get_SCValues (2)
get_SCValues1D
get_SValues (2)
get_SValues1D
get_Values (2)
get_Values1D
GetCapacity
GetCapacityInElements
GetComplexValues
GetObjectToByteArrayCopies object to an array of bytes.
GetRealValues
GLMSolveSolves a general Gauss-Markov linear model (GLM) problem.
HankelConstructs a Hankel matrix.
IDCTThe inverse discrete cosine transform (DCT).
IFFTThe inverse FFT from complex to complex.
IFFT1D (2)Inverse parallel in-place 1D FFT.
IFFT1DToReal (2)Inverse parallel in-place 1D FFT from complex to real.
IFFT2D (2)Inverse two-dimensional Fast Fourier Transformation from complex to complex.
IFFT2DToReal (2)Inverse two-dimentional Fast Fourier Transformation from complex to real.
IFFTToRealThe inverse FFT from complex to real.
ImagPart (2)Gets the imaginary part of a complex object.
IndexOfReturns the 1D index in to the matrix.
IntPower (2)Power (integer exponent).
Inv (11)Calculate the inverse of calling object elements [Index]..[Index+Len-1] in-place.
InvCbrt (4)The inverse of cube root 1/(v)^1/3.
InvElem (3)The inverse of matrix elements.
InvSqrt (4)The inverse of square root 1/(v)^1/2.
IsComplex
IsEqual (8)Compares two objects.
KacConstruct the Kac (Clement) matrix.
Kron (2)The Kronecker product between two vectors.
Kurtosis (3)The Kurtosis (fourth central momentum).
LMinQR
Ln (4)Natural logarithm.
LoadFromFileReads the header information and the values array content from the file.
LoadFromStreamSave component to the .NET framework Stream.
Log10 (4)Log base 10.
Log2 (4)Log base 2.
LogN (4)Log base N.
LowerTriangleConstructs lower triangular matrix.
LQR (2)QR or LQ factorization.
LQRSolve (4)Solve overdetermined or underdetermined system of real linear equations.
LSESolveSolves the linear equality-constrained least squares (LSE).
LULU, Cholesky or Bunch-Kaufmann factorization.
LUSolve (5)Solves system of linear equations by using LU factorization.
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 (6)Maximum value.
Maxc (3)Maximum value.
MaxColsCompute maximum of each column.
MaxEvery (4)Vectorised maximum.
MaxMin (4)Maximum and minimum value in a single pass.
MaxMinColsCompute maximum and minimum of each column.
MaxMinRowsCompute maximum and minimum of each row.
MaxRowsCompute maximum of each row.
Mean (5)Mean value.
MeanAndStdDev (2)Returns the standard deviation of all calling object elements.
Meanc (4)Mean value.
MeanColsCalculates the mean value of each of the matrix columns.
MeanRowsCalculates the mean value of each of the matrix rows.
Median (2)Median.
Min (6)Minimum value.
Minc (3)Minimum value.
MinColsCompute minimum of each column.
MinEvery (4)Vectorised minimum.
MinRowsCompute minimum of each row.
MtxFunctionCompute matrix function as a function of another matrix.
MtxIntPowerCalculates the matrix to integer power.
MtxPower (2)Calculates the matrix to any power, real or integer.
MtxSqrtCalculates the square root of the matrix.
Mul (23)Multiply object elements with Value.
MulAndAdd (26)Compute X*Y + Z
MulAndDiv (10)Compute X * Y / Z
MulAndSub (26)Compute X*Y - Z
MulArray (2)Multiplies multiple matrices.
MulDiagLeft (2)Multiply matrix with diagonal matrix from the left.
MulDiagRight (2)Multiply matrix with diagonal matrix from the right.
MulElem (5)Matrix element-wise multiplication.
MulI (4)Multiply elements by imaginary unit I.
MulSmall (2)Small matrix multiply. Performs arbitrary small matrix multiplication.
MulSmallInit (2)Initializes small matrix multiply according to lapacks dgemm api standard.
Norm1Calculates the matrix norm-1.
Normalize (12)Normalize data.
NormC (4)The C-norm.
NormFroCalculates the matrix Frobenius norm.
NormInfCalculates the matrix infinity norm.
NormL1 (4)The L1-norm.
NormL2 (4)The L2-norm.
Offset (4)Add/Subtract a value.
ParseParses string content as vector.
PasclConstructs a Pascal matrix.
PCValuesReturns a pointer to the double precision complex value stored at Row and Col.
PCValues1DObtaines a pointer to the complex value of the vector at Index.
PhaseSpectrum (2)The phase angles (spectrum) of object elements.
PixelDownSampleCreates a reduced size dense matrix for screen display (bitmap) to show the matrix pattern.
PixelResampleAllows to exactly specify the size of the destination matrix with PixelsHeight and PixelsWidth parameters.
PolarToCart (2)Converts the polar magnitude/phase pairs to cartesian pairs.
Power (7)Raises base object elements to any power.
PowerMtxRaises matrix 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.
PSCValuesReturns a pointer to the single precision complex value stored at Row and Col.
PSCValues1DObtaines a pointer to the complex value of the vector at Index.
PSValuesReturns a pointer to the single value stored at Row and Col.
PSValues1DObtains a pointer to the real value of the vector at Index.
PValuesReturns a pointer to the double value stored at Row and Col.
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.
RandUniform (3)The pseudo random sample generator with continuous uniform distribution.
Range (3)Calculate the range from all calling object elements.
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.
ReplaceNAN (2)Replaces all NAN values with Value.
Reset
Resize (2)Resizes the matrix, while preserving the values in already allocated memory.
ResizeAndTransposeResize and transpose.
Reverse (2)Reverse vector elements.
RMS (2)Root mean square (RMS).
Rotate (2)A cyclic shift on vector elements in range.
Rotate90 (2)Rotates matrix rows 90 degrees clockwise.
Round (5)Elements rounded to the nearest whole number.
RowExchangeExchanges two matrix rows.
RowPermutePermute the rows of the Src matrix.
SaveToFileWrite object header and values to a file.
SaveToMatrixMarketFileSaves matrix data to MatrixMarket ASCII file format.
SaveToStreamLoad the component from the .NET framework Stream.
Scale (4)Multiply object elements with Value.
ScaleCols (2)Scale all matrix columns with values from Src.
ScaleRows (2)Scale all matrix rows with values from Src.
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 (2)
SCValues1D
SDataIndex (2)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.
SelectAllResets any defined selection.
set_CValues (2)
set_CValues1D
set_DefaultArray
set_SCValues (2)
set_SCValues1D
set_SValues (2)
set_SValues1D
set_Values (2)
set_Values1D
SetCapacity
SetCapacityInElements
SetCol (2)Copies values from vector to matrix column.
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 (3)Sets object values.
SetLength
SetObjectFromByteArrayReads the properties of the object from the array of bytes.
SetRow (2)Copies values from vector to matrix row.
SetSingle (2)Sets object values (single).
SetSubIndexDefines a subarray.
SetSubRange (4)Defines a sub vector/matrix.
SetSubRangeLevel (2)Defines a sub vector/matrix and pushes any previous subranges on to a stack.
SetVal (6)Initialize elements to Value.
SetZero (3)Initializes object elements to zero.
Sgn (4)Computes signum function of calling object elements.
SgnMulSignum.
Shift (2)Shift vector elements in range.
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 (8)Size the object.
SizeFromArray (4)Sizes the calling matrix to match the size of the array.
SizeToArray (12)Sizes the array.
Skewness (3)Skewness (third central momentum).
SortAscend (2)Sorts the elements in a matrix row(s) in ascending order.
SortDescend (2)Sorts the elements in a matrix row(s) in descending order.
SplitSplits matrix in blocks.
Sqr (4)Square.
SqrAddScaled (8)Compute sqr(X) + sqr(Y)*yScale
SqrElem (2)Depreciated.
Sqrt (4)Square root.
SqrtElem (2)Depreciated.
StdDev (6)Standard deviation.
StdDevColsStandard deviation for matrix columns.
StdDevRowsStandard deviation for matrix rows.
StringsToValues (5)Convert strings to double (TCplx) and store them in the Values array.
Sub (18)Compute X - Y - Z
SubAndMul (50)Compute (X - Y)*Z
SubFrom (8)Subtraction from value.
SubRangeLevelReturns the current subrange stack level.
SubScaled (12)Compute X - Y*yScale - Z*zScale
SubScaledC (8)Compute X - Y*yScale - zScalar
Sum (5)Sums vector values.
Sumc (2)Sum (complex value).
SumColsCalculates the sum of each of the calling matrix columns.
SumOfSquares (2)Calculate the Sum of squares of the calling vector.
SumRowsCalculates the sum of each of the calling matrix rows.
SValues (2)
SValues1D
SVD (2)Singular value decomposition.
SVDGen (2)Computes generalized singular value decomposition.
SVDSolve (2)Calculates the minimum norm solution to a real linear least squares problem.
SylvesterSolves the Sylvester equation.
Tan (4)Tangens.
Tanh (4)Hyperbolic tangens.
TensorProdCalculates the tensor product of two vectors.
TextToValues
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.
Toeplitz (2)Constructs a Toeplitz matrix.
ToolTip
ToStringReturns content as a string.
TraceMatrix trace.
Transp (2)Transposes matrix.
Trunc (5)Rounds a real number towards zero.
TruncAndFrac (2)Rounds a real number towards zero and returns the fractional part.
UpperTriangleConstructs upper triangular matrix.
UpSampleInserts zeroes between consecutive array values.
ValidateCplxArrayIndexes
ValidateParams (4)
ValidateParams2
ValidateParamsPrecision (3)
ValidateRealArrayIndexes
Values (2)
Values1D
ValuesToStrings (4)Converts the content of the matrix Values array to a list of strings.
ValuesToText (2)Converts all calling matrix elements to string.
VanderMondeConstruct VanderMonde matrix.
WriteHeader (2)
WriteValues (2)Writes the header information for the calling vector to a stream.
ZScoreTransforms matrix into matrix of standardized data.

Operators

NameDescription
operator!= (4)Returns true, if any elements in Left are not equal to Right.
operator()
operator* (4)Multiply all elements in Left with corresponding elements in Right.
operator+ (4)Add coresponding elements in Left and Right.
operator- (6)Subtracts Right from Left and returns result.
operator/ (4)Divide all elements in Left with coresponding elements in Right.
operator== (4)Returns true, if all elements of Left are equal to Right.
operator[]

Fields

NameTypeDescription
AlfaTCplxAdditional parameter for certain Lapack methods.
BetaTCplxAdditional parameter for certain Lapack methods.
CDataDewArray<double>
fRefCountint
SCDataDewArray<float>
SDataDewArray<double>
SSDataDewArray<float>
ThreadIDlong long