Generic 3-vector. More...
#include <vector3.h>
Public Member Functions | |
__hostanddev__ scalar & | operator[] (int k) |
Access element. | |
__hostanddev__ const scalar & | operator[] (int k) const |
Access element. | |
__hostanddev__ scalar & | x () |
__hostanddev__ scalar & | y () |
__hostanddev__ scalar & | z () |
__hostanddev__ const scalar & | x () const |
__hostanddev__ const scalar & | y () const |
__hostanddev__ const scalar & | z () const |
__hostanddev__ bool | isNonzero () const |
true if any component nonzero | |
__hostanddev__ | vector3 (scalar a=0, scalar b=0, scalar c=0) |
Construct from elements. | |
vector3 (std::vector< scalar > a) | |
convert from std::vector | |
template<typename scalar2 > | |
__hostanddev__ | vector3 (const vector3< scalar2 > &a) |
convert scalar type | |
__hostanddev__ vector3 | operator+ (const vector3 &a) const |
__hostanddev__ vector3 | operator+= (const vector3 &a) |
__hostanddev__ vector3 | operator+ (const scalar a) const |
__hostanddev__ vector3 | operator+= (const scalar a) |
__hostanddev__ vector3 | operator- () const |
__hostanddev__ vector3 | operator- (const vector3 &a) const |
__hostanddev__ vector3 | operator-= (const vector3 &a) |
__hostanddev__ vector3 | operator/ (scalar s) const |
__hostanddev__ vector3 & | operator/= (scalar s) |
__hostanddev__ scalar | length_squared () const |
__hostanddev__ scalar | length () const |
void | print (FILE *fp, const char *format) const |
print to file / stream | |
__hostanddev__ bool | operator== (const vector3 &w) const |
__hostanddev__ bool | operator< (const vector3 &w) const |
comparison in lexicographic order | |
Generic 3-vector.