Matrix Record

Source: MtxExpr.cs · Assembly: Dew.Math

public struct Matrix

Matrix class for operator overloading in D2006 and later.

Declare Matrix instead of TMtx to take advantage of operator overloading in D2006 and later. Be carefull to declare Matrix only for local variables with short lifetime. Call the Create method for Matrix, if the variable is a global variable or a variable with a longer life. It also makes sense to continue to use TMtx for global vars. If the Create method (constuctor) is not called, the Matrix record obtains TMtx object from object cache (fast create). If the Create mehod is called, the TMtx object is created (slower) for use by Matrix record. Object cache has limited size.

Note
Calling the Create method (constructor) is not mandatory.

Properties

NameTypeDescription
AlfaTCplxAdditional parameter for certain Lapack methods.
AutoMtxTypeBooleanDefines if matrix type will be checked automatically.
BackErrorDoubleThe component-wise backward error.
BalanceTBalanceTypeDefines matrix balancing method.
BetaTCplxAdditional parameter for certain Lapack methods.
BlockEndBooleanReturns true, if the currrent subrange of the Matrix was also the last subrange in the Matrix.
CapacityInt64Sizing the object will not allocate less than Capacity samples.
CapacityStepDoubleSpecifies increment step for the Capacity property.
CaptionStringObject caption.
ColsInt32Defines the number of matrix columns.
ComplexBooleanDefines if object values are complex.
ComplexValuesStringDebugging aid.
ConditionCheckBooleanEnables/disable inline condition checking.
ConditionNrDoubleStores the condition number reciprocial value after the call to LUSolve.
ConditionNumberTConditionNumberDefines the norm used to compute the condition number.
FFTOddLengthBooleanDefines if FFT transform length is odd.
FFTScrambledBooleanLeave FFT scrambeled.
FFTStorageFormatTFFTStorageFormatFFT 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.
ForwErrorDoubleThe component-wise forward error.
InfoInt32The info parameter as returned by the last called LAPACK function.
IsSubRangeBooleanSet to true after the SetSubIndex or SetSubRange call.
ItemDoubleAccess elements of the matrix without specifying the name of the property.
LastDoubleLast element in object Values array.
LastcTCplxLast complex element in object CValues array.
LeadingColsInt32Defines the number of leading columns.
LengthInt32Defines the length of matrix in number of samples.
MtxErrorStringThe type of the error condition signaled by LAPACK.
PrecisionTPrecisionDefines the precision used by streaming routines.
QuadraticBooleanTrue, if matrix is quadratic (rows=cols).
RealValuesStringDebugging aid.
RefineSolutionBooleanEnables/disables the refining of the solution of the system of linear equations.
RoundingTRoundingDefines the rounding used by streaming routines.
RowsInt32Defines the number of matrix rows.
SubDiagInt32The number of subdiagonals in banded matrices.
SubRangeLevelInt32Returns the current depth of SubRange stack.
SuperDiagInt32The number of superdiagonals in banded matrices.
TagInt32Stores an integer value as a part of Matrix object.
TriangleFormTTriangleFormDetermine which part (upper or lower) of the symmetric, hermitian or triangular matrix is set.
TriangleUnitBooleanDetermine, if the matrix is unit triangular.
ZeroToleranceDoubleThe tolerance used by Dew.Math.Matrix.IsEqual.

Methods

NameDescription
Abs (4)Absolute values.
Add (18)Adds complex Value to all calling object complex elements.
AddAndMul (50)Compute (X + yScalar)*zScalar
AddDiagAdds (main) diagonal matrix to the calling matrix.
AddProduct (2)Add a product of two matrices.
AddScaled (25)Add each of Vec elements to corresponding elements in the calling object.
AddScaledC (8)Compute X*xScale + Y*yScale + zScalar
AddScaledSqr (8)Compute sqr(X*xScale + Y*yScale)
AddTensorProdCalculates the tensor product of two vectors and adds the result to calling matrix.
Adjung (2)Adjungate matrix.
AdoptAdopts TMtx object.
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.
BandedToDenseConvert banded matrix to dense.
BinarySearch (2)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.
CartToPolar (2)Converts elements from cartesian to polar coordinate form.
Cbrt (4)The cube root.
Ceil (4)Rounds towards positive infinity.
CholeskyTest if the matrix is semi positive definite.
ClearSets Matrix size to zero.
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 (8)Copy the Mtx elements [MtxRow,MtxCol]..[MtxRow+NrRows-1,MtxCol+NrCols-1] to the calling matrix elements [Row,Col],,[Row+NrRows-1,Col+NrCols-1].
CopyFromArray (14)Copies values from an array.
CopyTo (7)Copy and convert values to TMtxInt.
CopyToArray (14)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.
Csc (4)Cosecant.
Csch (4)Hyperbolic cosecant.
ctor (4)Uses Src object as internal storage.
CumProduct (2)Calculate the cumulative product for all Vec elements.
CumSum (4)Cumulative sum for each of the matrix columns.
DCTThe forward discrete cosine transform (DCT).
DegToRad (4)Convert degrees to radians (in-place).
DenseToBandedConvert dense matrix to banded.
DetectMtxTypeDetermines type of the matrix.
DeterminantDeterminant of squared matrix.
DeterminantcCalculates the determinant of squared complex matrix.
DiagSets the matrix diagonal to values from the vector.
DifferenceDifference.
DisableSelectPrevents calls to Dew.Math.Units.MtxExpr.Select.
DisableSubrangePrevents calls to Dew.Math.Matrix.SetSubRange.
Disown (2)Disowns a pointer to an array from calling matrix Values1D.
DivAndAdd (22)Compute X/Y + zScalar
DivAndSub (22)Compute X/Y - zScalar
Divide (14)Compute xScalar / (Y*Z)
DivideBy (8)Divide complex Value with elements of the calling object and store the result in the calling object.
DivideC (4)Compute X / (Y*zScale)
DotProdScalar product of two real arrays.
DotProdc (2)Returns the scalar product between Vec (complex) elements [VecIndex]..[VecIndex+Len-1] and calling object (complex) elements [Index]..[Index+Len-1].
DownSampleDownsamples object values.
Eig (4)Calculate the calling matrix eigenvalues and eigenvectors.
EigGen (2)Computes generalized eigenvalues and eigenvectors of a non-symmetric matrix.
EigSchure (2)Computes eigenvalues and optionally Schure matrix
EigSchureGenComputes generalized eigenvalues and Schur vectors of a non-symmetric matrix.
EigSym (3)Computes all eigenvalues of a symmetric (Hermitian) matrix between min and max Index.
EigSymGen (3)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 Dew.Math.Units.MtxExpr.Select.
EnableSubrangeEnables calls to Dew.Math.Matrix.SetSubRange.
Equal (2)Compares two matrices.
Erf (4)Error function of self (in-place).
Erfc (4)Complementary error function of self (in-place).
ErfInv (4)Inverse error function of self (in-place).
Exp (4)Exponent (e^).
Exp10 (4)Exponent base 10 (10^).
Exp2 (4)Exponent base 2 (2^).
Expj (3)A complex exponential e^(j*W).
ExtendToComplex (3)Extend Vec object to complex calling object.
EyeConstructs 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-dimentional 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)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.
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.
GetSchemaReturns null.
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 not in-place 1D FFT.
IFFT1DToReal (2)Inverse parallel not in-place 1D complex to real FFT.
IFFT2D (2)Inverse two-dimensional Fast Fourier Transformation from complex to complex.
IFFT2DToReal (2)Inverse two-dimensional Fast Fourier Transformation from complex to real.
IFFTToRealThe inverse FFT from complex to real.
ImagPart (2)Gets the imaginary part of a complex object.
IntPower (2)Calculate the power Base^(Exponent) for all Base object elements using the integer Exponent value and store the results in calling object.
Inv (9)Calculates matrix inverse (Mtx^-1).
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.
IsEqual (8)Compares complex Value with all calling object elements.
KacConstruct the Kac (Clement) matrix.
KronThe Kronecker product between two vectors.
Kurtosis (2)The Kurtosis (fourth central momentum).
Ln (4)Natural logarithm.
LoadFromFileReads the header information and the values array content from the file.
LoadFromStreamReads the header information and the values array content from a 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).
LUGeneral LU, Cholesky or Bunch-Kaufmann factorization.
LUSolve (5)Desc Matrix version of LUSolve. Perfroms a LUSolve for each B and X matrices columns in single pass.
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 (5)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 (3)Mean value.
Meanc (4)Mean value (complex).
MeanColsCalculates the mean value of each of the matrix columns.
MeanRowsCalculates the mean value of each of the matrix rows.
Median (2)Median.
Min (5)Minimum value.
Minc (3)Minimum value (complex).
MinColsCompute minimum of each column.
MinEvery (4)Vectorised minimum.
MinRowsCompute minimum of each row.
MtxFunctionCompute matrix function as a function of matrix.
MtxIntPowerCalculates the matrix to integer power.
MtxPower (2)Calculate the matrix to complex power Exponent.
MtxSqrtCalculates the square root of the matrix.
Mul (16)Multiply all calling object elements with complex Value in-place.
MulAndAdd (26)Compute (X*yScalar) + zScalar
MulAndDiv (10)Compute X * Y / zScalar
MulAndSub (26)Compute X*yScalar - Z*zScale
MulDiagLeft (2)Multiply matrix with diagonal matrix from the left.
MulDiagRight (2)Multiply matrix with diagonal matrix from the right.
MulElem (8)Matrix array multiplication.
MulI (4)Multiply elements by imaginary unit.
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 by subtracting a complex constant SubOffset from Vec elements and dividing the result by complex constant DivFactor.
NormC (4)The C-norm of calling Matrix.
NormFroCalculates the matrix Frobenius norm.
NormInfCalculates the matrix infinity norm.
NormL1 (4)The L1-norm of the calling Matrix.
NormL2 (4)The L2-norm of the calling Matrix.
Offset (4)Add/Subtract a complex value.
ParseParses string content as vector.
PasclConstructs a Pascal matrix.
PCValues1DObtains a pointer to the complex value of the Matrix 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 all calling Matrix elements to complex power Exponent in-place.
PowerMtxRaises matrix elements to any power.
PowerSpectrum (2)The power spectrum from object complex values.
PowerVecRaises Base object elements to Exponent object elements power.
Product (6)Elements product.
Productc (2)Elements product.
PSCValues1DObtains a pointer to the complex value of the Matrix at Index.
PSValues1DObtains a pointer to the real value of the Matrix at Index.
PValues1DObtains a pointer to the real value of the Matrix at Index.
RadToDeg (4)Convert radians to degrees (in-place).
RandGauss (3)The pseudo random sample generator with Gaussian distribution.
RandomShuffleRandomly shuffles the content of the matrix.
RandUniform (3)The pseudo random sample generator with continuous uniform distribution.
Range (3)Calculate the range from all calling object elements.
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.
ReplaceNAN (2)Replaces all NAN values with Value.
ResetResets object properties to default values.
Resize (2)Performs resize of the calling matrix to NewRows and NewCols.
ResizeAndTransposeResize and transpose.
Reverse (2)Reverse Matrix elements.
RMS (2)Root mean square (RMS).
Rotate (2)A cyclic shift on Matrix 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.
SaveToStreamWrites the header information and the Values content to a stream.
Scale (4)Multiply all calling object elements with a complex Value in-place.
ScaleCols (2)Scale all Mtx matrix columns with values from Src.
ScaleRows (2)Scale all Mtx matrix rows with values from Src.
ScatterScatter object elements.
ScatterByIncrScatter object elements.
ScatterByIndexesScatter object elements.
ScatterByMaskScatter object elements.
Sec (4)Secant.
Sech (4)Hyperbolic secant.
SelectAllResets any defined selection.
SetCol (2)Copies values from vector to matrix column.
SetDoubleSets object values (double).
SetFullRangeResets any defined subrange.
SetFullRangeLevelResets any defined subrange and pops the stack.
SetIntegerSets object values (integer).
SetIt (3)Sets object values.
SetRow (2)Copies values from vector to matrix row.
SetSingleSets object values (single).
SetSubIndexDefines a subarray.
SetSubRange (4)Sets the subarray size to full size. This method is the same as the Dew.Math.Matrix.SetFullRange method.
SetSubRangeLevel (2)Defines a sub Matrix/matrix and pushes the stack.
SetVal (6)Set all calling object complex elements to complex Value.
SetZero (3)Initializes object elements to zero.
SgnMulSignum.
Shift (2)A shift on Matrix elements in range.
Sign (4)Changes elements sign.
Sin (4)Sine.
SinCos (2)Sine and cosine.
Sinh (4)Hyperbolic sine.
SinhCosh (2)Hyperbolic sine and cosine.
Size (7)Size the object.
SizeFromArray (2)Sizes the calling matrix to match the size of the array.
SizeToArray (8)Sizes the array.
Skewness (2)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)*xScale + sqr(Y)*yScale
Sqrt (4)Square root.
StdDev (6)Standard deviation.
StdDevColsStandard deviation for matrix columns.
StdDevRowsStandard deviation for matrix rows.
StringsToValues (2)Convert strings from [ListIndex]..[ListIndex+ListLen-1] in aList to double (TCplx).
Sub (18)Subtracts complex Value from all calling object complex elements.
SubAndMul (50)Compute (X - yScalar)*zScalar
SubFrom (8)Subtract each of calling object elements from complex Value.
SubScaled (12)Compute X*xScale - Y*yScale - Z*zScale
SubScaledC (8)Compute X*xScale - Y*yScale - zScalar
Sum (5)Sums Matrix values.
Sumc (2)Sum (complex value).
SumColsThe sum of each of the calling matrix columns.
SumOfSquares (2)Calculate the Sum of squares of the calling Matrix.
SumRowsThe sum of each of the calling matrix rows.
SVD (2)Matrix version of SVD. Perfroms a SVD for each U and V matrices columns in single pass.
SVDGenComputes generalized singular value decomposition.
SVDSolve (2)Matrix version of SVDSolve. Perfroms a SVDSolve for each U and V matrices columns in single pass.
SylvesterSolves the Sylvester equation.
Tan (4)Tangens.
Tanh (4)Hyperbolic tangens.
TensorProdCalculates the tensor product of two vectors.
TextToValuesConverts text delimited with Delimiter to numbers.
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 and store the results in calling object.
ThresholdGT (8)Perform "greater than" threshold operation for complex numbers on all Vec object values and store the results in calling object.
ThresholdGT_LT (4)Perform "greater than and less than" threshold operation on all Vec object values and store the results in calling object.
ThresholdLT (8)Perform "less than" threshold operation for complex numbers on all Vec object values and store the results in calling object.
ThreshTop (4)Perform threshold operation on all Src object values and store the results in calling object.
Toeplitz (2)Constructs a Toeplitz matrix with first row equal to FirstRow vector and first column equal to FirstRow vector, but without the first element.
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.
ValuesToStrings (2)Convert calling matrix elements, starting with [Row,Col] and converting Len elements to strings with formating real parts with ReFormat, imaginary parts with ImFormat.
ValuesToTextConverts data to delimited string using Delimiter and number formatting options.
VanderMondeConstruct VanderMonde matrix.
WriteHeaderWrites the header information for the calling Matrix to a stream.
WriteValuesWrites object Values content to a stream.
WriteXmlWrite the object to the .NET XML stream.
ZScoreTransforms matrix into matrix of standardized data.

Operators

NameDescription
op_Addition (7)Adds Left to Right and returns result.
op_Division (7)Dividies Left with Right and returns result.
op_Equality (9)Returns true, if all elements of Left are equal to Right.
op_Explicit (5)Copies data in AValue to T2DCxplArray and returns result.
op_GreaterThan (7)Returns true, if ALeft is greater than ARight.
op_GreaterThanOrEqual (7)Returns true, if ALeft is greater than or equal to ARight.
op_Implicit (12)Dereferences internal TMtx objects and returns a pointer.
op_Inequality (9)Returns true, if any elements in Left are not equal to Right.
op_LessThan (7)Returns true, if ALeft is less than ARight.
op_LessThanOrEqual (7)Returns true, if ALeft is less than or equal to ARight.
op_Multiply (9)Multiplies Left with Right and returns result.
op_Subtraction (7)Subtracts Right from Left and returns result.
op_UnaryNegationNegates AValue and returns result.