MeVisLab Toolbox Reference
ml::TVector< TVectorBase > Class Template Reference

ML integer image vector class to be specialized for different purposes. More...

#include <mlIntegerVector.h>

Inheritance diagram for ml::TVector< TVectorBase >:
ml::TImageVector< intT >

Public Types

enum  { NumberOfDimensions = ParentClass::NumberOfDimensions }
 Enumerator defining the dimension of this class. More...
 
typedef TVectorBase::ComponentType ComponentType
 Integer type used by this vector. More...
 
typedef TVectorBase ParentClass
 Parent class of this class. More...
 

Public Member Functions

std::string print (const std::string &openStr="", const std::string &sepStr=" ", const std::string &termStr="", const MLint16 numDigits=-1) const
 Returns the string openStr + v.array[0] + sepStr + ... More...
 
Initialization
 TVector ()
 Constructor. All components are initialized to 0. More...
 
 TVector (const ComponentType i)
 Constructor which initializes all components to i. More...
 
 TVector (const TVector< TVectorBase > &v2)
 
TVector< TVectorBase > & operator= (const TVector< TVectorBase > &v2)
 
template<typename TVectorBase2 >
 TVector (const TVector< TVectorBase2 > &v2)
 Copy constructor from another TVector of same or other integer type, values are cast. More...
 
 TVector (const ComponentType xp, const TVector &p)
 Constructor which assigns X to x and copies other elements from p. More...
 
 TVector (const MLint num, const ComponentType *const arr, const ComponentType deflt)
 Constructor which initializes the vector components by copying them from arr[0] ,..., arr[num-1]. More...
 
void copy (const MLint num, ComponentType *const arr) const
 Copy the first num elements from internal array into arr starting with array[0] to arr[0] to array[num-1] to arr[num-1], respectively. More...
 
void set (const ComponentType v=0)
 Sets all components to v or - if v is not specified - to 0. More...
 
void set (const TVector &v)
 Like assignment operator. More...
 
Functions and operators.
TVector< TVectorBase > operator+ (const TVector &b) const
 Add the corresponding component from b to each component. More...
 
TVector< TVectorBase > & operator+= (const TVector< TVectorBase > &b)
 Adds the corresponding component from b to each component. More...
 
TVector< TVectorBase > operator- (const TVector< TVectorBase > &b) const
 Calculates and returns *this-b. More...
 
TVector< TVectorBase > & operator-= (const TVector< TVectorBase > &b)
 Subtracts the corresponding component from b from each component. More...
 
TVector< TVectorBase > operator* (const TVector< TVectorBase > &b) const
 Calculates and returns the multiplication of each component of this with its corresponding component from b. More...
 
TVector< TVectorBase > & operator*= (const TVector< TVectorBase > &b)
 Multiplies each component with its corresponding components from b. More...
 
TVector< TVectorBase > operator+ (const ComponentType b) const
 Calculates and returns the addition of each component of *this with scalar b. More...
 
TVector< TVectorBase > operator- (const ComponentType b) const
 Subtracts the scalar b from all components. More...
 
TVector< TVectorBase > operator* (const ComponentType b) const
 Multiplies all components with scalar b. More...
 
TVector< TVectorBase > operator/ (const TVector< TVectorBase > &b) const
 Calculates and returns the division of each component of *this by its corresponding component from b. More...
 
TVector< TVectorBase > & operator/= (const TVector< TVectorBase > &b)
 Divides each component by its corresponding component from b. More...
 
bool operator== (const TVector< TVectorBase > &b) const
 Equality operator: Returns whether each component of a is equal to its corresponding component of b. More...
 
bool operator!= (const TVector< TVectorBase > &b) const
 Inequality operator: Returns whether any component differs from its corresponding component of b. More...
 
bool operator< (const TVector< TVectorBase > &b) const
 "Smaller" comparison operator, return whether the 'smaller' relation is valid for all components. More...
 
bool operator<= (const TVector< TVectorBase > &b) const
 "Smaller Or Equal" comparison operator, return whether the 'smaller or equal' relation is valid for all components. More...
 
bool operator> (const TVector< TVectorBase > &b) const
 "Greater" comparison operator, return whether the 'greater' relation is valid for all components. More...
 
bool operator>= (const TVector< TVectorBase > &b) const
 "Greater or Equal" comparison operator, return whether the 'greater or equal' relation is valid for all components. More...
 
TVector< TVectorBase > operator& (const TVector< TVectorBase > &b) const
 Performs a binary "And" of all components with the corresponding components of another Vector. More...
 
TVector< TVectorBase > operator| (const TVector< TVectorBase > &b) const
 Performs a binary "Or" of all components with the corresponding components of another Vector. More...
 
TVector< TVectorBase > operator^ (const TVector< TVectorBase > &b) const
 Performs a binary "Xor" of all components with the corresponding components of another Vector. More...
 
TVector< TVectorBase > & operator&= (const TVector< TVectorBase > &b)
 Performs a binary "And" of all components with the corresponding components of another Vector. More...
 
TVector< TVectorBase > & operator|= (const TVector< TVectorBase > &b)
 Performs a binary "Or" of all components with the corresponding components of another Vector. More...
 
TVector< TVectorBase > & operator^= (const TVector< TVectorBase > &b)
 Performs a binary "Xor" of all components with the corresponding components of another Vector. More...
 
TVector< TVectorBase > operator& (const ComponentType b) const
 Performs a binary "And" of all components with an integer. More...
 
TVector< TVectorBase > operator| (const ComponentType b) const
 Performs a binary "Or" of all components with an integer. More...
 
TVector< TVectorBase > operator^ (const ComponentType b) const
 Performs a binary "Xor" of all components with an integer. More...
 
TVector< TVectorBase > & operator&= (const ComponentType b)
 Performs a binary "And" of all components with an integer. More...
 
TVector< TVectorBase > & operator|= (const ComponentType b)
 Performs a binary "Or" of all components with an integer. More...
 
TVector< TVectorBase > & operator^= (const ComponentType b)
 Performs a binary "Xor" of all components with an integer. More...
 
TVector< TVectorBase > operator>> (const int b) const
 Performs a binary right shift ">>" on each vector component. More...
 
TVector< TVectorBase > operator<< (const int b) const
 Performs a binary left shift "<<" on each vector component. More...
 
TVector< TVectorBase > & operator>>= (const int b)
 Performs a binary right shift unary ">>=" on each vector component. More...
 
TVector< TVectorBase > & operator<<= (const int b)
 Performs a binary left shift unary "<<=" on each vector component. More...
 
TVector< TVectorBase > operator- () const
 Performs an unary "-" on each vector component. More...
 
ComponentType operator[] (const size_t i) const
 Constant indexing operator permits read access to array[0], ..., array[NumberOfDimensions-1] via indexes 0,1, ..., NumberOfDimensions-1, respectively. More...
 
ComponentTypeoperator[] (const size_t i)
 Indexing operator permits read and write access to array[0], ..., array[NumberOfDimensions-1] via indexes 0,1, ..., NumberOfDimensions-1, respectively. More...
 
MLint getMaxIdx () const
 Searches the maximum component and returns the index of its first occurrence. More...
 
ComponentType getMax () const
 Returns the maximum component value. More...
 
MLint getMinIdx () const
 Searches the minimum component and returns the index of its first occurrence. More...
 
ComponentType getMin () const
 Returns the minimum component value. More...
 
TVector< TVectorBase > getStrides (const ComponentType offset=1) const
 Interprets the vector as image extension and returns a stride vector. More...
 
TVector< TVectorBase > getVectorPosition (ComponentType offsetPos) const
 Interprets the vector as a stride vector of an image and returns the offset position offsetPos from the image origin to the coordinate specified by the vector. More...
 
MLint getExtDimension () const
 Returns the index to the highest vector component which is not 1 which is useful to get the real dimensional extent of an image. More...
 
bool hasNegativeComp () const
 Returns whether any component is negative. More...
 
bool allBiggerZero () const
 Returns whether all components > 0. More...
 

Arithmetics as static and member functions

TVector< TVectorBase > divCeil (const TVector< TVectorBase > &b) const
 Returns the component wise division of the vector this by vector b with rounding up. More...
 
TVector< TVectorBase > compMin (const TVector< TVectorBase > &b) const
 Returns the component wise minimum of components of this and b. More...
 
TVector< TVectorBase > compMax (const TVector< TVectorBase > &b) const
 Returns the component wise maximum of components of this and b. More...
 
TVector< TVectorBase > compMod (const TVector< TVectorBase > &b) const
 Returns the rest of the division of this by b component wise. More...
 
TVector< TVectorBase > compAbs () const
 Returns a vector with all components of this replaced by their absolute values. More...
 
ComponentType compMul () const
 Returns the product of all components. There is no check for integer overflow. More...
 
ComponentType compSum () const
 Returns the sum of all components. There is no check for integer overflow. More...
 
ComponentType dot (const TVector< TVectorBase > &b) const
 Returns the scalar product of vectors this and b. There is no check for integer overflow. More...
 
void fillSmallerComps (const ComponentType threshold=0, const ComponentType fillVal=0)
 Sets the components which are smaller than threshold to fillVal. More...
 
void fillGreaterComps (const ComponentType threshold=0, const ComponentType fillVal=0)
 Sets the components which are greater than threshold to fillVal. More...
 
void fillEqualComps (const ComponentType threshold=0, const ComponentType fillVal=0)
 Sets the components which are equal to threshold to fillVal. More...
 
static TVector< TVectorBase > divCeil (const TVector< TVectorBase > &a, const TVector< TVectorBase > &b)
 Static version: Returns the component wise division of the vector a by vector b with rounding up. More...
 
static TVector< TVectorBase > compMin (const TVector< TVectorBase > &a, const TVector< TVectorBase > &b)
 Static version: Returns the component wise minimum of vectors a and b. More...
 
static TVector< TVectorBase > compMax (const TVector< TVectorBase > &a, const TVector< TVectorBase > &b)
 Static version: Returns the component wise maximum of vectors a and b. More...
 
static TVector< TVectorBase > compMod (const TVector< TVectorBase > &a, const TVector< TVectorBase > &b)
 Static version: Returns the rest dividing vector a by b component wise. More...
 
static TVector< TVectorBase > compAbs (const TVector< TVectorBase > &a)
 Static version: Returns a vector with all components of a replaced by their absolute values. More...
 
static ComponentType compMul (const TVector< TVectorBase > &a)
 Static version: Returns the product of all components without check for integer overflow. More...
 
static ComponentType compSum (const TVector< TVectorBase > &a)
 Static version: Returns the sum of all components without check for integer overflow. More...
 
static ComponentType dot (const TVector< TVectorBase > &a, const TVector< TVectorBase > &b)
 Static version: Returns the scalar product of vectors a and b without check for integer overflow. More...
 

Detailed Description

template<class TVectorBase>
class ml::TVector< TVectorBase >

ML integer image vector class to be specialized for different purposes.

It is a template to handle and calculate with n dimensional cardinal coordinates and vectors.

It represents a vector to address coordinates and offsets into images. The methods provide elementary arithmetic vector operations and support the stride concept for efficient image addressing.

The members of this class define a ND vector of type integer which is specialized normally to the ImageVector class which has the MLMaxImageDimension (defined in mlImageVector.h) with MLint as component type.

This class can also be instantiated with higher NumberOfDimensions arguments or other CompIntType arguments to compile arbitrary dimensional vectors with an arbitrary integer base type.

Example for vector initialization:

TVector<MLint> p;
p[0]=3; p[1]=5; p[2]=7; p[3]=9; p[4]=11; p[5]=13;
// or
TVector<MLint> q(4, p);
// or
TVector<MLint> q();
q.set(0);

Notes:

  • operator= can safely be used although not implemented explicitly.
  • This class is used to describe points, coordinates and subimage regions easily, in a uniform manner and independent of the exact number of supported dimensions.
  • All coordinate components are explicitly public and may used so without limitation of class functionality.
  • Even method parameters are implemented as "const" to give compilers maximum information to optimize.
  • In most methods this class is not traced nor ML_TRY/CATCH mechanisms are used, because:
  • it is heavily used in time critical positions for all image processing aspects in ML modules.
  • it should be possible to detect/debug errors easily on next higher function which then should be traced/try/caught.
Parameters
TVectorBaseshould be TVector6DBase for 6D ML image vector types or TVectorNDBase for other dimensional vectors.

Definition at line 110 of file mlIntegerVector.h.

Member Typedef Documentation

◆ ComponentType

template<class TVectorBase >
typedef TVectorBase::ComponentType ml::TVector< TVectorBase >::ComponentType

Integer type used by this vector.

Definition at line 115 of file mlIntegerVector.h.

◆ ParentClass

template<class TVectorBase >
typedef TVectorBase ml::TVector< TVectorBase >::ParentClass

Parent class of this class.

Definition at line 118 of file mlIntegerVector.h.

Member Enumeration Documentation

◆ anonymous enum

template<class TVectorBase >
anonymous enum

Enumerator defining the dimension of this class.

Enumerator
NumberOfDimensions 

Definition at line 121 of file mlIntegerVector.h.

Constructor & Destructor Documentation

◆ TVector() [1/6]

template<class TVectorBase >
ml::TVector< TVectorBase >::TVector ( )
inline

Constructor. All components are initialized to 0.

Definition at line 129 of file mlIntegerVector.h.

◆ TVector() [2/6]

template<class TVectorBase >
ml::TVector< TVectorBase >::TVector ( const ComponentType  i)
inlineexplicit

Constructor which initializes all components to i.

Definition at line 135 of file mlIntegerVector.h.

◆ TVector() [3/6]

template<class TVectorBase >
ml::TVector< TVectorBase >::TVector ( const TVector< TVectorBase > &  v2)
inline

Definition at line 144 of file mlIntegerVector.h.

◆ TVector() [4/6]

template<class TVectorBase >
template<typename TVectorBase2 >
ml::TVector< TVectorBase >::TVector ( const TVector< TVectorBase2 > &  v2)
inlineexplicit

Copy constructor from another TVector of same or other integer type, values are cast.

Only valid elements are copied if vectors have different lengths.

Definition at line 161 of file mlIntegerVector.h.

References ml::TVector< TVectorBase >::NumberOfDimensions.

◆ TVector() [5/6]

template<class TVectorBase >
ml::TVector< TVectorBase >::TVector ( const ComponentType  xp,
const TVector< TVectorBase > &  p 
)
inlineexplicit

Constructor which assigns X to x and copies other elements from p.

Definition at line 180 of file mlIntegerVector.h.

◆ TVector() [6/6]

template<class TVectorBase >
ml::TVector< TVectorBase >::TVector ( const MLint  num,
const ComponentType *const  arr,
const ComponentType  deflt 
)
explicit

Constructor which initializes the vector components by copying them from arr[0] ,..., arr[num-1].

All other elements are initialized to the value deflt.

Definition at line 650 of file mlIntegerVector.h.

References ML_CHECK_THROW, and ml::TVector< TVectorBase >::NumberOfDimensions.

Member Function Documentation

◆ allBiggerZero()

template<class TVectorBase >
bool ml::TVector< TVectorBase >::allBiggerZero ( ) const
inline

Returns whether all components > 0.

Definition at line 502 of file mlIntegerVector.h.

◆ compAbs() [1/2]

template<class TVectorBase >
TVector<TVectorBase> ml::TVector< TVectorBase >::compAbs ( ) const
inline

Returns a vector with all components of this replaced by their absolute values.

Definition at line 526 of file mlIntegerVector.h.

References ml::compAbs().

◆ compAbs() [2/2]

template<class TVectorBase >
TVector< TVectorBase > ml::TVector< TVectorBase >::compAbs ( const TVector< TVectorBase > &  a)
static

Static version: Returns a vector with all components of a replaced by their absolute values.

Definition at line 767 of file mlIntegerVector.h.

◆ compMax() [1/2]

template<class TVectorBase >
TVector< TVectorBase > ml::TVector< TVectorBase >::compMax ( const TVector< TVectorBase > &  a,
const TVector< TVectorBase > &  b 
)
static

Static version: Returns the component wise maximum of vectors a and b.

Definition at line 742 of file mlIntegerVector.h.

◆ compMax() [2/2]

template<class TVectorBase >
TVector<TVectorBase> ml::TVector< TVectorBase >::compMax ( const TVector< TVectorBase > &  b) const
inline

Returns the component wise maximum of components of this and b.

Definition at line 521 of file mlIntegerVector.h.

References ml::compMax().

◆ compMin() [1/2]

template<class TVectorBase >
TVector< TVectorBase > ml::TVector< TVectorBase >::compMin ( const TVector< TVectorBase > &  a,
const TVector< TVectorBase > &  b 
)
static

Static version: Returns the component wise minimum of vectors a and b.

Definition at line 731 of file mlIntegerVector.h.

◆ compMin() [2/2]

template<class TVectorBase >
TVector<TVectorBase> ml::TVector< TVectorBase >::compMin ( const TVector< TVectorBase > &  b) const
inline

Returns the component wise minimum of components of this and b.

Definition at line 519 of file mlIntegerVector.h.

References ml::compMin().

◆ compMod() [1/2]

template<class TVectorBase >
TVector< TVectorBase > ml::TVector< TVectorBase >::compMod ( const TVector< TVectorBase > &  a,
const TVector< TVectorBase > &  b 
)
static

Static version: Returns the rest dividing vector a by b component wise.

Division by zero caused by zero components of b must be avoided by caller.

Definition at line 755 of file mlIntegerVector.h.

References ML_CHECK_THROW.

◆ compMod() [2/2]

template<class TVectorBase >
TVector<TVectorBase> ml::TVector< TVectorBase >::compMod ( const TVector< TVectorBase > &  b) const
inline

Returns the rest of the division of this by b component wise.

Division by zero caused by zero components of b must be avoided by caller.

Definition at line 524 of file mlIntegerVector.h.

◆ compMul() [1/2]

template<class TVectorBase >
ComponentType ml::TVector< TVectorBase >::compMul ( ) const
inline

Returns the product of all components. There is no check for integer overflow.

Definition at line 529 of file mlIntegerVector.h.

References ml::compMul().

Referenced by ml::MultiFileVolumeListImageOutput::OutputImageProperties::readAndSetFromPagedImage(), and ml::TKernel< KDATATYPE >::setKernel().

◆ compMul() [2/2]

template<class TVectorBase >
static ComponentType ml::TVector< TVectorBase >::compMul ( const TVector< TVectorBase > &  a)
inlinestatic

Static version: Returns the product of all components without check for integer overflow.

Definition at line 550 of file mlIntegerVector.h.

◆ compSum() [1/2]

template<class TVectorBase >
ComponentType ml::TVector< TVectorBase >::compSum ( ) const
inline

Returns the sum of all components. There is no check for integer overflow.

Definition at line 531 of file mlIntegerVector.h.

◆ compSum() [2/2]

template<class TVectorBase >
static ComponentType ml::TVector< TVectorBase >::compSum ( const TVector< TVectorBase > &  a)
inlinestatic

Static version: Returns the sum of all components without check for integer overflow.

Definition at line 560 of file mlIntegerVector.h.

◆ copy()

template<class TVectorBase >
void ml::TVector< TVectorBase >::copy ( const MLint  num,
ComponentType *const  arr 
) const

Copy the first num elements from internal array into arr starting with array[0] to arr[0] to array[num-1] to arr[num-1], respectively.

All other components are left unchanged. arr must have at least num entries and at most NumberOfDimensions elements are copied.

Definition at line 661 of file mlIntegerVector.h.

References ML_CHECK_THROW.

◆ divCeil() [1/2]

template<class TVectorBase >
TVector< TVectorBase > ml::TVector< TVectorBase >::divCeil ( const TVector< TVectorBase > &  a,
const TVector< TVectorBase > &  b 
)
static

Static version: Returns the component wise division of the vector a by vector b with rounding up.

Division by zero caused by zero components of b must be avoided by caller.

Definition at line 718 of file mlIntegerVector.h.

References ML_CHECK_THROW.

◆ divCeil() [2/2]

template<class TVectorBase >
TVector<TVectorBase> ml::TVector< TVectorBase >::divCeil ( const TVector< TVectorBase > &  b) const
inline

Returns the component wise division of the vector this by vector b with rounding up.

Division by zero caused by zero components of b must be avoided by caller.

Definition at line 517 of file mlIntegerVector.h.

◆ dot() [1/2]

template<class TVectorBase >
static ComponentType ml::TVector< TVectorBase >::dot ( const TVector< TVectorBase > &  a,
const TVector< TVectorBase > &  b 
)
inlinestatic

Static version: Returns the scalar product of vectors a and b without check for integer overflow.

Definition at line 572 of file mlIntegerVector.h.

◆ dot() [2/2]

template<class TVectorBase >
ComponentType ml::TVector< TVectorBase >::dot ( const TVector< TVectorBase > &  b) const
inline

Returns the scalar product of vectors this and b. There is no check for integer overflow.

Definition at line 534 of file mlIntegerVector.h.

◆ fillEqualComps()

template<class TVectorBase >
void ml::TVector< TVectorBase >::fillEqualComps ( const ComponentType  threshold = 0,
const ComponentType  fillVal = 0 
)
inline

Sets the components which are equal to threshold to fillVal.

Definition at line 601 of file mlIntegerVector.h.

◆ fillGreaterComps()

template<class TVectorBase >
void ml::TVector< TVectorBase >::fillGreaterComps ( const ComponentType  threshold = 0,
const ComponentType  fillVal = 0 
)
inline

Sets the components which are greater than threshold to fillVal.

Definition at line 595 of file mlIntegerVector.h.

◆ fillSmallerComps()

template<class TVectorBase >
void ml::TVector< TVectorBase >::fillSmallerComps ( const ComponentType  threshold = 0,
const ComponentType  fillVal = 0 
)
inline

Sets the components which are smaller than threshold to fillVal.

Definition at line 583 of file mlIntegerVector.h.

◆ getExtDimension()

template<class TVectorBase >
MLint ml::TVector< TVectorBase >::getExtDimension

Returns the index to the highest vector component which is not 1 which is useful to get the real dimensional extent of an image.

Definition at line 703 of file mlIntegerVector.h.

Referenced by ml::MLITKObjectFactory::createObject(), and ml::MultiBaseType::isFiniteDifferenceFunctionValid().

◆ getMax()

template<class TVectorBase >
ComponentType ml::TVector< TVectorBase >::getMax ( ) const
inline

Returns the maximum component value.

Definition at line 454 of file mlIntegerVector.h.

◆ getMaxIdx()

template<class TVectorBase >
MLint ml::TVector< TVectorBase >::getMaxIdx ( ) const
inline

Searches the maximum component and returns the index of its first occurrence.

Definition at line 443 of file mlIntegerVector.h.

◆ getMin()

template<class TVectorBase >
ComponentType ml::TVector< TVectorBase >::getMin ( ) const
inline

Returns the minimum component value.

Definition at line 471 of file mlIntegerVector.h.

◆ getMinIdx()

template<class TVectorBase >
MLint ml::TVector< TVectorBase >::getMinIdx ( ) const
inline

Searches the minimum component and returns the index of its first occurrence.

Definition at line 460 of file mlIntegerVector.h.

◆ getStrides()

template<class TVectorBase >
TVector< TVectorBase > ml::TVector< TVectorBase >::getStrides ( const ComponentType  offset = 1) const

Interprets the vector as image extension and returns a stride vector.

The smallest stride (the x stride) is set to offset, i.e. an image voxel is assumed to have size = offset. So stride[0] = offset, stride[1] = offset*array[0], stride[2] = offset*array[0]*array[1], ..., etc.

Definition at line 673 of file mlIntegerVector.h.

Referenced by ml::TSubImage< DATATYPE >::copySubImageReorderColorPlanesToInterleaved(), ml::SubImage::setBox(), and ml::SubImage::setExtent().

◆ getVectorPosition()

template<class TVectorBase >
TVector< TVectorBase > ml::TVector< TVectorBase >::getVectorPosition ( ComponentType  offsetPos) const

Interprets the vector as a stride vector of an image and returns the offset position offsetPos from the image origin to the coordinate specified by the vector.

For offsetPos, an image with extents given by *this and the return value rv then holds:

offsetPos = rv.array[0]*array[0] + rv.array[1]*array[1] + ... + rv.array[NumberOfDimensions-1]*array[NumberOfDimensions-1]

)

Definition at line 687 of file mlIntegerVector.h.

References ML_CHECK_THROW.

Referenced by ml::TSubImage< DATATYPE >::convertPointerToSubImagePosition().

◆ hasNegativeComp()

template<class TVectorBase >
bool ml::TVector< TVectorBase >::hasNegativeComp ( ) const
inline

Returns whether any component is negative.

Definition at line 495 of file mlIntegerVector.h.

◆ operator!=()

template<class TVectorBase >
bool ml::TVector< TVectorBase >::operator!= ( const TVector< TVectorBase > &  b) const
inline

Inequality operator: Returns whether any component differs from its corresponding component of b.

Definition at line 294 of file mlIntegerVector.h.

◆ operator&() [1/2]

template<class TVectorBase >
TVector<TVectorBase> ml::TVector< TVectorBase >::operator& ( const ComponentType  b) const
inline

Performs a binary "And" of all components with an integer.

Definition at line 364 of file mlIntegerVector.h.

◆ operator&() [2/2]

template<class TVectorBase >
TVector<TVectorBase> ml::TVector< TVectorBase >::operator& ( const TVector< TVectorBase > &  b) const
inline

Performs a binary "And" of all components with the corresponding components of another Vector.

Definition at line 329 of file mlIntegerVector.h.

◆ operator&=() [1/2]

template<class TVectorBase >
TVector<TVectorBase>& ml::TVector< TVectorBase >::operator&= ( const ComponentType  b)
inline

Performs a binary "And" of all components with an integer.

Definition at line 380 of file mlIntegerVector.h.

◆ operator&=() [2/2]

template<class TVectorBase >
TVector<TVectorBase>& ml::TVector< TVectorBase >::operator&= ( const TVector< TVectorBase > &  b)
inline

Performs a binary "And" of all components with the corresponding components of another Vector.

Definition at line 345 of file mlIntegerVector.h.

◆ operator*() [1/2]

template<class TVectorBase >
TVector<TVectorBase> ml::TVector< TVectorBase >::operator* ( const ComponentType  b) const
inline

Multiplies all components with scalar b.

Definition at line 264 of file mlIntegerVector.h.

◆ operator*() [2/2]

template<class TVectorBase >
TVector<TVectorBase> ml::TVector< TVectorBase >::operator* ( const TVector< TVectorBase > &  b) const
inline

Calculates and returns the multiplication of each component of this with its corresponding component from b.

Definition at line 239 of file mlIntegerVector.h.

◆ operator*=()

template<class TVectorBase >
TVector<TVectorBase>& ml::TVector< TVectorBase >::operator*= ( const TVector< TVectorBase > &  b)
inline

Multiplies each component with its corresponding components from b.

Definition at line 244 of file mlIntegerVector.h.

◆ operator+() [1/2]

template<class TVectorBase >
TVector<TVectorBase> ml::TVector< TVectorBase >::operator+ ( const ComponentType  b) const
inline

Calculates and returns the addition of each component of *this with scalar b.

Definition at line 250 of file mlIntegerVector.h.

◆ operator+() [2/2]

template<class TVectorBase >
TVector<TVectorBase> ml::TVector< TVectorBase >::operator+ ( const TVector< TVectorBase > &  b) const
inline

Add the corresponding component from b to each component.

Definition at line 217 of file mlIntegerVector.h.

◆ operator+=()

template<class TVectorBase >
TVector<TVectorBase>& ml::TVector< TVectorBase >::operator+= ( const TVector< TVectorBase > &  b)
inline

Adds the corresponding component from b to each component.

Definition at line 222 of file mlIntegerVector.h.

◆ operator-() [1/3]

template<class TVectorBase >
TVector<TVectorBase> ml::TVector< TVectorBase >::operator- ( ) const
inline

Performs an unary "-" on each vector component.

Definition at line 423 of file mlIntegerVector.h.

◆ operator-() [2/3]

template<class TVectorBase >
TVector<TVectorBase> ml::TVector< TVectorBase >::operator- ( const ComponentType  b) const
inline

Subtracts the scalar b from all components.

Definition at line 257 of file mlIntegerVector.h.

◆ operator-() [3/3]

template<class TVectorBase >
TVector<TVectorBase> ml::TVector< TVectorBase >::operator- ( const TVector< TVectorBase > &  b) const
inline

Calculates and returns *this-b.

Definition at line 228 of file mlIntegerVector.h.

◆ operator-=()

template<class TVectorBase >
TVector<TVectorBase>& ml::TVector< TVectorBase >::operator-= ( const TVector< TVectorBase > &  b)
inline

Subtracts the corresponding component from b from each component.

Definition at line 233 of file mlIntegerVector.h.

◆ operator/()

template<class TVectorBase >
TVector<TVectorBase> ml::TVector< TVectorBase >::operator/ ( const TVector< TVectorBase > &  b) const
inline

Calculates and returns the division of each component of *this by its corresponding component from b.

Definition at line 271 of file mlIntegerVector.h.

◆ operator/=()

template<class TVectorBase >
TVector<TVectorBase>& ml::TVector< TVectorBase >::operator/= ( const TVector< TVectorBase > &  b)
inline

Divides each component by its corresponding component from b.

Definition at line 276 of file mlIntegerVector.h.

References ML_CHECK_THROW.

◆ operator<()

template<class TVectorBase >
bool ml::TVector< TVectorBase >::operator< ( const TVector< TVectorBase > &  b) const
inline

"Smaller" comparison operator, return whether the 'smaller' relation is valid for all components.

Definition at line 300 of file mlIntegerVector.h.

◆ operator<<()

template<class TVectorBase >
TVector<TVectorBase> ml::TVector< TVectorBase >::operator<< ( const int  b) const
inline

Performs a binary left shift "<<" on each vector component.

Definition at line 399 of file mlIntegerVector.h.

◆ operator<<=()

template<class TVectorBase >
TVector<TVectorBase>& ml::TVector< TVectorBase >::operator<<= ( const int  b)
inline

Performs a binary left shift unary "<<=" on each vector component.

Definition at line 410 of file mlIntegerVector.h.

◆ operator<=()

template<class TVectorBase >
bool ml::TVector< TVectorBase >::operator<= ( const TVector< TVectorBase > &  b) const
inline

"Smaller Or Equal" comparison operator, return whether the 'smaller or equal' relation is valid for all components.

Definition at line 307 of file mlIntegerVector.h.

◆ operator=()

template<class TVectorBase >
TVector<TVectorBase>& ml::TVector< TVectorBase >::operator= ( const TVector< TVectorBase > &  v2)
inline

Definition at line 149 of file mlIntegerVector.h.

◆ operator==()

template<class TVectorBase >
bool ml::TVector< TVectorBase >::operator== ( const TVector< TVectorBase > &  b) const
inline

Equality operator: Returns whether each component of a is equal to its corresponding component of b.

Definition at line 286 of file mlIntegerVector.h.

◆ operator>()

template<class TVectorBase >
bool ml::TVector< TVectorBase >::operator> ( const TVector< TVectorBase > &  b) const
inline

"Greater" comparison operator, return whether the 'greater' relation is valid for all components.

Definition at line 314 of file mlIntegerVector.h.

◆ operator>=()

template<class TVectorBase >
bool ml::TVector< TVectorBase >::operator>= ( const TVector< TVectorBase > &  b) const
inline

"Greater or Equal" comparison operator, return whether the 'greater or equal' relation is valid for all components.

Definition at line 321 of file mlIntegerVector.h.

◆ operator>>()

template<class TVectorBase >
TVector<TVectorBase> ml::TVector< TVectorBase >::operator>> ( const int  b) const
inline

Performs a binary right shift ">>" on each vector component.

Definition at line 399 of file mlIntegerVector.h.

◆ operator>>=()

template<class TVectorBase >
TVector<TVectorBase>& ml::TVector< TVectorBase >::operator>>= ( const int  b)
inline

Performs a binary right shift unary ">>=" on each vector component.

Definition at line 410 of file mlIntegerVector.h.

◆ operator[]() [1/2]

template<class TVectorBase >
ComponentType& ml::TVector< TVectorBase >::operator[] ( const size_t  i)
inline

Indexing operator permits read and write access to array[0], ..., array[NumberOfDimensions-1] via indexes 0,1, ..., NumberOfDimensions-1, respectively.

The caller must guarantee that i is within [0,...,NumberOfDimensions-1].

Definition at line 440 of file mlIntegerVector.h.

◆ operator[]() [2/2]

template<class TVectorBase >
ComponentType ml::TVector< TVectorBase >::operator[] ( const size_t  i) const
inline

Constant indexing operator permits read access to array[0], ..., array[NumberOfDimensions-1] via indexes 0,1, ..., NumberOfDimensions-1, respectively.

The caller must guarantee that i is within [0,...,NumberOfDimensions-1].

Definition at line 434 of file mlIntegerVector.h.

◆ operator^() [1/2]

template<class TVectorBase >
TVector<TVectorBase> ml::TVector< TVectorBase >::operator^ ( const ComponentType  b) const
inline

Performs a binary "Xor" of all components with an integer.

Definition at line 374 of file mlIntegerVector.h.

◆ operator^() [2/2]

template<class TVectorBase >
TVector<TVectorBase> ml::TVector< TVectorBase >::operator^ ( const TVector< TVectorBase > &  b) const
inline

Performs a binary "Xor" of all components with the corresponding components of another Vector.

Definition at line 339 of file mlIntegerVector.h.

◆ operator^=() [1/2]

template<class TVectorBase >
TVector<TVectorBase>& ml::TVector< TVectorBase >::operator^= ( const ComponentType  b)
inline

Performs a binary "Xor" of all components with an integer.

Definition at line 392 of file mlIntegerVector.h.

◆ operator^=() [2/2]

template<class TVectorBase >
TVector<TVectorBase>& ml::TVector< TVectorBase >::operator^= ( const TVector< TVectorBase > &  b)
inline

Performs a binary "Xor" of all components with the corresponding components of another Vector.

Definition at line 357 of file mlIntegerVector.h.

◆ operator|() [1/2]

template<class TVectorBase >
TVector<TVectorBase> ml::TVector< TVectorBase >::operator| ( const ComponentType  b) const
inline

Performs a binary "Or" of all components with an integer.

Definition at line 369 of file mlIntegerVector.h.

◆ operator|() [2/2]

template<class TVectorBase >
TVector<TVectorBase> ml::TVector< TVectorBase >::operator| ( const TVector< TVectorBase > &  b) const
inline

Performs a binary "Or" of all components with the corresponding components of another Vector.

Definition at line 334 of file mlIntegerVector.h.

◆ operator|=() [1/2]

template<class TVectorBase >
TVector<TVectorBase>& ml::TVector< TVectorBase >::operator|= ( const ComponentType  b)
inline

Performs a binary "Or" of all components with an integer.

Definition at line 386 of file mlIntegerVector.h.

◆ operator|=() [2/2]

template<class TVectorBase >
TVector<TVectorBase>& ml::TVector< TVectorBase >::operator|= ( const TVector< TVectorBase > &  b)
inline

Performs a binary "Or" of all components with the corresponding components of another Vector.

Definition at line 351 of file mlIntegerVector.h.

◆ print()

template<class TVectorBase >
std::string ml::TVector< TVectorBase >::print ( const std::string &  openStr = "",
const std::string &  sepStr = " ",
const std::string &  termStr = "",
const MLint16  numDigits = -1 
) const

Returns the string openStr + v.array[0] + sepStr + ...

  • v.array[NumberOfDimensions-2] + sepStr + v.array[NumberOfDimensions-1] + termStr. numDigits is the number of digits to be used as print parameter. If numDigits is <=0 then no space specification is used.

Definition at line 780 of file mlIntegerVector.h.

Referenced by ml::TKernel< KDATATYPE >::getKernel().

◆ set() [1/2]

template<class TVectorBase >
void ml::TVector< TVectorBase >::set ( const ComponentType  v = 0)
inline

Sets all components to v or - if v is not specified - to 0.

Definition at line 198 of file mlIntegerVector.h.

◆ set() [2/2]

template<class TVectorBase >
void ml::TVector< TVectorBase >::set ( const TVector< TVectorBase > &  v)
inline

Like assignment operator.

Definition at line 204 of file mlIntegerVector.h.


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