diff --git a/src/Numerics/Numerics.csproj b/src/Numerics/Numerics.csproj index 71693a57..d9b364b0 100644 --- a/src/Numerics/Numerics.csproj +++ b/src/Numerics/Numerics.csproj @@ -446,6 +446,7 @@ + diff --git a/src/Numerics/Optimization/Exceptions.cs b/src/Numerics/Optimization/Exceptions.cs index 841f97cb..c9c94f5b 100644 --- a/src/Numerics/Optimization/Exceptions.cs +++ b/src/Numerics/Optimization/Exceptions.cs @@ -34,7 +34,7 @@ namespace MathNet.Numerics.Optimization public EvaluationException(string message, double point) : base(message) { - this.Point = new DenseVector(1, point); + this.Point = DenseVector.Create(1, point); } public EvaluationException(string message, Exception inner_exception, Vector point) diff --git a/src/Numerics/Optimization/ObjectiveChecker1D.cs b/src/Numerics/Optimization/ObjectiveChecker1D.cs index ebd3ccc6..78484ec6 100644 --- a/src/Numerics/Optimization/ObjectiveChecker1D.cs +++ b/src/Numerics/Optimization/ObjectiveChecker1D.cs @@ -39,7 +39,7 @@ namespace MathNet.Numerics.Optimization } 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); } @@ -61,7 +61,7 @@ namespace MathNet.Numerics.Optimization } 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); } @@ -83,7 +83,7 @@ namespace MathNet.Numerics.Optimization } 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); } @@ -125,7 +125,7 @@ namespace MathNet.Numerics.Optimization } 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)); } } }