Browse Source
Merge pull request #542 from jnyrup/ArgumentChecks
Argument checks
spatial
Christoph Ruegg
9 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with
3 additions and
8 deletions
-
src/Numerics/Distance.cs
-
src/Numerics/Optimization/NelderMeadSimplex.cs
-
src/Numerics/Providers/LinearAlgebra/ManagedLinearAlgebraProvider.Complex.cs
|
|
|
@ -427,7 +427,7 @@ namespace MathNet.Numerics |
|
|
|
throw new ArgumentException(Resources.ArgumentVectorsSameLength); |
|
|
|
} |
|
|
|
|
|
|
|
if ((a.Length == 0 && b.Length == 0) || (a == null && b == null)) |
|
|
|
if (a.Length == 0 && b.Length == 0) |
|
|
|
{ |
|
|
|
return 0; |
|
|
|
} |
|
|
|
@ -473,7 +473,7 @@ namespace MathNet.Numerics |
|
|
|
throw new ArgumentException(Resources.ArgumentVectorsSameLength); |
|
|
|
} |
|
|
|
|
|
|
|
if ((a.Length == 0 && b.Length == 0) || (a == null && b == null)) |
|
|
|
if (a.Length == 0 && b.Length == 0) |
|
|
|
{ |
|
|
|
return 0; |
|
|
|
} |
|
|
|
|
|
|
|
@ -113,7 +113,7 @@ namespace MathNet.Numerics.Optimization |
|
|
|
if (initialGuess == null) |
|
|
|
throw new ArgumentNullException("initialGuess", "initialGuess must be initialized"); |
|
|
|
|
|
|
|
if (initialGuess == null) |
|
|
|
if (initalPertubation == null) |
|
|
|
throw new ArgumentNullException("initalPertubation", "initalPertubation must be initialized, if unknown use overloaded version of FindMinimum()"); |
|
|
|
|
|
|
|
SimplexConstant[] simplexConstants = SimplexConstant.CreateSimplexConstantsFromVectors(initialGuess,initalPertubation); |
|
|
|
|
|
|
|
@ -70,11 +70,6 @@ namespace MathNet.Numerics.Providers.LinearAlgebra |
|
|
|
throw new ArgumentException(Resources.ArgumentVectorsSameLength); |
|
|
|
} |
|
|
|
|
|
|
|
if (y.Length != x.Length) |
|
|
|
{ |
|
|
|
throw new ArgumentException(Resources.ArgumentVectorsSameLength); |
|
|
|
} |
|
|
|
|
|
|
|
if (alpha.IsZero()) |
|
|
|
{ |
|
|
|
y.Copy(result); |
|
|
|
|