|
EllAlgo 1.6.13
|
A simple 2D vector class for linear algebra operations. More...
#include <linear_algebra.hpp>
Public Types | |
| using | value_type = T |
Public Member Functions | |
| Vector2 (size_t size) | |
| Vector2 (const std::vector< T > &v) | |
| ~Vector2 ()=default | |
| Vector2 (const Vector2 &)=default | |
| Vector2 & | operator= (const Vector2 &)=default |
| Vector2 (Vector2 &&) noexcept=default | |
| Vector2 & | operator= (Vector2 &&) noexcept=default |
| T & | operator[] (size_t i) |
| const T & | operator[] (size_t i) const |
| size_t | size () const |
| Vector2 & | operator+= (const Vector2 &rhs) |
| Vector2 & | operator-= (const Vector2 &rhs) |
| Vector2 & | operator*= (T scalar) |
| T | dot (const Vector2 &other) const |
| T | norm () const |
A simple 2D vector class for linear algebra operations.
This class provides basic vector operations including addition, subtraction, scalar multiplication, dot product, and norm calculation. It is implemented using std::vector as the underlying storage.
| T | The element type (typically float or double) |
|
inline |
Copy assignment operator.
|
defaultnoexcept |
Move assignment operator.
|
inline |
Provides access to the elements of the Vector2 object.
| i | The index of the element to access. |
|
inline |
Provides constant access to the elements of the Vector2 object.
| i | The index of the element to access. |