|
void | set (T _a, T _b) |
| Set all coordinates of a 2D vector.
|
|
void | set (T _a, T _b, T _c) |
| Set all coordinates of a 3D vector.
|
|
void | set (T _a, T _b, T _c, T _d) |
| Set all coordinates of a 4D vector.
|
|
const T & | operator[] (unsigned int i) const |
| Const index operator.
|
|
T & | operator[] (unsigned int i) |
| Non-const index operator.
|
|
const T & | operator() (unsigned int i) const |
| Const index operator.
|
|
T & | operator() (unsigned int i) |
| Non-const index operator.
|
|
T * | get () |
|
const T * | get () const |
|
bool | operator== (const V &v) const |
| Equality operator.
|
|
bool | operator== (T k) const |
| Equality wrt scalar. True if all coords are equal to scalar.
|
|
bool | operator!= (const V &v) const |
| Inequality operator.
|
|
bool | operator!= (T k) const |
| Inequality wrt scalar. True if any coord not equal to scalar.
|
|
bool | all_l (const V &v) const |
|
bool | all_le (const V &v) const |
|
bool | all_g (const V &v) const |
|
bool | all_ge (const V &v) const |
|
const V & | operator*= (T k) |
| Assignment multiplication with scalar.
|
|
const V & | operator/= (T k) |
| Assignment division with scalar.
|
|
const V & | operator+= (T k) |
| Assignment addition with scalar. Adds scalar to each coordinate.
|
|
const V & | operator-= (T k) |
| Assignment subtraction with scalar. Subtracts scalar from each coord.
|
|
const V & | operator*= (const V &v) |
|
const V & | operator/= (const V &v) |
| Assigment division with vector. Each coord divided independently.
|
|
const V & | operator+= (const V &v) |
| Assignmment addition with vector.
|
|
const V & | operator-= (const V &v) |
| Assignment subtraction with vector.
|
|
const V | operator- () const |
| Negate vector.
|
|
const V | operator* (const V &v1) const |
|
const V | operator+ (const V &v1) const |
| Add two vectors.
|
|
const V | operator- (const V &v1) const |
| Subtract two vectors.
|
|
const V | operator/ (const V &v1) const |
| Divide two vectors. Each coord separately.
|
|
const V | operator* (T k) const |
| Multiply scalar onto vector.
|
|
const V | operator/ (T k) const |
| Divide vector by scalar.
|
|
const T | min_coord () const |
| Return the smallest coordinate of the vector.
|
|
const T | max_coord () const |
| Return the largest coordinate of the vector.
|
|
template<class T, class V, unsigned int N>
class CGLA::ArithVec< T, V, N >
Template representing generic arithmetic vectors.
The three parameters to the template are
T - the scalar type (i.e. float, int, double etc.)
V - the name of the vector type. This template is always (and only) used as ancestor of concrete types, and the name of the class inheriting from this class is used as the V argument.
N - The final argument is the dimension N. For instance, N=3 for a 3D vector.
This class template contains all functions that are assumed to be the same for any arithmetic vector - regardless of dimension or the type of scalars used for coordinates.
The template contains no virtual functions which is important since they add overhead.