From 5283dc9d19326b0ab0a162e84d7142b7ff58ee90 Mon Sep 17 00:00:00 2001 From: Scott Stephens Date: Fri, 23 Sep 2016 16:21:47 -0500 Subject: [PATCH] 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 --- .../ObjectiveFunctions/LazyObjectiveFunctionBase.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Numerics/Optimization/ObjectiveFunctions/LazyObjectiveFunctionBase.cs b/src/Numerics/Optimization/ObjectiveFunctions/LazyObjectiveFunctionBase.cs index d8357772..5ec0aa0c 100644 --- a/src/Numerics/Optimization/ObjectiveFunctions/LazyObjectiveFunctionBase.cs +++ b/src/Numerics/Optimization/ObjectiveFunctions/LazyObjectiveFunctionBase.cs @@ -6,14 +6,14 @@ namespace MathNet.Numerics.Optimization.ObjectiveFunctions { Vector _point; - bool _hasFunctionValue; - double _functionValue; + protected bool _hasFunctionValue; + protected double _functionValue; - bool _hasGradientValue; - Vector _gradientValue; + protected bool _hasGradientValue; + protected Vector _gradientValue; - bool _hasHessianValue; - Matrix _hessianValue; + protected bool _hasHessianValue; + protected Matrix _hessianValue; protected LazyObjectiveFunctionBase(bool gradientSupported, bool hessianSupported) {