kangaroo  1.0
the cbls library
Public Types | Private Types | Private Member Functions | Private Attributes
WeightedSummationValueScalarToValueFactorVector< MaxiOrMini, paramValue, paramWeight, value, paramMetric, metric > Class Template Reference

Weighted summation value scalar to value factor vector. More...

#include <weightedSummationValueScalarToValueFactorVector.hpp>

Inheritance diagram for WeightedSummationValueScalarToValueFactorVector< MaxiOrMini, paramValue, paramWeight, value, paramMetric, metric >:
Inheritance graph
[legend]

Public Types

typedef paramWeight ParamWeightType
 Parameter weight type.
 
typedef paramValue ParamValueType
 Parameter value type.
 
typedef paramMetric ParamMetricType
 Parameter metric type.
 
typedef value ValueType
 Value type.
 
typedef metric MetricType
 Metric type.
 
- Public Types inherited from ValueVectorFunction< value, metric, FactorVector >
typedef value ValueType
 Value type.
 
typedef metric MetricType
 Metric type.
 

Static Public Member Functions

static WeightedSummationValueScalarToValueFactorVector< MaxiOrMini, paramValue, paramWeight, value, paramMetric, metric > * define (System *const pSystem, Dim const ParamCount, Expression *const *pParamExprs, paramWeight *pParamWeights, ParamSpecType *pParamSpecs=nullptr)
 Define a weighted sum value scalar to value vector in the system. More...
 
- 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...
 

Private Types

typedef DataTempBuff< paramValue, paramWeight >::Type ValueTempType
 Value temporarry type.
 
typedef DataTempBuff< ValueTempType, value >::Type ValueBuffType
 Value buffer type.
 
typedef DataTempBuff< paramMetric, paramWeight >::Type MetricTempType
 Metric temporarry type.
 
typedef DataTempBuff< MetricTempType, metric >::Type MetricBuffType
 Metric buffer type.
 

Private Member Functions

 ~WeightedSummationValueScalarToValueFactorVector ()
 Destructor. More...
 
 WeightedSummationValueScalarToValueFactorVector (System *const pSystem, Dim const ParamCount, Expression *const *pParamExprs, paramWeight *pParamWeights, ParamSpecType *pParamSpecs)
 Param constructor. More...
 
 WeightedSummationValueScalarToValueFactorVector (WeightedSummationValueScalarToValueFactorVector< MaxiOrMini, paramValue, paramWeight, value, paramMetric, metric > &&that) noexcept=delete
 Move constructor.
 
 WeightedSummationValueScalarToValueFactorVector (WeightedSummationValueScalarToValueFactorVector< MaxiOrMini, paramValue, paramWeight, value, paramMetric, metric > const &that)=delete
 Copy constructor.
 
WeightedSummationValueScalarToValueFactorVectoroperator= (WeightedSummationValueScalarToValueFactorVector< MaxiOrMini, paramValue, paramWeight, value, paramMetric, metric > &&that) noexcept=delete
 Move assignment.
 
WeightedSummationValueScalarToValueFactorVectoroperator= (WeightedSummationValueScalarToValueFactorVector< MaxiOrMini, paramValue, paramWeight, value, paramMetric, metric > const &that)=delete
 Copy assignment.
 
virtual void computeFinal ()
 Compute the expression. More...
 
virtual void executeAnew ()
 Execute the expression. More...
 
virtual void simulateAnew ()
 Simulate the expression. More...
 
virtual void executeIncr ()
 Execute the expression. More...
 
virtual void simulateIncr ()
 Simulate the expression. More...
 
Identity
Hash calcExprHash () const
 Calculate expression hash value. More...
 
virtual Bool equate (Expression const &theExpression) const
 Compare expressions for equality. More...
 

Private Attributes

kb< ValueRecord< paramValue > const * > mParamExprValueRecords
 Parameter expression value records.
 
kb< ScalarRecord< paramMetric > const * > mParamExprScalarRecords
 Parameter expression vector records.
 
kb< paramWeight > mParamWeights
 Parameter weights.
 
ValueBuffType cacheExecValue
 Execution cache value.
 
kb< MetricBuffType > * cacheExecVector
 Execution cache Vector.
 
kll< Serial > * tempChangedVector
 Vector that undergone changes.
 

Additional Inherited Members

- Public Member Functions inherited from ValueVectorFunction< value, metric, FactorVector >
virtual Wrap ExecWrappedValue () const overridefinal
 Execution value wrap. More...
 
virtual Wrap SimulWrappedValue () const overridefinal
 Simulation value wrap. More...
 
virtual Dim VectorFieldCount () const overridefinal
 Number of fields in the vectors. More...
 
virtual Wrap ExecWrappedVectorField (Order const MaxiOrMini, Serial const FieldSerial) const overridefinal
 Execution value wrap of a vector field. More...
 
virtual ValueRecord< value > const * ExprValueRecord () const overridefinal
 Expression value. More...
 
virtual VectorRecord< metric > const * ExprVectorRecord (Order const MaxiOrMini) const overridefinal
 Expression metric. More...
 
virtual VectorType ExprVectorType () const overridefinal
 Expression vector type. More...
 
virtual Serial ValueTypeSerial () const overridefinal
 Value type serial. More...
 
virtual Serial MetricTypeSerial () const overridefinal
 Metric type serial. More...
 
value ExecValue () const
 Execution value. More...
 
value SimulValue () const
 Simulation value. More...
 
Order MetricOptiOrder () const
 Metric optimisation ordering. More...
 
metric ExecVectorField (Order MaxiOrMini, Serial const FieldSerial) const
 Execution metric of a vector field. More...
 
- Public Member Functions inherited from Function
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...
 
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...
 
virtual ~Function ()
 Destructor. More...
 
Serial FuncVarToFactorSerial (Serial const VarSerial) const
 Find the factor serial for a given variable serial. 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...
 
Bool CompatibleValueMetricTypes () const
 Whether value and metric types are compatible. More...
 
virtual ScalarBase const * ExprScalarRecord (Order const MaxiOrMini) const
 Expression scalar record or null if no scalar is present. 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 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 inherited from Function
Index const NestingIndex
 Function nesting index; starts from 0.
 
Serial const FuncSerial
 Unique over all functions.
 
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.
 
- 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 inherited from NaryValueScalarToValueFactorVectorFunc< value, metric >
virtual ~NaryValueScalarToValueFactorVectorFunc ()
 Destructor. More...
 
 NaryValueScalarToValueFactorVectorFunc (System *const mSystem, Order const MaxiOrMini, Dim const ParamCount)
 Param constructor. More...
 
 NaryValueScalarToValueFactorVectorFunc (NaryValueScalarToValueFactorVectorFunc< value, metric > &&that) noexcept=delete
 Move constructor.
 
 NaryValueScalarToValueFactorVectorFunc (NaryValueScalarToValueFactorVectorFunc< value, metric > const &that)=delete
 Copy constructor.
 
NaryValueScalarToValueFactorVectorFunc< value, metric > & operator= (NaryValueScalarToValueFactorVectorFunc< value, metric > &&that) noexcept=delete
 Move assignment.
 
NaryValueScalarToValueFactorVectorFunc< value, metric > & operator= (NaryValueScalarToValueFactorVectorFunc< value, metric > const &that)=delete
 Copy assignment.
 
- Protected Member Functions inherited from ValueVectorFunction< value, metric, FactorVector >
virtual ~ValueVectorFunction ()
 Destructor. More...
 
 ValueVectorFunction (System *const pSystem, Order const MaxiOrMini, Dim const ParamCount)
 Param constructor. More...
 
 ValueVectorFunction (ValueVectorFunction< value, metric, vectorType > &&that) noexcept=delete
 Move constructor.
 
 ValueVectorFunction (ValueVectorFunction< value, metric, vectorType > const &that)=delete
 Copy constructor.
 
ValueVectorFunction< value, metric, vectorType > & operator= (ValueVectorFunction< value, metric, vectorType > &&that) noexcept=delete
 Move assignment.
 
ValueVectorFunction< value, metric, vectorType > & operator= (ValueVectorFunction< value, metric, vectorType > const &that)=delete
 Copy assignment.
 
virtual Wrap ExecWrappedScalar (Order const MaxiOrMini) const
 Execution scalar wrap of the expression—throws error. More...
 
virtual void syncExecClock ()
 Synchronise the execution clock. More...
 
virtual void syncSimulClock ()
 synchronise the simulation clock. More...
 
void defineExprValueRecord ()
 Define expression value. More...
 
void defineExprVectorRecord (Dim const FieldCount)
 Define vector record. More...
 
- Protected Member Functions inherited from Function
virtual void setupComputation ()
 Set up various things for computation. More...
 
virtual void adjustMemAuto () override
 Adjust memory requirement automatically. More...
 
void setFuncSerial (Serial const pSerial)
 Set function serial. More...
 
Hash calcExprHash () const
 Calculate expression hash value. More...
 
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...
 
 Function (System *const pSystem, Dim const ParamCount)
 Param constructor. More...
 
 Function (Function &&that) noexcept=delete
 Move constructor.
 
 Function (Function const &that)=delete
 Copy constructor.
 
Functionoperator= (Function &&that) noexcept=delete
 Move assignment.
 
Functionoperator= (Function const &that)=delete
 Copy assignment.
 
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...
 
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...
 
- 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.
 
Expressionoperator= (Expression &&that) noexcept=delete
 Move assignment.
 
Expressionoperator= (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 syncExecBatchClock ()
 Synchronize the execution batch clock. More...
 
virtual void syncSimulBatchClock ()
 Synchronize the simulation batch clock. More...
 
virtual Serial setPatron (Function *const pFunction, Serial ParamSerial)
 Set a patron in the expression and return patron serial. More...
 
- Static Protected Member Functions inherited from Function
static Serial defineWithinSystem (Function *const pFunction)
 Define the function in the system. More...
 
- Protected Attributes inherited from ValueVectorFunction< value, metric, FactorVector >
ValueRecord< value > * mExprValueRecord
 Point to the value record.
 
VectorRecord< metric > * mExprVectorRecord
 Point to the vector record.
 
Order const mMetricOptiOrder
 Maximisation or minimisation?
 
- Protected Attributes inherited from Function
Serial mRootFuncSerial
 Root function serial in the system.
 
- 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.
 

Detailed Description

template<Order MaxiOrMini, typename paramValue, typename paramWeight = paramValue, typename value = paramValue, typename paramMetric = paramValue, typename metric = paramMetric>
class WeightedSummationValueScalarToValueFactorVector< MaxiOrMini, paramValue, paramWeight, value, paramMetric, metric >

Weighted summation value scalar to value factor vector.

Template Parameters
MaxiOrMiniThe maximisation or minimisation order.
paramValueThe value type of the parameters.
paramWeightThe weight type of the parameters.
valueThe value type of the function–default is paramValue.
paramMetricThe metric type of the parameters–default is paramValue.
metricThe metric type of the function–default is paramMetric.

Constructor & Destructor Documentation

template<Order MaxiOrMini, typename paramValue , typename paramWeight , typename value , typename paramMetric , typename metric >
WeightedSummationValueScalarToValueFactorVector< MaxiOrMini, paramValue, paramWeight, value, paramMetric, metric >::~WeightedSummationValueScalarToValueFactorVector ( )
inlineprivate

Destructor.

template<Order MaxiOrMini, typename paramValue , typename paramWeight , typename value , typename paramMetric , typename metric >
WeightedSummationValueScalarToValueFactorVector< MaxiOrMini, paramValue, paramWeight, value, paramMetric, metric >::WeightedSummationValueScalarToValueFactorVector ( System *const  pSystem,
Dim const  ParamCount,
Expression *const *  pParamExprs,
paramWeight *  pParamWeights,
ParamSpecType pParamSpecs 
)
inlineprivate

Param constructor.

Member Function Documentation

template<Order MaxiOrMini, typename paramValue , typename paramWeight , typename value , typename paramMetric , typename metric >
void WeightedSummationValueScalarToValueFactorVector< MaxiOrMini, paramValue, paramWeight, value, paramMetric, metric >::computeFinal ( )
inlineprivatevirtual

Compute the expression.

Implements Function.

template<Order MaxiOrMini, typename paramValue , typename paramWeight , typename value , typename paramMetric , typename metric >
void WeightedSummationValueScalarToValueFactorVector< MaxiOrMini, paramValue, paramWeight, value, paramMetric, metric >::executeAnew ( )
inlineprivatevirtual

Compute the expression in execution mode.

Implements Expression.

template<Order MaxiOrMini, typename paramValue , typename paramWeight , typename value , typename paramMetric , typename metric >
void WeightedSummationValueScalarToValueFactorVector< MaxiOrMini, paramValue, paramWeight, value, paramMetric, metric >::simulateAnew ( )
inlineprivatevirtual

Compute the expression in simulation mode.

Implements Expression.

template<Order MaxiOrMini, typename paramValue , typename paramWeight , typename value , typename paramMetric , typename metric >
void WeightedSummationValueScalarToValueFactorVector< MaxiOrMini, paramValue, paramWeight, value, paramMetric, metric >::executeIncr ( )
inlineprivatevirtual

Compute the expression in execution mode.

Implements Expression.

template<Order MaxiOrMini, typename paramValue , typename paramWeight , typename value , typename paramMetric , typename metric >
void WeightedSummationValueScalarToValueFactorVector< MaxiOrMini, paramValue, paramWeight, value, paramMetric, metric >::simulateIncr ( )
inlineprivatevirtual

Compute the expression in simulation mode.

Implements Expression.

template<Order MaxiOrMini, typename paramValue , typename paramWeight , typename value , typename paramMetric , typename metric >
Hash WeightedSummationValueScalarToValueFactorVector< MaxiOrMini, paramValue, paramWeight, value, paramMetric, metric >::calcExprHash ( ) const
inlineprivate

Calculate hash value of the expression.

template<Order MaxiOrMini, typename paramValue , typename paramWeight , typename value , typename paramMetric , typename metric >
Bool WeightedSummationValueScalarToValueFactorVector< MaxiOrMini, paramValue, paramWeight, value, paramMetric, metric >::equate ( Expression const &  theExpression) const
inlineprivatevirtual

Compare two Expressions for equality.

Reimplemented from Function.


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