Browse Source

Optimization: Check in forgotten file

(updated by cdrnet)
optimization-2
Scott Stephens 13 years ago
committed by Christoph Ruegg
parent
commit
eabd31cef5
  1. 1
      src/Numerics/Numerics.csproj
  2. 2
      src/Numerics/Optimization/Exceptions.cs
  3. 8
      src/Numerics/Optimization/ObjectiveChecker1D.cs

1
src/Numerics/Numerics.csproj

@ -446,6 +446,7 @@
<Compile Include="Threading\CommonParallel.cs" /> <Compile Include="Threading\CommonParallel.cs" />
<Compile Include="Trigonometry.cs" /> <Compile Include="Trigonometry.cs" />
<Compile Include="Window.cs" /> <Compile Include="Window.cs" />
<Compile Include="Optimization\ExitCondition.cs" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<EmbeddedResource Include="Properties\Resources.resx"> <EmbeddedResource Include="Properties\Resources.resx">

2
src/Numerics/Optimization/Exceptions.cs

@ -34,7 +34,7 @@ namespace MathNet.Numerics.Optimization
public EvaluationException(string message, double point) public EvaluationException(string message, double point)
: base(message) : base(message)
{ {
this.Point = new DenseVector(1, point); this.Point = DenseVector.Create(1, point);
} }
public EvaluationException(string message, Exception inner_exception, Vector<double> point) public EvaluationException(string message, Exception inner_exception, Vector<double> point)

8
src/Numerics/Optimization/ObjectiveChecker1D.cs

@ -39,7 +39,7 @@ namespace MathNet.Numerics.Optimization
} }
catch (Exception e) catch (Exception e)
{ {
throw new EvaluationException("Objective function evaluation failed.", e, new DenseVector(1, this.Point)); throw new EvaluationException("Objective function evaluation failed.", e, DenseVector.Create(1, this.Point));
} }
this.Checker.ValueChecker(tmp, this.InnerEvaluation.Point); this.Checker.ValueChecker(tmp, this.InnerEvaluation.Point);
} }
@ -61,7 +61,7 @@ namespace MathNet.Numerics.Optimization
} }
catch (Exception e) catch (Exception e)
{ {
throw new EvaluationException("Objective derivative evaluation failed.", e, new DenseVector(1, this.Point)); throw new EvaluationException("Objective derivative evaluation failed.", e, DenseVector.Create(1, this.Point));
} }
this.Checker.DerivativeChecker(tmp, this.InnerEvaluation.Point); this.Checker.DerivativeChecker(tmp, this.InnerEvaluation.Point);
} }
@ -83,7 +83,7 @@ namespace MathNet.Numerics.Optimization
} }
catch (Exception e) catch (Exception e)
{ {
throw new EvaluationException("Objective second derivative evaluation failed.", e, new DenseVector(1,this.Point)); throw new EvaluationException("Objective second derivative evaluation failed.", e, DenseVector.Create(1, this.Point));
} }
this.Checker.SecondDerivativeChecker(tmp, this.InnerEvaluation.Point); this.Checker.SecondDerivativeChecker(tmp, this.InnerEvaluation.Point);
} }
@ -125,7 +125,7 @@ namespace MathNet.Numerics.Optimization
} }
catch (Exception e) catch (Exception e)
{ {
throw new EvaluationException("Objective evaluation failed.", e, new DenseVector(1,point)); throw new EvaluationException("Objective evaluation failed.", e, DenseVector.Create(1, point));
} }
} }
} }

Loading…
Cancel
Save