There are four ways to construct a vector:
CVector(int nType=DATA_FLOAT );
CVector(CVector *s);
CVector(int nDimension, double nValue=0);
CVector(CString strData,int nType=DATA_FLOAT);
Parameters
nType
The type of the vector. You can create different types of vector. If a vector is created by using "CVector(DATA_FLOAT)", its dimension is zero. This means that it is a empty vector.
s
A existing vector will be used to construct a new vector with the same dimension and value.
nDimension
The dimension of the vector.
nValue
The initial value of the vector will be set. Its default is 0.
strData
A vector will be created by using the data string, such as "{1,2,3}".
Remarks
Constructs a CVector object.
Example
// example for CVector::CVector
CVector a(); // an empty vector will be constructed, and its dimension is zero.
CVector b("1,2,3"); // Vector b will be (1,2,3).
CVector c(&b) ; // Vector c is the same as vector b
CVector d(5,2); // Vector d will be (2,2,2,2,2)
CVector Overview | Class Members
Also see