ITK  6.0.0
Insight Toolkit
Public Types | Public Member Functions | Private Attributes | List of all members
VariableLengthVectorExpression< TExpr1, TExpr2, TBinaryOp > Struct Template Reference

#include <itkVariableLengthVector.h>

Detailed Description

template<typename TExpr1, typename TExpr2, typename TBinaryOp>
struct VariableLengthVectorExpression< TExpr1, TExpr2, TBinaryOp >

Expression Template for VariableLengthVector. Contains an expression template that models a binary operation between two sub expressions (of type VariableLengthVector, or VariableLengthVectorExpression)

Template Parameters
TExpr1Type of the left sub-expression
TExpr2Type of the right sub-expression
TBinaryOpBinary Operation to apply to both sub-expressions.
Note
We permit to add a VariableLengthVector<float> with a VariableLengthVector<double>, the result will be of type VariableLengthVector<double>.
Warning
Explicitly static casting an expression to a VariableLengthVector<> will defeat the purpose of the optimization implemented here. It's thus best to let the expression automatically adjust to the type with the most precision. Eventually, when assigning to the final destination (a VariableLengthVector<>), a casting on-the-fly could be realized by the assignment operator, or by the copy constructor.
Todo:
Add support for unary operations like operator-().

Definition at line 1225 of file itkVariableLengthVector.h.

Public Types

using RealValueType = typename NumericTraits< ResType >::RealType
 
using ResType = typename mpl::PromoteType< typename Details::GetType< TExpr1 >::Type, typename Details::GetType< TExpr2 >::Type >::Type
 

Public Member Functions

RealValueType GetNorm () const
 
RealValueType GetSquaredNorm () const
 
unsigned int Size () const
 
 VariableLengthVectorExpression (TExpr1 const &lhs, TExpr2 const &rhs)
 
ResType operator[] (unsigned int idx) const
 

Private Attributes

const TExpr1 & m_lhs
 
const TExpr2 & m_rhs
 

Member Typedef Documentation

◆ RealValueType

template<typename TExpr1, typename TExpr2, typename TBinaryOp>
using VariableLengthVectorExpression< TExpr1, TExpr2, TBinaryOp >::RealValueType = typename NumericTraits<ResType>::RealType

Real type of the elements.

Definition at line 1248 of file itkVariableLengthVector.h.

◆ ResType

template<typename TExpr1, typename TExpr2, typename TBinaryOp>
using VariableLengthVectorExpression< TExpr1, TExpr2, TBinaryOp >::ResType = typename mpl::PromoteType<typename Details::GetType<TExpr1>::Type, typename Details::GetType<TExpr2>::Type>::Type

Vector type of the Result Expression.

Definition at line 1246 of file itkVariableLengthVector.h.

Constructor & Destructor Documentation

◆ VariableLengthVectorExpression()

template<typename TExpr1, typename TExpr2, typename TBinaryOp>
VariableLengthVectorExpression< TExpr1, TExpr2, TBinaryOp >::VariableLengthVectorExpression ( TExpr1 const &  lhs,
TExpr2 const &  rhs 
)
inline

Definition at line 1227 of file itkVariableLengthVector.h.

Member Function Documentation

◆ GetNorm()

template<typename TExpr1, typename TExpr2, typename TBinaryOp>
RealValueType VariableLengthVectorExpression< TExpr1, TExpr2, TBinaryOp >::GetNorm ( ) const

Returns vector's Euclidean Norm

◆ GetSquaredNorm()

template<typename TExpr1, typename TExpr2, typename TBinaryOp>
RealValueType VariableLengthVectorExpression< TExpr1, TExpr2, TBinaryOp >::GetSquaredNorm ( ) const

Returns vector's squared Euclidean Norm

◆ operator[]()

template<typename TExpr1, typename TExpr2, typename TBinaryOp>
ResType VariableLengthVectorExpression< TExpr1, TExpr2, TBinaryOp >::operator[] ( unsigned int  idx) const
inline

Element access operator.

Precondition
idx < Size()

Definition at line 1260 of file itkVariableLengthVector.h.

◆ Size()

template<typename TExpr1, typename TExpr2, typename TBinaryOp>
unsigned int VariableLengthVectorExpression< TExpr1, TExpr2, TBinaryOp >::Size ( ) const
inline

Returns the size of the vector expression.

Definition at line 1239 of file itkVariableLengthVector.h.

Member Data Documentation

◆ m_lhs

template<typename TExpr1, typename TExpr2, typename TBinaryOp>
const TExpr1& VariableLengthVectorExpression< TExpr1, TExpr2, TBinaryOp >::m_lhs
private

Definition at line 1276 of file itkVariableLengthVector.h.

◆ m_rhs

template<typename TExpr1, typename TExpr2, typename TBinaryOp>
const TExpr2& VariableLengthVectorExpression< TExpr1, TExpr2, TBinaryOp >::m_rhs
private

Definition at line 1277 of file itkVariableLengthVector.h.


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