class CDVector |
Vector class with double precision.
| Abs () Takes the absolute valueof each element. | |
| AlignTo ( const CDVector &v, double* pA, double* pB ) Linear alignment of this vector to another vector using the L2 norm. | |
| AutoCorrelation ( const int lag ) const Calculates the autocorrelation of the vector. | |
| Ceil () Takes ceil() of each element. | |
| Clamp ( const double min, const double max ) Clamps the vector to [min,max]. | |
| 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. | |
| Floor () Takes floor() of each element. | |
| FromFile ( FILE* fh ) Reads a vector from disk in binary format. | |
| FromFile ( const CDString& sFilename ) 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. | |
| Linspace ( const double x1, const double x2, const int n ) Generates a vector of linearly equally spaced points between x1 and x2 (inclusive). | |
| 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. | |
| Median () const Calculates the median. | |
| Min (int& iPos) const Finds the minimum element in the vector and its position. | |
| Min () const Finds the minimum element in the vector. | |
| Ne (const double B, CDVector& C ) const Not Equal - compares a double and a vector. | |
| Ne ( const CDVector& B, CDVector& C ) const Not Equal - compares a vector 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. | |
| Rand ( const int st, const int end ) Uniformly distributed integer random numbers. | |
| Range ( const int st, const int end) const Returns a sub range of a vector. | |
| Reverse () Reverses the vector. | |
| Round () Takes round() of each element. | |
| Shuffle () Shuffles (randomizes) 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 ( FILE* fh ) const Writes the vector to disk in binary format. | |
| ToFile ( const CDString& sFilename ) 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. | |
| ToMatrix ( const int nRows, const int nCols, CDMatrix &m, bool rowWise ) Converts this vector to a matrix. | |
| ToString (const bool fNewline) const Returns a string representing the vector. | |
| Trim ( const double percentage ) const Removes the extreme 'percentage' part of the vector. | |
| TrimmedMean ( const double percentage ) const Calculates the trimmed mean. | |
| TrimmedStd ( const double percentage ) const Calculates the trimmed standard deviation. | |
| TrimmedVar ( const double percentage ) const Calculates the trimmed variance. | |
| Var ( double* pMean ) const Calculates the variance of the vector. | |
| VecCat ( const CDVector &v ) const Concatenates a vector to the end of this vector. | |
| operator= (double value) Assignment operator. | |
| operator= (const CDVector &vIn) Assignment operator. | |
| operator= (const CVisDVector &vIn) Assignment operator. |
Vector class with double precision based upon the VisSDK vector class CVisDVector.
Assignment operator.
Assignment operator.
Assignment operator. Sets all element to the input value.
Finds the maximum element in the vector.
Finds the minimum element in the vector.
Finds the minimum element in the vector and its position.
Calculates the mean value of the vector.
Calculates the skewness the vector.
Calculates the standard deviation the vector.
Calculates the sum of the vector.
Calculates the variance the vector.
Sorts the vector in either ascending (default) or descending order. Implemented using the standard quicksort, qsort().
The STL sort is most likely faster, though.
Squares each element.
Takes the square root of each element.
Takes the power 'dP' of each element.
Multiplies two vectors element-wise. Corresponding MatLab operator ".*".
Divide two vectors element-wise. Corresponding MatLab operator "./".
Returns a string representing the vector.
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.
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().
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().
Writes the vector to disk in binary format. Use 'readbin.m' to load such a file into MatLab (placed in the diva/matlab dir).
Reads a vector from disk in binary format.
Writes the vector to disk in binary format. Use 'readbin.m' to load such a file into MatLab (placed in the diva/matlab dir).
Reads a vector from disk in binary format.
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()
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()
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()
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()
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 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()
Takes the natural logarithm of each element.
Takes the absolute valueof each element.
Reverses the vector.
Inserts uniformly distributed random numbers in the range [0;1].
Inserts uniformly distributed integer random numbers in the range [st;end].
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.
Takes ceil() of each element.
Takes floor() of each element.
Takes round() of each element.
Generates a vector of linearly equally spaced points between x1 and x2 (inclusive).
Returns a sub range of a vector.
Converts this vector to a matrix, either by row (default) or column.
Concatenates a vector to the end of this vector.
Clamps the vector to [min,max].
Linear alignment of this vector to another vector using the L2 norm.
Calculates the autocorrelation of the vector with a given lag (default lag is 1).
Shuffles (randomizes) the vector.
Calculates the median.
Removes the extreme 'percentage' part of the vector. E.g. v.Trim( .10 ) removes the 5% of the lower tail and 5% of the upper tail.
By convention Trim( 1. ) returns the median.
Removes the extreme 'percentage' part of the vector and calculates the mean of the remaining data.
Removes the extreme 'percentage' part of the vector and calculates the variance of the remaining data.
Removes the extreme 'percentage' part of the vector and calculates the standard deviation of the remaining data.
Alphabetic index HTML hierarchy of classes or Java
| Back | DIVA Reference Manual | The DIVA-Site |