Vector of generic size. More...
#include <fMatrix.h>
Public Member Functions | |
void | abs () |
Converts all elements to their absolute values. | |
fVec () | |
fVec (int m, double *ini=0) | |
fVec (int m, double ini) | |
fVec (const fVec &ini) | |
void | get_subvec (int start, const fVec &allV) |
Copy a sub-vector of a larger vector. | |
double | length () const |
Length of the vector. | |
int | lineq (const fMat &A, const fVec &b) |
Solves linear equation Ax = b. | |
int | lineq_porfs (const fMat &A, const fVec &b) |
int | lineq_posv (const fMat &A, const fVec &b) |
int | lineq_sr (const fMat &A, fVec &w_err, fVec &w_norm, double k, const fVec &b) |
int | lineq_svd (const fMat &A, const fVec &b, int lwork=-1) |
int | max_index () |
Returns the index of the largest element. | |
double | max_value () |
Returns the maximum value. | |
int | min_index () |
Returns the index of the smallest element. | |
double | min_value () |
Returns the minimum value. | |
double & | operator() (int i) |
Returns the reference to the i-th element. | |
double | operator() (int i) const |
Returns the value of the i-th element. | |
void | operator= (double d) |
Assignment operations. | |
fVec | operator= (const fVec &vec) |
void | resize (int i) |
Change the size. | |
void | set (double *_d) |
Sets all elements. | |
void | set_subvec (int start, const fVec &subV) |
Copy a smaller vector as a sub-vector. | |
int | size () const |
Size of the vector (same as row()). | |
double | sum () |
Returns the sum of the elements. | |
void | unit () |
Converts to a unit vector (no length check!). | |
void | zero () |
Creates a zero vector. | |
~fVec () | |
Functions | |
Operators in function forms (faster). | |
void | set (const fVec &vec) |
void | neg (const fVec &vec) |
void | add (const fVec &vec1, const fVec &vec2) |
void | add (const fVec &vec) |
void | sub (const fVec &vec1, const fVec &vec2) |
void | div (const fVec &vec, double d) |
void | mul (const fVec &vec, double d) |
void | mul (double d, const fVec &vec) |
void | mul (const fMat &mat, const fVec &vec) |
M * v. | |
void | mul (const fVec &vec, const fMat &mat) |
v^T * M | |
Friends | |
double | length (const fVec &v) |
Length of the vector. | |
fVec | unit (const fVec &v) |
Returns a unit vector with the same direction (no length check!). | |
Operators | |
void | operator+= (const fVec &vec) |
void | operator-= (const fVec &vec) |
void | operator*= (double d) |
void | operator/= (double d) |
fVec | operator- (const fVec &vec) |
fVec | operator+ (const fVec &vec1, const fVec &vec2) |
fVec | operator- (const fVec &vec1, const fVec &vec2) |
fVec | operator/ (const fVec &vec, double d) |
fVec | operator* (double d, const fVec &vec) |
fVec | operator* (const fVec &vec, double d) |
double | operator* (const fVec &vec1, const fVec &vec2) |
fVec::fVec | ( | ) | [inline] |
fVec::fVec | ( | int | m, |
double * | ini = 0 |
||
) | [inline] |
fVec::fVec | ( | int | m, |
double | ini | ||
) | [inline] |
fVec::fVec | ( | const fVec & | ini | ) | [inline] |
fVec::~fVec | ( | ) | [inline] |
Converts all elements to their absolute values.
Definition at line 1510 of file fMatrix.cpp.
Definition at line 1562 of file fMatrix.cpp.
void fVec::get_subvec | ( | int | start, |
const fVec & | allV | ||
) |
Copy a sub-vector of a larger vector.
Definition at line 65 of file fMatrix.cpp.
double fVec::length | ( | void | ) | const [inline] |
Solves linear equation Ax = b.
Definition at line 163 of file fMatrix.cpp.
Definition at line 788 of file fMatrix.cpp.
Definition at line 765 of file fMatrix.cpp.
Definition at line 869 of file fMatrix.cpp.
Definition at line 468 of file fMatrix.cpp.
int fVec::max_index | ( | ) |
double fVec::max_value | ( | ) |
Returns the maximum value.
Definition at line 1478 of file fMatrix.cpp.
int fVec::min_index | ( | ) |
Returns the index of the smallest element.
Definition at line 1462 of file fMatrix.cpp.
double fVec::min_value | ( | ) |
Returns the minimum value.
Definition at line 1494 of file fMatrix.cpp.
M * v.
Definition at line 1380 of file fMatrix.cpp.
v^T * M
Definition at line 1401 of file fMatrix.cpp.
double& fVec::operator() | ( | int | i | ) | [inline] |
double fVec::operator() | ( | int | i | ) | const [inline] |
void fVec::operator*= | ( | double | d | ) |
Reimplemented from fMat.
Definition at line 1552 of file fMatrix.cpp.
Definition at line 1539 of file fMatrix.cpp.
Definition at line 1546 of file fMatrix.cpp.
void fVec::operator/= | ( | double | d | ) |
Reimplemented from fMat.
Definition at line 1557 of file fMatrix.cpp.
void fVec::operator= | ( | double | d | ) |
Definition at line 1651 of file fMatrix.cpp.
void fVec::resize | ( | int | i | ) | [inline] |
void fVec::set_subvec | ( | int | start, |
const fVec & | subV | ||
) |
Copy a smaller vector as a sub-vector.
Definition at line 76 of file fMatrix.cpp.
int fVec::size | ( | void | ) | const [inline] |
Definition at line 1583 of file fMatrix.cpp.
double fVec::sum | ( | ) | [inline] |
void fVec::unit | ( | ) | [inline] |
void fVec::zero | ( | ) | [inline] |
Definition at line 1632 of file fMatrix.cpp.
Definition at line 1639 of file fMatrix.cpp.
Definition at line 1612 of file fMatrix.cpp.
Definition at line 1574 of file fMatrix.cpp.
Definition at line 1531 of file fMatrix.cpp.
Definition at line 1590 of file fMatrix.cpp.
Definition at line 1605 of file fMatrix.cpp.