kangaroo
1.0
the cbls library
|
Functions that depend on other expressions. More...
#include <function0.hpp>
Data Structures | |
class | ExprOrder |
Dereferenced order for expressions. More... | |
class | ExprSpecOrder |
Dereferenced order for expressions. More... | |
Public Member Functions | |
Activation Properties | |
Bool | ActiveLazyHalfAutoExec () const |
Whether auto execution in lazy half mode is active? More... | |
void | activateLazyHalfAutoExec (Bool const SetNotUnset) |
Activate auto execution in lazy half mode. More... | |
Public Member Functions inherited from Expression | |
Bool | Terminal () const |
Whether the expression terminal—variables or constants are terminals, functions are not. More... | |
Bool | Updatable () const |
Whether the expression updatable—variables are updatable, functions may be updatable. More... | |
Bool | Computable () const |
Whether the expression computable—functions are normally computable, but may not be updatable as well. More... | |
virtual Serial | ValueTypeSerial () const |
Value type serial number. More... | |
virtual Serial | MetricTypeSerial () const |
Metric type serial number. More... | |
Bool | CompatibleValueMetricTypes () const |
Whether value and metric types are compatible. More... | |
virtual ValueBase const * | ExprValueRecord () const |
Expression value record or null if no value is present. More... | |
virtual ScalarBase const * | ExprScalarRecord (Order const MaxiOrMini) const |
Expression scalar record or null if no scalar is present. More... | |
virtual VectorBase const * | ExprVectorRecord (Order const MaxiOrMini) const |
Expression vector record or null if no vector is present. More... | |
virtual VectorType | ExprVectorType () const |
Expression vector type: fields for params or factors or values. More... | |
virtual Bool | SharedOptiMetrics () const |
Whether maxi and mini metrics share the same metric record. More... | |
virtual Order | ActiveSharedOptiMetric () const |
When shared, the active one between the maxi or mini metrics. More... | |
virtual Wrap | ExecWrappedValue () const =0 |
Execution value wrap of the expression. | |
virtual Wrap | SimulWrappedValue () const =0 |
Simulation value wrap of the expression. | |
virtual Wrap | ExecWrappedScalar (Order const MaxiOrMini) const =0 |
Execution scalar wrap of the expression. | |
virtual Dim | VectorFieldCount () const =0 |
Number of fields in the vector metrics. | |
virtual Wrap | ExecWrappedVectorField (Order const MaxiOrMini, Serial const FieldSerial) const =0 |
Execution value wrap of a vector field. | |
virtual Bool | NeedLazyModeUserExecution () const |
Needs user initiated execution in lazy computation mode, since there might be backlog: call this in propagation mode. More... | |
virtual Bool | NeedDownwardUserSimulation () const |
Needs simulation since simulation has not been performed, call this after propagation: call this in propagation mode. More... | |
Clock | ExecClock () const |
The execution clock of the expression. More... | |
Clock | SimulClock () const |
The simulation clock of the expression. More... | |
Bool | ChangedSystemExecClock () const |
Whether the system's execution clock changed from the expression's execution clock. More... | |
Bool | ChangedSystemSimulClock () const |
Whether the system's simulation clock changed from the expression's simulation clock. More... | |
Data Fields | |
Function Nesting | |
Index const | NestingIndex |
Function nesting index; starts from 0. | |
Data Fields inherited from Expression | |
Identifier const | ExprFamily |
Expression family is either void, variable, constant or function. | |
Identifier const | ExprModel |
Expression model is a category within each expression family. | |
Identifier const | ExprFormat |
Expression format is a concrete expression implementation. | |
System *const | SysMaster |
The system that contains this expression. | |
Hash const | ExprHash |
Expression hash value is used in quick matching of a certain expression. | |
xb< Function * > const | PatronFuncs |
Patron functions of the current expression. | |
xb< Serial > const | PatronParams |
Parameter serials in the patron expressions. | |
Protected Member Functions | |
Computation Methods | |
virtual void | computeFinal ()=0 |
Computation when function is final. | |
virtual void | setupComputation () |
Set up various things for computation. More... | |
Memory Management | |
virtual void | adjustMemAuto () override |
Adjust memory requirement automatically. More... | |
Synchronisation Methods | |
virtual void | syncExecClock () override |
Synchronize the execution clock. More... | |
Protected Member Functions inherited from Expression | |
virtual | ~Expression () |
Destructor. More... | |
Expression (System *const pSystem) | |
Param constructor. More... | |
Expression (Expression &&that) noexcept=delete | |
Move constructor. | |
Expression (Expression const &that)=delete | |
Copy constructor. | |
Expression & | operator= (Expression &&that) noexcept=delete |
Move assignment. | |
Expression & | operator= (Expression const &that)=delete |
Copy assignment. | |
void | setExprFamily (Identifier const pFamily) |
Set expression family. More... | |
void | setExprModel (Identifier const pModel) |
Set expression model. More... | |
void | setExprFormat (Identifier const pFormat) |
Set expression format. More... | |
void | setExprHash (Hash const pHash) |
Set expression hash value. More... | |
void | setUpdatable (Bool const SetNotUnset) |
Set expression updatablity. More... | |
void | updateExecClock () |
Update the execution clock. More... | |
void | updateSimulClock () |
Update the simulation clock. More... | |
virtual void | syncSimulClock () |
Synchronize the simulation clock. More... | |
virtual void | syncExecBatchClock () |
Synchronize the execution batch clock. More... | |
virtual void | syncSimulBatchClock () |
Synchronize the simulation batch clock. More... | |
virtual void | executeAnew ()=0 |
Compute in anew execution mode. | |
virtual void | executeIncr ()=0 |
Compute in incrmental execution mode. | |
virtual void | simulateAnew ()=0 |
Compute in anew simulation mode. | |
virtual void | simulateIncr ()=0 |
Compute in incremental simulation mode. | |
virtual Serial | setPatron (Function *const pFunction, Serial ParamSerial) |
Set a patron in the expression and return patron serial. More... | |
Friends | |
Friend Classes | |
class | System |
Friend access to System. | |
class | Expression |
Friend access to Expression. | |
class | VarLock |
Friend access to VarLock. | |
class | TabuBase |
Friend access to TabuBase. | |
Function Identity | |
Serial const | FuncSerial |
Unique over all functions. | |
void | setFuncSerial (Serial const pSerial) |
Set function serial. More... | |
Hash | calcExprHash () const |
Calculate expression hash value. More... | |
virtual Bool | equate (Expression const &that) const override |
Compare expressions for equality. More... | |
Care-For Methods | |
virtual TabuBase const * | CareTabuInstance () const |
Which tabu instance to care for. More... | |
virtual void | computeTabuEffect () |
Compute the tabu effect upon callback. More... | |
virtual void | computeLockEffect () |
Compute the lock effect up on callback. More... | |
virtual Identifier | CareTabuModel () const |
Care for any tabu model? More... | |
virtual Bool | CareLockEffect () const |
Care for lock effect? More... | |
virtual Bool | CareFactorSerial () const |
Care factor serial? More... | |
Essential Methods | |
Function (System *const pSystem, Dim const ParamCount) | |
Param constructor. More... | |
Function (Function &&that) noexcept=delete | |
Move constructor. | |
Function (Function const &that)=delete | |
Copy constructor. | |
Function & | operator= (Function &&that) noexcept=delete |
Move assignment. | |
Function & | operator= (Function const &that)=delete |
Copy assignment. | |
virtual | ~Function () |
Destructor. More... | |
Parameters and Variables | |
Expressions that the function depends on.
| |
kb< Expression * > const | ParamExprs |
Parameter expressions that this function immediately depends on. | |
kb< ParamSpecType > const *const | ParamSpecs |
Parameter specifications i.e. how to use values and metrics. | |
xb< Variable * > const | FactorVars |
Factor variables that this function transitively depends on. | |
nrl< xb< Serial > > const | ParamFactors |
Variables that parameters depend on. Factor serial of the function are use to represent parameter variables. | |
void | setParameters (ParamOrder const pParamOrder, Dim const ParamCount, Expression *const *const pParamExprs, ParamSpecType const *const pParamSpecs=nullptr, Index *const pParamIndexes=nullptr) |
Set the parameters, if unordered then expression pointers along with indexes (if given) are sorted. More... | |
Serial | FuncVarToFactorSerial (Serial const VarSerial) const |
Find the factor serial for a given variable serial. More... | |
Installation Methods | |
Serial | mRootFuncSerial |
Root function serial in the system. | |
void | defineRootWithinSystem () |
Define as a root within the system. More... | |
Serial | RootFuncSerial () const |
The root function serial within the system. More... | |
void | setRootFuncSerial (Serial const RootFuncSerial) |
Set the root function serial with the system. More... | |
static Serial | defineWithinSystem (Function *const pFunction) |
Define the function in the system. More... | |
Additional Inherited Members | |
Static Public Member Functions inherited from Expression | |
static void | performExecution (Expression *const pExpression) |
Execute in current (anew or incrmental) mode. More... | |
static void | performSimulation (Expression *const pExpression) |
Simulate in current (anew or incremental) mode. More... | |
static void | performExecAnew (Expression *const pExpression) |
Execute in anew mode. More... | |
static void | performExecIncr (Expression *const pExpression) |
Execute in incremental mode. More... | |
static void | performSimulAnew (Expression *const pExpression) |
Simulate in anew mode. More... | |
static void | performSimulIncr (Expression *const pExpression) |
Simulate in incremental mode. More... | |
Protected Attributes inherited from Expression | |
friend | System |
Friend access to System. | |
Clock | mEmulClock |
The emulation clock, when the expression was emulated. | |
Clock | mExecClock |
The execution clock, when the expression was executed. | |
Clock | mSimulClock |
The simulation clock, when the expression was simulated. | |
Functions that depend on other expressions.
|
inlinevirtual |
Destructor.
|
inlineprotected |
Default constructor.
|
inlineprotected |
Set the function serial.
|
inlineprotected |
Calculate hash value.
|
inlineoverrideprotectedvirtual |
Compare two expressions for equality.
Implements Expression.
Reimplemented in WeightedSummationValueScalarOptiSwapToValueFactorVector< MaxiOrMini, paramValue, paramWeight, value, paramMetric, metric >, WeightedSummationValueScalarToValueFactorVector< MaxiOrMini, paramValue, paramWeight, value, paramMetric, metric >, FalseCountComposeValueToValue< paramValue, bindOper >, TrueCountComposeValueToValue< paramValue, bindOper >, WeightedSummationValueFactorVectorOptiSwapToValueFactorVector< MaxiOrMini, paramValue, paramWeight, value, paramMetric, metric >, WeightedSummationValueFactorVectorToValueFactorVector< MaxiOrMini, paramValue, paramWeight, value, paramMetric, metric >, WeightedSummationValueScalarOrFactorVectorOptiSwapToValueFactorVector< MaxiOrMini, paramValue, paramWeight, value, paramMetric, metric >, WeightedSummationValueScalarOrFactorVectorToValueFactorVector< MaxiOrMini, paramValue, paramWeight, value, paramMetric, metric >, TerminalSummationComposeValueToValue< paramValue, bindOper >, WeightedSummationValueToValue< paramValue, paramWeight, value >, SummationComposeValueToValue< paramValue, bindOper >, BindValueToValue< oper >, IfThenValueToValue< condValue, branchValue, value >, and NotIfThenValueToValue< condValue, branchValue, value >.
|
inlinevirtual |
Care for tabu effect
Reimplemented in HeapOptimalMapVarRankSingleVarTabuDoCallbackLock< MaxiOrMini, paramValue, buffer >, HeapOptimalFactorVectorRankOptiSwapSingleVarTabuDoCallbackLock< MaxiOrMini, paramMetric, buffer >, HeapOptimalFactorVectorRankSingleVarTabuDoCallbackLock< MaxiOrMini, paramMetric, buffer >, HeapOptimalMapVarRankSingleVarTabuDoCallback< MaxiOrMini, paramValue, buffer >, HeapOptimalFactorVectorRankOptiSwapSingleVarTabuDoCallback< MaxiOrMini, paramMetric, buffer >, and HeapOptimalFactorVectorRankSingleVarTabuDoCallback< MaxiOrMini, paramMetric, buffer >.
|
inlinevirtual |
Care for lock effect?
Reimplemented in HeapOptimalFactorVectorRankLock< MaxiOrMini, paramMetric, buffer >, HeapOptimalFactorVectorRankOptiSwapLock< MaxiOrMini, paramMetric, buffer >, HeapOptimalMapVarRankSingleVarTabuDoCallbackLock< MaxiOrMini, paramValue, buffer >, HeapOptimalMapVarRankLock< MaxiOrMini, paramValue, buffer >, HeapOptimalFactorVectorRankOptiSwapSingleVarTabuDoCallbackLock< MaxiOrMini, paramMetric, buffer >, and HeapOptimalFactorVectorRankSingleVarTabuDoCallbackLock< MaxiOrMini, paramMetric, buffer >.
|
inlinevirtual |
Care for factor serial?
|
inlineprotectedvirtual |
Care for tabu effect.
Reimplemented in HeapOptimalMapVarRankSingleVarTabuDoCallbackLock< MaxiOrMini, paramValue, buffer >, HeapOptimalFactorVectorRankOptiSwapSingleVarTabuDoCallbackLock< MaxiOrMini, paramMetric, buffer >, HeapOptimalFactorVectorRankSingleVarTabuDoCallbackLock< MaxiOrMini, paramMetric, buffer >, HeapOptimalMapVarRankSingleVarTabuDoCallback< MaxiOrMini, paramValue, buffer >, HeapOptimalFactorVectorRankOptiSwapSingleVarTabuDoCallback< MaxiOrMini, paramMetric, buffer >, and HeapOptimalFactorVectorRankSingleVarTabuDoCallback< MaxiOrMini, paramMetric, buffer >.
|
inlineprotectedvirtual |
Compute tabu effect.
Reimplemented in HeapOptimalMapVarRankSingleVarTabuDoCallbackLock< MaxiOrMini, paramValue, buffer >, HeapOptimalFactorVectorRankOptiSwapSingleVarTabuDoCallbackLock< MaxiOrMini, paramMetric, buffer >, HeapOptimalFactorVectorRankSingleVarTabuDoCallbackLock< MaxiOrMini, paramMetric, buffer >, HeapOptimalMapVarRankSingleVarTabuDoCallback< MaxiOrMini, paramValue, buffer >, HeapOptimalFactorVectorRankOptiSwapSingleVarTabuDoCallback< MaxiOrMini, paramMetric, buffer >, and HeapOptimalFactorVectorRankSingleVarTabuDoCallback< MaxiOrMini, paramMetric, buffer >.
|
inlineprotectedvirtual |
Compute lock effect.
Reimplemented in HeapOptimalFactorVectorRankLock< MaxiOrMini, paramMetric, buffer >, HeapOptimalFactorVectorRankOptiSwapLock< MaxiOrMini, paramMetric, buffer >, HeapOptimalMapVarRankSingleVarTabuDoCallbackLock< MaxiOrMini, paramValue, buffer >, HeapOptimalMapVarRankLock< MaxiOrMini, paramValue, buffer >, HeapOptimalFactorVectorRankOptiSwapSingleVarTabuDoCallbackLock< MaxiOrMini, paramMetric, buffer >, and HeapOptimalFactorVectorRankSingleVarTabuDoCallbackLock< MaxiOrMini, paramMetric, buffer >.
|
inlineprotectedvirtual |
Set up for various things needed for computation.
|
inline |
Whether auto execution in lazy half mode is active.
|
inline |
Activate auto execution in lazy half mode.
|
inlineoverrideprotectedvirtual |
Adjust memory allocation automatically.
Reimplemented from Expression.
|
inlineoverrideprotectedvirtual |
Synchronize the execution clock.
Reimplemented from Expression.
Reimplemented in ValueVectorFunction< value, metric, vectorType >, ValueVectorFunction< value, metric, FactorVector >, AllDifferentViolationValueToValue< paramValue, value >, AllDifferentSatisfactionValueToValue< paramValue, value >, AllDifferentViolationValueToValueMiniFactorVector< paramValue, value, metric >, ValueFunction< value >, NaryValueFactorVectorToValueFactorVectorFunc< value, metric >, ValueFunction< bindOper::OutputType >, ValueFunction< oper::OutputType >, and NaryValueScalarOrFactorVectorToValueFactorVectorFunc< value, metric >.
|
inline |
Find the factor serial of a given variable within the function.
|
inlineprotected |
Set the parameters of the expression.
|
inlinestaticprotected |
Define the given function in the system and get a function serial.
|
inlineprotected |
Define the given function within the system as a root function.
|
inlineprotected |
Return the root function serial in the system.
|
inlineprotected |
Set the root function serial in the system.