|
|
| Vector (void) |
| | Default construction, initializes all components to zero.
|
| |
|
template<typename U , size_t M> |
| | Vector (const Vector< U, M > &vector) |
| | Copy construction from a vector with different element type.
|
| |
|
| Vector (const T(&v)[N]) |
| | Initialization from C-array.
|
| |
|
| Vector (const T *v, std::size_t n) |
| | Initialization from pointer and size.
|
| |
|
| Vector (const T *v, std::size_t n, T def) |
| | Initialization from poiner, size and a default value.
|
| |
|
| Vector (T v) |
| | Initialization of all components by v.
|
| |
|
template<typename... P> |
| | Vector (P...vn) |
| | Initialization from N values.
|
| |
|
template<typename... P> |
| | Vector (const Vector< T, M > &a, P...p) |
| | Initialization from a vector of smaller dimension and additional values.
|
| |
|
| Vector (const Matrix< T, 1, N > &matrix) |
| | Construction from to Matrix-1xN.
|
| |
|
| Vector (const Matrix< T, N, 1 > &matrix) |
| | Construction from to Matrix-Nx1.
|
| |
| T | At (const Vector &vector, std::size_t i) const T x(void) const |
| | Returns the value of the i-th coordinate of the vector. More...
|
| |
|
T | y (void) const |
| | Returns the 1-st component.
|
| |
|
T | z (void) const |
| | Returns the 2-nd component.
|
| |
|
T | w (void) const |
| | Returns the 3-nd component.
|
| |
|
Vector< T, 2 > | xy (void) const |
| | Returns a subvector with the first two components.
|
| |
|
Vector< T, 3 > | xyz (void) const |
| | Returns a subvector with the first three components.
|
| |
|
Vector & | operator+= (const Vector &v) |
| | Adds a vector to this vector.
|
| |
|
Vector & | operator-= (const Vector &v) |
| | Subtracts a vector from this vector.
|
| |
|
Vector & | operator*= (T v) |
| | Multiples this vector by a scalar value.
|
| |
|
Vector & | operator/= (T v) |
| | Divides this vector by a scalar value.
|
| |
|
T * | Data (void) |
| | Pointer to the components of this vector.
|
| |
|
const T * | Data (void) const |
| | Pointer to the components of this vector.
|
| |
| T | At (std::size_t i) const |
| | Access to the i-th component of this vector. More...
|
| |
| T | At (std::size_t i, T fallback) const |
| | Access to the i-th component of this vector with a fallback. More...
|
| |
| T & | operator[] (std::size_t i) |
| | Access to the i-th component of this vector. More...
|
| |
| const T & | operator[] (std::size_t i) const |
| | Const access to the i-th component of this vector. More...
|
| |
|
void | Add (const VectorBase &v) |
| | Adds v to this vector.
|
| |
|
void | Subtract (const VectorBase &v) |
| | Subtracts v from this vector.
|
| |
|
void | Multiply (T v) |
| | Multiplies this vector by a scalar value.
|
| |
|
void | Multiply (const VectorBase &that) |
| | Multiplies the elements of this and that vector.
|
| |
|
void | Divide (T v) |
| | Divides this vector by a scalar value.
|
| |
|
void | Divide (const VectorBase &that) |
| | Divides the elements of this and that vector.
|
| |
|
T | Length (void) const |
| | Returns the lenght of this vector.
|
| |
|
bool | IsNormal (T eps=T(0)) const |
| | Returns true if the vector is normal.
|
| |
|
void | Normalize (void) |
| | Normalizes this vector.
|
| |
|
|
std::size_t | Size (const Vector &a) |
| | Returns the dimension of the vector.
|
| |
|
const T * | Data (const Vector &vector) |
| | Returns a pointer to an array containing the vectors coordinates.
|
| |
|
Vector | Negated (const Vector &a) |
| | Returns a new vector that is a negation of vector a.
|
| |
|
Vector | operator+ (const Vector &a) |
| | Identity operator.
|
| |
|
Vector | operator- (const Vector &a) |
| | Negation operator.
|
| |
|
Vector | Added (const Vector &a, const Vector &b) |
| | Adds two vectors.
|
| |
|
Vector | operator+ (const Vector &a, const Vector &b) |
| | Vector addition operator.
|
| |
|
Vector | Subtracted (const Vector &a, const Vector &b) |
| | Subtracts two vectors.
|
| |
|
Vector | operator- (const Vector &a, const Vector &b) |
| | Vector subtration operator.
|
| |
|
Vector | Multiplied (const Vector &a, T v) |
| | Multiples a vector by a scalar value.
|
| |
|
Vector | operator* (const Vector &a, T v) |
| | Operator for multiplication by a scalar value.
|
| |
|
Vector | operator* (T v, const Vector &a) |
| | Operator for multiplication by a scalar value.
|
| |
|
Vector | Divided (const Vector &a, T v) |
| | Divides a vector by a scalar value.
|
| |
|
Vector | operator/ (const Vector &a, T v) |
| | Operator for division by a scalar value.
|
| |
|
T | Dot (const Vector &a, const Vector &b) |
| | Dot product of two vectors.
|
| |
|
T | Length (const Vector &a) |
| | Returns the length of a vector.
|
| |
|
T | Distance (const Vector &a, const Vector &b) |
| | Returns the distance between two vectors.
|
| |
|
Vector | Normalized (Vector a) |
| | Returns a normalized version of the vector passed as argument.
|
| |
|
template<std::size_t Cols> |
| Vector< T, Cols > | operator* (const Vector &v, const Matrix< T, N, Cols > &m) |
| | Vector by Matrix multiplication operator.
|
| |
|
template<std::size_t Rows> |
| Vector< T, Rows > | operator* (const Matrix< T, Rows, N > &m, const Vector &v) |
| | Matrix by Vector multiplication operator.
|
| |
template<typename T, std::size_t N>
class oglplus::Vector< T, N >
Basic template for vector types.
.file oglplus/math/vector_n.ipp .brief A generalized vector template
- Author
- Matus Chochlik
Copyright 2010-2014 Matus Chochlik. Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- Template Parameters
-
| T | the coordinate value type |
| N | the dimension of the Vector |
- See Also
- Matrix
- Examples:
- standalone/001_shape2dot.cpp, and standalone/026_blender_mesh_loader.cpp.