PARTONS/NumA++
|
Numerical Analysis C++ routines
|
Object representing a mathematical vector. More...
Public Member Functions | |
VectorD () | |
Default constructor. More... | |
VectorD (size_t size) | |
Construct a vector of given size initialized at 0. More... | |
VectorD (size_t size, double initValue) | |
Construct a vector of given size initialized at initValue. More... | |
VectorD (const std::vector< double > &vector) | |
Copy constructor. More... | |
VectorD (const VectorD &vector) | |
Copy constructor. More... | |
VectorD (const Vector2D &vector) | |
Copy constructor. More... | |
VectorD (const Vector3D &vector) | |
Copy constructor. More... | |
VectorD (const Vector4D &vector) | |
Copy constructor. More... | |
virtual | ~VectorD () |
Default destructor. More... | |
void | push_back (double value) |
Same as std::vector. More... | |
void | resize (size_t n, double value=0.) |
Same as std::vector. More... | |
void | assign (size_t n, double value=0.) |
Same as std::vector. More... | |
size_t | size () const |
VectorD | sub (size_t startPos, size_t endPos) const |
Returns a subset of the vector: [startPos:endPos[. More... | |
double | operator* (const VectorD &rhs) const |
Scalar product. More... | |
VectorD | operator- (const VectorD &rhs) const |
Subtraction. More... | |
VectorD | operator+ (const VectorD &rhs) const |
Addition. More... | |
VectorD | operator* (double rhs) const |
Multiplication of all coefficients by a scalar. More... | |
VectorD | operator+ (double rhs) const |
Addition of all coefficients with a scalar. More... | |
VectorD | operator- (double rhs) const |
Subtraction of all coefficient with a scalar. More... | |
VectorD | operator/ (double rhs) const |
Division of all coefficients by a scalar. More... | |
double | norm () const |
Norm 2. More... | |
MatrixD | toMatrix () |
Conversion to a matrix of one column. More... | |
double & | operator[] (size_t n) |
Direct accessor in memory with the specified index value n. More... | |
double & | at (size_t n) |
Same as std::vector. More... | |
const double & | operator[] (size_t n) const |
Direct accessor in memory with the specified index value n. More... | |
const double & | at (size_t n) const |
Same as std::vector. More... | |
const std::vector< double > & | toStdVector () const |
Conversion to std::vector. More... | |
std::string | toString () const |
Return a formatted characters string to display vector's values. More... | |
Static Public Member Functions | |
static VectorD | concatenate (const VectorD &V1, const VectorD &V2) |
Concatenation of two vectors. More... | |
Private Attributes | |
std::vector< double > | m_vector |
An array of double to represent the vector in memory. More... | |
Object representing a mathematical vector.
NumA::VectorD::VectorD | ( | ) |
Default constructor.
NumA::VectorD::VectorD | ( | size_t | size | ) |
Construct a vector of given size initialized at 0.
size | Size of the vector. |
NumA::VectorD::VectorD | ( | size_t | size, |
double | initValue | ||
) |
Construct a vector of given size initialized at initValue.
size | Size of the vector. |
initValue | Default value for the coefficients. |
NumA::VectorD::VectorD | ( | const std::vector< double > & | vector | ) |
Copy constructor.
vector | std::vector<double> |
|
virtual |
Default destructor.
void NumA::VectorD::assign | ( | size_t | n, |
double | value = 0. |
||
) |
Same as std::vector.
double & NumA::VectorD::at | ( | size_t | n | ) |
Same as std::vector.
const double & NumA::VectorD::at | ( | size_t | n | ) | const |
Same as std::vector.
double NumA::VectorD::norm | ( | ) | const |
Norm 2.
double NumA::VectorD::operator* | ( | const VectorD & | rhs | ) | const |
VectorD NumA::VectorD::operator* | ( | double | rhs | ) | const |
Multiplication of all coefficients by a scalar.
rhs | Scalar. |
VectorD NumA::VectorD::operator+ | ( | double | rhs | ) | const |
Addition of all coefficients with a scalar.
rhs | Scalar. |
VectorD NumA::VectorD::operator- | ( | double | rhs | ) | const |
Subtraction of all coefficient with a scalar.
rhs | Scalar. |
VectorD NumA::VectorD::operator/ | ( | double | rhs | ) | const |
Division of all coefficients by a scalar.
rhs | Scalar. |
double & NumA::VectorD::operator[] | ( | size_t | n | ) |
Direct accessor in memory with the specified index value n.
n |
const double & NumA::VectorD::operator[] | ( | size_t | n | ) | const |
Direct accessor in memory with the specified index value n.
n |
void NumA::VectorD::push_back | ( | double | value | ) |
Same as std::vector.
void NumA::VectorD::resize | ( | size_t | n, |
double | value = 0. |
||
) |
Same as std::vector.
size_t NumA::VectorD::size | ( | ) | const |
VectorD NumA::VectorD::sub | ( | size_t | startPos, |
size_t | endPos | ||
) | const |
MatrixD NumA::VectorD::toMatrix | ( | ) |
Conversion to a matrix of one column.
const std::vector< double > & NumA::VectorD::toStdVector | ( | ) | const |
Conversion to std::vector.
std::string NumA::VectorD::toString | ( | ) | const |
Return a formatted characters string to display vector's values.
|
private |
An array of double to represent the vector in memory.