#include <shark/LinAlg/BLAS/cpu/vector.hpp>
Public Types | |
typedef array_type::const_reference | const_reference |
typedef array_type::reference | reference |
typedef elementwise< dense_tag > | evaluation_category |
typedef iterators::dense_storage_iterator< value_type > | iterator |
typedef iterators::dense_storage_iterator< value_type const > | const_iterator |
Public Member Functions | |
vector ()=default | |
Constructor of a vector By default it is empty, i.e. size()==0 . More... | |
vector (size_type size) | |
Constructor of a vector with a predefined size By default, its elements are initialized to 0. More... | |
vector (size_type size, const value_type &init) | |
Constructor of a vector with a predefined size and a unique initial value. More... | |
vector (vector const &v)=default | |
Copy-constructor of a vector. More... | |
vector (vector &&v) | |
Move-constructor of a vector. More... | |
vector (std::initializer_list< T > list) | |
template<class Iter > | |
vector (Iter begin, Iter end) | |
Constructs the vector from a predefined range. More... | |
template<class E > | |
vector (vector_expression< E, cpu_tag > const &e) | |
Copy-constructor of a vector from a vector_expression. More... | |
vector & | operator= (vector const &v)=default |
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. More... | |
vector & | operator= (vector &&v) |
Move-Assign a full vector (RHS-vector) to the current vector (LHS-vector) More... | |
template<class C > | |
vector & | operator= (vector_container< C, cpu_tag > const &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). This method does not create any temporary. More... | |
template<class E > | |
vector & | operator= (vector_expression< E, cpu_tag > const &e) |
Assign the result of a vector_expression to the vector Assign the result of a vector_expression to the vector. More... | |
size_type | size () const |
Return the size of the vector. More... | |
storage_type | raw_storage () |
Returns the underlying storage structure for low level access. More... | |
const_storage_type | raw_storage () const |
Returns the underlying storage structure for low level access. More... | |
device_traits< cpu_tag >::queue_type & | queue () |
size_type | max_size () const |
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. More... | |
bool | empty () const |
Return true if the vector is empty (size==0 ) More... | |
void | resize (size_type size) |
Resize the vector. More... | |
const_reference | operator() (size_type i) const |
Return a const reference to the element \(i\) Return a const reference to the element \(i\). With some compilers, this notation will be faster than operator []. More... | |
reference | operator() (size_type i) |
Return a reference to the element \(i\) Return a reference to the element \(i\). With some compilers, this notation will be faster than operator []. More... | |
const_reference | operator[] (size_type i) const |
Return a const reference to the element \(i\). More... | |
reference | operator[] (size_type i) |
Return a reference to the element \(i\). More... | |
reference | front () |
Returns the first element of the vector. More... | |
const_reference | front () const |
Returns the first element of the vector. More... | |
reference | back () |
Returns the last element of the vector. More... | |
const_reference | back () const |
Returns the last element of the vector. More... | |
void | push_back (value_type const &element) |
resizes the vector by appending a new element to the end. this invalidates storage More... | |
void | clear () |
Clear the vector, i.e. set all values to the zero value. More... | |
const_iterator | cbegin () const |
return an iterator on the first element of the vector More... | |
const_iterator | cend () const |
return an iterator after the last element of the vector More... | |
const_iterator | begin () const |
return an iterator on the first element of the vector More... | |
const_iterator | end () const |
return an iterator after the last element of the vector More... | |
iterator | begin () |
Return an iterator on the first element of the vector. More... | |
iterator | end () |
Return an iterator at the end of the vector. More... | |
iterator | set_element (iterator pos, size_type index, value_type value) |
iterator | clear_element (iterator pos) |
iterator | clear_range (iterator start, iterator end) |
void | reserve (size_type) |
template<class Archive > | |
void | serialize (Archive &ar, const unsigned int file_version) |
Public Member Functions inherited from remora::vector_container< vector< T, cpu_tag >, cpu_tag > | |
const container_type & | operator() () const |
container_type & | operator() () |
Public Member Functions inherited from remora::vector_expression< vector< T, cpu_tag >, cpu_tag > | |
const expression_type & | operator() () const |
expression_type & | operator() () |
Friends | |
void | swap (vector &v1, vector &v2) |
Swap the content of two vectors. More... | |
Definition at line 43 of file vector.hpp.
typedef iterators::dense_storage_iterator<value_type const> remora::vector< T, cpu_tag >::const_iterator |
Definition at line 244 of file vector.hpp.
typedef array_type::const_reference remora::vector< T, cpu_tag >::const_reference |
Definition at line 49 of file vector.hpp.
typedef elementwise<dense_tag> remora::vector< T, cpu_tag >::evaluation_category |
Definition at line 57 of file vector.hpp.
typedef iterators::dense_storage_iterator<value_type> remora::vector< T, cpu_tag >::iterator |
Definition at line 243 of file vector.hpp.
typedef array_type::reference remora::vector< T, cpu_tag >::reference |
Definition at line 50 of file vector.hpp.
|
default |
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 |
Definition at line 68 of file vector.hpp.
|
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 |
Definition at line 73 of file vector.hpp.
|
default |
Copy-constructor of a vector.
v | is the vector to be duplicated |
|
inline |
Move-constructor of a vector.
v | is the vector to be moved |
Definition at line 82 of file vector.hpp.
|
inline |
Definition at line 84 of file vector.hpp.
|
inline |
Constructs the vector from a predefined range.
Definition at line 88 of file vector.hpp.
|
inline |
Copy-constructor of a vector from a vector_expression.
e | the vector_expression whose values will be duplicated into the vector |
Definition at line 93 of file vector.hpp.
References remora::assign().
|
inline |
Returns the last element of the vector.
Definition at line 224 of file vector.hpp.
|
inline |
Returns the last element of the vector.
Definition at line 228 of file vector.hpp.
|
inline |
return an iterator on the first element of the vector
Definition at line 257 of file vector.hpp.
|
inline |
Return an iterator on the first element of the vector.
Definition at line 267 of file vector.hpp.
|
inline |
return an iterator on the first element of the vector
Definition at line 247 of file vector.hpp.
|
inline |
return an iterator after the last element of the vector
Definition at line 252 of file vector.hpp.
|
inline |
Clear the vector, i.e. set all values to the zero
value.
Definition at line 238 of file vector.hpp.
|
inline |
Definition at line 284 of file vector.hpp.
References remora::iterators::dense_storage_iterator< T, Tag >::index().
|
inline |
Definition at line 292 of file vector.hpp.
|
inline |
Return true if the vector is empty (size==0
)
true
if empty, false
otherwise Definition at line 171 of file vector.hpp.
|
inline |
return an iterator after the last element of the vector
Definition at line 262 of file vector.hpp.
|
inline |
Return an iterator at the end of the vector.
Definition at line 272 of file vector.hpp.
|
inline |
Returns the first element of the vector.
Definition at line 216 of file vector.hpp.
|
inline |
Returns the first element of the vector.
Definition at line 220 of file vector.hpp.
|
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.
Definition at line 165 of file vector.hpp.
|
inline |
Return a const reference to the element \(i\) Return a const reference to the element \(i\). With some compilers, this notation will be faster than operator
[].
i | index of the element |
Definition at line 188 of file vector.hpp.
|
inline |
Return a reference to the element \(i\) Return a reference to the element \(i\). With some compilers, this notation will be faster than operator
[].
i | index of the element |
Definition at line 196 of file vector.hpp.
|
default |
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 |
Move-Assign a full vector (RHS-vector) to the current vector (LHS-vector)
v | is the source vector container |
Definition at line 111 of file vector.hpp.
|
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 |
Definition at line 121 of file vector.hpp.
References remora::assign().
|
inline |
Assign the result of a vector_expression to the vector Assign the result of a vector_expression to the vector.
e | is a const reference to the vector_expression |
Definition at line 131 of file vector.hpp.
References shark::swap().
|
inline |
Return a const reference to the element \(i\).
i | index of the element |
Definition at line 203 of file vector.hpp.
|
inline |
Return a reference to the element \(i\).
i | index of the element |
Definition at line 210 of file vector.hpp.
|
inline |
resizes the vector by appending a new element to the end. this invalidates storage
Definition at line 233 of file vector.hpp.
|
inline |
Definition at line 155 of file vector.hpp.
|
inline |
Returns the underlying storage structure for low level access.
Definition at line 147 of file vector.hpp.
|
inline |
Returns the underlying storage structure for low level access.
Definition at line 152 of file vector.hpp.
|
inline |
Definition at line 298 of file vector.hpp.
|
inline |
|
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) |
Definition at line 314 of file vector.hpp.
|
inline |
Definition at line 277 of file vector.hpp.
References remora::iterators::dense_storage_iterator< T, Tag >::index().
|
inline |
Return the size of the vector.
Definition at line 142 of file vector.hpp.
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 |
Definition at line 303 of file vector.hpp.