MatrixInt Struct

Header: Dew.Math/MtxExprInt.h · Cross-compiler

struct MatrixInt;

Integer vector class for operator overloading (Delphi 2006 and later).

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

Constructors

NameDescription
MatrixInt (13)Constructor of the record.

Destructors

NameDescription
~MatrixInt

Properties

NameTypeDescription
BlockEndboolReturns true, if the currrent subrange of the vector was also the last subrange in the MatrixInt.
Capacitylong longSizing the object will not allocate less than Capacity samples.
CapacityStepdoubleSpecifies increment step for the Capacity property.
CaptionDewStringVector Caption.
ColsintDefines the number of matrix columns.
ColsBitCountintDefines number of bits stored in one row.
ConditionCheckboolEnables/disable inline condition checking.
DataTMtxInt*
FirstintFirst element in object Values array.
IntegerValuesDewStringReturns data for inspection by the debugger.
IntPrecisionTIntPrecisionDefines internal storage precision which can be either 32, 16 or 8 bit.
IsSubRangeboolSet to true after the SetSubIndex or SetSubRange call.
LastintLast element in object Values array.
LeadingColsintDefines the number of leading columns.
LengthintDefines the length in number of samples.
RowsintDefines the number of matrix Rows.
ScaleFactorintSpecifies the power of two for the scale factor used by some methods.
TagintStores an integer value as a part of the object.

Methods

NameDescription
__Hold
__LiteralRows
__Retain
Abs (4)Absolute values.
Add (12)Add coresponding elements in Src2 to Src1.
AddAndMul (26)Compute (X + Y)*Z
AddScaled (10)Compute X + Y*yScale
AddScaledC (4)Compute X + Y*yScale + zScalar
AddScaledSqr (4)Compute sqr(X + Y*yScale)
Adopt (2)Adopts TMtxInt object.
Assign
AssignWithoutCopy
BinaryAnd (8)Apply binary "and" between coresponding elements in Src1 and Src2.
BinaryNot (4)Applies binary "not" operation to elements stored in the object.
BinaryOr (8)Apply binary "or" between coresponding elements in Src1 and Src2.
BinarySearch (4)Finds a match for X in object values using binary search.
BinaryXor (8)Apply binary "xor" between elements in the calling object and Value.
BitPack (2)Converts Src to packed bit storage.
BitShift (4)Apply binary shift by number of Bits to the left (positive) or right (negative) for all elements in the calling object.
BitShiftLeft (4)Apply binary shift by number of Bits to the left for all elements in the calling object.
BitShiftRight (4)Apply binary shift by number of Bits to the right for all elements in the calling object.
BitSizeSizes the matrix according to bit storage required.
BitUnpack (2)Converts Src to packed bit storage.
BlockFinishDeinitializes block processing before the final block is processed.
BlockInit (4)Initializes block processing.
BlockNextObtains the next subrange of the data.
BValues
BValues1D
ClearSets vector 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.
Convert (2)Copy each of Vec elements to the calling object.
Copy (3)Copy object values.
CopyFromArray (17)Copies values from a real Src array.
CopyToArray (17)Copies values from the calling object to the Dst array and converts data to double precision numbers.
CopyVec (2)Copies values from vector to a matrix.
CountInRange (2)Returns number of values within the interval.
CreateFromCache
CumSum (4)Cumulative sum.
DataIndex (2)
DiagSets the matrix diagonal to values from the vector.
DifferenceDifference.
DisableSelectPrevents calls to MatrixInt::Select.
DisableSubrangePrevents calls to MatrixInt::SetSubRange.
Disown (2)Disowns a pointer to an array from matrix Values1D.
Dispose
DivAndAdd (12)Compute X/Y + Z
DivAndSub (12)Compute X/Y - Z
Divide (12)Divides coresponding elements in Num with Den.
DivideBy (4)Divide Value with calling vector elements.
DivideC (2)Compute X / (Y*zScale)
EnableSelectEnables calls to MatrixInt::Select.
EnableSubrangeEnables calls to MatrixInt::SetSubRange.
EqualCompares two matrices.
Equals
EyeConstructs an eye matrix.
Find (2)Finds a match for X in object values.
FindAndSplit (3)Finds the masks for a vector and splits it.
FindMask (5)Finds a vector mask.
FlipHor (2)Flips the matrix elements horizontally.
FlipVer (2)Flips the matrix elements vertically
get_Bits
get_BValues
get_BValues1D
get_IValues
get_IValues1D
get_SValues
get_SValues1D
GetHashCode
GetSelect
GetSelect2D
GetSelectIndex
GetSelectIndex2D
IndexOfReturns the 1D index in to the matrix.
IsEqual (4)Compares Value with all calling object elements.
IValues
IValues1D
KronThe Kronecker product between two vectors.
LoadFromFileReads the header information and the values array content from the file.
LoadFromStream
LogicalNot (4)Applies logical "not" operation to elements stored in the object.
LowerTriangleConstructs lower triangular matrix.
Max (4)Maximum value.
MaxColsCompute maximum of each column.
MaxMin (2)Calculate minimum and maximum in one procedure call.
MaxMinColsCompute maximum and minimum of each column.
MaxMinIdx (2)Calculate minimum, maximum and their indices in one procedure call.
MaxMinRowsCompute maximum and minimum of each row.
MaxRowsCompute maximum of each row.
Median (2)Applies median filter with size Mask to the calling vector elements [Index.. Index+Len-1].
Min (4)Minimum value.
MinColsCompute minimum of each column.
MinRowsCompute minimum of each row.
Mul (4)Compute X*Y*Z
MulAndAdd (14)Compute X*Y + Z
MulAndDiv (6)Compute X * Y / Z
MulAndSub (14)Compute X*Y - Z
MulElem (2)Matrix array multiplication.
Multiply (8)Multiplies coresponding elements in Src2 with Src1.
ParseParses string content as vector.
PBValues (2)Obtains a pointer to the integer value of the vector at Index.
PIValues (2)Obtains a pointer to the integer value of the vector at Index.
PSValues (2)Obtains a pointer to the integer value of the vector at Index.
PValues1DObtains a pointer to the integer value of the vector at Index.
RampFills the calling vector elements [Index]..[Index+Len-1].
ReadHeaderReads the header information from a stream to object.
ReadValuesRead values content from stream to object.
RemDiv (6)Divide all Src elements with Value elements and store result of division in the calling object and reminder in RemDst.
ResetResets object properties to default values.
Resize (2)Sizes the calling matrix to NewRows and NewCols.
ResizeAndTransposeResize and transpose.
Reverse (2)Reverse vector elements.
Rotate (2)A cyclic shift on vector elements in range.
Rotate90 (2)Rotates matrix Rows 90 degrees clockwise.
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.
SaveToStream
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.
Select
SelectAllResets any defined selection.
set_Bits
set_BValues
set_BValues1D
set_IValues
set_IValues1D
set_SValues
set_SValues1D
SetCol (2)Copies values from vector to matrix column.
SetFullRangeResets any defined subrange.
SetFullRangeLevelResets last defined subrange and pops the subrange stack.
SetIt (2)Sets object values.
SetRow (2)Copies values from vector to matrix row.
SetSelect
SetSelect2D
SetSelectIndex
SetSelectIndex2D
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 (3)Set all calling object elements to Value.
SetZero (3)Set all calling vector elements to zero.
Shift (2)Perform a shift on vector elements in range.
Size (4)Sets the size of matrix.
SizeFromArray (3)Sets the size of the vector to match an array.
SizeToArray (10)Sizes complex array.
SortAscend (4)Sort calling vector elements [Index..Index+Len-1] in ascending order in-place.
SortDescend (4)Sort calling vector elements [Index..Index+Len-1] in descending order in-place.
SplitSplits matrix in blocks.
SqrAddScaled (4)Compute sqr(X) + sqr(Y)*yScale
StringsToValues (4)Convert strings to integers and store them in the Values array.
Sub (4)Compute X - Y - Z
SubAndMul (26)Compute (X - Y)*Z
SubScaled (6)Compute X - Y*yScale - Z*zScale
SubScaledC (4)Compute X - Y*yScale - zScalar
Subtract (8)Subtract coresponding elements in Src2 from Src1.
SubtractFrom (4)Subtract all calling vector elements from integer Value.
Sum (2)Sums vector values.
SumColsCalculates the sum of each of the calling matrix columns.
SumRowsCalculates the sum of each of the calling matrix Rows.
SValues
SValues1D
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_LT (4)Threshold greater than and less than operation.
ThreshTop (4)Threshold top operation.
ToStringReturns content as a string.
Transp (2)Transposes matrix.
UpperTriangleConstructs upper triangular matrix.
ValuesToStrings (4)Converts the content of the matrix Values array to a list of strings.
ValuesToText (2)Converts all calling matrix elements to string.
WriteHeaderWrites the header information for the calling vector to a stream.
WriteValuesWrites object Values content to a stream.

Operators

NameDescription
operator DewArray<double>Explicitely convert MatrixInt to array of doubles.
operator DewArray<float>Explicitely convert MatrixInt to array of doubles.
operator DewArray<int>Explicitely convert MatrixInt to array of integer.
operator DewArray<short>Explicitely convert MatrixInt to array of integer.
operator DewArray<unsigned char>Explicitely convert MatrixInt to array of integer.
operator TMtxInt *
operator!Performs logical (and bitwise) "not" on the Value.
operator!= (8)Returns true, if Left and Right do not have equal Length and Values.
operator& (3)Computes bitwise "and" between Left and right.
operator() (12)
operator* (5)Multiply all elements in Left with Right.
operator+ (5)Add left to all elements in Right and return result.
operator- (6)Subtract all elements in Right from Left.
operator->
operator/ (5)Divide all elements in Left with Right.
operator< (3)Returns true, if all elements of ALeft are smaller from ARight.
operator<<Performs bitwise left shift of aValue.
operator<= (3)Returns true, if all elements of ALeft are smaller or equal from ARight.
operator= (3)
operator== (8)Returns true, if Left and Right are of equal Length and Values.
operator> (3)Returns true, if all elements of ALeft are greater from ARight.
operator>= (3)Returns true, if all elements of ALeft are greater or equal from ARight.
operator>>Performs bitwise right shift of aValue.
operator^ (3)Performs logical "xor" between Left and Right.
operator| (3)Computes bitwise "or" between Left and right.

Fields

NameTypeDescription
FDataTMtxInt *