NABLA
Nabla Ain't Basic Linear Algebra
|
Vector template class. More...
Public Types | |
typedef util::sequence < value_type > ::const_reference | const_reference |
Type of reference to constant element. | |
typedef util::sequence < value_type >::reference | reference |
Type of reference to element. | |
typedef value_t | value_type |
Type of elements. |
Public Member Functions | |
vector () | |
Default constructor. | |
vector (const vector &a) | |
Copy constructor. | |
vector (temporary< vector > &a) | |
Move constructor from temporary object. | |
template<typename expr_t , typename tag > | |
vector (const vector_expression< value_type, expr_t, tag > &a) | |
Copy constructor from vector expression. | |
vector (size_t size) | |
Constructor with size initialization. | |
vector (size_t size, const_reference value) | |
Constructor with size and value initialization. | |
~vector () | |
Destructor. | |
template<typename expr_t , typename tag > | |
void | assign (const vector_expression< value_type, expr_t, tag > &rhs) |
Assigns vector expression to this object. | |
reference | operator() (size_t i) |
Subscript operator. | |
const_reference | operator() (size_t i) const |
Subscript operator. | |
vector & | operator= (const vector &a) |
Assignment operator. | |
template<typename expr_t , typename tag > | |
vector & | operator= (const vector_expression< value_type, expr_t, tag > &rhs) |
Assignment operator. | |
vector & | operator= (temporary< vector > &a) |
Move assignment operator. | |
reference | operator[] (size_t i) |
Subscript operator. | |
const_reference | operator[] (size_t i) const |
Subscript operator. | |
void | resize (size_t size) |
Resizes vector. | |
void | resize (size_t size, const_reference value) |
Resizes vector. | |
size_t | size () const |
Returns size of vector. | |
void | swap (vector &a) |
Swaps contents of two vectors. |
Vector template class.
This class represents a vector, i.e. a string of values.
Object of this type is a column vector – can act as a v.size()
by 1 matrix. (For more information on orientation see Vector Orientation.)
&v(i)==&v(0) + i
i<v.size()
.
|
inline |
|
inline |
Assigns vector expression to this object.
This function assigns rhs in the most efficient way. That means that no temporary is introduced to store intermediate result. This circumstance can cause suprising results as stated above.
Like in the STL this function doesn't care about object's previous state. The function discards all the contents (which may immediately invalidate all references to this object) and copies the result of rhs expression to this object's new contents.
In other words this object should not be involved in the argument expression rhs. Otherwise this function may produce unexpected result or even crash the program.
Definition at line 3205 of file matrix.h.
References nabla::get_vector(), and vector< value_t >::resize().
|
inline |
Resizes vector.
Changes vector size to size. Values of elements are undefined.
Definition at line 3215 of file matrix.h.
References vector< value_t >::size().
|
inline |
Resizes vector.
Changes vector size to size. Values of elements are set to value.
Definition at line 3226 of file matrix.h.
References vector< value_t >::resize().
|
inline |