Browse Source

Optimization: Changes to LazyObjectiveFunctionBase

* Previous versions of the class did not allow subclasses to
initialize the value/gradient/hessian fields once and reuse the
memory for subsequent evaluations.
* This commit exposes raw value/gradient/hessian fields to
subclasses
v3
Scott Stephens 10 years ago
committed by Erik Ovegard
parent
commit
5283dc9d19
  1. 12
      src/Numerics/Optimization/ObjectiveFunctions/LazyObjectiveFunctionBase.cs

12
src/Numerics/Optimization/ObjectiveFunctions/LazyObjectiveFunctionBase.cs

@ -6,14 +6,14 @@ namespace MathNet.Numerics.Optimization.ObjectiveFunctions
{ {
Vector<double> _point; Vector<double> _point;
bool _hasFunctionValue; protected bool _hasFunctionValue;
double _functionValue; protected double _functionValue;
bool _hasGradientValue; protected bool _hasGradientValue;
Vector<double> _gradientValue; protected Vector<double> _gradientValue;
bool _hasHessianValue; protected bool _hasHessianValue;
Matrix<double> _hessianValue; protected Matrix<double> _hessianValue;
protected LazyObjectiveFunctionBase(bool gradientSupported, bool hessianSupported) protected LazyObjectiveFunctionBase(bool gradientSupported, bool hessianSupported)
{ {

Loading…
Cancel
Save