A dense vector of values of type T
.
More...
#include <vector.hpp>
Classes | |
class | const_iterator |
class | iterator |
Public Types | |
typedef A::size_type | size_type |
typedef A::difference_type | difference_type |
typedef T | value_type |
typedef type_traits< T > ::const_reference | const_reference |
typedef T & | reference |
typedef T * | pointer |
typedef const T * | const_pointer |
typedef A | array_type |
typedef const vector_reference < const self_type > | const_closure_type |
typedef vector_reference < self_type > | closure_type |
typedef self_type | vector_temporary_type |
typedef dense_tag | storage_category |
typedef reverse_iterator_base < const_iterator > | const_reverse_iterator |
typedef reverse_iterator_base < iterator > | reverse_iterator |
typedef vector< T, A > | container_type |
typedef vector_tag | type_category |
typedef E | expression_type |
Public Member Functions | |
BOOST_UBLAS_INLINE | vector () |
Constructor of a vector By default it is empty, i.e. More... | |
BOOST_UBLAS_INLINE | vector (size_type size) |
Constructor of a vector with a predefined size By default, its elements are initialized to 0. More... | |
BOOST_UBLAS_INLINE | vector (size_type, const array_type &data) |
Constructor of a vector by copying from another container This type has the generic name array_typ within the vector definition. More... | |
BOOST_UBLAS_INLINE | vector (const array_type &data) |
Constructor of a vector by copying from another container This type has the generic name array_typ within the vector definition. More... | |
BOOST_UBLAS_INLINE | vector (size_type size, const value_type &init) |
Constructor of a vector with a predefined size and a unique initial value. More... | |
BOOST_UBLAS_INLINE | vector (const vector &v) |
Copy-constructor of a vector. More... | |
template<class AE > | |
BOOST_UBLAS_INLINE | vector (const vector_expression< AE > &ae) |
Copy-constructor of a vector from a vector_expression Depending on the vector_expression, this constructor can have the cost of the computations of the expression (trivial to say it, but it is to take into account in your complexity calculations). More... | |
BOOST_UBLAS_INLINE size_type | max_size () const |
Return the maximum size of the data container. More... | |
BOOST_UBLAS_INLINE bool | empty () const |
Return true if the vector is empty (size==0 ) More... | |
BOOST_UBLAS_INLINE size_type | size () const |
Return the size of the vector. More... | |
BOOST_UBLAS_INLINE const array_type & | data () const |
Return a const reference to the container. Useful to access data directly for specific type of container. More... | |
BOOST_UBLAS_INLINE array_type & | data () |
Return a reference to the container. Useful to speed-up write operations to the data in very specific case. More... | |
BOOST_UBLAS_INLINE void | resize (size_type size, bool preserve=true) |
Resize the vector Resize the vector to a new size. More... | |
BOOST_UBLAS_INLINE pointer | find_element (size_type i) |
Return a pointer to the element . More... | |
BOOST_UBLAS_INLINE const_pointer | find_element (size_type i) const |
Return a const pointer to the element . More... | |
BOOST_UBLAS_INLINE const_reference | operator() (size_type i) const |
Return a const reference to the element Return a const reference to the element . More... | |
BOOST_UBLAS_INLINE reference | operator() (size_type i) |
Return a reference to the element Return a reference to the element . More... | |
BOOST_UBLAS_INLINE const_reference | operator[] (size_type i) const |
Return a const reference to the element . More... | |
BOOST_UBLAS_INLINE reference | operator[] (size_type i) |
Return a reference to the element . More... | |
BOOST_UBLAS_INLINE reference | insert_element (size_type i, const_reference t) |
Set element to the value t . More... | |
BOOST_UBLAS_INLINE void | erase_element (size_type i) |
Set element to the zero value. More... | |
BOOST_UBLAS_INLINE void | clear () |
Clear the vector, i.e. set all values to the zero value. More... | |
BOOST_UBLAS_INLINE vector & | operator= (const vector &v) |
Assign a full vector (RHS-vector) to the current vector (LHS-vector) More... | |
template<class C > | |
BOOST_UBLAS_INLINE vector & | operator= (const vector_container< C > &v) |
Assign a full vector (RHS-vector) to the current vector (LHS-vector) Assign a full vector (RHS-vector) to the current vector (LHS-vector). More... | |
BOOST_UBLAS_INLINE vector & | assign_temporary (vector &v) |
Assign a full vector (RHS-vector) to the current vector (LHS-vector) More... | |
template<class AE > | |
BOOST_UBLAS_INLINE vector & | operator= (const vector_expression< AE > &ae) |
Assign the result of a vector_expression to the vector Assign the result of a vector_expression to the vector. More... | |
template<class AE > | |
BOOST_UBLAS_INLINE vector & | assign (const vector_expression< AE > &ae) |
Assign the result of a vector_expression to the vector Assign the result of a vector_expression to the vector. More... | |
template<class AE > | |
BOOST_UBLAS_INLINE vector & | operator+= (const vector_expression< AE > &ae) |
Assign the sum of the vector and a vector_expression to the vector Assign the sum of the vector and a vector_expression to the vector. More... | |
template<class C > | |
BOOST_UBLAS_INLINE vector & | operator+= (const vector_container< C > &v) |
Assign the sum of the vector and a vector_expression to the vector Assign the sum of the vector and a vector_expression to the vector. More... | |
template<class AE > | |
BOOST_UBLAS_INLINE vector & | plus_assign (const vector_expression< AE > &ae) |
Assign the sum of the vector and a vector_expression to the vector Assign the sum of the vector and a vector_expression to the vector. More... | |
template<class AE > | |
BOOST_UBLAS_INLINE vector & | operator-= (const vector_expression< AE > &ae) |
Assign the difference of the vector and a vector_expression to the vector Assign the difference of the vector and a vector_expression to the vector. More... | |
template<class C > | |
BOOST_UBLAS_INLINE vector & | operator-= (const vector_container< C > &v) |
Assign the difference of the vector and a vector_expression to the vector Assign the difference of the vector and a vector_expression to the vector. More... | |
template<class AE > | |
BOOST_UBLAS_INLINE vector & | minus_assign (const vector_expression< AE > &ae) |
Assign the difference of the vector and a vector_expression to the vector Assign the difference of the vector and a vector_expression to the vector. More... | |
template<class AT > | |
BOOST_UBLAS_INLINE vector & | operator*= (const AT &at) |
Assign the product of the vector and a scalar to the vector Assign the product of the vector and a scalar to the vector. More... | |
template<class AT > | |
BOOST_UBLAS_INLINE vector & | operator/= (const AT &at) |
Assign the division of the vector by a scalar to the vector Assign the division of the vector by a scalar to the vector. More... | |
BOOST_UBLAS_INLINE void | swap (vector &v) |
Swap the content of the vector with another vector. More... | |
BOOST_UBLAS_INLINE const_iterator | find (size_type i) const |
Return a const iterator to the element i. More... | |
BOOST_UBLAS_INLINE iterator | find (size_type i) |
Return an iterator to the element i. More... | |
BOOST_UBLAS_INLINE const_iterator | begin () const |
return an iterator on the first element of the vector More... | |
BOOST_UBLAS_INLINE const_iterator | cbegin () const |
return an iterator on the first element of the vector More... | |
BOOST_UBLAS_INLINE const_iterator | end () const |
return an iterator after the last element of the vector More... | |
BOOST_UBLAS_INLINE const_iterator | cend () const |
return an iterator after the last element of the vector More... | |
BOOST_UBLAS_INLINE iterator | begin () |
Return an iterator on the first element of the vector. More... | |
BOOST_UBLAS_INLINE iterator | end () |
Return an iterator at the end of the vector. More... | |
BOOST_UBLAS_INLINE const_reverse_iterator | rbegin () const |
Return a const reverse iterator before the first element of the reversed vector (i.e. end() of normal vector) More... | |
BOOST_UBLAS_INLINE const_reverse_iterator | crbegin () const |
Return a const reverse iterator before the first element of the reversed vector (i.e. end() of normal vector) More... | |
BOOST_UBLAS_INLINE const_reverse_iterator | rend () const |
Return a const reverse iterator on the end of the reverse vector (i.e. first element of the normal vector) More... | |
BOOST_UBLAS_INLINE const_reverse_iterator | crend () const |
Return a const reverse iterator on the end of the reverse vector (i.e. first element of the normal vector) More... | |
BOOST_UBLAS_INLINE reverse_iterator | rbegin () |
Return a const reverse iterator before the first element of the reversed vector (i.e. end() of normal vector) More... | |
BOOST_UBLAS_INLINE reverse_iterator | rend () |
Return a const reverse iterator on the end of the reverse vector (i.e. first element of the normal vector) More... | |
template<class Archive > | |
void | serialize (Archive &ar, const unsigned int) |
Serialize a vector into and archive as defined in Boost. More... | |
BOOST_UBLAS_INLINE const container_type & | operator() () const |
BOOST_UBLAS_INLINE container_type & | operator() () |
Static Public Attributes | |
static const unsigned | complexity |
Friends | |
BOOST_UBLAS_INLINE friend void | swap (vector &v1, vector &v2) |
Swap the content of two vectors. More... | |
A dense vector of values of type T
.
For a -dimensional vector and every element is mapped to the -th element of the container. A storage type A
can be specified which defaults to unbounded_array
. Elements are constructed by A
, which need not initialise their value.
T | type of the objects stored in the vector (like int, double, complex,...) |
A | The type of the storage array of the vector. Default is unbounded_array<T> . <bounded_array<T> and std::vector<T> can also be used |
typedef A boost::numeric::ublas::vector< T, A >::array_type |
typedef vector_reference<self_type> boost::numeric::ublas::vector< T, A >::closure_type |
typedef const vector_reference<const self_type> boost::numeric::ublas::vector< T, A >::const_closure_type |
typedef const T* boost::numeric::ublas::vector< T, A >::const_pointer |
typedef type_traits<T>::const_reference boost::numeric::ublas::vector< T, A >::const_reference |
typedef reverse_iterator_base<const_iterator> boost::numeric::ublas::vector< T, A >::const_reverse_iterator |
|
inherited |
typedef A::difference_type boost::numeric::ublas::vector< T, A >::difference_type |
|
inherited |
typedef T* boost::numeric::ublas::vector< T, A >::pointer |
typedef T& boost::numeric::ublas::vector< T, A >::reference |
typedef reverse_iterator_base<iterator> boost::numeric::ublas::vector< T, A >::reverse_iterator |
typedef A::size_type boost::numeric::ublas::vector< T, A >::size_type |
typedef dense_tag boost::numeric::ublas::vector< T, A >::storage_category |
|
inherited |
typedef T boost::numeric::ublas::vector< T, A >::value_type |
typedef self_type boost::numeric::ublas::vector< T, A >::vector_temporary_type |
|
inline |
Constructor of a vector By default it is empty, i.e.
size()==0
.
|
inlineexplicit |
Constructor of a vector with a predefined size By default, its elements are initialized to 0.
size | initial size of the vector |
|
inline |
|
inline |
Constructor of a vector by copying from another container This type has the generic name array_typ
within the vector definition.
data | container of type A |
|
inline |
Constructor of a vector with a predefined size and a unique initial value.
size | of the vector |
init | value to assign to each element of the vector |
|
inline |
Copy-constructor of a vector.
v | is the vector to be duplicated |
|
inline |
Copy-constructor of a vector from a vector_expression Depending on the vector_expression, this constructor can have the cost of the computations of the expression (trivial to say it, but it is to take into account in your complexity calculations).
ae | the vector_expression which values will be duplicated into the vector |
|
inline |
Assign the result of a vector_expression to the vector Assign the result of a vector_expression to the vector.
This is lazy-compiled and will be optimized out by the compiler on any type of expression.
AE | is the type of the vector_expression |
ae | is a const reference to the vector_expression |
Referenced by boost::numeric::ublas::block_prod(), and boost::numeric::ublas::vector< T, bounded_array< T, N > >::operator=().
|
inline |
Assign a full vector (RHS-vector) to the current vector (LHS-vector)
v | is the source vector |
Referenced by boost::numeric::ublas::vector< T, bounded_array< T, N > >::operator+=(), boost::numeric::ublas::vector< T, bounded_array< T, N > >::operator-=(), and boost::numeric::ublas::vector< T, bounded_array< T, N > >::operator=().
|
inline |
return an iterator on the first element of the vector
Referenced by boost::numeric::ublas::vector< T, bounded_array< T, N > >::cbegin(), boost::numeric::ublas::vector< T, bounded_array< T, N > >::clear(), boost::numeric::ublas::vector< T, bounded_array< T, N > >::find(), boost::numeric::ublas::vector< T, A >::const_iterator::index(), boost::numeric::ublas::vector< T, A >::iterator::index(), boost::numeric::ublas::vector< T, A >::const_iterator::operator*(), boost::numeric::ublas::vector< T, A >::iterator::operator*(), and boost::numeric::ublas::vector< T, bounded_array< T, N > >::rend().
|
inline |
Return an iterator on the first element of the vector.
|
inline |
return an iterator on the first element of the vector
|
inline |
return an iterator after the last element of the vector
|
inline |
Clear the vector, i.e. set all values to the zero
value.
Referenced by boost::numeric::ublas::sparse_prod().
|
inline |
Return a const reverse iterator before the first element of the reversed vector (i.e. end() of normal vector)
|
inline |
Return a const reverse iterator on the end of the reverse vector (i.e. first element of the normal vector)
|
inline |
Return a const
reference to the container. Useful to access data directly for specific type of container.
Referenced by boost::numeric::ublas::vector< T, bounded_array< T, N > >::clear(), boost::numeric::ublas::vector< T, bounded_array< T, N > >::erase_element(), boost::numeric::ublas::vector< T, bounded_array< T, N > >::find(), boost::numeric::ublas::vector< T, bounded_array< T, N > >::find_element(), boost::numeric::ublas::vector< T, bounded_array< T, N > >::insert_element(), boost::numeric::ublas::vector< T, bounded_array< T, N > >::operator()(), boost::numeric::ublas::vector< T, bounded_array< T, N > >::operator=(), boost::numeric::ublas::vector< T, bounded_array< T, N > >::resize(), and boost::numeric::ublas::vector< T, bounded_array< T, N > >::swap().
|
inline |
Return a reference to the container. Useful to speed-up write operations to the data in very specific case.
|
inline |
Return true if the vector is empty (size==0
)
true
if empty, false
otherwise
|
inline |
return an iterator after the last element of the vector
Referenced by boost::numeric::ublas::vector< T, bounded_array< T, N > >::cend(), boost::numeric::ublas::vector< T, bounded_array< T, N > >::clear(), boost::numeric::ublas::vector< T, A >::const_iterator::index(), boost::numeric::ublas::vector< T, A >::iterator::index(), boost::numeric::ublas::vector< T, A >::const_iterator::operator*(), boost::numeric::ublas::vector< T, A >::iterator::operator*(), and boost::numeric::ublas::vector< T, bounded_array< T, N > >::rbegin().
|
inline |
Return an iterator at the end of the vector.
|
inline |
Set element to the zero value.
i | index of the element |
|
inline |
Return a const iterator to the element i.
i | index of the element |
Referenced by boost::numeric::ublas::vector< T, bounded_array< T, N > >::begin(), and boost::numeric::ublas::vector< T, bounded_array< T, N > >::end().
|
inline |
Return an iterator to the element i.
i | index of the element |
|
inline |
Return a pointer to the element .
i | index of the element |
|
inline |
Return a const pointer to the element .
i | index of the element |
|
inline |
Set element to the value t
.
i | index of the element |
t | reference to the value to be set |
|
inline |
Return the maximum size of the data container.
Return the upper bound (maximum size) on the data container. Depending on the container, it can be bigger than the current size of the vector.
|
inline |
Assign the difference of the vector and a vector_expression to the vector Assign the difference of the vector and a vector_expression to the vector.
This is lazy-compiled and will be optimized out by the compiler on any type of expression. No temporary is created. Computations are done and stored directly into the resulting vector.
AE | is the type of the vector_expression |
ae | is a const reference to the vector_expression |
Referenced by boost::numeric::ublas::vector< T, bounded_array< T, N > >::operator-=().
|
inline |
Return a const reference to the element Return a const reference to the element .
With some compilers, this notation will be faster than [i]
i | index of the element |
|
inline |
Return a reference to the element Return a reference to the element .
With some compilers, this notation will be faster than [i]
i | index of the element |
|
inlineinherited |
|
inlineinherited |
|
inline |
Assign the product of the vector and a scalar to the vector Assign the product of the vector and a scalar to the vector.
This is lazy-compiled and will be optimized out by the compiler on any type of expression. No temporary is created. Computations are done and stored directly into the resulting vector.
AE | is the type of the vector_expression |
at | is a const reference to the scalar |
|
inline |
Assign the sum of the vector and a vector_expression to the vector Assign the sum of the vector and a vector_expression to the vector.
This is lazy-compiled and will be optimized out by the compiler on any type of expression. A temporary is created for the computations.
AE | is the type of the vector_expression |
ae | is a const reference to the vector_expression |
|
inline |
Assign the sum of the vector and a vector_expression to the vector Assign the sum of the vector and a vector_expression to the vector.
This is lazy-compiled and will be optimized out by the compiler on any type of expression. No temporary is created. Computations are done and stored directly into the resulting vector.
AE | is the type of the vector_expression |
ae | is a const reference to the vector_expression |
|
inline |
Assign the difference of the vector and a vector_expression to the vector Assign the difference of the vector and a vector_expression to the vector.
This is lazy-compiled and will be optimized out by the compiler on any type of expression. A temporary is created for the computations.
AE | is the type of the vector_expression |
ae | is a const reference to the vector_expression |
|
inline |
Assign the difference of the vector and a vector_expression to the vector Assign the difference of the vector and a vector_expression to the vector.
This is lazy-compiled and will be optimized out by the compiler on any type of expression. No temporary is created. Computations are done and stored directly into the resulting vector.
AE | is the type of the vector_expression |
ae | is a const reference to the vector_expression |
|
inline |
Assign the division of the vector by a scalar to the vector Assign the division of the vector by a scalar to the vector.
This is lazy-compiled and will be optimized out by the compiler on any type of expression. No temporary is created. Computations are done and stored directly into the resulting vector.
AE | is the type of the vector_expression |
at | is a const reference to the scalar |
|
inline |
Assign a full vector (RHS-vector) to the current vector (LHS-vector)
v | is the source vector |
Referenced by boost::numeric::ublas::permutation_matrix< T, A >::operator=().
|
inline |
Assign a full vector (RHS-vector) to the current vector (LHS-vector) Assign a full vector (RHS-vector) to the current vector (LHS-vector).
This method does not create any temporary.
v | is the source vector container |
|
inline |
Assign the result of a vector_expression to the vector Assign the result of a vector_expression to the vector.
This is lazy-compiled and will be optimized out by the compiler on any type of expression.
AE | is the type of the vector_expression |
ae | is a const reference to the vector_expression |
|
inline |
Return a const reference to the element .
i | index of the element |
|
inline |
Return a reference to the element .
i | index of the element |
|
inline |
Assign the sum of the vector and a vector_expression to the vector Assign the sum of the vector and a vector_expression to the vector.
This is lazy-compiled and will be optimized out by the compiler on any type of expression. No temporary is created. Computations are done and stored directly into the resulting vector.
AE | is the type of the vector_expression |
ae | is a const reference to the vector_expression |
Referenced by boost::numeric::ublas::block_prod(), and boost::numeric::ublas::vector< T, bounded_array< T, N > >::operator+=().
|
inline |
Return a const reverse iterator before the first element of the reversed vector (i.e. end() of normal vector)
Referenced by boost::numeric::ublas::vector< T, bounded_array< T, N > >::crbegin().
|
inline |
Return a const reverse iterator before the first element of the reversed vector (i.e. end() of normal vector)
|
inline |
Return a const reverse iterator on the end of the reverse vector (i.e. first element of the normal vector)
Referenced by boost::numeric::ublas::vector< T, bounded_array< T, N > >::crend().
|
inline |
Return a const reverse iterator on the end of the reverse vector (i.e. first element of the normal vector)
|
inline |
Resize the vector Resize the vector to a new size.
If preserve
is true, data are copied otherwise data are lost. If the new size is bigger, the remaining values are filled in with the initial value (0 by default) in the case of unbounded_array
, which is the container by default. If the new size is smaller, last values are lost. This behaviour can be different if you explicitely specify another type of container.
size | new size of the vector |
preserve | if true, keep values |
Referenced by boost::numeric::ublas::vector< T, bounded_array< T, N > >::operator=(), and boost::numeric::odeint::resize_impl< boost::numeric::ublas::vector< T_V, A_V >, boost::numeric::ublas::permutation_matrix< T, A > >::resize().
|
inline |
Serialize a vector into and archive as defined in Boost.
ar | Archive object. Can be a flat file, an XML file or any other stream |
file_version | Optional file version (not yet used) |
|
inline |
Return the size of the vector.
Referenced by boost::numeric::odeint::rosenbrock4< Value, Coefficients, Resizer >::calc_state(), boost::numeric::odeint::implicit_euler< ValueType, Resizer >::do_step(), boost::numeric::odeint::rosenbrock4< Value, Coefficients, Resizer >::do_step(), boost::numeric::ublas::vector< T, bounded_array< T, N > >::operator=(), boost::numeric::ublas::permutation_matrix< T, A >::permutation_matrix(), boost::numeric::odeint::rosenbrock4< Value, Coefficients, Resizer >::prepare_dense_output(), boost::numeric::odeint::resize_impl< boost::numeric::ublas::matrix< T, L, A >, boost::numeric::ublas::vector< T_V, A_V > >::resize(), boost::numeric::odeint::resize_impl< boost::numeric::ublas::vector< T_V, A_V >, boost::numeric::ublas::permutation_matrix< T, A > >::resize(), boost::numeric::odeint::same_size_impl< boost::numeric::ublas::matrix< T, L, A >, boost::numeric::ublas::vector< T_V, A_V > >::same_size(), boost::numeric::odeint::same_size_impl< boost::numeric::ublas::permutation_matrix< T, A >, boost::numeric::ublas::vector< T_V, A_V > >::same_size(), and boost::numeric::ublas::sparse_prod().
|
inline |
Swap the content of the vector with another vector.
v | is the vector to be swapped with |
Referenced by boost::numeric::ublas::vector< T, bounded_array< T, N > >::assign_temporary(), and boost::numeric::ublas::operator>>().
|
friend |
Swap the content of two vectors.
v1 | is the first vector. It takes values from v2 |
v2 | is the second vector It takes values from v1 |
|
staticinherited |