#include <Vector4.hpp>
Inherits Vector< T >.
Public Member Functions | |
Vector4 (void) | |
Default constructor Create a 4 Vector. | |
Vector4 (const Vector4< T > &v) | |
Copy constructor Create a Vector by copying the input Vector. | |
Vector4 (const Vector3< T > &v, const T &d1) | |
Vector4 constructor. | |
Vector4 (const T &d1, const Vector3< T > &v) | |
Vector4 constructor. | |
Vector4 (const Vector2< T > &v1, const Vector2< T > &v2) | |
Vector4 constructor. | |
Vector4 (const Vector2< T > &v1, const T &d1, const T &d2) | |
Vector4 constructor. | |
Vector4 (const T &d1, const T &d2, const Vector2< T > &v1) | |
Vector4 constructor. | |
Vector4 (const T &d1, const Vector2< T > &v1, const T &d2) | |
Vector4 constructor. | |
Vector4 (const Vector4< T > *v) | |
Copy constructor Create a Vector by copying the input Vector. | |
Vector4 (const T &d1, const T &d2, const T &d3, const T &d4) | |
Create a 4 Vector Create a 4 Vector and use the value d1, d2, d3 to set the data of the Vector. | |
Vector4 (const T &d) | |
Create a 4 Vector Create a 4 Vector and use the value d to set the data of the Vector. | |
Vector4 (const T *a) | |
create a 4 Vector create a 4 Vector and set data by using the values array d | |
Vector4 (const Vector< T > &v) | |
Create a 4 Vector from a generic vector of size 4. | |
~Vector4 (void) | |
Destructor. | |
T & | x (void) |
Return x coordinate reference. | |
const T & | x (void) const |
Return x coordinate reference. | |
T & | y (void) |
Return y coordinate reference. | |
const T & | y (void) const |
Return y coordinate reference. | |
T & | z (void) |
Return z coordinate reference. | |
const T & | z (void) const |
Return z coordinate reference. | |
T & | w (void) |
Return w coordinate reference. | |
const T & | w (void) const |
Return w coordinate reference. | |
Vector4< T > & | normalize (void) |
Normalize the vector Divide each elements of this vector its norm. | |
Vector4< T > | getNormalized (void) const |
Normalize a copy of the vector. | |
Vector4< T > & | operator= (const Vector4< T > &v) |
copy the value of the argument vector4 to this vector | |
T | operator* (const Vector4< T > &v) const |
Multiplies the Vector with a Vector4 (dot product). | |
T | dot (const Vector4< T > &v) const |
dot product | |
Vector4< T > | operator+ (const Vector4< T > &v) const |
adds two vectors | |
Vector4< T > | operator- (const Vector4< T > &v) const |
subtracts two vectors | |
Vector4< T > | operator/ (const T &d) const |
Divides the Vector4 by a value. | |
Vector4< T > | operator* (const T &d) const |
Multiplies the Vector with a value. | |
Vector4< T > | operator- (void) const |
Compute opposite of the Vector. | |
Vector4< T > & | operator+= (const Vector4< T > &v) |
Adds the Vector4 with a Vector. | |
Vector4< T > & | operator-= (const Vector4< T > &v) |
Subtracts the Vector4 with a Vector. | |
Vector4< T > & | operator/= (const T &d) |
Divides the Vector4 with a value All values of the Vector4 are divided by d. | |
Vector4< T > & | operator*= (const T &d) |
Multiplies the Vector4 with a value. | |
size_t | size (void) const |
Returns the number of rows of the Vector4. | |
void | fill (const T &d) |
Sets the value d on every entry of the vector. | |
void | setZero (void) |
Reset the vector entries to zero. |
Definition at line 36 of file Vector4.hpp.
kn::Vector4< T >::Vector4 | ( | void | ) | [inline] |
kn::Vector4< T >::Vector4 | ( | const Vector4< T > & | v | ) | [inline] |
Copy constructor Create a Vector by copying the input Vector.
v | the Vector to copy |
Definition at line 51 of file Vector4.hpp.
kn::Vector4< T >::Vector4 | ( | const Vector3< T > & | v, | |
const T & | d1 | |||
) | [inline] |
Vector4 constructor.
v | a vector3 | |
d1 | the fourth value |
Definition at line 63 of file Vector4.hpp.
kn::Vector4< T >::Vector4 | ( | const T & | d1, | |
const Vector3< T > & | v | |||
) | [inline] |
Vector4 constructor.
v | a vector3 | |
d1 | the first value of the vector4 |
Definition at line 75 of file Vector4.hpp.
kn::Vector4< T >::Vector4 | ( | const Vector2< T > & | v1, | |
const Vector2< T > & | v2 | |||
) | [inline] |
Vector4 constructor.
v1 | a vector2 | |
v2 | a vector2 |
Definition at line 87 of file Vector4.hpp.
kn::Vector4< T >::Vector4 | ( | const Vector2< T > & | v1, | |
const T & | d1, | |||
const T & | d2 | |||
) | [inline] |
Vector4 constructor.
v1 | a vector2 | |
d1 | the third value of the vector4 | |
d2 | the fourth value of the vector4 |
Definition at line 100 of file Vector4.hpp.
kn::Vector4< T >::Vector4 | ( | const T & | d1, | |
const T & | d2, | |||
const Vector2< T > & | v1 | |||
) | [inline] |
Vector4 constructor.
v1 | a vector2 | |
d1 | the first value of the vector4 | |
d2 | the second value of the vector4 |
Definition at line 113 of file Vector4.hpp.
kn::Vector4< T >::Vector4 | ( | const T & | d1, | |
const Vector2< T > & | v1, | |||
const T & | d2 | |||
) | [inline] |
Vector4 constructor.
v1 | a vector2 | |
d1 | the first value of the vector4 | |
d2 | the fourth value of the vector4 |
Definition at line 126 of file Vector4.hpp.
kn::Vector4< T >::Vector4 | ( | const Vector4< T > * | v | ) | [inline] |
Copy constructor Create a Vector by copying the input Vector.
v | the pointer to the Vector to copy |
MathException | pointer is null |
Definition at line 397 of file Vector4.hpp.
kn::Vector4< T >::Vector4 | ( | const T & | d1, | |
const T & | d2, | |||
const T & | d3, | |||
const T & | d4 | |||
) | [inline] |
Create a 4 Vector Create a 4 Vector and use the value d1, d2, d3 to set the data of the Vector.
d1 | value used to set data of the Vector | |
d2 | value used to set data of the Vector | |
d3 | value used to set data of the Vector | |
d4 | value used to set data of the Vector |
Definition at line 149 of file Vector4.hpp.
kn::Vector4< T >::Vector4 | ( | const T & | d | ) | [inline, explicit] |
kn::Vector4< T >::Vector4 | ( | const T * | a | ) | [inline] |
create a 4 Vector create a 4 Vector and set data by using the values array d
a | pointer to an array of data |
MathException | d is null |
Definition at line 406 of file Vector4.hpp.
kn::Vector4< T >::Vector4 | ( | const Vector< T > & | v | ) | [inline] |
Create a 4 Vector from a generic vector of size 4.
v | a vector |
MathException | size of vector is different of 4 |
Definition at line 387 of file Vector4.hpp.
kn::Vector4< T >::~Vector4 | ( | void | ) | [inline] |
T kn::Vector4< T >::dot | ( | const Vector4< T > & | v | ) | const [inline] |
dot product
v | the Vector used for the dot product |
MathException | incompatible vector size |
Definition at line 286 of file Vector4.hpp.
void kn::Vector4< T >::fill | ( | const T & | d | ) | [inline] |
Sets the value d on every entry of the vector.
Reimplemented from kn::Vector< T >.
Definition at line 372 of file Vector4.hpp.
Vector4< T > kn::Vector4< T >::getNormalized | ( | void | ) | const [inline] |
Normalize a copy of the vector.
Reimplemented from kn::Vector< T >.
Definition at line 425 of file Vector4.hpp.
Vector4< T > & kn::Vector4< T >::normalize | ( | void | ) | [inline] |
Normalize the vector Divide each elements of this vector its norm.
Reimplemented from kn::Vector< T >.
Definition at line 415 of file Vector4.hpp.
Vector4<T> kn::Vector4< T >::operator* | ( | const T & | d | ) | const [inline] |
Multiplies the Vector with a value.
d | the value multiplied with this Vector |
Reimplemented from kn::Vector< T >.
Definition at line 319 of file Vector4.hpp.
T kn::Vector4< T >::operator* | ( | const Vector4< T > & | v | ) | const [inline] |
Vector4< T > & kn::Vector4< T >::operator*= | ( | const T & | d | ) | [inline] |
Multiplies the Vector4 with a value.
d | the value multiplied with this Vector4 |
Reimplemented from kn::Vector< T >.
Definition at line 496 of file Vector4.hpp.
Vector4< T > kn::Vector4< T >::operator+ | ( | const Vector4< T > & | v | ) | const [inline] |
adds two vectors
v | the vector to be added |
Definition at line 448 of file Vector4.hpp.
Vector4< T > & kn::Vector4< T >::operator+= | ( | const Vector4< T > & | v | ) | [inline] |
Vector4<T> kn::Vector4< T >::operator- | ( | void | ) | const [inline] |
Compute opposite of the Vector.
Reimplemented from kn::Vector< T >.
Definition at line 327 of file Vector4.hpp.
Vector4< T > kn::Vector4< T >::operator- | ( | const Vector4< T > & | v | ) | const [inline] |
subtracts two vectors
v | the vector to be substracted |
Definition at line 459 of file Vector4.hpp.
Vector4< T > & kn::Vector4< T >::operator-= | ( | const Vector4< T > & | v | ) | [inline] |
Vector4<T> kn::Vector4< T >::operator/ | ( | const T & | d | ) | const [inline] |
Divides the Vector4 by a value.
d | the value dividing this Vector |
MathException | d is null |
Reimplemented from kn::Vector< T >.
Definition at line 310 of file Vector4.hpp.
Vector4< T > & kn::Vector4< T >::operator/= | ( | const T & | d | ) | [inline] |
Divides the Vector4 with a value All values of the Vector4 are divided by d.
d | the value divided with this Vector4 |
Reimplemented from kn::Vector< T >.
Definition at line 487 of file Vector4.hpp.
Vector4< T > & kn::Vector4< T >::operator= | ( | const Vector4< T > & | v | ) | [inline] |
copy the value of the argument vector4 to this vector
v | the source vector |
MathException | incompatible size for vector4 |
Definition at line 437 of file Vector4.hpp.
void kn::Vector4< T >::setZero | ( | void | ) | [inline] |
Reset the vector entries to zero.
Reimplemented from kn::Vector< T >.
Definition at line 379 of file Vector4.hpp.
size_t kn::Vector4< T >::size | ( | void | ) | const [inline] |
Returns the number of rows of the Vector4.
Reimplemented from kn::Vector< T >.
Definition at line 365 of file Vector4.hpp.
const T& kn::Vector4< T >::w | ( | void | ) | const [inline] |
Return w coordinate reference.
Definition at line 250 of file Vector4.hpp.
T& kn::Vector4< T >::w | ( | void | ) | [inline] |
Return w coordinate reference.
Definition at line 242 of file Vector4.hpp.
const T& kn::Vector4< T >::x | ( | void | ) | const [inline] |
Return x coordinate reference.
Definition at line 202 of file Vector4.hpp.
T& kn::Vector4< T >::x | ( | void | ) | [inline] |
Return x coordinate reference.
Definition at line 194 of file Vector4.hpp.
const T& kn::Vector4< T >::y | ( | void | ) | const [inline] |
Return y coordinate reference.
Definition at line 218 of file Vector4.hpp.
T& kn::Vector4< T >::y | ( | void | ) | [inline] |
Return y coordinate reference.
Definition at line 210 of file Vector4.hpp.
const T& kn::Vector4< T >::z | ( | void | ) | const [inline] |
Return z coordinate reference.
Definition at line 234 of file Vector4.hpp.
T& kn::Vector4< T >::z | ( | void | ) | [inline] |
Return z coordinate reference.
Definition at line 226 of file Vector4.hpp.