clVector Struct

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

struct clVector;

Open CL vector class with overloaded operators.

Declare clVector to run computation on Open CL Be carefull to declare clVector only for local variables with short lifetime. Call the Create method for clVector, if the variable is a global variable or a variable with a longer life.If the Create method (constuctor) is called, the clVector creates its own memory object in GPU memory, otherwise object cache is used.

Constructors

NameDescription
clVector (11)

Destructors

NameDescription
~clVector

Properties

NameTypeDescription
CaptionDewString
Complexbool
DataTOpenCLVector*
DeviceTOpenCLDevice*Returns the device on which we allocated memory for this object.
FloatPrecisionTclFloatPrecision
IsSubRangeboolAutomatically set to true after the SetSubIndex or SetSubRange call.
Lengthint
Taglong long

Methods

NameDescription
__Hold
__Retain
Abs (4)Absolute values.
Add (12)Add each of Vec2 elements to corresponding elements in Vec1.
AddProduct (2)Add a product of two vectors.
AddScaled (4)Add each of Vec elements to corresponding elements in the calling object.
Adopt
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
CartToPolar (2)Converts elements from cartesian to polar coordinate form.
Cbrt (4)The cube root.
Ceil (4)Rounds towards positive infinity.
Conj (4)Conjugate.
ConjMul (4)Conjugate and multiply.
Copy (4)Copy object values.
CopyCplxFromArray (2)
CopyFromArray (3)
CopyTo (2)
CopyToArray (3)
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.
DifferenceCalculate the difference for all Vec elements.
DisableSelectPrevents calls to clVector::Select.
DisableSubrangePrevents calls to clVector::SetSubRange.
Divide (4)Divide each of Num elements with corresponding elements in Den.
DivideBy (8)Divide Value with elements of the calling object and store the result in the calling object.
DotProd (5)Scalar product of two real arrays.
DotProdc (4)Scalar product of two complex arrays.
DownSampleDownsamples vector values.
EnableSelectEnables calls to clVector::Select.
EnableSubrangeEnables calls to clVector::SetSubRange.
Erf (4)Error functon of values.
Erfc (4)Complementary 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.
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.
GetFloatPrecision
ImagPart (2)Gets the imaginary part of a complex object.
IntPower (2)Power (integer exponent).
Inv (4)Inverse elements.
InvCbrt (4)The inverse of cube root 1/(v)^1/3.
InvSqrt (4)The inverse of square root 1/(v)^1/2.
Ln (4)Natural logarithm.
Log10 (4)Log base 10.
Log2 (4)Log base 2.
LogN (4)Log base N.
Mag (4)Magnitude.
Max (6)Maximum value.
Maxc (3)Maximum value.
MaxMin (4)Maximum and minimum value in a single pass.
Mean (5)Mean value.
Meanc (4)Mean value.
Min (6)Minimum value.
Minc (3)Minimum value.
Mul (12)Multiply Vec1 elements [Vec1Index]..[Vec1Index+Len-1] with Vec2 object elements [Vec2Index]..[Vec2Index+Len-1].
MulI (4)Multiply elements by imaginary unit I.
NormThe norm of a vector.
Normalize (4)Normalize object.
NormC (4)The C-norm.
NormL1 (4)The L1-norm.
NormL2 (4)The L2-norm.
PhaseSpectrum (2)The phase angles (spectrum) of object 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.
Product (6)Elements product.
Productc (2)Elements product.
Ramp (7)Fills the calling vector with a series following linear rule.
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.
Reverse (4)Reverse vector elements.
RMSStandard deviation.
Rotate (2)A cyclic shift on vector elements in range.
Round (4)Elements rounded to the nearest whole number.
Scale (4)Multiply object elements with Value.
Sec (4)Secant.
Sech (4)Hyperbolic secant.
Select (2)Selects a set of elements from the vector.
SelectAllResets any defined selection.
SetFloatPrecision
SetFullRangeResets any defined subrange.
SetSubIndex (2)Defines a sub-vector.
SetSubRange (4)Defines the calling vector to have the view of the same memory as Src.
SetVal (4)Initialize elements to Value.
SetZero (2)Initializes object elements to zero.
Sgn (4)Computes signum function of calling object elements.
SgnMulSignum.
Shift (2)A shift on 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 (3)
SizeToArray (3)
Sqr (4)Square.
Sqrt (4)Square root.
StdDev (4)Standard deviation.
Sub (12)Subtracts Value from object elements.
SubFrom (8)Subtraction from value.
Sum (5)Sums vector values.
SumAndSqrSum (2)Computes the sum and the sum of squared elements from the elements in the calling object.
Sumc (2)Sum (complex value).
Tan (4)Tangens.
Tanh (4)Hyperbolic tangens.
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.
Trunc (4)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 vector values.

Operators

NameDescription
operator DewArray<double>
operator DewArray<float>
operator TOpenCLVector *
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=