#include <cmath>
#include <iostream>
#include <stdexcept>
#include <algorithm>
#include <cassert>
#include "ExpressionEvaluation/StackElement.h"
Go to the source code of this file.
|
template<class T_CompHelper , class T > |
std::vector< int > | ExpressionParsing::compareVector (std::vector< T > &&a, std::vector< T > &&b, T_CompHelper helper) |
|
template<class T_CompHelper , class T > |
std::vector< int > | ExpressionParsing::compareVectorAlt (const std::vector< T > &&a, std::vector< T > &&b, T_CompHelper helper) |
|
template<class T_CompHelper > |
std::vector< int > | ExpressionParsing::compareVector (std::vector< int > &&a, const std::vector< int > &&b, T_CompHelper helper) |
|
template<class T_CompHelper > |
std::vector< int > | ExpressionParsing::compareVectorAlt (const std::vector< int > &&a, std::vector< int > &&b, T_CompHelper helper) |
|
std::ostream & | ExpressionParsing::operator<< (std::ostream &os, const StackElement &el) |
| Declare an output operator for StackElement objects. More...
|
|
◆ IMPL_ASSIGN_OP
#define IMPL_ASSIGN_OP |
( |
|
OP | ) |
|
Value:
makeVectorIfNecessary( rhs ); \
makeDoubleIfNecessary( rhs ); \
case SE_INT: \
m_intVal OP rhs.scalarValue< int >(); \
break; \
case SE_DOUBLE: \
m_doubleVal OP rhs.scalarValue< double >(); \
break; \
case SE_VECINT: \
*this OP rhs.vectorValue< int >( m_vecIntVal.size() ); \
break; \
case SE_VECDOUBLE: \
*this OP rhs.vectorValue< double >( m_vecDoubleVal.size() ); \
break; \
default: \
throw std::runtime_error( "StackElement ill-defined in " \
#OP ); \
break; \
} \
return *this; \
}
Helper macro implementing the assignment operator specialisations.
Definition at line 194 of file StackElement.cxx.
◆ UNARY_MATH_FUNCTION
#define UNARY_MATH_FUNCTION |
( |
|
FUNC, |
|
|
|
BASEFUNC |
|
) |
| |
Value:
if (this->m_moved) throw std::logic_error("Content already moved");\
StackElement temp( std::move(*this) ); \
this->m_moved=true; \
temp.makeDouble(); \
if( temp.m_type == SE_DOUBLE ) { \
temp.m_doubleVal = BASEFUNC( temp.m_doubleVal ); \
return temp; \
} else if( temp.m_type == SE_VECDOUBLE ) { \
for(
double&
value : temp.m_vecDoubleVal ) { \
value = BASEFUNC(
value ); \
} \
return temp; \
} else { \
\
return temp; \
} \
}
Helper macro for implementing many of the mathematical functions.
Definition at line 641 of file StackElement.cxx.