LTL  2.0.x
Public Types | Public Member Functions | List of all members
ltl::ExprLiteralNode< T > Class Template Reference

Node in the expression parse tree representing a literal number. More...

Inherits ltl::LTLIterator.

Public Types

typedef T value_type
 the result data type is the type of the constant More...
 
enum  { dims =0 }
 The number of dimensions. More...
 
enum  { numIndexIter = 0 }
 The number of ltl::IndexIter index iterators (always 0) More...
 
enum  { numConvolution = 0 }
 The number of convolution operations (always 0) More...
 
enum  { isVectorizable = 1 }
 Constants are vectorizable: splat the constant across the vector. More...
 

Public Member Functions

 ExprLiteralNode (const T f)
 Constructor: store the constant, splat if we are vectorizing. More...
 
value_type readAtOffsetDim (const int, const int) const
 
value_type readAtOffset (const int) const
 
value_type readAtOffset (const int, const int) const
 
value_type readAtOffset (const int, const int, const int) const
 
bool isStorageContiguous () const
 always true More...
 
bool isStride1 () const
 always true More...
 
template<int N>
bool isConformable (const Shape< N > &) const
 always true More...
 
void reset ()
 
void advance () const
 Implement the iterator interface: do nothing for advancing. More...
 
void advance (const int) const
 
void advance (const int, const int) const
 
void advanceWithStride1 () const
 
void advanceDim () const
 
void advanceDim (const int) const
 
void operator++ () const
 
value_type operator* () const
 Evaluate by simply returning the constant. More...
 
value_type readWithoutStride (const int) const
 
value_type readWithStride (const int) const
 
value_type readWithStride (const int, const int) const
 
int boundary_l (const int) const
 
int boundary_u (const int) const
 

Detailed Description

template<typename T>
class ltl::ExprLiteralNode< T >

Node in the expression parse tree representing a literal number.

This class represents a literal number in the parse tree of an expression so that expressions can involve literal constants in the usual way.

Like all parse tree elements, this class implements the iterator interface, simply doing nothing for all methods except dereferencing, for which it returns the literal constant it holds.

Member Typedef Documentation

template<typename T >
typedef T ltl::ExprLiteralNode< T >::value_type

the result data type is the type of the constant

Member Enumeration Documentation

template<typename T >
anonymous enum

The number of dimensions.

Enumerator
dims 
template<typename T >
anonymous enum

The number of ltl::IndexIter index iterators (always 0)

Enumerator
numIndexIter 
template<typename T >
anonymous enum

The number of convolution operations (always 0)

Enumerator
numConvolution 
template<typename T >
anonymous enum

Constants are vectorizable: splat the constant across the vector.

Enumerator
isVectorizable 

Constructor & Destructor Documentation

template<typename T >
ltl::ExprLiteralNode< T >::ExprLiteralNode ( const T  f)
inline

Constructor: store the constant, splat if we are vectorizing.

Member Function Documentation

template<typename T >
void ltl::ExprLiteralNode< T >::advance ( ) const
inline

Implement the iterator interface: do nothing for advancing.

template<typename T >
void ltl::ExprLiteralNode< T >::advance ( const int  ) const
inline
template<typename T >
void ltl::ExprLiteralNode< T >::advance ( const int  ,
const int   
) const
inline
template<typename T >
void ltl::ExprLiteralNode< T >::advanceWithStride1 ( ) const
inline
template<typename T >
void ltl::ExprLiteralNode< T >::advanceDim ( ) const
inline
template<typename T >
void ltl::ExprLiteralNode< T >::advanceDim ( const int  ) const
inline
template<typename T >
void ltl::ExprLiteralNode< T >::operator++ ( ) const
inline
template<typename T >
value_type ltl::ExprLiteralNode< T >::operator* ( ) const
inline

Evaluate by simply returning the constant.

template<typename T >
value_type ltl::ExprLiteralNode< T >::readWithoutStride ( const int  ) const
inline
template<typename T >
value_type ltl::ExprLiteralNode< T >::readWithStride ( const int  ) const
inline
template<typename T >
value_type ltl::ExprLiteralNode< T >::readWithStride ( const int  ,
const int   
) const
inline
template<typename T >
value_type ltl::ExprLiteralNode< T >::readAtOffsetDim ( const int  ,
const int   
) 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 T >
value_type ltl::ExprLiteralNode< T >::readAtOffset ( const int  ) const
inline
template<typename T >
value_type ltl::ExprLiteralNode< T >::readAtOffset ( const int  ,
const int   
) const
inline
template<typename T >
value_type ltl::ExprLiteralNode< T >::readAtOffset ( const int  ,
const int  ,
const int   
) const
inline
template<typename T >
int ltl::ExprLiteralNode< T >::boundary_l ( const int  ) const
inline
template<typename T >
int ltl::ExprLiteralNode< T >::boundary_u ( const int  ) const
inline
template<typename T >
bool ltl::ExprLiteralNode< T >::isStorageContiguous ( void  ) const
inline

always true

template<typename T >
bool ltl::ExprLiteralNode< T >::isStride1 ( ) const
inline

always true

template<typename T >
template<int N>
bool ltl::ExprLiteralNode< T >::isConformable ( const Shape< N > &  ) const
inline

always true

template<typename T >
void ltl::ExprLiteralNode< T >::reset ( )
inline