|
| Vector () |
| Create a vector with unitialized values.
|
|
| Vector (std::initializer_list< ValueType > init) |
| Create a vector with the values contained in a bracket list.
|
|
| Vector (const VectorX< ValueType > &other) |
| Build a Vector from a VectorX of same type.
|
|
| Vector (const VectorX< ValueType > &other, ValueType padding) |
| Build a vector from a VectorX of same type.
|
|
template<typename U > |
| Vector (const Vector< U, N > &other) |
| Build a vector from a vector storing another type.
|
|
| Vector (const Vector &other)=default |
|
Vector & | operator= (const Vector &other)=default |
|
| Vector (Vector &&other) noexcept=default |
|
Vector & | operator= (Vector &&other) noexcept=default |
|
size_t | size () const |
| Returns the size of the vector, which also correspond to vector number of dimension.
|
|
ValueType | at (size_t index) const |
| Access vector's value at given index.
|
|
void | setAt (size_t index, ValueType value) |
| Set value as given index.
|
|
ValueType | operator[] (size_t index) const |
|
ValueType & | operator[] (size_t index) |
|
double | squaredLength () const |
| Returns the vector's norm, squared.
|
|
double | length () const |
| Returns the vector's norm.
|
|
void | normalize () |
| Normalize the vector.
|
|
Iterator | begin () noexcept |
|
ConstIterator | begin () const noexcept |
|
Iterator | end () noexcept |
|
ConstIterator | end () const noexcept |
|
bool | operator== (const Vector &other) const |
|
bool | operator!= (const Vector &other) const |
|
std::string | toString () const |
|
Vector | operator- () const |
|
Vector & | operator+= (const Vector &v) |
|
Vector & | operator-= (const Vector &v) |
|
Vector | operator+ (const Vector &v) const |
|
Vector | operator- (const Vector &v) const |
|
Vector & | operator*= (ValueType value) |
|
Vector & | operator/= (ValueType value) |
|
Vector | operator* (ValueType v) const |
|
Vector | operator/ (ValueType v) const |
|
ValueType | dot (const Vector &v) const |
| Dot product of two vectors.
|
|
Vector | cross (const Vector &v) const |
| Cross product of two vectors.
|
|
Vector & | operator*= (const Vector &v) |
|
Vector & | operator/= (const Vector &v) |
|
Vector | operator* (const Vector &v) const |
|
Vector | operator/ (const Vector &v) const |
|
bool | operator< (const Vector &other) const |
|
bool | operator<= (const Vector &other) const |
|
bool | operator> (const Vector &other) const |
|
bool | operator>= (const Vector &other) const |
|
| operator VectorX< ValueType > () const |
|
template<typename T, size_t N>
class iolink::Vector< T, N >
An arithmetic vector.
- Template Parameters
-
T | The type wrote in the vector. |
N | The size, or number of dimension of the vector. |
Aliases can be used to made this class more practical to use. They use the following convention: VectorNX Where N is the size and X the type. The types currently available are:
- U8 and I8 respectively for unsigned and signed 8bits integers.
- U16 and I16 respectively for unsigned and signed 16bits integers.
- U32 and I32 respectively for unsigned and signed 32bits integers.
- U64 and I64 respectively for unsigned and signed 64bits integers.
- F for single precision floats.
- D for double precision floats.
Examples:
- Vector2i32: 2 dimensional 32bits signed integer.
- Vector3f: 3 dimensionnal single precision float.