LTL  2.0.x
Public Types | Public Member Functions | List of all members
ltl::ExprUnopNode< A, Op, N > Class Template Reference

Unary operation node in the expression parse tree. More...

Inherits ltl::LTLIterator.

Public Types

typedef Op::value_type value_type
 the result data type is the value_type of the operation More...
 
enum  { dims =N }
 The number of dimensions. More...
 
enum  { numIndexIter = A::numIndexIter }
 The number of ltl::IndexIter index iterators in the operand. More...
 
enum  { numConvolution = A::numConvolution }
 The number of convolution operations. More...
 
enum  { isVectorizable = A::isVectorizable * Op::isVectorizable }
 Vectorizable if the operand is vectorizable and if the the operation is vectorizable. More...
 

Public Member Functions

 ExprUnopNode (const A &a)
 Constructor. More...
 
value_type readAtOffsetDim (const int i, const int dim) const
 
value_type readAtOffset (const int i) const
 
value_type readAtOffset (const int i, const int j) const
 
value_type readAtOffset (const int i, const int j, const int k) const
 
bool isStorageContiguous () const
 
bool isStride1 () const
 
bool isConformable (const Shape< N > &other) const
 
void reset ()
 
const Shape< N > * shape () const
 Return a shape object from the operand parse tree. More...
 
void operator++ ()
 Implement the iterator interface forwarding all operations to the operand. More...
 
void advance ()
 
void advance (const int i)
 
void advance (const int i, const int dim)
 
void advanceWithStride1 ()
 
void advanceDim ()
 
void advanceDim (const int cutDim)
 
value_type operator* () const
 Evaluate by passing the values of the operand to the operation. More...
 
value_type readWithoutStride (const int i) const
 
value_type readWithStride (const int i) const
 
value_type readWithStride (const int i, const int dim) const
 
int boundary_l (const int dim) const
 
int boundary_u (const int dim) const
 

Detailed Description

template<typename A, typename Op, int N>
class ltl::ExprUnopNode< A, Op, N >

Unary operation node in the expression parse tree.

This class represents a unary operation in the parse tree of an expression. It captures the operrand of the operation (of type ExprNode<>) and the operation itself, which is a functor that encapsulates the operation for the element type of the arrays/expressions involved.

Like all parse tree elements, this class implements the iterator interface. It forwards all iterator movements to the operand, and when dereferenced, evaluates the operation passing the operand as the parameter.

Member Typedef Documentation

template<typename A , typename Op , int N>
typedef Op::value_type ltl::ExprUnopNode< A, Op, N >::value_type

the result data type is the value_type of the operation

Member Enumeration Documentation

template<typename A , typename Op , int N>
anonymous enum

The number of dimensions.

Enumerator
dims 
template<typename A , typename Op , int N>
anonymous enum

The number of ltl::IndexIter index iterators in the operand.

Enumerator
numIndexIter 
template<typename A , typename Op , int N>
anonymous enum

The number of convolution operations.

Enumerator
numConvolution 
template<typename A , typename Op , int N>
anonymous enum

Vectorizable if the operand is vectorizable and if the the operation is vectorizable.

Enumerator
isVectorizable 

Constructor & Destructor Documentation

template<typename A , typename Op , int N>
ltl::ExprUnopNode< A, Op, N >::ExprUnopNode ( const A &  a)
inline

Constructor.

Member Function Documentation

template<typename A , typename Op , int N>
void ltl::ExprUnopNode< A, Op, N >::operator++ ( )
inline

Implement the iterator interface forwarding all operations to the operand.

template<typename A , typename Op , int N>
void ltl::ExprUnopNode< A, Op, N >::advance ( )
inline
template<typename A , typename Op , int N>
void ltl::ExprUnopNode< A, Op, N >::advance ( const int  i)
inline
template<typename A , typename Op , int N>
void ltl::ExprUnopNode< A, Op, N >::advance ( const int  i,
const int  dim 
)
inline
template<typename A , typename Op , int N>
void ltl::ExprUnopNode< A, Op, N >::advanceWithStride1 ( )
inline
template<typename A , typename Op , int N>
void ltl::ExprUnopNode< A, Op, N >::advanceDim ( )
inline
template<typename A , typename Op , int N>
void ltl::ExprUnopNode< A, Op, N >::advanceDim ( const int  cutDim)
inline
template<typename A , typename Op , int N>
value_type ltl::ExprUnopNode< A, Op, N >::operator* ( ) const
inline

Evaluate by passing the values of the operand to the operation.

template<typename A , typename Op , int N>
value_type ltl::ExprUnopNode< A, Op, N >::readWithoutStride ( const int  i) const
inline
template<typename A , typename Op , int N>
value_type ltl::ExprUnopNode< A, Op, N >::readWithStride ( const int  i) const
inline
template<typename A , typename Op , int N>
value_type ltl::ExprUnopNode< A, Op, N >::readWithStride ( const int  i,
const int  dim 
) const
inline
template<typename A , typename Op , int N>
value_type ltl::ExprUnopNode< A, Op, N >::readAtOffsetDim ( const int  i,
const int  dim 
) const
inline

compute and return the value of the subexpression in the parse tree below us at an offset in dimension 1, 2, and/or 3. Used for evaluating convolutions

template<typename A , typename Op , int N>
value_type ltl::ExprUnopNode< A, Op, N >::readAtOffset ( const int  i) const
inline
template<typename A , typename Op , int N>
value_type ltl::ExprUnopNode< A, Op, N >::readAtOffset ( const int  i,
const int  j 
) const
inline
template<typename A , typename Op , int N>
value_type ltl::ExprUnopNode< A, Op, N >::readAtOffset ( const int  i,
const int  j,
const int  k 
) const
inline
template<typename A , typename Op , int N>
int ltl::ExprUnopNode< A, Op, N >::boundary_l ( const int  dim) const
inline

Return the width of the lower/upper boundary in dimension dim to be left unevaluated. Zero in most cases except for convolutions, which do require padding of the half-width of the kernel.

template<typename A , typename Op , int N>
int ltl::ExprUnopNode< A, Op, N >::boundary_u ( const int  dim) const
inline
template<typename A , typename Op , int N>
bool ltl::ExprUnopNode< A, Op, N >::isStorageContiguous ( void  ) const
inline
template<typename A , typename Op , int N>
bool ltl::ExprUnopNode< A, Op, N >::isStride1 ( ) const
inline
template<typename A , typename Op , int N>
bool ltl::ExprUnopNode< A, Op, N >::isConformable ( const Shape< N > &  other) const
inline
template<typename A , typename Op , int N>
void ltl::ExprUnopNode< A, Op, N >::reset ( )
inline
template<typename A , typename Op , int N>
const Shape<N>* ltl::ExprUnopNode< A, Op, N >::shape ( ) const
inline

Return a shape object from the operand parse tree.