ML Reference
|
A 32 dimensional vector class for floating point types. More...
#include <mlVector32.h>
Public Types | |
typedef DT | ComponentType |
A typedef to "export" the type of components. | |
Public Types inherited from ml::FloatingPointVector< DT, 32 > | |
enum | |
This enum grants access to the size during compile time, e.g. More... | |
typedef DT | ComponentType |
A typedef to "export" the type of components. | |
Public Member Functions | |
constructors | |
Tvec32 (DT value=0) | |
Default and value constructor. | |
Tvec32 (const FloatingPointVector< DT, 32 > &v) | |
Copy constructor from FloatingPointVector. | |
Tvec32 (const DT x00, const DT x01, const DT x02, const DT x03, const DT x04, const DT x05, const DT x06, const DT x07, const DT x08, const DT x09, const DT x10, const DT x11, const DT x12, const DT x13, const DT x14, const DT x15, const DT x16, const DT x17, const DT x18, const DT x19, const DT x20, const DT x21, const DT x22, const DT x23, const DT x24, const DT x25, const DT x26, const DT x27, const DT x28, const DT x29, const DT x30, const DT x31) | |
Builds the vector from the scalars x00, ... x31 to the components 0 to 31, respectively. | |
Other operators and methods | |
void | assign (const DT x00, const DT x01, const DT x02, const DT x03, const DT x04, const DT x05, const DT x06, const DT x07, const DT x08, const DT x09, const DT x10, const DT x11, const DT x12, const DT x13, const DT x14, const DT x15, const DT x16, const DT x17, const DT x18, const DT x19, const DT x20, const DT x21, const DT x22, const DT x23, const DT x24, const DT x25, const DT x26, const DT x27, const DT x28, const DT x29, const DT x30, const DT x31) |
Sets all components to the corresponding passed values. | |
Public Member Functions inherited from ml::FloatingPointVector< DT, 32 > | |
FloatingPointVector (DT value=DT(0)) | |
Default and value constructor. | |
FloatingPointVector< DT, size, FloatingPointVectorDataContainerBase< DT, size > > & | operator= (DT value) |
Assignment of scalar value to all components. | |
bool | operator== (const FloatingPointVector< DT, size, FloatingPointVectorDataContainerBase< DT, size > > &buffer) const |
Returns whether *this and buffer are component wise equal. | |
bool | operator!= (const FloatingPointVector< DT, size, FloatingPointVectorDataContainerBase< DT, size > > &buffer) const |
Returns whether any components of *this and buffer are not equal. | |
bool | operator< (const FloatingPointVector< DT, size, FloatingPointVectorDataContainerBase< DT, size > > &buffer) const |
Defines an artificial order for use in sort algorithms (lexicographical order). | |
const DT & | operator[] (const size_t i) const |
Constant indexing operators. | |
DT & | operator[] (const size_t i) |
Indexing operators. | |
size_t | getSize () const |
Returns the number of elements of value buffer. | |
DT | norm2 () const |
Returns the Euclidean norm (the vector length), i.e., square root of sum of squares of all components. | |
DT | norm2 (const FloatingPointVector< DT, size, FloatingPointVectorDataContainerBase< DT, size > > &weight) const |
Returns the weighted Euclidean norm, i.e., square root of sum of squares of all components multiplied with corresponding squared component of weight. | |
DT | dot (const FloatingPointVector< DT, size, FloatingPointVectorDataContainerBase< DT, size > > &buffer) const |
Returns the dot product, i.e., sum of all components multiplied with corresponding components of buffer. | |
DT | normalize () |
Normalizes the buffer and returns the Euclidean length of vector before normalization, i.e., norm2. | |
DT | length () const |
Returns the length of the vector, i.e. norm2(). | |
DT | distance (const FloatingPointVector< DT, size, FloatingPointVectorDataContainerBase< DT, size > > &buffer) const |
Returns the distance of this vector to a given one. | |
DT | distanceSquared (const FloatingPointVector< DT, size, FloatingPointVectorDataContainerBase< DT, size > > &buffer) const |
Returns the squared distance of this vector to a given one. | |
DT | lengthSquared () const |
Returns the squared length of the vector. | |
DT | compSum () const |
Returns the sum of all components. | |
DT | compMul () const |
Returns the product of all vector components. | |
DT | compMaxAbs () const |
Returns the maximum of absolute component values. | |
void | compMin (FloatingPointVector< DT, size, FloatingPointVectorDataContainerBase< DT, size > > buffer) |
Sets the component wise minimum of *this and buffer in *this. | |
void | compMax (FloatingPointVector< DT, size, FloatingPointVectorDataContainerBase< DT, size > > buffer) |
Sets the component wise maximum of *this and buffer in *this. | |
void | compAbs () |
Kills negative signs from all components. | |
void | compDiv (const FloatingPointVector< DT, size, FloatingPointVectorDataContainerBase< DT, size > > &d) |
Divides each vector component by the corresponding one of d. | |
void | compSqr () |
Calculates and sets the square of all components. | |
void | compSqrt () |
Calculates and sets square root of all components. | |
void | clampMin (const FloatingPointVector< DT, size, FloatingPointVectorDataContainerBase< DT, size > > &lower) |
Calculates and sets all components clamped to lower, i.e., if any component is smaller than the corresponding one in lower then it is set to the one from lower. | |
void | clampMax (const FloatingPointVector< DT, size, FloatingPointVectorDataContainerBase< DT, size > > &upper) |
Calculates and sets all components clamped to upper, i.e., if any component is greater than the corresponding one in upper then it is set to the one from upper. | |
void | clamp (const FloatingPointVector< DT, size, FloatingPointVectorDataContainerBase< DT, size > > &lower, const FloatingPointVector< DT, size, FloatingPointVectorDataContainerBase< DT, size > > &upper) |
Calculates and sets all components of *this so that they are between minimum min and maximum max. | |
void | compRound () |
Rounds all components of this vector using floor(component + 0.5). | |
void | compFloor () |
Rounds all components of this vector using floor(component). | |
void | compCeil () |
Rounds all components of this vector to integer using ceil(component). | |
FloatingPointVector< DT, 3, FloatingPointVectorDataContainerBase< DT, size > > | cross (const FloatingPointVector< DT, 3, FloatingPointVectorDataContainerBase< DT, size > > &b) const |
Returns the cross product for elements, i.e., return vector vertical to *this and b. | |
void | apply (ML_LA_FROM_DOUBLE_TO_DOUBLE f) |
Applies the function f to each component starting from index 0 to index size-1. | |
std::ostream & | writeOut (std::ostream &os) const |
Writes all components to ostream os starting from index 0 to size-1. | |
std::istream & | readIn (std::istream &is) |
Reads all components from istream is starting starting from index 0 to size-1. | |
Additional Inherited Members | |
Protected Attributes inherited from ml::FloatingPointVectorDataContainerBase< DT, size > | |
DT | _buffer [size] |
Related Symbols inherited from ml::FloatingPointVector< DT, 32 > | |
DT | compMul (const FloatingPointVector< DT, size, FloatingPointVectorDataContainerBase< DT, size > > &vec) |
Returns the product of all components. | |
FloatingPointVector< DT, size, FloatingPointVectorDataContainerBase< DT, size > > | compMin (FloatingPointVector< DT, size, FloatingPointVectorDataContainerBase< DT, size > > buffer1, const FloatingPointVector< DT, size, FloatingPointVectorDataContainerBase< DT, size > > &buffer2) |
Component wise minimum of buffer1 and buffer2. | |
FloatingPointVector< DT, size, FloatingPointVectorDataContainerBase< DT, size > > | compMax (FloatingPointVector< DT, size, FloatingPointVectorDataContainerBase< DT, size > > buffer1, const FloatingPointVector< DT, size, FloatingPointVectorDataContainerBase< DT, size > > &buffer2) |
Component wise maximum of buffer1 and buffer2. | |
FloatingPointVector< DT, size, FloatingPointVectorDataContainerBase< DT, size > > | compAbs (FloatingPointVector< DT, size, FloatingPointVectorDataContainerBase< DT, size > > vec) |
Returns a vector with all components from vec without negative sign. | |
FloatingPointVector< DT, size, FloatingPointVectorDataContainerBase< DT, size > > | compDiv (FloatingPointVector< DT, size, FloatingPointVectorDataContainerBase< DT, size > > vec, const FloatingPointVector< DT, size, FloatingPointVectorDataContainerBase< DT, size > > &d) |
Component wise division of vec / d. | |
FloatingPointVector< DT, size, FloatingPointVectorDataContainerBase< DT, size > > | compSqr (FloatingPointVector< DT, size, FloatingPointVectorDataContainerBase< DT, size > > vec) |
Returns a vector with all components from vec squared. | |
FloatingPointVector< DT, size, FloatingPointVectorDataContainerBase< DT, size > > | compSqrt (FloatingPointVector< DT, size, FloatingPointVectorDataContainerBase< DT, size > > vec) |
Returns a vector with all components from vec square-rooted. | |
FloatingPointVector< DT, size, FloatingPointVectorDataContainerBase< DT, size > > | clampMin (FloatingPointVector< DT, size, FloatingPointVectorDataContainerBase< DT, size > > vec, const FloatingPointVector< DT, size, FloatingPointVectorDataContainerBase< DT, size > > &m) |
Returns a new vector with all components from vec clamped to minimum m. | |
FloatingPointVector< DT, size, FloatingPointVectorDataContainerBase< DT, size > > | clampMax (FloatingPointVector< DT, size, FloatingPointVectorDataContainerBase< DT, size > > vec, const FloatingPointVector< DT, size, FloatingPointVectorDataContainerBase< DT, size > > &m) |
Returns a new vector with all components from vec clamped to maximum m. | |
FloatingPointVector< DT, size, FloatingPointVectorDataContainerBase< DT, size > > | clamp (FloatingPointVector< DT, size, FloatingPointVectorDataContainerBase< DT, size > > vec, const FloatingPointVector< DT, size, FloatingPointVectorDataContainerBase< DT, size > > &lower, const FloatingPointVector< DT, size, FloatingPointVectorDataContainerBase< DT, size > > &upper) |
Returns a new vector with all components from vec clamped to range [lower, upper]. | |
FloatingPointVector< DT, size, FloatingPointVectorDataContainerBase< DT, size > > & | operator+= (FloatingPointVector< DT, size, FloatingPointVectorDataContainerBase< DT, size > > &op1, const FloatingPointVector< DT, size, FloatingPointVectorDataContainerBase< DT, size > > &buffer) |
Arithmetic assignment: Component wise addition. | |
FloatingPointVector< DT, size, FloatingPointVectorDataContainerBase< DT, size > > & | operator-= (FloatingPointVector< DT, size, FloatingPointVectorDataContainerBase< DT, size > > &op1, const FloatingPointVector< DT, size, FloatingPointVectorDataContainerBase< DT, size > > &buffer) |
Arithmetic assignment: Component wise subtraction of buffer from *this. | |
FloatingPointVector< DT, size, FloatingPointVectorDataContainerBase< DT, size > > & | operator*= (FloatingPointVector< DT, size, FloatingPointVectorDataContainerBase< DT, size > > &op1, MLdouble value) |
Arithmetic assignment: Component wise multiplication *this with specialized MLdouble scalar value. | |
FloatingPointVector< DT, size, FloatingPointVectorDataContainerBase< DT, size > > & | operator*= (FloatingPointVector< DT, size, FloatingPointVectorDataContainerBase< DT, size > > &op1, const FloatingPointVector< DT, size, FloatingPointVectorDataContainerBase< DT, size > > &op2) |
Arithmetic assignment: Component wise multiplication *this with a vector of the same size. | |
FloatingPointVector< DT, size, FloatingPointVectorDataContainerBase< DT, size > > & | operator/= (FloatingPointVector< DT, size, FloatingPointVectorDataContainerBase< DT, size > > &op1, MLdouble value) |
Arithmetic assignment: Component wise division of *this by scalar value. | |
FloatingPointVector< DT, size, FloatingPointVectorDataContainerBase< DT, size > > & | operator/= (FloatingPointVector< DT, size, FloatingPointVectorDataContainerBase< DT, size > > &op1, const FloatingPointVector< DT, size, FloatingPointVectorDataContainerBase< DT, size > > &op2) |
Arithmetic assignment: Component wise division of *this by the values of a vector of the same size. | |
bool | operator! (const FloatingPointVector< DT, size, FloatingPointVectorDataContainerBase< DT, size > > &a) |
Returns whether all components are 0. | |
FloatingPointVector< DT, size, FloatingPointVectorDataContainerBase< DT, size > > | operator+ (FloatingPointVector< DT, size, FloatingPointVectorDataContainerBase< DT, size > > lhs, const FloatingPointVector< DT, size, FloatingPointVectorDataContainerBase< DT, size > > &rhs) |
Return value is the component wise addition of lhs and rhs. | |
FloatingPointVector< DT, size, FloatingPointVectorDataContainerBase< DT, size > > | operator+ (const FloatingPointVector< DT, size, FloatingPointVectorDataContainerBase< DT, size > > &buffer) |
Unary plus, for completeness and for those who really want to use that... | |
FloatingPointVector< DT, size, FloatingPointVectorDataContainerBase< DT, size > > | operator- (FloatingPointVector< DT, size, FloatingPointVectorDataContainerBase< DT, size > > lhs, const FloatingPointVector< DT, size, FloatingPointVectorDataContainerBase< DT, size > > &rhs) |
Return value is the component wise subtraction of rhs from lhs. | |
FloatingPointVector< DT, size, FloatingPointVectorDataContainerBase< DT, size > > | operator- (const FloatingPointVector< DT, size, FloatingPointVectorDataContainerBase< DT, size > > &buffer) |
Unary minus, all components of the vector are multiplied with -1. | |
DT | operator* (const FloatingPointVector< DT, size, FloatingPointVectorDataContainerBase< DT, size > > &a, const FloatingPointVector< DT, size, FloatingPointVectorDataContainerBase< DT, size > > &b) |
Dot product, returns a.dot(b). | |
FloatingPointVector< DT, size, FloatingPointVectorDataContainerBase< DT, size > > | operator* (FloatingPointVector< DT, size, FloatingPointVectorDataContainerBase< DT, size > > lhs, MLdouble rhs) |
Component wise multiplication of lhs with rhs. | |
FloatingPointVector< DT, size, FloatingPointVectorDataContainerBase< DT, size > > | operator* (MLdouble lhs, FloatingPointVector< DT, size, FloatingPointVectorDataContainerBase< DT, size > > rhs) |
Component wise multiplication of rhs with lhs. | |
FloatingPointVector< DT, size, FloatingPointVectorDataContainerBase< DT, size > > | operator/ (FloatingPointVector< DT, size, FloatingPointVectorDataContainerBase< DT, size > > lhs, MLdouble rhs) |
Component wise division of lhs by specialized rhs of type MLdouble. | |
A 32 dimensional vector class for floating point types.
A 32 dimensional vector class.
Definition at line 31 of file mlVector32.h.
typedef DT ml::Tvec32< DT >::ComponentType |
A typedef to "export" the type of components.
Definition at line 36 of file mlVector32.h.
|
inlineexplicit |
Default and value constructor.
Sets all entries to a user given value. value is the init value for all entries. 0 is the default value.
Definition at line 44 of file mlVector32.h.
|
inline |
Copy constructor from FloatingPointVector.
This allows the usage of SclarVectorTemplate objects of the same DT in operators using the Tvec32, because the FloatingPointVector objects can implicitly be cast.
Definition at line 51 of file mlVector32.h.
|
inline |
Builds the vector from the scalars x00, ... x31 to the components 0 to 31, respectively.
Definition at line 56 of file mlVector32.h.
|
inline |
Sets all components to the corresponding passed values.
Definition at line 77 of file mlVector32.h.