class mlpack::optimization::Function< FunctionType >
The Function class is a wrapper class for any FunctionType that will add any possible derived methods.
- Optimizers can expect FunctionTypes to have a wider array of functions than those FunctionTypes may actually implement.
- FunctionTypes don't need to implement every single method that an optimizer might require, just those from which every method can be inferred.
This class works by inheriting from a large set of "mixin" classes that provide missing functions, if needed. For instance, the AddGradient<> mixin will provide a Gradient() method if the given FunctionType implements an EvaluateWithGradient() method.
Since all of the casting is static and each of the mixin classes is an empty class, there should be no runtime overhead at all for this functionality. In addition, this class does not (to the best of my knowledge) rely on any undefined behavior.
The documentation for this class was generated from the following file:
Generated by 1.8.13