A CompiledExpression is a highly optimized representation of an expression for cases when you want to evaluate it many times as quickly as possible.
More...
#include <CompiledExpression.h>
A CompiledExpression is a highly optimized representation of an expression for cases when you want to evaluate it many times as quickly as possible.
You should treat it as an opaque object; none of the internal representation is visible.
A CompiledExpression is created by calling createCompiledExpression() on a ParsedExpression.
WARNING: CompiledExpression is NOT thread safe. You should never access a CompiledExpression from two threads at the same time.
◆ CompiledExpression() [1/3]
PLMD::CompiledExpression::CompiledExpression |
( |
| ) |
|
◆ CompiledExpression() [2/3]
◆ ~CompiledExpression()
PLMD::CompiledExpression::~CompiledExpression |
( |
| ) |
|
◆ CompiledExpression() [3/3]
PLMD::CompiledExpression::CompiledExpression |
( |
const ParsedExpression & |
expression | ) |
|
|
private |
◆ compileExpression()
◆ evaluate()
double PLMD::CompiledExpression::evaluate |
( |
| ) |
const |
Evaluate the expression.
The values of all variables should have been set before calling this.
◆ findTempIndex()
◆ getVariableReference()
double & PLMD::CompiledExpression::getVariableReference |
( |
const std::string & |
name | ) |
|
Get a reference to the memory location where the value of a particular variable is stored.
This can be used to set the value of the variable before calling evaluate().
◆ getVariables()
const set< string > & PLMD::CompiledExpression::getVariables |
( |
| ) |
const |
Get the names of all variables used by this expression.
◆ operator=()
◆ setVariableLocations()
void PLMD::CompiledExpression::setVariableLocations |
( |
std::map< std::string, double *> & |
variableLocations | ) |
|
You can optionally specify the memory locations from which the values of variables should be read.
This is useful, for example, when several expressions all use the same variable. You can then set the value of that variable in one place, and it will be seen by all of them.
◆ ParsedExpression
◆ arguments
std::vector<std::vector<int> > PLMD::lepton::CompiledExpression::arguments |
|
private |
◆ argValues
std::vector<double> PLMD::lepton::CompiledExpression::argValues |
|
mutableprivate |
◆ dummyVariables
std::map<std::string, double> PLMD::lepton::CompiledExpression::dummyVariables |
|
private |
◆ jitCode
void* PLMD::lepton::CompiledExpression::jitCode |
|
private |
◆ operation
std::vector<Operation*> PLMD::lepton::CompiledExpression::operation |
|
private |
◆ target
std::vector<int> PLMD::lepton::CompiledExpression::target |
|
private |
◆ variableIndices
std::map<std::string, int> PLMD::lepton::CompiledExpression::variableIndices |
|
private |
◆ variableNames
std::set<std::string> PLMD::lepton::CompiledExpression::variableNames |
|
private |
◆ variablePointers
std::map<std::string, double*> PLMD::lepton::CompiledExpression::variablePointers |
|
private |
◆ variablesToCopy
std::vector<std::pair<double*, double*> > PLMD::lepton::CompiledExpression::variablesToCopy |
|
private |
◆ workspace
std::vector<double> PLMD::lepton::CompiledExpression::workspace |
|
mutableprivate |
The documentation for this class was generated from the following files: