Vector Struct

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

struct Vector;

Vector class for operator overloading (Delphi 2006 and later).

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

Constructors

NameDescription
Vector (15)Internally creates TVec object without using object cache.

Destructors

NameDescription
~Vector

Properties

NameTypeDescription
AlfaTCplxAdditional parameter for certain Lapack methods.
BetaTCplxAdditional parameter for certain Lapack methods.
BlockEndboolReturns true, if the currrent subrange of the vector was also the last subrange in the vector.
Capacitylong longSizing the object will not allocate less than Capacity samples.
CapacityStepdoubleSpecifies increment step for the Capacity property.
CaptionDewStringVector Caption.
ComplexboolDefines if object values are complex.
ComplexValuesDewString
ConditionCheckboolEnables/disable inline condition checking.
DataTVec*
FFTOddLengthboolDefines if FFT transform length is odd.
FFTScrambledboolLeave 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.
IsDoublebool
IsSubRangeboolSet to true after the SetSubIndex or SetSubRange call.
LastdoubleLast element in object Values array.
LastcTCplxLast complex element in object CValues array.
LengthintDefines the length in number of samples.
PrecisionTPrecisionDefines the precision used by streaming routines.
RealValuesDewString
RoundingTRoundingDefines the rounding used by streaming routines.
SubRangeLevelintReturns the current depth of SubRange stack.
TagintStores an integer value as a part of the object.
ZeroTolerancedoubleThe tolerance used by Vector::IsEqual.

Methods

NameDescription
__Hold
__Retain
Abs (4)Absolute values.
Add (18)Adds Value to object elements.
AddAndMul (50)Compute (X + Y)*Z
AddProduct (2)Add a product of two vectors.
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)
Adopt (2)Adopts TVec object.
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
AssignWithoutCopy
AutoCorrBiasedBiased auto-correlation.
AutoCorrNormalNormal auto-corellation.
AutoCorrUnBiasedUnbiased auto-correlation.
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.
CartToPolar (2)Converts elements from cartesian to polar coordinate form.
Cbrt (4)The cube root.
Ceil (4)Rounds towards positive infinity.
ClearSets vector size to zero.
Concat (2)Concatenates an array of TVec objects.
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.
ConvolveSingle-rate finite, linear convolution of two sequences.
Copy (7)Copy object values.
CopyFromArray (12)Copies values from an array.
CopyTo (5)Copy and convert values to TVecInt.
CopyToArray (12)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.
CreateFromCache
CrossCorrThe cross-correlation of two vectors.
Csc (4)Cosecant.
Csch (4)Hyperbolic cosecant.
CumProduct (4)Calculate the cumulative product for all Vec elements.
CumSum (4)Cumulative sum.
CValues
DCT (3)The forward discrete cosine transform (DCT).
DegToRad (4)Convert degrees to radians (in-place).
DiagCopies the k-th diagonal from the TMtx object.
Difference (3)Difference.
DisableSelectPrevents calls to Vector::Select.
DisableSubrangePrevents calls to Vector::SetSubRange.
Disown (3)Disowns a values pointer.
Dispose
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)
DotProd (2)Scalar product of two real arrays.
DotProdc (4)Scalar product of two complex arrays.
DownSample (2)Downsamples object values.
EnableSelectEnables calls to Vector::Select.
EnableSubrangeEnables calls to Vector::SetSubRange.
Equal (2)Compares vector elements and returns true if vectors are equal.
Equals
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)Extends a real object to a complex object.
FFT (3)Fast Furier Transformation (FFT) from complex to complex or from real to complex.
FFTFromReal (3)The forward Fast Fourier Transformation (FFT) from real to complex.
Find (2)Finds a match for X in object values.
FindAndGather (3)Finds and gathers vector 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.
GatherGather vector elements.
GatherByIncrGather vector elements.
GatherByIndexGather vector elements.
GatherByMaskGather vector elements.
GatherSplitGather a vector, split to two vectors.
get_CValues
get_SCValues
get_SValues
get_Values
GetCol (3)Copies a column from matrix.
GetHashCode
GetRow (3)Copies a row from matrix.
GetSelect
GetSelectIndex
GroupSumSums items from Src with matching corresponding indexes from Bins and places result in self.
GroupSumIterationSums items from Src with matching corresponding indexes from Bins and places result in self.
HilbertThe fast hilbert transform (FFT based).
IDCT (3)The inverse discrete cosine transform (DCT).
IFFT (3)The inverse FFT from complex to complex.
IFFTToReal (3)The inverse FFT from complex to real.
ImagPart (2)Gets the imaginary part of a complex object.
Integrate (2)Integrate calling vector values.
IntPower (2)Power (integer exponent).
Inv (8)Invert elements.
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 two objects and returns True, if they are equal.
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.
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 (5)Maximum value.
Maxc (3)Maximum value.
MaxEvery (4)Vectorised maximum.
MaxMin (4)Maximum and minimum value in a single pass.
Mean (3)Mean value.
MeanAndStdDev (2)Returns the standard deviation of all calling object elements.
Meanc (4)Mean value.
Median (2)Median.
Min (5)Minimum value.
Minc (3)Minimum value.
MinEvery (4)Vectorised minimum.
Mul (18)Multiply object elements with Value.
MulAndAdd (26)Compute X*Y + Z
MulAndDiv (10)Compute X * Y / Z
MulAndSub (26)Compute X*Y - Z
MulI (4)Multiply elements by imaginary unit I.
NormThe norm of a vector.
Normalize (12)Normalize data.
NormC (4)The C-norm.
NormL1 (4)The L1-norm.
NormL2 (4)The L2-norm.
Offset (4)Add/Subtract a value.
ParseParses string content as vector.
PCValues1DObtains a pointer to the complex value of the vector at Index.
PhaseSpectrum (2)The phase angles (spectrum) of object elements.
PixelDownSample (2)Downsamples (reduces) the number of vector elements.
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.
PrimeNumbersFills vector with prime numbers, starting from 2 up to the value of n.
Product (6)Elements product.
Productc (2)Elements product.
PSCValues1D
PSValues1D
PValues1DObtains a pointer to the real value of the vector at Index.
RadToDeg (4)Convert radians to degrees (in-place).
Ramp (7)Fills the calling vector with a series following linear rule.
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.
ReadHeaderReads the header information from a stream to object.
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.
Rem (4)The Reminder after division X/Y.
Replace (4)Search and replace a value.
ReplaceNAN (2)Replaces all NAN values with Value.
ResetResets object properties to default values.
Resize (2)Resizes vector size while preserving values.
Reverse (4)Reverse vector elements.
RMS (2)Root mean square (RMS).
Rotate (4)A cyclic shift on vector elements in range.
Round (5)Elements rounded to the nearest whole number.
SaveToFileWrite object header and values to a file.
SaveToStreamWrites the header information and the Values content to a stream.
Scale (4)Multiply object elements with Value.
ScatterScatter object elements.
ScatterByIncrScatter object elements.
ScatterByIndexesScatter object elements.
ScatterByMaskScatter object elements.
SCValues
Sec (4)Secant.
Sech (4)Hyperbolic secant.
Select
SelectAllResets any defined selection.
set_CValues
set_SCValues
set_SValues
set_Values
SetCplxSets vector values (complex).
SetDouble (3)Sets object values (double).
SetFullRangeResets any defined subrange.
SetFullRangeLevel
SetInteger (3)Sets object values (integer).
SetIt (4)Sets object values.
SetSelect
SetSelectIndex
SetSingle (3)Sets object values (single).
SetSubIndex (2)Defines a subarray.
SetSubRange (4)Defines a sub vector/matrix.
SetSubRangeLevel (2)Defines a sub vector/matrix and pushes previous subrange to internal stack.
SetVal (4)Initialize elements to Value.
SetZero (2)Initializes object elements to zero.
Sgn (4)Computes signum function of calling object elements.
SgnMulSignum.
Shift (4)Shift vector 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 (8)Sets the following properties
SizeFromArray (6)Sets the size of the vector to match an array.
SizeToArray (6)Sizes the array.
Skewness (2)Skewness (third central momentum).
SortAscend (4)Sorts vector elements in ascending order.
SortDescend (4)Sorts vector elements in descending order.
Split (3)Splits the calling vector to an array of TVec objects.
Sqr (4)Square.
SqrAddScaled (8)Compute sqr(X) + sqr(Y)*yScale
Sqrt (4)Square root.
StdDev (6)Standard deviation.
StringsToValues (2)Convert strings in aList to double or TCplx.
StripNanAndInf (3)Copy Src into self, dropping every NAN/INF element and compacting the result.
Sub (18)Compute X - Y - Z
SubAndMul (50)Compute (X - Y)*Z
SubFrom (8)Subtraction from value.
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).
SumOfSquares (2)Calculate the Sum of squares of the calling vector.
SValues
Tan (4)Tangens.
Tanh (4)Hyperbolic tangens.
TensorProd (2)Tensor product between vector and matrix.
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.
ToStringReturns content as a string.
Trunc (5)Rounds a real number towards zero.
TruncAndFrac (2)Rounds a real number towards zero and returns the fractional part.
UpSample (2)Inserts zeroes between consecutive array values.
Values
ValuesToStrings (5)Writes vector values to string array.
ValuesToText (3)Writes vector values to string.
WriteHeader (2)Writes the header information for the calling vector to a stream.
WriteValues (2)Writes object Values content to a stream.
ZScore (2)Transforms vector into vector of standardized data in-place.

Operators

NameDescription
operator DewArray<double>Explicitely convert Vector to array of doubles.
operator DewArray<float>Explicitely convert Vector to array of doubles.
operator TVec *
operator!= (10)Returns true, if Left and Right are not equal.
operator() (4)
operator* (9)Multiply all elements in Left with Right.
operator+ (9)Add left to all elements in Right and return result.
operator- (12)Subtract all elements in Right from Left.
operator->
operator/ (9)Divide all elements in Left with Right.
operator< (7)Returns true, if Left is less than Right. Returns true, if all elements in ALeft are less than ARight.
operator<= (7)Returns true, if Left is less than or equal to Right.
operator= (3)
operator== (10)Returns true, if Left and Right are of equal Length and Values.
operator> (7)Returns true, if Left is greater than Right.
operator>= (7)Returns true, if Left is greater than or equal to Right.
operator[]

Fields

NameTypeDescription
FDataTVec *