![]() |
SynAPSE
0.6.0
Synergistic Analysis of Phase Space Evolution
|
Object that can host any type of data in a vector arrangement. More...
#include <Vector.hh>
Public Member Functions | |
| Vector () | |
| Default constructor, initilizes an empty vector of dimension 0. More... | |
| Vector (const size_t &n) | |
| Size constructor, initializes an empty vector of dimension n. More... | |
| Vector (const std::vector< T > &vec) | |
| Std constructor, sets the underlying std::vector. More... | |
| Vector (const T *vec, const size_t &n) | |
| Array constructor, sets the underlying std::vector. More... | |
| Vector (const size_t &n, const T &value) | |
| Constant constructor, initializes a vector of dimension n filled with value. More... | |
| Vector (const Vector &vec) | |
| Copy constructor. More... | |
| ~Vector () | |
| Destructor. More... | |
| Vector & | operator= (const Vector &vec) |
| Equality operator. More... | |
| Vector | operator- () const |
| Overload the unary minus for vector algebra. More... | |
| Vector | operator+ (const Vector &vec) const |
| Overload the vector sum. More... | |
| void | operator+= (const Vector &vec) |
| Overload the vector sum. More... | |
| Vector | operator- (const Vector &vec) const |
| Overload the v substraction. More... | |
| void | operator-= (const Vector &vec) |
| Overload the v substraction. More... | |
| T | operator* (const Vector &vec) const |
| Overload the vector product (dot product) More... | |
| Vector | operator* (const T &factor) const |
| Overload the vector product with a scalar. More... | |
| void | operator*= (const T &factor) |
| Overload the vector product with a scalar. More... | |
| Vector | operator/ (const T &factor) const |
| Overload the vector ratio with a scalar. More... | |
| void | operator/= (const T &factor) |
| Overload the vector ratio with a scalar. More... | |
| const T & | operator[] (const size_t i) const |
| Overload the subscript operator, return a value. More... | |
| T & | operator[] (const size_t i) |
| Overload the subscript operator, return a value, allows mods. More... | |
| const T & | back () const |
| Returns the last element of the vector. More... | |
| const T & | front () const |
| Returns the first element of the vector. More... | |
| T | mag () const |
| Returns the magnitude of the vector. More... | |
| T | mag2 () const |
| Returns the square of the magnitude of the vector. More... | |
| T | norm () const |
| Returns the norm of the vector. More... | |
| T | norm2 () const |
| Returns the square of the norm of the vector. More... | |
| T | dot (const Vector &vec) const |
| Returns the dot product with another vecror. More... | |
| Vector | cross (const Vector &vec) const |
| Returns the cross product with another vecror. More... | |
| void | push_back (const T &element) |
| Adds element at the back. More... | |
| void | push_front (const T &element) |
| Adds element at the back. More... | |
| void | resize (const size_t n) |
| Resizes the vector to chosen dimension. More... | |
| const size_t | size () const |
| Returns dimension of the vector. More... | |
| const std::vector< T > & | std () const |
| Returns the vector as an std::vector. More... | |
Private Attributes | |
| std::vector< T > | _vec |
| Underlying std::vector. More... | |
Object that can host any type of data in a vector arrangement.
The class definition also contains a multitude of linear algebra methods that are useful to work with vectors.
Default constructor, initilizes an empty vector of dimension 0.
Size constructor, initializes an empty vector of dimension n.
Std constructor, sets the underlying std::vector.
Array constructor, sets the underlying std::vector.
Constant constructor, initializes a vector of dimension n filled with value.
| const T & Vector< T >::back | ( | ) | const |
Returns the last element of the vector.
Returns the cross product with another vecror.
Returns the dot product with another vecror.
| const T & Vector< T >::front | ( | ) | const |
Returns the first element of the vector.
| T Vector< T >::mag | ( | ) | const |
Returns the magnitude of the vector.
| T Vector< T >::mag2 | ( | ) | const |
Returns the square of the magnitude of the vector.
| T Vector< T >::norm | ( | ) | const |
Returns the norm of the vector.
| T Vector< T >::norm2 | ( | ) | const |
Returns the square of the norm of the vector.
Overload the vector product (dot product)
Overload the vector product with a scalar.
| void Vector< T >::operator*= | ( | const T & | factor | ) |
Overload the vector product with a scalar.
Overload the vector sum.
Overload the vector sum.
Overload the unary minus for vector algebra.
Overload the v substraction.
Overload the v substraction.
Overload the vector ratio with a scalar.
| void Vector< T >::operator/= | ( | const T & | factor | ) |
Overload the vector ratio with a scalar.
Equality operator.
| const T & Vector< T >::operator[] | ( | const size_t | i | ) | const |
Overload the subscript operator, return a value.
| T & Vector< T >::operator[] | ( | const size_t | i | ) |
Overload the subscript operator, return a value, allows mods.
| void Vector< T >::push_back | ( | const T & | element | ) |
Adds element at the back.
| void Vector< T >::push_front | ( | const T & | element | ) |
Adds element at the back.
| void Vector< T >::resize | ( | const size_t | n | ) |
Resizes the vector to chosen dimension.
| const size_t Vector< T >::size | ( | ) | const |
Returns dimension of the vector.
| const std::vector< T > & Vector< T >::std | ( | ) | const |
Returns the vector as an std::vector.
|
private |
Underlying std::vector.
1.8.6