moab
|
Cartesian Vector. More...
#include <CartVect.hpp>
Public Member Functions | |
CartVect () | |
CartVect (double v) | |
CartVect (double i, double j, double k) | |
CartVect (const double a[3]) | |
CartVect & | operator= (const double v[3]) |
double & | operator[] (unsigned i) |
double | operator[] (unsigned i) const |
CartVect & | operator+= (const CartVect &v) |
CartVect & | operator-= (const CartVect &v) |
CartVect & | operator*= (const CartVect &v) |
CartVect & | operator+= (double s) |
CartVect & | operator-= (double s) |
CartVect & | operator*= (double s) |
CartVect & | operator/= (double s) |
bool | operator== (const CartVect &v) const |
double | length () const |
vector length | |
double | length_squared () const |
void | normalize () |
make unit length | |
void | flip () |
flip direction | |
void | scale (const CartVect &v) |
double * | array () |
const double * | array () const |
void | get (double v[3]) const |
Private Attributes | |
double | d [3] |
Cartesian Vector.
Definition at line 13 of file CartVect.hpp.
moab::CartVect::CartVect | ( | ) | [inline] |
Definition at line 20 of file CartVect.hpp.
{ }
moab::CartVect::CartVect | ( | double | v | ) | [inline, explicit] |
Initialze all three values to same scalar (typically zero)
Definition at line 23 of file CartVect.hpp.
moab::CartVect::CartVect | ( | double | i, |
double | j, | ||
double | k | ||
) | [inline] |
Definition at line 25 of file CartVect.hpp.
moab::CartVect::CartVect | ( | const double | a[3] | ) | [inline, explicit] |
Initialze from array
Definition at line 28 of file CartVect.hpp.
double* moab::CartVect::array | ( | ) | [inline] |
Definition at line 69 of file CartVect.hpp.
{ return d; }
const double* moab::CartVect::array | ( | ) | const [inline] |
Definition at line 71 of file CartVect.hpp.
{ return d; }
void CartVect::flip | ( | ) | [inline] |
void moab::CartVect::get | ( | double | v[3] | ) | const [inline] |
initialize array from this
Definition at line 75 of file CartVect.hpp.
double CartVect::length | ( | ) | const [inline] |
double CartVect::length_squared | ( | ) | const [inline] |
Definition at line 103 of file CartVect.hpp.
void CartVect::normalize | ( | ) | [inline] |
Assign cross product to this
Definition at line 97 of file CartVect.hpp.
{ return *this = *this * v; }
CartVect& moab::CartVect::operator*= | ( | double | s | ) | [inline] |
Definition at line 49 of file CartVect.hpp.
Definition at line 38 of file CartVect.hpp.
CartVect& moab::CartVect::operator+= | ( | double | s | ) | [inline] |
Definition at line 45 of file CartVect.hpp.
Definition at line 40 of file CartVect.hpp.
CartVect& moab::CartVect::operator-= | ( | double | s | ) | [inline] |
Definition at line 47 of file CartVect.hpp.
CartVect& moab::CartVect::operator/= | ( | double | s | ) | [inline] |
Definition at line 51 of file CartVect.hpp.
CartVect& moab::CartVect::operator= | ( | const double | v[3] | ) | [inline] |
Definition at line 30 of file CartVect.hpp.
bool moab::CartVect::operator== | ( | const CartVect & | v | ) | const [inline] |
Definition at line 53 of file CartVect.hpp.
double& moab::CartVect::operator[] | ( | unsigned | i | ) | [inline] |
Definition at line 33 of file CartVect.hpp.
{ return d[i]; }
double moab::CartVect::operator[] | ( | unsigned | i | ) | const [inline] |
Definition at line 35 of file CartVect.hpp.
{ return d[i]; }
void moab::CartVect::scale | ( | const CartVect & | v | ) | [inline] |
per-element scalar multiply (this[0] *= v[0], this[1] *= v[1], ...)
Definition at line 65 of file CartVect.hpp.
double moab::CartVect::d[3] [private] |
Definition at line 16 of file CartVect.hpp.