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;
bool _hasFunctionValue;
double _functionValue;
protected bool _hasFunctionValue;
protected double _functionValue;
bool _hasGradientValue;
Vector<double> _gradientValue;
protected bool _hasGradientValue;
protected Vector<double> _gradientValue;
bool _hasHessianValue;
Matrix<double> _hessianValue;
protected bool _hasHessianValue;
protected Matrix<double> _hessianValue;
protected LazyObjectiveFunctionBase(bool gradientSupported, bool hessianSupported)
{

Loading…
Cancel
Save