MBDyn-1.7.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
EE_Power Class Reference

#include <evaluator_impl.h>

Inheritance diagram for EE_Power:
Collaboration diagram for EE_Power:

Public Member Functions

 EE_Power (ExpressionElement *pEE1, ExpressionElement *pEE2)
 
 ~EE_Power (void)
 
TypedValue Eval (void) const
 
std::ostream & Output (std::ostream &out) const
 
- Public Member Functions inherited from ExpressionElement
virtual ~ExpressionElement (void)
 

Private Attributes

ExpressionElementm_pEE1
 
ExpressionElementm_pEE2
 

Additional Inherited Members

- Public Types inherited from ExpressionElement
enum  EEFlags { EE_NONE = 0x0U, EE_CONSTIFY = 0x1U, EE_OPTIMIZE = EE_CONSTIFY }
 
- Static Public Member Functions inherited from ExpressionElement
static unsigned GetFlags (void)
 
static void SetFlag (EEFlags f)
 
static void ClearFlag (EEFlags f)
 
static bool IsFlag (EEFlags f)
 
- Static Protected Attributes inherited from ExpressionElement
static unsigned m_uEEFlags
 

Detailed Description

Definition at line 494 of file evaluator_impl.h.

Constructor & Destructor Documentation

EE_Power::EE_Power ( ExpressionElement pEE1,
ExpressionElement pEE2 
)
inline

Definition at line 499 of file evaluator_impl.h.

499 : m_pEE1(pEE1), m_pEE2(pEE2) {};
ExpressionElement * m_pEE1
ExpressionElement * m_pEE2
EE_Power::~EE_Power ( void  )
inline

Definition at line 500 of file evaluator_impl.h.

References m_pEE1, and m_pEE2.

500 { delete m_pEE1; delete m_pEE2; };
ExpressionElement * m_pEE1
ExpressionElement * m_pEE2

Member Function Documentation

TypedValue EE_Power::Eval ( void  ) const
inlinevirtual

Implements ExpressionElement.

Definition at line 503 of file evaluator_impl.h.

References a, ExpressionElement::Eval(), TypedValue::GetInt(), TypedValue::GetReal(), TypedValue::GetType(), m_pEE1, m_pEE2, MBDYN_EXCEPT_ARGS, grad::pow(), TypedValue::VAR_BOOL, TypedValue::VAR_INT, and TypedValue::VAR_STRING.

504  {
505  TypedValue a = m_pEE1->Eval();
506  TypedValue b = m_pEE2->Eval();
508  silent_cerr(" power undefined between string " << a << " and " << b << std::endl);
510 
511  } else if ((a.GetType() == TypedValue::VAR_INT && b.GetType() == TypedValue::VAR_INT)
513  {
514  Real value = std::pow(a.GetInt(), b.GetInt());
515  if (Real(Int(value)) != value) {
516  silent_cerr(" power(" << a.GetInt() << ", " << b.GetInt() << ") overflows (use explicit/implicit cast?)" << std::endl);
518  }
519  return value;
520 
521  } else {
522  return std::pow(a.GetReal(), b.GetReal());
523  }
524  };
Real GetReal(void) const
Definition: mathp.cc:1228
GradientExpression< BinaryExpr< FuncPow, LhsExpr, RhsExpr > > pow(const GradientExpression< LhsExpr > &u, const GradientExpression< RhsExpr > &v)
Definition: gradient.h:2961
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63
TypedValue::Type GetType(void) const
Definition: mathp.cc:1155
ExpressionElement * m_pEE1
virtual TypedValue Eval(void) const =0
ExpressionElement * m_pEE2
int Int
Definition: mathtyp.h:40
static const doublereal a
Definition: hfluid_.h:289
Int GetInt(void) const
Definition: mathp.cc:1209
double Real
Definition: mathtyp.h:39

Here is the call graph for this function:

std::ostream& EE_Power::Output ( std::ostream &  out) const
inlinevirtual

Implements ExpressionElement.

Definition at line 527 of file evaluator_impl.h.

References m_pEE1, m_pEE2, and ExpressionElement::Output().

528  {
529  return out << "(", m_pEE1->Output(out) << " ^ ", m_pEE2->Output(out) << ")";
530  };
ExpressionElement * m_pEE1
ExpressionElement * m_pEE2
virtual std::ostream & Output(std::ostream &out) const =0

Here is the call graph for this function:

Member Data Documentation

ExpressionElement* EE_Power::m_pEE1
private

Definition at line 496 of file evaluator_impl.h.

Referenced by Eval(), Output(), and ~EE_Power().

ExpressionElement * EE_Power::m_pEE2
private

Definition at line 496 of file evaluator_impl.h.

Referenced by Eval(), Output(), and ~EE_Power().


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