MeVisLab Toolbox Reference
ml::Tvec5< DT > Class Template Reference

Forward declarations to resolve header file dependencies. More...

#include <mlVector5.h>

Inheritance diagram for ml::Tvec5< DT >:
ml::FloatingPointVector< DT, 5 > ml::FloatingPointVectorDataContainerBase< DT, size >

Public Types

typedef FloatingPointVector< DT, 5 > Superclass
 A typedef as a shorthand for the base class. More...
 
typedef DT ComponentType
 A typedef to "export" the type of components. More...
 
- Public Types inherited from ml::FloatingPointVector< DT, 5 >
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. More...
 

Public Member Functions

constructors
 Tvec5 (const DT value=0)
 Default and value constructor. More...
 
 Tvec5 (const Superclass &v)
 Copy constructor from FloatingPointVector. More...
 
 Tvec5 (const DT x, const DT y, const DT z, const DT c, const DT t)
 Builds the vector from the scalars x, y, z, c and t to the components 0 to 4, respectively. More...
 
 Tvec5 (const Tvec2< DT > &v, const DT z, const DT c, const DT t)
 Casts Tvec2 to Tvec5. Last components are set to z, c and t. More...
 
 Tvec5 (const Tvec3< DT > &v, const DT c, const DT t)
 Casts Tvec3 to Tvec5. Last components are set to c and t. More...
 
 Tvec5 (const Tvec4< DT > &v, const DT t)
 Casts Tvec4 to Tvec5. Last component is set to t and u. More...
 
Other operators and methods
void assign (const DT x, const DT y, const DT z, const DT c, const DT t)
 Sets all components to the passed values. More...
 
Tvec5< DT > & operator+= (const Tvec2< DT > &v)
 Incrementation by a Tvec2. More...
 
Tvec5< DT > & operator+= (const Tvec3< DT > &v)
 Incrementation by a Tvec3. More...
 
Tvec5< DT > & operator+= (const Tvec4< DT > &v)
 Incrementation by a Tvec4. More...
 
const Tvec3< DT > getVec3 () const
 Returns a Tvec3 from components 0,1, and 2. More...
 
const Tvec4< DT > getVec4 () const
 Returns a Tvec4 from components 0, 1, 2, and 3. More...
 
- Public Member Functions inherited from ml::FloatingPointVector< DT, 5 >
 FloatingPointVector (DT value=DT(0))
 Default and value constructor. More...
 
FloatingPointVector< DT, size, FloatingPointVectorDataContainerBase< DT, size > > & operator= (DT value)
 Assignment of scalar value to all components. More...
 
bool operator== (const FloatingPointVector< DT, size, FloatingPointVectorDataContainerBase< DT, size > > &buffer) const
 Returns whether *this and buffer are component wise equal. More...
 
bool operator!= (const FloatingPointVector< DT, size, FloatingPointVectorDataContainerBase< DT, size > > &buffer) const
 Returns whether any components of *this and buffer are not equal. More...
 
bool operator< (const FloatingPointVector< DT, size, FloatingPointVectorDataContainerBase< DT, size > > &buffer) const
 Defines an artificial order for use in sort algorithms (lexicographical order). More...
 
const DT & operator[] (const size_t i) const
 Constant indexing operators. More...
 
DT & operator[] (const size_t i)
 Indexing operators. More...
 
size_t getSize () const
 Returns the number of elements of value buffer. More...
 
DT norm2 () const
 Returns the Euclidean norm (the vector length), i.e., square root of sum of squares of all components. More...
 
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. More...
 
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. More...
 
DT normalize ()
 Normalizes the buffer and returns the Euclidean length of vector before normalization, i.e., norm2. More...
 
DT length () const
 Returns the length of the vector, i.e. norm2(). More...
 
DT distance (const FloatingPointVector< DT, size, FloatingPointVectorDataContainerBase< DT, size > > &buffer) const
 Returns the distance of this vector to a given one. More...
 
DT distanceSquared (const FloatingPointVector< DT, size, FloatingPointVectorDataContainerBase< DT, size > > &buffer) const
 Returns the squared distance of this vector to a given one. More...
 
DT lengthSquared () const
 Returns the squared length of the vector. More...
 
DT compSum () const
 Returns the sum of all components. More...
 
DT compMul () const
 Returns the product of all vector components. More...
 
DT compMaxAbs () const
 Returns the maximum of absolute component values. More...
 
void compMin (FloatingPointVector< DT, size, FloatingPointVectorDataContainerBase< DT, size > > buffer)
 Sets the component wise minimum of *this and buffer in *this. More...
 
void compMax (FloatingPointVector< DT, size, FloatingPointVectorDataContainerBase< DT, size > > buffer)
 Sets the component wise maximum of *this and buffer in *this. More...
 
void compAbs ()
 Kills negative signs from all components. More...
 
void compDiv (const FloatingPointVector< DT, size, FloatingPointVectorDataContainerBase< DT, size > > &d)
 Divides each vector component by the corresponding one of d. More...
 
void compSqr ()
 Calculates and sets the square of all components. More...
 
void compSqrt ()
 Calculates and sets square root of all components. More...
 
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. More...
 
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. More...
 
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. More...
 
void compRound ()
 Rounds all components of this vector using floor(component + 0.5). More...
 
void compFloor ()
 Rounds all components of this vector using floor(component). More...
 
void compCeil ()
 Rounds all components of this vector to integer using ceil(component). More...
 
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. More...
 
void apply (ML_LA_FROM_DOUBLE_TO_DOUBLE f)
 Applies the function f to each component starting from index 0 to index size-1. More...
 
std::ostream & writeOut (std::ostream &os) const
 Writes all components to ostream os starting from index 0 to size-1. More...
 
std::istream & readIn (std::istream &is)
 Reads all components from istream is starting starting from index 0 to size-1. More...
 

Additional Inherited Members

- Protected Attributes inherited from ml::FloatingPointVectorDataContainerBase< DT, size >
DT _buffer [size]
 

Detailed Description

template<class DT>
class ml::Tvec5< DT >

Forward declarations to resolve header file dependencies.

A five dimensional vector class for floating point types.

A five dimensional vector class.

Definition at line 47 of file mlVector5.h.

Member Typedef Documentation

◆ ComponentType

template<class DT >
typedef DT ml::Tvec5< DT >::ComponentType

A typedef to "export" the type of components.

Definition at line 55 of file mlVector5.h.

◆ Superclass

template<class DT >
typedef FloatingPointVector<DT,5> ml::Tvec5< DT >::Superclass

A typedef as a shorthand for the base class.

Definition at line 52 of file mlVector5.h.

Constructor & Destructor Documentation

◆ Tvec5() [1/6]

template<class DT >
ml::Tvec5< DT >::Tvec5 ( const DT  value = 0)
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 63 of file mlVector5.h.

◆ Tvec5() [2/6]

template<class DT >
ml::Tvec5< DT >::Tvec5 ( const Superclass v)
inline

Copy constructor from FloatingPointVector.

Definition at line 68 of file mlVector5.h.

◆ Tvec5() [3/6]

template<class DT >
ml::Tvec5< DT >::Tvec5 ( const DT  x,
const DT  y,
const DT  z,
const DT  c,
const DT  t 
)
inline

Builds the vector from the scalars x, y, z, c and t to the components 0 to 4, respectively.

Definition at line 74 of file mlVector5.h.

◆ Tvec5() [4/6]

template<class DT >
ml::Tvec5< DT >::Tvec5 ( const Tvec2< DT > &  v,
const DT  z,
const DT  c,
const DT  t 
)
inline

Casts Tvec2 to Tvec5. Last components are set to z, c and t.

Definition at line 84 of file mlVector5.h.

◆ Tvec5() [5/6]

template<class DT >
ml::Tvec5< DT >::Tvec5 ( const Tvec3< DT > &  v,
const DT  c,
const DT  t 
)
inline

Casts Tvec3 to Tvec5. Last components are set to c and t.

Definition at line 94 of file mlVector5.h.

◆ Tvec5() [6/6]

template<class DT >
ml::Tvec5< DT >::Tvec5 ( const Tvec4< DT > &  v,
const DT  t 
)
inline

Casts Tvec4 to Tvec5. Last component is set to t and u.

Definition at line 104 of file mlVector5.h.

Member Function Documentation

◆ assign()

template<class DT >
void ml::Tvec5< DT >::assign ( const DT  x,
const DT  y,
const DT  z,
const DT  c,
const DT  t 
)
inline

Sets all components to the passed values.

Definition at line 119 of file mlVector5.h.

◆ getVec3()

template<class DT >
const Tvec3<DT> ml::Tvec5< DT >::getVec3 ( ) const
inline

Returns a Tvec3 from components 0,1, and 2.

Definition at line 156 of file mlVector5.h.

◆ getVec4()

template<class DT >
const Tvec4<DT> ml::Tvec5< DT >::getVec4 ( ) const
inline

Returns a Tvec4 from components 0, 1, 2, and 3.

Definition at line 164 of file mlVector5.h.

◆ operator+=() [1/3]

template<class DT >
Tvec5<DT>& ml::Tvec5< DT >::operator+= ( const Tvec2< DT > &  v)
inline

Incrementation by a Tvec2.

Definition at line 129 of file mlVector5.h.

◆ operator+=() [2/3]

template<class DT >
Tvec5<DT>& ml::Tvec5< DT >::operator+= ( const Tvec3< DT > &  v)
inline

Incrementation by a Tvec3.

Definition at line 137 of file mlVector5.h.

◆ operator+=() [3/3]

template<class DT >
Tvec5<DT>& ml::Tvec5< DT >::operator+= ( const Tvec4< DT > &  v)
inline

Incrementation by a Tvec4.

Definition at line 146 of file mlVector5.h.


The documentation for this class was generated from the following files: