OPAL (Object Oriented Parallel Accelerator Library)
2.2.0
OPAL
|
Representation objects and parsers for attribute expressions. More...
Classes | |
class | Scalar |
A scalar expression. More... | |
class | PtrToScalar |
A pointer to a scalar expression. More... | |
class | ArrayOfPtrs |
An array of pointers to scalar expressions. More... | |
class | OArray |
An array expression. More... | |
class | PtrToArray |
A pointer to an array expression. More... | |
class | SRefAttr |
An attribute defined as a reference to a scalar. More... | |
class | AAutomatic |
Object attribute with an ``automatic'' array value. More... | |
class | ABinary |
An array expression with two array operands. More... | |
class | AColumn |
An array expression defined as a table column. More... | |
class | ADeferred |
Object attribute with a ``deferred'' array value. More... | |
class | AList |
An array expression defined by a list of scalar expressions. More... | |
class | ARefAttr |
An attribute defined as a reference to an array. More... | |
class | ARefExpr |
An expression defined as a reference to an array. More... | |
class | ARow |
An array expression defined as a table row. More... | |
class | ASUnary |
A scalar expression with one array operand. More... | |
class | ATable |
An array expression generated from a TABLE() function. More... | |
class | AUnary |
An array expression with one array operand. More... | |
class | AValue |
Object attribute with a constant array value. More... | |
class | Indexer |
A scalar expression to retrieve an indexed component from an array. More... | |
class | SAutomatic |
Object attribute with an ``automatic'' scalar value. More... | |
class | SBinary |
A scalar expression with two scalar operands. More... | |
class | SCell |
A scalar expression referring to a table cell. More... | |
class | SConstant |
A scalar constant expression. More... | |
class | SDeferred |
Object attribute with a ``deferred'' scalar value. More... | |
class | SHash |
A scalar expression. More... | |
class | SNull |
A scalar expression without operands. More... | |
class | SRefExpr |
An expression defined as a reference to a scalar. More... | |
class | SUnary |
A scalar expression with one scalar operand. More... | |
class | SValue |
Object attribute with a constant scalar value. More... | |
struct | TFunction0 |
An operand-less function returning a T. More... | |
struct | TFunction1 |
A function of one U, returning a T. More... | |
struct | TFunction2 |
A function of two U's returning a T. More... | |
Typedefs | |
typedef TFunction1< double, const std::vector< double > & > | ArrayFun |
typedef Expression | Expr_t |
type of an expression More... | |
typedef boost::tuple< double, bool > | Result_t |
typedef std::map< std::string, Expressions::Expr_t * > | Named_t |
type of an expressions with a name More... | |
typedef std::pair< std::string, Expressions::Expr_t * > | SingleNamed_t |
Enumerations | |
enum | Result_tIdx { VALUE, IS_VALID } |
enum | OperatorType_t { NONE, EQ, NOT_EQ, INEQ_LHS, INEQ_LHS_EQ, INEQ_RHS, INEQ_RHS_EQ } |
distinguish different constraints More... | |
Functions | |
PtrToScalar< bool > | parseBool (Statement &) |
Parse boolean expression. More... | |
PtrToScalar< double > | parseReal (Statement &) |
Parse real expression. More... | |
double | parseRealConst (Statement &) |
Parse real constant. More... | |
std::string | parseString (Statement &, const char msg[]) |
Parse string value. More... | |
PtrToArray< bool > | parseBoolArray (Statement &) |
Parse boolean array expression. More... | |
PtrToArray< double > | parseRealArray (Statement &) |
Parse real array expression. More... | |
PtrToArray< double > | parseRealConstArray (Statement &) |
Parse real array constant. More... | |
std::vector< std::string > | parseStringArray (Statement &) |
Parse string array. More... | |
void | parseDelimiter (Statement &stat, char delim) |
Test for one-character delimiter. More... | |
void | parseDelimiter (Statement &stat, const char delim[2]) |
Test for two-character delimiter. More... | |
PlaceRep | parsePlace (Statement &) |
Parse place specification. More... | |
RangeRep | parseRange (Statement &) |
Parse range specification. More... | |
SRefAttr< double > * | parseReference (Statement &) |
Parse variable reference. More... | |
TableRowRep | parseTableRow (Statement &) |
Parse a token list (for macro argument and the like). More... | |
std::list< Token > | parseTokenList (Statement &) |
Parse a token list (for macro argument and the like). More... | |
std::vector< std::list< Token > > | parseTokenListArray (Statement &) |
Parse a token list array (for LIST commands). More... | |
PtrToScalar< double > | parseTableExpression (Statement &, const Table *) |
Parse table expression (depends on a table's rows). More... | |
template<class T > | |
std::ostream & | operator<< (std::ostream &os, const ARefAttr< T > &a) |
bool | Or (bool a, bool b) |
bool | And (bool a, bool b) |
bool | Le (double a, double b) |
bool | Lt (double a, double b) |
bool | Ge (double a, double b) |
bool | Gt (double a, double b) |
bool | Eq (double a, double b) |
bool | Ne (double a, double b) |
double | Neg (double a) |
double | Sign (double a) |
double | Tgauss (double a) |
double | Add (double a, double b) |
double | Sub (double a, double b) |
double | Mpy (double a, double b) |
double | Div (double a, double b) |
double | getEkin () |
double | ranf () |
double | gauss () |
double | Max (double a, double b) |
double | Min (double a, double b) |
double | Mod (double a, double b) |
double | Mina (const std::vector< double > &array) |
double | Maxa (const std::vector< double > &array) |
double | Rmsa (const std::vector< double > &array) |
double | AbsMax (const std::vector< double > &array) |
PtrToScalar< bool > | parseAnd (Statement &stat) |
PtrToArray< double > | parseArrayFactor (Statement &stat) |
PtrToArray< double > | parseArrayPrimary (Statement &stat) |
PtrToArray< double > | parseArrayTerm (Statement &stat) |
void | parseBracketList (Statement &stat, char close, std::list< Token > &result) |
PtrToScalar< double > | parseFactor (Statement &stat) |
PtrToScalar< double > | parsePrimary (Statement &stat) |
PtrToScalar< bool > | parseRelation (Statement &stat) |
PtrToScalar< double > | parseTerm (Statement &stat) |
PtrToArray< double > | parseColumnGenerator (Statement &stat) |
PtrToArray< double > | parseRowGenerator (Statement &stat) |
PtrToArray< double > | parseTableGenerator (Statement &stat) |
template<class T > | |
std::ostream & | operator<< (std::ostream &os, const SRefAttr< T > &a) |
template<class T > | |
const T * | find (const T table[], const std::string &name) |
Look up name. More... | |
Variables | |
const Table * | currentTable = 0 |
OwnPtr< ATable > | currentArray |
Representation objects and parsers for attribute expressions.
typedef TFunction1<double, const std::vector<double>&> Expressions::ArrayFun |
Definition at line 293 of file Expressions.cpp.
typedef Expression Expressions::Expr_t |
type of an expression
Definition at line 34 of file Expression.h.
typedef std::map<std::string, Expressions::Expr_t*> Expressions::Named_t |
type of an expressions with a name
Definition at line 45 of file Expression.h.
typedef boost::tuple<double, bool> Expressions::Result_t |
Definition at line 37 of file Expression.h.
typedef std::pair<std::string, Expressions::Expr_t*> Expressions::SingleNamed_t |
Definition at line 48 of file Expression.h.
distinguish different constraints
Enumerator | |
---|---|
NONE | |
EQ | |
NOT_EQ | |
INEQ_LHS | |
INEQ_LHS_EQ | |
INEQ_RHS | |
INEQ_RHS_EQ |
Definition at line 51 of file Expression.h.
Enumerator | |
---|---|
VALUE | |
IS_VALID |
Definition at line 38 of file Expression.h.
double Expressions::AbsMax | ( | const std::vector< double > & | array | ) |
Definition at line 279 of file Expressions.cpp.
References abs(), endl(), max(), and Options::warn.
double Expressions::Add | ( | double | a, |
double | b | ||
) |
Definition at line 120 of file Expressions.cpp.
bool Expressions::And | ( | bool | a, |
bool | b | ||
) |
Definition at line 79 of file Expressions.cpp.
double Expressions::Div | ( | double | a, |
double | b | ||
) |
Definition at line 138 of file Expressions.cpp.
bool Expressions::Eq | ( | double | a, |
double | b | ||
) |
Definition at line 94 of file Expressions.cpp.
Look up name.
Definition at line 34 of file TFind.h.
References T.
Referenced by TwoDGrid::Add(), interpolation::ThreeDGrid::add(), Individual::checkConstraints(), OpalSimulation::cleanUp(), Help::execute(), What::execute(), Select::execute(), AttList::execute(), Cartesian< Dim, MFLOAT >::get_meshSpacing(), Cartesian< Dim, MFLOAT >::getCellVolumeField(), Cartesian< Dim, MFLOAT >::getDeltaCellField(), Cartesian< Dim, MFLOAT >::getDeltaVertexField(), SampleIndividual::getIndex(), Variator< ind_t, CrossoverOperator, MutationOperator >::initial_population(), MapAnalyser::linTAnalyze(), EditInstall::parse(), parseArrayPrimary(), parsePrimary(), TwoDGrid::Remove(), interpolation::ThreeDGrid::remove(), and Variator< ind_t, CrossoverOperator, MutationOperator >::Variator().
double Expressions::gauss | ( | ) |
Definition at line 166 of file Expressions.cpp.
References Random::gauss(), and Options::rangen.
bool Expressions::Ge | ( | double | a, |
double | b | ||
) |
Definition at line 88 of file Expressions.cpp.
Referenced by vmap< Key, T, Compare >::insert().
double Expressions::getEkin | ( | ) |
Definition at line 153 of file Expressions.cpp.
References PartBunchBase< T, Dim >::get_meanKineticEnergy(), OpalData::getInstance(), and OpalData::getPartBunch().
bool Expressions::Gt | ( | double | a, |
double | b | ||
) |
Definition at line 91 of file Expressions.cpp.
bool Expressions::Le | ( | double | a, |
double | b | ||
) |
Definition at line 82 of file Expressions.cpp.
Referenced by vmap< Key, T, Compare >::find(), vmap< Key, T, Compare >::insert(), and vmap< Key, T, Compare >::operator[]().
bool Expressions::Lt | ( | double | a, |
double | b | ||
) |
Definition at line 85 of file Expressions.cpp.
Referenced by vmap< Key, T, Compare >::equal_range(), vmap< Key, T, Compare >::insert(), vmap< Key, T, Compare >::lower_bound(), vmap< Key, T, Compare >::operator=(), and vmap< Key, T, Compare >::upper_bound().
double Expressions::Max | ( | double | a, |
double | b | ||
) |
Definition at line 209 of file Expressions.cpp.
References max().
double Expressions::Maxa | ( | const std::vector< double > & | array | ) |
Definition at line 251 of file Expressions.cpp.
References endl(), max(), and Options::warn.
double Expressions::Min | ( | double | a, |
double | b | ||
) |
Definition at line 213 of file Expressions.cpp.
References min().
Referenced by Mina().
double Expressions::Mina | ( | const std::vector< double > & | array | ) |
Definition at line 237 of file Expressions.cpp.
References endl(), Min(), and Options::warn.
double Expressions::Mod | ( | double | a, |
double | b | ||
) |
Definition at line 217 of file Expressions.cpp.
References fmod().
double Expressions::Mpy | ( | double | a, |
double | b | ||
) |
Definition at line 132 of file Expressions.cpp.
bool Expressions::Ne | ( | double | a, |
double | b | ||
) |
Definition at line 97 of file Expressions.cpp.
double Expressions::Neg | ( | double | a | ) |
Definition at line 103 of file Expressions.cpp.
|
inline |
Definition at line 102 of file ARefAttr.h.
References Attribute::print().
|
inline |
Definition at line 106 of file SRefAttr.h.
References Attribute::print().
bool Expressions::Or | ( | bool | a, |
bool | b | ||
) |
Definition at line 76 of file Expressions.cpp.
PtrToScalar< bool > Expressions::parseAnd | ( | Statement & | stat | ) |
Definition at line 680 of file Expressions.cpp.
References Statement::delimiter(), Expressions::SBinary< T, U >::make(), and parseRelation().
Referenced by parseBool().
PtrToArray< double > Expressions::parseArrayFactor | ( | Statement & | stat | ) |
Definition at line 693 of file Expressions.cpp.
References Statement::delimiter(), and parseArrayPrimary().
Referenced by parseArrayTerm().
PtrToArray< double > Expressions::parseArrayPrimary | ( | Statement & | stat | ) |
Definition at line 706 of file Expressions.cpp.
References Statement::delimiter(), find(), Statement::keyword(), parseColumnGenerator(), parseDelimiter(), parsePlace(), parseReal(), parseRealArray(), parseRealConstArray(), parseRowGenerator(), parseString(), parseStringArray(), parseTableGenerator(), and Statement::real().
Referenced by parseArrayFactor().
PtrToArray< double > Expressions::parseArrayTerm | ( | Statement & | stat | ) |
Definition at line 784 of file Expressions.cpp.
References Statement::delimiter(), and parseArrayFactor().
Referenced by parseRealArray().
PtrToScalar< bool > Expressions::parseBool | ( | Statement & | stat | ) |
Parse boolean expression.
Definition at line 353 of file Expressions.cpp.
References Statement::delimiter(), Expressions::SBinary< T, U >::make(), and parseAnd().
Referenced by Attributes::Bool::parse(), parseBoolArray(), Attributes::BoolArray::parseComponent(), and parseRelation().
PtrToArray< bool > Expressions::parseBoolArray | ( | Statement & | stat | ) |
Parse boolean array expression.
Definition at line 433 of file Expressions.cpp.
References Statement::delimiter(), parseBool(), and parseDelimiter().
Referenced by Attributes::BoolArray::parse().
Definition at line 804 of file Expressions.cpp.
References Statement::atEnd(), Statement::delimiter(), Statement::getCurrent(), and Token::isDel().
Referenced by parseTokenList().
PtrToArray< double > Expressions::parseColumnGenerator | ( | Statement & | stat | ) |
Definition at line 1000 of file Expressions.cpp.
References Statement::delimiter(), parseDelimiter(), parseRange(), and parseString().
Referenced by parseArrayPrimary().
void Expressions::parseDelimiter | ( | Statement & | stat, |
char | delim | ||
) |
Test for one-character delimiter.
Definition at line 515 of file Expressions.cpp.
References Statement::delimiter().
Referenced by ConstraintCmd::parse(), EditInstall::parse(), Line::parse(), Object::parse(), OpalElement::parse(), parseArrayPrimary(), OpalParser::parseAssign(), parseBoolArray(), parseColumnGenerator(), Macro::parseFormals(), Line::parseList(), parsePlace(), SequenceParser::parsePosition(), parsePrimary(), parseReference(), parseRelation(), parseRowGenerator(), parseString(), parseStringArray(), parseTableGenerator(), parseTableRow(), and parseTokenListArray().
void Expressions::parseDelimiter | ( | Statement & | stat, |
const char | delim[2] | ||
) |
Test for two-character delimiter.
Definition at line 523 of file Expressions.cpp.
References Statement::delimiter().
PtrToScalar< double > Expressions::parseFactor | ( | Statement & | stat | ) |
Definition at line 827 of file Expressions.cpp.
References Statement::delimiter(), Expressions::SBinary< T, U >::make(), and parsePrimary().
Referenced by parseTerm().
Parse place specification.
Definition at line 531 of file Expressions.cpp.
References PlaceRep::append(), Statement::delimiter(), Statement::keyword(), name, parseDelimiter(), parseRealConst(), parseString(), and Round().
Referenced by Attributes::Place::parse(), parseArrayPrimary(), parsePrimary(), parseRange(), parseRowGenerator(), and parseTableRow().
PtrToScalar< double > Expressions::parsePrimary | ( | Statement & | stat | ) |
Definition at line 840 of file Expressions.cpp.
References currentArray, currentTable, Statement::delimiter(), find(), OwnPtr< Object >::isValid(), Expressions::SNull< T >::make(), Expressions::SUnary< T, U >::make(), Expressions::SBinary< T, U >::make(), Table::makeColumnExpression(), parseDelimiter(), parsePlace(), parseReal(), parseRealArray(), parseRealConst(), parseString(), and Statement::real().
Referenced by parseFactor().
Parse range specification.
Definition at line 569 of file Expressions.cpp.
References Statement::delimiter(), Statement::keyword(), and parsePlace().
Referenced by Attributes::Range::parse(), and parseColumnGenerator().
PtrToScalar< double > Expressions::parseReal | ( | Statement & | stat | ) |
Parse real expression.
Definition at line 366 of file Expressions.cpp.
References Statement::delimiter(), Expressions::SUnary< T, U >::make(), Expressions::SBinary< T, U >::make(), and parseTerm().
Referenced by Attributes::Real::parse(), parseArrayPrimary(), Attributes::RealArray::parseComponent(), parsePrimary(), parseRealConst(), parseRelation(), parseTableExpression(), and parseTableGenerator().
PtrToArray< double > Expressions::parseRealArray | ( | Statement & | stat | ) |
Parse real array expression.
Definition at line 452 of file Expressions.cpp.
References Statement::delimiter(), and parseArrayTerm().
Referenced by Attributes::RealArray::parse(), parseArrayPrimary(), parsePrimary(), and parseRealConstArray().
double Expressions::parseRealConst | ( | Statement & | stat | ) |
Parse real constant.
Definition at line 397 of file Expressions.cpp.
References parseReal().
Referenced by Object::parse(), OpalElement::parse(), OpalParser::parseAssign(), parsePlace(), SequenceParser::parsePosition(), parsePrimary(), parseReference(), parseString(), and parseTableGenerator().
PtrToArray< double > Expressions::parseRealConstArray | ( | Statement & | stat | ) |
Parse real array constant.
Definition at line 483 of file Expressions.cpp.
References arg(), Expressions::OArray< T >::evaluate(), and parseRealArray().
Referenced by parseArrayPrimary().
Parse variable reference.
Definition at line 581 of file Expressions.cpp.
References Statement::delimiter(), parseDelimiter(), parseRealConst(), parseString(), and Round().
Referenced by Attributes::Reference::parse().
PtrToScalar< bool > Expressions::parseRelation | ( | Statement & | stat | ) |
Definition at line 933 of file Expressions.cpp.
References Statement::boolean(), Statement::delimiter(), OpalData::find(), BoolConstant::getBool(), OpalData::getInstance(), Expressions::SBinary< T, U >::make(), Statement::mark(), name, parseBool(), parseDelimiter(), parseReal(), Statement::restore(), and Statement::word().
Referenced by parseAnd().
PtrToArray< double > Expressions::parseRowGenerator | ( | Statement & | stat | ) |
Definition at line 1023 of file Expressions.cpp.
References Statement::delimiter(), parseDelimiter(), parsePlace(), parseString(), and parseStringArray().
Referenced by parseArrayPrimary().
std::string Expressions::parseString | ( | Statement & | stat, |
const char | msg[] | ||
) |
Parse string value.
Definition at line 403 of file Expressions.cpp.
References Statement::delimiter(), parseDelimiter(), parseRealConst(), Statement::str(), and Statement::word().
Referenced by Attributes::String::parse(), ConstraintCmd::parse(), EditInstall::parse(), EditParser::parse(), OpalParser::parse(), Line::parse(), Object::parse(), OpalElement::parse(), OpalParser::parseAction(), parseArrayPrimary(), OpalParser::parseAssign(), parseColumnGenerator(), Attributes::StringArray::parseComponent(), OpalParser::parseDefine(), Macro::parseFormals(), Line::parseList(), OpalParser::parseMacro(), SequenceParser::parseMember(), parsePlace(), SequenceParser::parsePosition(), parsePrimary(), parseReference(), parseRowGenerator(), parseStringArray(), and parseTableRow().
std::vector< std::string > Expressions::parseStringArray | ( | Statement & | stat | ) |
Parse string array.
Definition at line 496 of file Expressions.cpp.
References Statement::delimiter(), parseDelimiter(), and parseString().
Referenced by Attributes::StringArray::parse(), parseArrayPrimary(), and parseRowGenerator().
PtrToScalar< double > Expressions::parseTableExpression | ( | Statement & | stat, |
const Table * | t | ||
) |
Parse table expression (depends on a table's rows).
Definition at line 621 of file Expressions.cpp.
References currentTable, and parseReal().
Referenced by List::list().
PtrToArray< double > Expressions::parseTableGenerator | ( | Statement & | stat | ) |
Definition at line 1045 of file Expressions.cpp.
References currentArray, Statement::delimiter(), parseDelimiter(), parseReal(), parseRealConst(), and Round().
Referenced by parseArrayPrimary().
TableRowRep Expressions::parseTableRow | ( | Statement & | stat | ) |
Parse a token list (for macro argument and the like).
Definition at line 610 of file Expressions.cpp.
References parseDelimiter(), parsePlace(), and parseString().
Referenced by Attributes::TableRow::parse().
PtrToScalar< double > Expressions::parseTerm | ( | Statement & | stat | ) |
Definition at line 980 of file Expressions.cpp.
References Statement::delimiter(), Expressions::SBinary< T, U >::make(), and parseFactor().
Referenced by parseReal().
Parse a token list (for macro argument and the like).
Definition at line 629 of file Expressions.cpp.
References Statement::atEnd(), Statement::getCurrent(), Token::isDel(), Statement::mark(), parseBracketList(), and Statement::restore().
Referenced by Attributes::TokenList::parse(), Attributes::TokenListArray::parseComponent(), and parseTokenListArray().
Parse a token list array (for LIST commands).
Definition at line 660 of file Expressions.cpp.
References Statement::delimiter(), parseDelimiter(), and parseTokenList().
Referenced by Attributes::TokenListArray::parse().
double Expressions::ranf | ( | ) |
Definition at line 162 of file Expressions.cpp.
References Options::rangen, and Random::uniform().
double Expressions::Rmsa | ( | const std::vector< double > & | array | ) |
Definition at line 265 of file Expressions.cpp.
References endl(), sqrt(), and Options::warn.
double Expressions::Sign | ( | double | a | ) |
Definition at line 109 of file Expressions.cpp.
double Expressions::Sub | ( | double | a, |
double | b | ||
) |
Definition at line 126 of file Expressions.cpp.
double Expressions::Tgauss | ( | double | a | ) |
Definition at line 113 of file Expressions.cpp.
References abs(), Random::gauss(), and Options::rangen.
Definition at line 305 of file Expressions.cpp.
Referenced by parsePrimary(), and parseTableGenerator().
const Table* Expressions::currentTable = 0 |
Definition at line 304 of file Expressions.cpp.
Referenced by parsePrimary(), and parseTableExpression().