Vector class with double precision.
![]() | CrossProduct ( const CDVector &v1, const CDVector &v2) Forms the cross product of two vectors. |
![]() | ElementDivide (const CDVector& vector) Divide two vectors element-wise. |
![]() | ElementMultiply (const CDVector& vector) Multiplies two vectors element-wise. |
![]() | Eq (const double B, CDVector& C ) const Equal - compares a vector and a double. |
![]() | Eq ( const CDVector& B, CDVector& C ) const Equal - compares a vector and a vector. |
![]() | FromFile ( const CDString& sFilename ) Reads a vector from disk in binary format. |
![]() | FromFile ( FILE *fh ) Reads a vector from disk in binary format. |
![]() | FromMatlab (const CDString& sFilename, const CDString& sName) Reads a vector from disk in MatLab (.m) format. |
![]() | Ge ( const CDVector& B, CDVector& C ) const Greater Than or Equal - compares a vector and a vector. |
![]() | Ge (const double B, CDVector& C ) const Greater Than or Equal - compares a double and a vector. |
![]() | Gt (const double B, CDVector& C ) const Greater Than - compares a double and a vector. |
![]() | Gt ( const CDVector& B, CDVector& C ) const Greater Than - compares a vector and a vector. |
![]() | Le ( const CDVector& B, CDVector& C ) const Less Than or Equal - compares a vector and a vector. |
![]() | Le (const double B, CDVector& C ) const Less Than or Equal - compares a double and a vector. |
![]() | Log () Takes the natural logarithm of each element. |
![]() | Lt ( const CDVector& B, CDVector& C ) const Less Than - compares a vector and a vector. |
![]() | Lt (const double B, CDVector& C ) const Less Than - compares a double and a vector. |
![]() | Max () const Finds the maximum element in the vector. |
![]() | Mean () const Calculates the mean value of the vector. |
![]() | Min () const Finds the minimum element in the vector. |
![]() | Min (int& iPos) const Finds the minimum element in the vector and its position. |
![]() | Ne ( const CDVector& B, CDVector& C ) const Not Equal - compares a vector and a vector. |
![]() | Ne (const double B, CDVector& C ) const Not Equal - compares a double and a vector. |
![]() | Norm1 () const Calculates the one-norm (L1) of the vector. |
![]() | Norm2 () const Calculates the two-norm (L2) of the vector. |
![]() | NormInf () const Calculates the infinity-norm (Linf) of the vector. |
![]() | Normalize2 () Normalizes the vector to unit length, using the 2-norm. |
![]() | Pow (double dP) Takes the power 'dP' of each element. |
![]() | Rand () Uniformly distributed random numbers. |
![]() | Reverse () Reverses the vector. |
![]() | Skewness () const Calculates the skewness of the vector. |
![]() | Sort ( bool ascending ) Sorts the vector. |
![]() | Sqr () Squares each element. |
![]() | Sqrt () Takes the square root of each element. |
![]() | Std () const Calculates the standard deviation of the vector. |
![]() | Sum () const Calculates the sum of the vector. |
![]() | ToFile ( const CDString& sFilename ) const Writes the vector to disk in binary format. |
![]() | ToFile ( FILE *fh ) const Writes the vector to disk in binary format. |
![]() | ToMatlab (const CDString& sFilename, const CDString& sName, const CDString& sComment, bool fAppend) const Writes the vector to disk in MatLab (.m) format. |
![]() | ToString (const bool fNewline) const Returns a string representing the vector. |
![]() | Var () const Calculates the variance of the vector. |
![]() | operator= (double value) Assignment operator. |
![]() | operator= (const CVisDVector &vIn) Assignment operator. |
![]() | operator= (const CDVector &vIn) Assignment operator. |
Vector class with double precision based upon the VisSDK vector class CVisDVector.
Forms the cross product of two vectors and store the result in this. If the vector does have the correct size, it will be resized.
Divide two vectors element-wise.
Corresponding MatLab operator "./".
Multiplies two vectors element-wise.
Corresponding MatLab operator ".*".
Compares of a vector and a double and returns
the result as a binary vector i.e.: C(i) = 1 if A(i) == B
C(i) = 0 else Corresponding MatLab function EQ()
Compares of a vector and a vector and returns
the result as a binary matrix i.e.: C(i) = 1 if A(i) == B
C(i) = 0 else Corresponding MatLab function EQ()
Reads a vector from disk in binary format.
Reads a vector from disk in binary format.
Reads a vector from disk in MatLab (.m) format into
'this'. Notice that this should be used for storage a (really)
large vectors, due to the computational and i/o overhead
induced by the simple MatLab text format. Also, remember that MatLab can't read (.m) files with lines
longer than 4096 bytes. If no communication with MatLab is needed, but merely
to/from disk functionality within a DIVA program, it is
suggested to use the fast binary i/o methods ToFile() and
FromFile().
Compares of a double and a vector and returns
the result as a binary matrix i.e.: C(i) = 1 if A(i) >= B
C(i) = 0 else Corresponding MatLab function GE()
Compares of a vector and a vector and returns
the result as a binary matrix i.e.: C(i) = 1 if A(i) >= B
C(i) = 0 else Corresponding MatLab function GE()
Compares of a double and a vector and returns
the result as a binary matrix i.e.: C(i) = 1 if A(i) > B
C(i) = 0 else Corresponding MatLab function GT()
Compares of a vector and a vector and returns
the result as a binary matrix i.e.: C(i) = 1 if A(i) > B
C(i) = 0 else Corresponding MatLab function GT()
Compares of a double and a vector and returns
the result as a binary matrix i.e.: C(i) = 1 if A(i) <= B
C(i) = 0 else Corresponding MatLab function LE()
Compares of a vector and a vector and returns
the result as a binary matrix i.e.: C(i) = 1 if A(i) <= B
C(i) = 0 else Corresponding MatLab function LE()
Takes the natural logarithm of each element.
Compares of a double and a vector and returns
the result as a binary matrix i.e.: C(i) = 1 if A(i) < B
C(i) = 0 else Corresponding MatLab function LT()
Compares of a vector and a vector and returns
the result as a binary matrix i.e.: C(i) = 1 if A(i) < B
C(i) = 0 else Corresponding MatLab function LT()
Finds the maximum element in the vector.
Calculates the mean value of the vector.
Finds the minimum element in the vector.
Finds the minimum element in the vector and its position.
Compares of a double and a vector and returns
the result as a binary matrix i.e.: C(i) = 1 if A(i) != B
C(i) = 0 else Corresponding MatLab function NE()
Compares of a vector and a vector and returns
the result as a binary matrix i.e.: C(i) = 1 if A(i) != B
C(i) = 0 else Corresponding MatLab function NE()
Calculates the one-norm (L1) of the vector.
Also known as the city block metric. L1(v) = |x_1| + |x_2| .. + |x_n|
Calculates the two-norm (L2) of the vector.
Also known as the Euclidean length. L2(v) = sqrt( x_1^2 + x_2^2 .. + x_n^2 )
Calculates the infinity-norm (Linf) of the vector.
Also known as the Chebyshev Norm. Linf(v) = max( |x_1|, |x_2| ... , |x_n| )
Normalizes the vector to unit length, using the 2-norm.
Takes the power 'dP' of each element.
Inserts uniformly distributed random numbers in
the range [0;1].
Reverses the vector.
Calculates the skewness the vector.
Sorts the vector in either ascending (default) or descending order.
Implemented using the standard quicksort, qsort().
Squares each element.
Takes the square root of each element.
Calculates the standard deviation the vector.
Calculates the sum of the vector.
Writes the vector to disk in binary format.
Use 'readbin.m' to load such a file into MatLab
(placed in the diva/matlab dir).
Writes the vector to disk in binary format.
Use 'readbin.m' to load such a file into MatLab
(placed in the diva/matlab dir).
Writes the vector to disk in MatLab (.m) format.
To read the vector into MatLab write e.g.
'my_vector.m' at the MatLab prompt. Notice that this should be used for storage a (really)
large vectors, due to the computational and i/o overhead
induced by the simple MatLab text format. Also, remember that MatLab can't read (.m) files with lines
longer than 4096 bytes. If no communication with MatLab is needed, but merely
to/from disk functionality within a DIVA program, it is
suggested to use the fast binary i/o methods ToFile() and
FromFile().
Returns a string representing the vector.
Calculates the variance the vector.
Assignment operator.
Assignment operator.
Assignment operator. Sets all element to the input value.
DIVAMatrixExport void ElementDivide(const CDVector& vector)
DIVAMatrixExport void ElementMultiply(const CDVector& vector)
DIVAMatrixExport void Eq(const double B, CDVector& C ) const
C - Output result vector.
DIVAMatrixExport void Eq( const CDVector& B, CDVector& C ) const
C - Output result vector.
DIVAMatrixExport void FromFile( const CDString& sFilename )
DIVAMatrixExport void FromFile( FILE *fh )
DIVAMatrixExport void FromMatlab(const CDString& sFilename, const CDString& sName)
sName - The name to search for (and load) inside the matlab file.
DIVAMatrixExport void Ge(const double B, CDVector& C ) const
C - Output result vector.
DIVAMatrixExport void Ge( const CDVector& B, CDVector& C ) const
C - Output result vector.
DIVAMatrixExport void Gt(const double B, CDVector& C ) const
C - Output result vector.
DIVAMatrixExport void Gt( const CDVector& B, CDVector& C ) const
C - Output result vector.
DIVAMatrixExport void Le(const double B, CDVector& C ) const
C - Output result vector.
DIVAMatrixExport void Le( const CDVector& B, CDVector& C ) const
C - Output result vector.
DIVAMatrixExport void Log()
DIVAMatrixExport void Lt(const double B, CDVector& C ) const
C - Output result vector.
DIVAMatrixExport void Lt( const CDVector& B, CDVector& C ) const
C - Output result vector.
DIVAMatrixExport double Max() const
DIVAMatrixExport double Mean() const
DIVAMatrixExport double Min() const
DIVAMatrixExport double Min(int& iPos) const
DIVAMatrixExport void Ne(const double B, CDVector& C ) const
C - Output result vector.
DIVAMatrixExport void Ne( const CDVector& B, CDVector& C ) const
C - Output result vector.
DIVAMatrixExport double Norm1() const
DIVAMatrixExport double Norm2() const
DIVAMatrixExport double NormInf() const
DIVAMatrixExport void Normalize2()
DIVAMatrixExport void Pow(double dP)
DIVAMatrixExport void Rand()
DIVAMatrixExport void Reverse()
DIVAMatrixExport double Skewness() const
DIVAMatrixExport void Sort( bool ascending )
DIVAMatrixExport void Sqr()
DIVAMatrixExport void Sqrt()
DIVAMatrixExport double Std() const
DIVAMatrixExport double Sum() const
DIVAMatrixExport void ToFile( const CDString& sFilename ) const
DIVAMatrixExport void ToFile( FILE *fh ) const
DIVAMatrixExport void ToMatlab(const CDString& sFilename, const CDString& sName, const CDString& sComment, bool fAppend) const
sName - Name of destination matlab variable.
sComment - Optional comment inside the file.
fAppend - If true, the vector is appended to the file
'sFilename'.
DIVAMatrixExport CDString ToString(const bool fNewline) const
DIVAMatrixExport double Var() const
DIVAMatrixExport CDVector& operator=(const CVisDVector &vIn)
DIVAMatrixExport CDVector& operator=(const CDVector &vIn)
DIVAMatrixExport CDVector& operator=(double value)
Back | DIVA Reference Manual | The DIVA-Site |