|
| Model () |
| Construct a default Model function object.
|
|
| Model (const ModelEvaluator< ResultRef, Args... > &evalfn, const Vec< Param > ¶ms={}, const ModelSerializer &serializerfn={}) |
| Construct a Model function object with given model evaluator function and its parameters. More...
|
|
| Model (const ModelCalculator< Result, Args... > &calcfn, const Vec< Param > ¶ms={}, const ModelSerializer &serializerfn={}) |
| Construct a Model function object with given direct model calculator and its parameters. More...
|
|
template<typename Fun , Requires<!isFunction< Fun >> = true> |
| Model (const Fun &f) |
| Construct a Model function object with either a model evaluator or a model calculator function. More...
|
|
auto | withMemoization () const -> Model |
| Return a new Model function object with memoization for the model calculator.
|
|
auto | apply (ResultRef res, const Args &... args) const -> void |
| Evaluate the model with given arguments.
|
|
auto | operator() (const Args &... args) const -> Result |
| Evaluate the model with given arguments and return the result of the evaluation.
|
|
auto | operator() (ResultRef res, const Args &... args) const -> void |
| Evaluate the model with given arguments and return the result of the evaluation.
|
|
auto | initialized () const -> bool |
| Return true if this Model function object has been initialized.
|
|
| operator bool () const |
| Return true if this Model function object has been initialized.
|
|
auto | evaluatorFn () const -> const ModelEvaluator< ResultRef, Args..., const Vec< Param > & > & |
| Return the model evaluator function of this Model function object.
|
|
auto | calculatorFn () const -> const ModelCalculator< Result, Args..., const Vec< Param > & > & |
| Return the model calculator function of this Model function object.
|
|
auto | serializerFn () const -> const ModelSerializer |
| Return the function that serializes the underlying model function to a Data object.
|
|
auto | params () const -> const Vec< Param > & |
| Return the model parameters of this Model function object.
|
|
auto | serialize () const -> Data |
| Return serialization of the underlying model function to a Data object.
|
|
template<typename Result, typename... Args>
class Reaktoro::Model< Result(Args...)>
The class used to represent a model function and its parameters.
Construct a Model function object with either a model evaluator or a model calculator function.
This constructor exists so that functions that are not wrapped into an std::function
object can be used to construct a Model function object. Without this constructor, an explicit wrap must be performed by the used. For example, Model(ModelCalculator<real(real,real)>([](real T, real P) { return A + B*T + C*T*P; }))
can be replaced with Model([](real T, real P) { return A + B*T + C*T*P; })
.
- Parameters
-
f | A model evaluator or a model calculator function. |