FEDRA emulsion software from the OPERA Collaboration
Expr< ExprType, T, D, D2 > Class Template Reference

#include <Expression.hh>

Public Types

typedef T value_type
 

Public Member Functions

apply (unsigned int i) const
 
 Expr (const ExprType &rhs)
 
std::ostream & print (std::ostream &os) const
 used by operator<<() More...
 
 ~Expr ()
 

Static Public Attributes

static const unsigned int cols = D2
 
static const unsigned int rows = D
 

Private Attributes

ExprType rhs_
 

Member Typedef Documentation

◆ value_type

template<class ExprType , class T , unsigned int D, unsigned int D2 = 0>
typedef T Expr< ExprType, T, D, D2 >::value_type

Constructor & Destructor Documentation

◆ Expr()

template<class ExprType , class T , unsigned int D, unsigned int D2 = 0>
Expr< ExprType, T, D, D2 >::Expr ( const ExprType &  rhs)
inline
48  :
49  rhs_(rhs) {}
ExprType rhs_
Definition: Expression.hh:92

◆ ~Expr()

template<class ExprType , class T , unsigned int D, unsigned int D2 = 0>
Expr< ExprType, T, D, D2 >::~Expr ( )
inline
52 {}

Member Function Documentation

◆ apply()

template<class ExprType , class T , unsigned int D, unsigned int D2 = 0>
T Expr< ExprType, T, D, D2 >::apply ( unsigned int  i) const
inline
55  {
56  return rhs_.apply(i);
57  }

◆ print()

template<class ExprType , class T , unsigned int D, unsigned int D2 = 0>
std::ostream& Expr< ExprType, T, D, D2 >::print ( std::ostream &  os) const
inline

used by operator<<()

65  {
66  os.setf(ios::right, ios::adjustfield) ;
67 
68  if(D2 == 0) {
69  unsigned int i=0;
70  for(; i<D-1; ++i) {
71  os << apply(i) << ", ";
72  }
73  os << apply(i);
74  } else {
75  os << "[ ";
76  for (unsigned int i=0; i < D; ++i) {
77  for (unsigned int j=0; j < D2; ++j) {
78  os << setw(12) << apply(i*D2+j);
79  if ((!((j+1)%12)) && (j < D2-1))
80  os << endl << " ...";
81  }
82  if (i != D - 1)
83  os << endl << " ";
84  }
85  os << " ]";
86  } // if D2==0
87 
88  return os;
89  }
T apply(unsigned int i) const
Definition: Expression.hh:55

Member Data Documentation

◆ cols

template<class ExprType , class T , unsigned int D, unsigned int D2 = 0>
const unsigned int Expr< ExprType, T, D, D2 >::cols = D2
static

◆ rhs_

template<class ExprType , class T , unsigned int D, unsigned int D2 = 0>
ExprType Expr< ExprType, T, D, D2 >::rhs_
private

◆ rows

template<class ExprType , class T , unsigned int D, unsigned int D2 = 0>
const unsigned int Expr< ExprType, T, D, D2 >::rows = D
static

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