FBase | +----FVector4
#include <Flek/FVector4.H>
FVector4 is a 4 dimensional vector represented internally as an array of doubles. This class is related to FVector2 and FVector3 which are 2-D and 3-D versions of this class. All FVector classes are forward declared in FVector.h.
virtual FVector4::FBase(void);
Make a copy of the object.
FVector4::FVector4();
The default constructor sets each element in the vector to 0.FVector4::FVector4(double val);
This one argument constructor intializes all elements in the vector with the given value.FVector4::FVector4(double * arr);
This one argument constructor initializes the vector with the first three elements in the given array.FVector4::FVector4(double val1, double val2, double val3, double val4);
This four argument constructor initializes the vector with the passed values.FVector4::FVector4(const FVector4& vec);
The copy constructor initializes this vector with the contents of another vector.FVector4::FVector4(const FVector2& vec);
This constructor initializes the vector from the contents of a FVector2 (a 2D vector). The third and forth elements are set to zero.FVector4::FVector4(const FVector3& vec);
This constructor initializes the vector from the contents of a FVector2 (a 2D vector). The third element is set to zero.
void FVector4::copy_from(const FVector2& vec);
Initialize the elements from a FVector2,void FVector4::copy_from(const FVector3& vec);
Initialize the elements from a FVector4,
void FVector4::fill_array(double arr[4]);
Fill an array with the elements of the vector.
void FVector4::get(double& v1, double& v2, double& v3, double& v4);
Get the elements of vector into given values.
double FVector4::length();
Length (norm) of the vector.
friend double FVector4::norm(const FVector4& vec);
Norm of the vector.
friend double FVector4::normalize(FVector4& vec);
Normalize. Returns previous norm.
friend FVector4 FVector4::normalized(const FVector4& vec);
Returns normalized vector.
friend double FVector4::normsqr(const FVector4& vec);
Square of the norm of the vector.
bool FVector4::operator !=(const FVector4& vec);
Boolean ineqality operator.
double FVector4::operator * (const FVector4& vec);
Operator for scalar multiplication (dot product).friend FVector4 FVector4::operator * (double scalar, const FVector4& vec);
Friend operator for scalar pre-multiplication.friend FVector4 FVector4::operator * (const FVector4& vec, double scalar);
Friend operator for scalar post-multiplication.
void FVector4::operator *=(double scalar);
Arithmetic operator for multiplicative (scalar) assignment.
FVector4 FVector4::operator +(const FVector4& vec);
Arithmetic operator for addition.
void FVector4::operator +=(const FVector4& vec);
Arithmetic operator for additive assignment.
FVector4 FVector4::operator -(const FVector4& vec);
Arithmetic operator for subtraction.friend FVector4 FVector4::operator -(const FVector4& vec);
Friend operator for negation.
void FVector4::operator -=(const FVector4& vec);
Arithmetic operator for subtractive assignment.
friend FVector4 FVector4::operator /(const FVector4& vec, double scalar);
Friend operator for scalar division.
void FVector4::operator /=(double scalar);
Arithmetic operator for divisive (scalar) assignment.
friend ostream& FVector4::operator <<(ostream& o, const FVector4& vec);
I/O Stream insertion operator. Of the form "[ x y z ]".
FVector4& FVector4::operator =(const FVector4& vec);
Assignment operator from another FVector3.FVector4& FVector4::operator =(double scalar);
Assignment operator from a scalar. All elements are set to the scalar value.FVector4& FVector4::operator =(const FVector2& vec);
Assignment operator from a FVector2. The third and forth elements are set to 0.FVector4& FVector4::operator =(const FVector3& vec);
Assignment operator from a FVector3. The forth element is set to 0.
bool FVector4::operator ==(const FVector4& vec);
Boolean equality operator.
friend istream& FVector4::operator >>(istream& i, FVector4& vec);
I/O Stream extraction operator. Of the form "[ x y z ]".
double& FVector4::operator [] (uint index);
Element access operator. For efficiency, this doesn't check for valid indicesdouble FVector4::operator [] (uint index);
Element access operator. For efficiency, this doesn't check for valid indices
friend FVector4 FVector4::product(const FVector4& vec1, const FVector4& vec2);
Friend operator for element-by-element product.
void FVector4::reset(void);
Set elements of vector to default values.
void FVector4::set(double v1, double v2, double v3, double v4);
Set each element vector to the given values.void FVector4::set(double val);
Set each element vector to the given value.
friend void FVector4::swap(FVector4& vec1, FVector4& vec2);
Swap the elements of two FVector4s.
virtual FVector4::~FVector4();
The virtual destructor does nothing.