KJB
|
#include <g_quaternion.h>
Public Member Functions | |
Vector_d () | |
default constructor More... | |
Vector_d (const Vector_d &v) | |
Copy constructor. More... | |
Vector_d (const Vector_d< D-1 > &v, double fill1) | |
Copy from D-1 dimensional vector, providing extra element. More... | |
Vector_d (const Vector_d< D-1 > &v, double fill1, double fill2) | |
Copy from D-2 dimensional vector, providing extra elements. More... | |
template<class Iterator > | |
Vector_d (Iterator begin) | |
Fill constructor. More... | |
Vector_d (const Vector &v) | |
Construct from "dynamic" vector. More... | |
Vector_d (double init) | |
initialize all elements with value init More... | |
Vector_d (double x, double y) | |
Vector_d (double x, double y, double z) | |
Vector_d (double x, double y, double z, double w) | |
double | x () const |
double & | x () |
lvalue of the first element of a vector. More... | |
void | set_x (double xv) |
double | y () const |
double & | y () |
lvalue of the second element of a vector. More... | |
void | set_y (double yv) |
Changes the second element of a vector (if it exists). More... | |
double | z () const |
double & | z () |
lvalue of the third element of a vector. More... | |
void | set_z (double zv) |
Changes the third element of a vector (if it exists). More... | |
double | w () const |
read fourth element (i.e., index 3) of vector, if it exists. More... | |
double & | w () |
lvalue of the fourth element of a vector (i.e., has index 3). More... | |
void | set_w (double wv) |
Changes the fourth element of a vector (if it exists). More... | |
Vector_d & | operator= (const Vector_d &other) |
assignment More... | |
Vector_d & | operator= (const Vector &other) |
assignment from dynamic vector More... | |
Vector_d< D > & | operator-= (const Vector_d< D > &second) |
Vector_d< D > & | operator-= (double second) |
Vector_d< D > & | operator+= (const Vector_d< D > &second) |
Vector_d< D > & | operator+= (double second) |
Vector_d< D > & | operator*= (double s) |
Vector_d< D > & | operator/= (double s) |
void | resize (size_t n) |
double | norm1 () const |
double | magnitude_squared () const |
return the squared l2-norm of this vector More... | |
double | magnitude () const |
return the l2-norm of this vector More... | |
Vector_d< D > & | normalize () |
normalize this vector to have l2-norm of 1.0 More... | |
Vector_d< D > | normalized () const |
Non-mutating (functionally pure) version of normalize() More... | |
Vector_d< D > & | negate () |
kjb::Vector_d< D >::Vector_d | ( | ) |
default constructor
kjb::Vector_d< D >::Vector_d | ( | const Vector_d< D > & | v | ) |
Copy constructor.
kjb::Vector_d< D >::Vector_d | ( | const Vector_d< D-1 > & | v, |
double | fill1 | ||
) |
Copy from D-1 dimensional vector, providing extra element.
kjb::Vector_d< D >::Vector_d | ( | const Vector_d< D-1 > & | v, |
double | fill1, | ||
double | fill2 | ||
) |
Copy from D-2 dimensional vector, providing extra elements.
|
inlineexplicit |
Fill constructor.
|
explicit |
Construct from "dynamic" vector.
|
explicit |
initialize all elements with value init
kjb::Vector_d< D >::Vector_d | ( | double | x, |
double | y | ||
) |
kjb::Vector_d< D >::Vector_d | ( | double | x, |
double | y, | ||
double | z | ||
) |
Construct a Vector from three values. This constructor only exists if D == 3
kjb::Vector_d< D >::Vector_d | ( | double | x, |
double | y, | ||
double | z, | ||
double | w | ||
) |
Construct a Vector from four values. This constructor only exists if D == 4
double kjb::Vector_d< D >::magnitude | ( | ) | const |
return the l2-norm of this vector
double kjb::Vector_d< D >::magnitude_squared | ( | ) | const |
return the squared l2-norm of this vector
Vector_d< D > & kjb::Vector_d< D >::negate | ( | ) |
double kjb::Vector_d< D >::norm1 | ( | ) | const |
Vector_d< D > & kjb::Vector_d< D >::normalize | ( | ) |
normalize this vector to have l2-norm of 1.0
Vector_d< D > kjb::Vector_d< D >::normalized | ( | ) | const |
Non-mutating (functionally pure) version of normalize()
Vector_d< D > & kjb::Vector_d< D >::operator*= | ( | double | s | ) |
Vector_d< D > & kjb::Vector_d< D >::operator+= | ( | double | second | ) |
Vector_d< D > & kjb::Vector_d< D >::operator-= | ( | double | second | ) |
Vector_d< D > & kjb::Vector_d< D >::operator/= | ( | double | s | ) |
assignment
Vector_d< D > & kjb::Vector_d< D >::operator= | ( | const Vector & | other | ) |
assignment from dynamic vector
void kjb::Vector_d< D >::resize | ( | size_t | n | ) |
if | n != D |
void kjb::Vector_d< D >::set_w | ( | double | wv | ) |
Changes the fourth element of a vector (if it exists).
void kjb::Vector_d< D >::set_x | ( | double | xv | ) |
void kjb::Vector_d< D >::set_y | ( | double | yv | ) |
Changes the second element of a vector (if it exists).
void kjb::Vector_d< D >::set_z | ( | double | zv | ) |
Changes the third element of a vector (if it exists).
double kjb::Vector_d< D >::w | ( | ) | const |
read fourth element (i.e., index 3) of vector, if it exists.
Runtime_error | if D < 4; |
double & kjb::Vector_d< D >::w | ( | ) |
lvalue of the fourth element of a vector (i.e., has index 3).
Runtime_error | if D < 4. |
double kjb::Vector_d< D >::x | ( | ) | const |
double x() const; Returns the first element of a vector. This method throws exception if D < 1.
double & kjb::Vector_d< D >::x | ( | ) |
lvalue of the first element of a vector.
Runtime_error | if D < 1. |
double kjb::Vector_d< D >::y | ( | ) | const |
double y() const; Returns the second element of a vector. This method throw exception if D < 2.
double & kjb::Vector_d< D >::y | ( | ) |
lvalue of the second element of a vector.
Runtime_error | if D < 2. |
double kjb::Vector_d< D >::z | ( | ) | const |
Returns the third element of a vector. This method throws exception if D < 3.
double & kjb::Vector_d< D >::z | ( | ) |
lvalue of the third element of a vector.
Runtime_error | if D < 3. |