fluidvis
|
#include <SXMath.h>
Public Member Functions | |
EXPA | DVector () |
EXPA | DVector (double v) |
EXPA | DVector (double x, double y) |
EXPA | DVector (double x, double y, double z) |
EXPA | DVector (double x, double y, double z, double w) |
EXPA | DVector (const double *v) |
EXPA | DVector (const Vector &vector) |
EXPA | DVector (const DVector &vector) |
EXPA DVector & | operator= (const DVector &v) |
virtual EXPA | ~DVector () |
EXPA double & | operator[] (unsigned int index) |
EXPA double | operator[] (unsigned int index) const |
EXPA DVector & | operator<< (const DVector &v) |
EXPA DVector & | operator<< (const double *v) |
EXPA const DVector & | operator>> (DVector &v) const |
EXPA const DVector & | operator>> (double *v) const |
EXPA DVector & | add (const DVector &v) |
EXPA DVector & | add (double x) |
EXPA DVector & | crossmult (const DVector &v) |
EXPA DVector & | scalarmult (double s) |
EXPA double | innerprod (const DVector &v) const |
EXPA DVector & | leftmult (const DMatrix &m) |
EXPA DVector & | rightmult (const DMatrix &m) |
EXPA DVector & | normalize () |
EXPA double | distance (const DVector &v) const |
EXPA double | length () const |
EXPA DVector & | random () |
EXPA DVector & | homogenize () |
EXPA bool | equals (const DVector &v) const |
EXPA bool | equals (const DVector &v, double epsilon) const |
Public Attributes | |
double * | elements |
Friends | |
EXPA friend DVector | operator+ (const DVector &v1, const DVector &v2) |
EXPA friend DVector | operator+ (const DVector &v, double x) |
EXPA friend DVector | operator+ (double x, const DVector &v) |
EXPA friend DVector | operator% (const DVector &v1, const DVector &v2) |
EXPA friend DVector | operator* (const DVector &v, double x) |
EXPA friend DVector | operator* (double x, const DVector &v) |
EXPA friend DVector | operator-- (const DVector &v) |
EXPA friend double | operator* (const DVector &v1, const DVector &v2) |
EXPA friend DVector | operator* (const DMatrix &m, const DVector &v) |
EXPA friend DVector | operator* (const DVector &v, const DMatrix &m) |
A double precision Vector in four-dimensional homogenous space
EXPA sx::DVector::DVector | ( | ) |
default constructor, constructs a zero vector with w=1
EXPA sx::DVector::DVector | ( | double | v | ) |
constructor, initializes x,y,z with v and w=1
EXPA sx::DVector::DVector | ( | double | x, |
double | y | ||
) |
constructor, initializes the vector with (x,y,0,1)
EXPA sx::DVector::DVector | ( | double | x, |
double | y, | ||
double | z | ||
) |
constructor, initializes the vector with (x,y,z,1)
EXPA sx::DVector::DVector | ( | double | x, |
double | y, | ||
double | z, | ||
double | w | ||
) |
constructor, initializes the vector with (x,y,z,w)
EXPA sx::DVector::DVector | ( | const double * | v | ) |
Constructor, copies array v into elements. v must have at least length 4.
EXPA sx::DVector::DVector | ( | const Vector & | vector | ) |
constructor for casting
EXPA sx::DVector::DVector | ( | const DVector & | vector | ) |
copy constructor
|
virtual |
deconstructor
adds vector v to this vector, leaves w untouched, and returns a reference to this
EXPA DVector& sx::DVector::add | ( | double | x | ) |
add vector (x,x,x,1) to this vector, leaves w untouched, and returns a reference to this
stores the crossproduct of this and v in this, leaves w untouched, and returns a reference to this
EXPA double sx::DVector::distance | ( | const DVector & | v | ) | const |
returns the distance of the points specified by the first three components of this and v
EXPA bool sx::DVector::equals | ( | const DVector & | v | ) | const |
returns true iff all components of this and v are equal
EXPA bool sx::DVector::equals | ( | const DVector & | v, |
double | epsilon | ||
) | const |
returns true iff the difference of each component of this and v is not larger than epsilon
EXPA DVector& sx::DVector::homogenize | ( | ) |
Homogenizes the vector by dividing x, y, z, w by w, and returns a reference to this. If w is equal to zero, the method does not modify this.
EXPA double sx::DVector::innerprod | ( | const DVector & | v | ) | const |
returns the inner product of the first three components of this and v
EXPA double sx::DVector::length | ( | ) | const |
returns the length of (x,y,z)
EXPA DVector& sx::DVector::normalize | ( | ) |
Normalizes this leaving w untouched, and taking only the components x, y, z into consideration, and returns a reference to this.
copies vector v, and returns a reference to this
EXPA DVector& sx::DVector::operator<< | ( | const double * | v | ) |
Copies array v, and returns a reference to this. The length of array v must be at least 4. Returns a reference to this.
copies itself to vector v, returns a reference to this
EXPA const DVector& sx::DVector::operator>> | ( | double * | v | ) | const |
Copies itself to array v. The length of array v must be at least 4. Returns a reference to this.
EXPA double& sx::DVector::operator[] | ( | unsigned int | index | ) |
Returns a reference to the index. component. If index is out of bounds, an exception is thrown.
index | number of the component |
return | reference to the index. component |
exception | throws an exception Exception of type EX_BOUNDS, if index is equal to 4 or above |
EXPA double sx::DVector::operator[] | ( | unsigned int | index | ) | const |
Returns a reference to the index. component. If index is out of bounds, an exception is thrown.
index | number of the component |
return | reference to the index. component |
exception | throws an exception Exception of type EX_BOUNDS, if index is equal to 4 or above |
EXPA DVector& sx::DVector::random | ( | ) |
assigns (x,y,z) with a random value out of [0,1]^3, sets w=1, and returns a reference to this
EXPA DVector& sx::DVector::scalarmult | ( | double | s | ) |
multiplies this with s, leaves w untouched, and returns a reference to this
returns the crossproduct of v1 and v2 with w=1
returns the scalarproduct of v and x and copies w of v into the returned vector
returns the scalarproduct of v and x and copies w of v into the returned vector
returns the inner product of the first three components of v1 and v2
returns the sum of v1 and v2 with w=1
returns the sum of v and (x,x,x,1) with w=1
returns the sum of v and (x,x,x,1) with w=1
returns the scalarproduct of v with -1 and copies w of v into the returned vector
double* sx::DVector::elements |
components of vector, has always four components x,y,z,w