3D geometric vector More...
Public Member Functions | |
geom_vector () | |
Constructor initializing each element to the value 0. | |
geom_vector (element_type const &v_x, element_type const &v_y, element_type const &v_z) | |
element_type & | x () |
Returns x coordinate's value. More... | |
element_type & | y () |
Returns y coordinate's value. More... | |
element_type & | z () |
Returns z coordinate's value. More... | |
element_type | x () const |
Returns a copy of the x coordinate's value. More... | |
element_type | y () const |
Returns a copy of the y coordinate's value. More... | |
element_type | z () const |
Returns a copy of the z coordinate's value. More... | |
template<int N> | |
element_type | get () const |
Returns the Nth coordinate's value with tuple interface. More... | |
template<int N> | |
void | set (element_type const &value) |
Set the Nth coordinate's value with tuple interface. More... | |
bool | operator== (geom_vector const &coords) const |
Coordinate-wise comparison of 2 geometric vectors. More... | |
geom_vector & | operator= (geom_vector const &coords) |
Assign coordinates with those of another vector coords . More... | |
geom_vector & | operator= (element_type const &val) |
Assign coordinates with a value val . More... | |
geom_vector & | operator+= (geom_vector const &coords) |
Add to coordinates those of another vector coords . More... | |
geom_vector & | operator-= (geom_vector const &coords) |
Subtract from the coordinates those of another vector coords . More... | |
geom_vector & | operator*= (element_type const &a) |
Multiply coordinates with a value a . More... | |
geom_vector & | operator/= (element_type const &a) |
Divide coordinates with a value a . More... | |
bool | operator< (geom_vector const &other) const |
'Less than' comparison with another vector. This comparator lexicographically compares the coordinates of the vectors. More... | |
element_type | dot (geom_vector const &other) const |
Perform a dot product with another vector other . More... | |
geom_vector | cross (geom_vector const &other) const |
Perform a cross product with another vector other . More... | |
void | normalize (element_type const &n=1.0) |
Normalize vector to a value n . More... | |
Public Types | |
typedef ELEMENT | element_type |
3D geometric vector
ELEMENT | type of elements stored in vector. |
Template specialization for 3D.
stapl::geom_vector< 3, ELEMENT >::geom_vector | ( | element_type const & | v_x, |
element_type const & | v_y, | ||
element_type const & | v_z | ||
) |
v_x | x coordinate's value. |
v_y | y coordinate's value. |
v_z | z coordinate's value. |
element_type& stapl::geom_vector< 3, ELEMENT >::x | ( | ) |
Returns x coordinate's value.
element_type& stapl::geom_vector< 3, ELEMENT >::y | ( | ) |
Returns y coordinate's value.
element_type& stapl::geom_vector< 3, ELEMENT >::z | ( | ) |
Returns z coordinate's value.
element_type stapl::geom_vector< 3, ELEMENT >::x | ( | ) | const |
Returns a copy of the x coordinate's value.
element_type stapl::geom_vector< 3, ELEMENT >::y | ( | ) | const |
Returns a copy of the y coordinate's value.
element_type stapl::geom_vector< 3, ELEMENT >::z | ( | ) | const |
Returns a copy of the z coordinate's value.
element_type stapl::geom_vector< 3, ELEMENT >::get | ( | ) | const |
Returns the Nth coordinate's value with tuple interface.
void stapl::geom_vector< 3, ELEMENT >::set | ( | element_type const & | value | ) |
Set the Nth coordinate's value with tuple interface.
Nth | coordinate's value. |
bool stapl::geom_vector< 3, ELEMENT >::operator== | ( | geom_vector< 3, ELEMENT > const & | coords | ) | const |
Coordinate-wise comparison of 2 geometric vectors.
coords | vector tested for equality. |
geom_vector& stapl::geom_vector< 3, ELEMENT >::operator= | ( | geom_vector< 3, ELEMENT > const & | coords | ) |
Assign coordinates with those of another vector coords
.
coords | vector whose elements are used in assignment. |
geom_vector& stapl::geom_vector< 3, ELEMENT >::operator= | ( | element_type const & | val | ) |
Assign coordinates with a value val
.
val | value. |
geom_vector& stapl::geom_vector< 3, ELEMENT >::operator+= | ( | geom_vector< 3, ELEMENT > const & | coords | ) |
Add to coordinates those of another vector coords
.
coords | the vector whose elements are used in the addition. |
geom_vector& stapl::geom_vector< 3, ELEMENT >::operator-= | ( | geom_vector< 3, ELEMENT > const & | coords | ) |
Subtract from the coordinates those of another vector coords
.
coords | the vector whose elements are used in the subtraction. |
geom_vector& stapl::geom_vector< 3, ELEMENT >::operator*= | ( | element_type const & | a | ) |
Multiply coordinates with a value a
.
a | value. |
geom_vector& stapl::geom_vector< 3, ELEMENT >::operator/= | ( | element_type const & | a | ) |
Divide coordinates with a value a
.
a | value. |
bool stapl::geom_vector< 3, ELEMENT >::operator< | ( | geom_vector< 3, ELEMENT > const & | other | ) | const |
'Less than' comparison with another vector. This comparator lexicographically compares the coordinates of the vectors.
other | the vector provided for comparison. |
element_type stapl::geom_vector< 3, ELEMENT >::dot | ( | geom_vector< 3, ELEMENT > const & | other | ) | const |
Perform a dot product with another vector other
.
other | the vector provided for the dot product. |
geom_vector stapl::geom_vector< 3, ELEMENT >::cross | ( | geom_vector< 3, ELEMENT > const & | other | ) | const |
Perform a cross product with another vector other
.
other | the vector provided for the cross product. |
void stapl::geom_vector< 3, ELEMENT >::normalize | ( | element_type const & | n = 1.0 | ) |
Normalize vector to a value n
.
n | value. |