diff --git a/src/Numerics.Tests/LinearAlgebraTests/VectorTests.cs b/src/Numerics.Tests/LinearAlgebraTests/VectorTests.cs index 3a255000..eb430550 100644 --- a/src/Numerics.Tests/LinearAlgebraTests/VectorTests.cs +++ b/src/Numerics.Tests/LinearAlgebraTests/VectorTests.cs @@ -30,7 +30,6 @@ using System; using MathNet.Numerics.LinearAlgebra; using MathNet.Numerics.LinearAlgebra.Storage; -using MathNet.Numerics.Properties; using NUnit.Framework; namespace MathNet.Numerics.UnitTests.LinearAlgebraTests @@ -77,7 +76,7 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests { Assert.That(() => DenseVectorStorage.OfInit(-1, index => 42), Throws.TypeOf() - .With.Message.Contains(Resources.ArgumentNotNegative)); + .With.Message.Contains("Value must not be negative (zero is ok).")); } [Test] @@ -85,7 +84,7 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests { Assert.That(() => DenseVectorStorage.OfValue(-1, 42), Throws.TypeOf() - .With.Message.Contains(Resources.ArgumentNotNegative)); + .With.Message.Contains("Value must not be negative (zero is ok).")); } [Test] @@ -93,7 +92,7 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests { Assert.That(() => SparseVectorStorage.OfInit(-1, index => 42), Throws.TypeOf() - .With.Message.Contains(Resources.ArgumentNotNegative)); + .With.Message.Contains("Value must not be negative (zero is ok).")); } [Test] @@ -101,7 +100,7 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests { Assert.That(() => SparseVectorStorage.OfValue(-1, 42), Throws.TypeOf() - .With.Message.Contains(Resources.ArgumentNotNegative)); + .With.Message.Contains("Value must not be negative (zero is ok).")); } } } diff --git a/src/Numerics/Combinatorics.cs b/src/Numerics/Combinatorics.cs index 63e66c9d..6769840f 100644 --- a/src/Numerics/Combinatorics.cs +++ b/src/Numerics/Combinatorics.cs @@ -30,7 +30,6 @@ using System; using System.Collections.Generic; using System.Linq; -using MathNet.Numerics.Properties; using MathNet.Numerics.Random; namespace MathNet.Numerics @@ -134,7 +133,7 @@ namespace MathNet.Numerics /// The random number generator to use. Optional; the default random source will be used if null. public static int[] GeneratePermutation(int n, System.Random randomSource = null) { - if (n < 0) throw new ArgumentOutOfRangeException(nameof(n), Resources.ArgumentNotNegative); + if (n < 0) throw new ArgumentOutOfRangeException(nameof(n), "Value must not be negative (zero is ok)."); int[] indices = new int[n]; for (int i = 0; i < indices.Length; i++) @@ -194,7 +193,7 @@ namespace MathNet.Numerics /// Boolean mask array of length N, for each item true if it is selected. public static bool[] GenerateCombination(int n, System.Random randomSource = null) { - if (n < 0) throw new ArgumentOutOfRangeException(nameof(n), Resources.ArgumentNotNegative); + if (n < 0) throw new ArgumentOutOfRangeException(nameof(n), "Value must not be negative (zero is ok)."); var random = randomSource ?? SystemRandomSource.Default; @@ -216,9 +215,9 @@ namespace MathNet.Numerics /// Boolean mask array of length N, for each item true if it is selected. public static bool[] GenerateCombination(int n, int k, System.Random randomSource = null) { - if (n < 0) throw new ArgumentOutOfRangeException(nameof(n), Resources.ArgumentNotNegative); - if (k < 0) throw new ArgumentOutOfRangeException(nameof(k), Resources.ArgumentNotNegative); - if (k > n) throw new ArgumentOutOfRangeException(nameof(k), string.Format(Resources.ArgumentOutOfRangeSmallerEqual, "k", "n")); + if (n < 0) throw new ArgumentOutOfRangeException(nameof(n), "Value must not be negative (zero is ok)."); + if (k < 0) throw new ArgumentOutOfRangeException(nameof(k), "Value must not be negative (zero is ok)."); + if (k > n) throw new ArgumentOutOfRangeException(nameof(k), $"{"k"} must be smaller than or equal to {"n"}."); var random = randomSource ?? SystemRandomSource.Default; @@ -261,8 +260,8 @@ namespace MathNet.Numerics { T[] array = data as T[] ?? data.ToArray(); - if (elementsToChoose < 0) throw new ArgumentOutOfRangeException(nameof(elementsToChoose), Resources.ArgumentNotNegative); - if (elementsToChoose > array.Length) throw new ArgumentOutOfRangeException(nameof(elementsToChoose), string.Format(Resources.ArgumentOutOfRangeSmallerEqual, "elementsToChoose", "data.Count")); + if (elementsToChoose < 0) throw new ArgumentOutOfRangeException(nameof(elementsToChoose), "Value must not be negative (zero is ok)."); + if (elementsToChoose > array.Length) throw new ArgumentOutOfRangeException(nameof(elementsToChoose), $"elementsToChoose must be smaller than or equal to data.Count."); bool[] mask = GenerateCombination(array.Length, elementsToChoose, randomSource); @@ -284,8 +283,8 @@ namespace MathNet.Numerics /// Integer mask array of length N, for each item the number of times it was selected. public static int[] GenerateCombinationWithRepetition(int n, int k, System.Random randomSource = null) { - if (n < 0) throw new ArgumentOutOfRangeException(nameof(n), Resources.ArgumentNotNegative); - if (k < 0) throw new ArgumentOutOfRangeException(nameof(k), Resources.ArgumentNotNegative); + if (n < 0) throw new ArgumentOutOfRangeException(nameof(n), "Value must not be negative (zero is ok)."); + if (k < 0) throw new ArgumentOutOfRangeException(nameof(k), "Value must not be negative (zero is ok)."); var random = randomSource ?? SystemRandomSource.Default; @@ -307,7 +306,7 @@ namespace MathNet.Numerics /// The chosen combination with repetition, in the original order. public static IEnumerable SelectCombinationWithRepetition(this IEnumerable data, int elementsToChoose, System.Random randomSource = null) { - if (elementsToChoose < 0) throw new ArgumentOutOfRangeException(nameof(elementsToChoose), Resources.ArgumentNotNegative); + if (elementsToChoose < 0) throw new ArgumentOutOfRangeException(nameof(elementsToChoose), "Value must not be negative (zero is ok)."); T[] array = data as T[] ?? data.ToArray(); int[] mask = GenerateCombinationWithRepetition(array.Length, elementsToChoose, randomSource); @@ -331,9 +330,9 @@ namespace MathNet.Numerics /// An array of length K that contains the indices of the selections as integers of the interval [0, N). public static int[] GenerateVariation(int n, int k, System.Random randomSource = null) { - if (n < 0) throw new ArgumentOutOfRangeException(nameof(n), Resources.ArgumentNotNegative); - if (k < 0) throw new ArgumentOutOfRangeException(nameof(k), Resources.ArgumentNotNegative); - if (k > n) throw new ArgumentOutOfRangeException(nameof(k), string.Format(Resources.ArgumentOutOfRangeSmallerEqual, "k", "n")); + if (n < 0) throw new ArgumentOutOfRangeException(nameof(n), "Value must not be negative (zero is ok)."); + if (k < 0) throw new ArgumentOutOfRangeException(nameof(k), "Value must not be negative (zero is ok)."); + if (k > n) throw new ArgumentOutOfRangeException(nameof(k), $"k must be smaller than or equal to n."); var random = randomSource ?? SystemRandomSource.Default; @@ -368,8 +367,8 @@ namespace MathNet.Numerics var random = randomSource ?? SystemRandomSource.Default; T[] array = data.ToArray(); - if (elementsToChoose < 0) throw new ArgumentOutOfRangeException(nameof(elementsToChoose), Resources.ArgumentNotNegative); - if (elementsToChoose > array.Length) throw new ArgumentOutOfRangeException(nameof(elementsToChoose), string.Format(Resources.ArgumentOutOfRangeSmallerEqual, "elementsToChoose", "data.Count")); + if (elementsToChoose < 0) throw new ArgumentOutOfRangeException(nameof(elementsToChoose), "Value must not be negative (zero is ok)."); + if (elementsToChoose > array.Length) throw new ArgumentOutOfRangeException(nameof(elementsToChoose), "elementsToChoose must be smaller than or equal to data.Count."); // Partial Fisher-Yates Shuffling for (int i = array.Length - 1; i >= array.Length - elementsToChoose; i--) @@ -389,8 +388,8 @@ namespace MathNet.Numerics /// An array of length K that contains the indices of the selections as integers of the interval [0, N). public static int[] GenerateVariationWithRepetition(int n, int k, System.Random randomSource = null) { - if (n < 0) throw new ArgumentOutOfRangeException(nameof(n), Resources.ArgumentNotNegative); - if (k < 0) throw new ArgumentOutOfRangeException(nameof(k), Resources.ArgumentNotNegative); + if (n < 0) throw new ArgumentOutOfRangeException(nameof(n), "Value must not be negative (zero is ok)."); + if (k < 0) throw new ArgumentOutOfRangeException(nameof(k), "Value must not be negative (zero is ok)."); var random = randomSource ?? SystemRandomSource.Default; @@ -408,7 +407,7 @@ namespace MathNet.Numerics /// The chosen variation with repetition, in random order. public static IEnumerable SelectVariationWithRepetition(this IEnumerable data, int elementsToChoose, System.Random randomSource = null) { - if (elementsToChoose < 0) throw new ArgumentOutOfRangeException(nameof(elementsToChoose), Resources.ArgumentNotNegative); + if (elementsToChoose < 0) throw new ArgumentOutOfRangeException(nameof(elementsToChoose), "Value must not be negative (zero is ok)."); T[] array = data as T[] ?? data.ToArray(); int[] indices = GenerateVariationWithRepetition(array.Length, elementsToChoose, randomSource); diff --git a/src/Numerics/Compatibility.cs b/src/Numerics/Compatibility.cs index 7c638e37..cecd7d4c 100644 --- a/src/Numerics/Compatibility.cs +++ b/src/Numerics/Compatibility.cs @@ -104,7 +104,7 @@ namespace MathNet.Numerics var action = actions[i]; if (action == null) { - throw new ArgumentException(String.Format(Properties.Resources.ArgumentItemNull, nameof(actions)), nameof(actions)); + throw new ArgumentException($"At least one item of {nameof(actions)} is a null reference (Nothing in Visual Basic).", nameof(actions)); } tasks[i] = Task.Factory.StartNew(action, parallelOptions.CancellationToken, TaskCreationOptions.None, parallelOptions.TaskScheduler); diff --git a/src/Numerics/Distance.cs b/src/Numerics/Distance.cs index 4ad7c389..c1cfac51 100644 --- a/src/Numerics/Distance.cs +++ b/src/Numerics/Distance.cs @@ -30,7 +30,6 @@ using System; using System.Collections.Generic; using MathNet.Numerics.LinearAlgebra; -using MathNet.Numerics.Properties; using MathNet.Numerics.Providers.LinearAlgebra; using MathNet.Numerics.Statistics; @@ -56,7 +55,7 @@ namespace MathNet.Numerics { if (a.Length != b.Length) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } double sum = 0d; @@ -74,7 +73,7 @@ namespace MathNet.Numerics { if (a.Length != b.Length) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } float sum = 0f; @@ -125,7 +124,7 @@ namespace MathNet.Numerics { if (a.Length != b.Length) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } var diff = new double[a.Length]; @@ -140,7 +139,7 @@ namespace MathNet.Numerics { if (a.Length != b.Length) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } var diff = new float[a.Length]; @@ -236,7 +235,7 @@ namespace MathNet.Numerics { if (a.Length != b.Length) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } double max = Math.Abs(a[0] - b[0]); @@ -258,7 +257,7 @@ namespace MathNet.Numerics { if (a.Length != b.Length) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } float max = Math.Abs(a[0] - b[0]); @@ -288,7 +287,7 @@ namespace MathNet.Numerics { if (a.Length != b.Length) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } if (p < 0d) @@ -326,7 +325,7 @@ namespace MathNet.Numerics { if (a.Length != b.Length) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } if (p < 0d) @@ -364,7 +363,7 @@ namespace MathNet.Numerics { if (a.Length != b.Length) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } double sum = 0d; @@ -382,7 +381,7 @@ namespace MathNet.Numerics { if (a.Length != b.Length) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } float sum = 0f; @@ -400,7 +399,7 @@ namespace MathNet.Numerics { if (a.Length != b.Length) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } var ab = LinearAlgebraControl.Provider.DotProduct(a, b); @@ -416,7 +415,7 @@ namespace MathNet.Numerics { if (a.Length != b.Length) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } var ab = LinearAlgebraControl.Provider.DotProduct(a, b); @@ -432,7 +431,7 @@ namespace MathNet.Numerics { if (a.Length != b.Length) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } int count = 0; @@ -453,7 +452,7 @@ namespace MathNet.Numerics { if (a.Length != b.Length) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } int count = 0; @@ -497,7 +496,7 @@ namespace MathNet.Numerics if (a.Length != b.Length) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } if (a.Length == 0 && b.Length == 0) @@ -543,7 +542,7 @@ namespace MathNet.Numerics if (a.Length != b.Length) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } if (a.Length == 0 && b.Length == 0) diff --git a/src/Numerics/Distributions/Bernoulli.cs b/src/Numerics/Distributions/Bernoulli.cs index 2cf69852..8ff122d3 100644 --- a/src/Numerics/Distributions/Bernoulli.cs +++ b/src/Numerics/Distributions/Bernoulli.cs @@ -30,7 +30,6 @@ using System; using System.Collections.Generic; using System.Linq; -using MathNet.Numerics.Properties; using MathNet.Numerics.Random; using MathNet.Numerics.Threading; @@ -57,7 +56,7 @@ namespace MathNet.Numerics.Distributions { if (!IsValidParameterSet(p)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } _random = SystemRandomSource.Default; @@ -74,7 +73,7 @@ namespace MathNet.Numerics.Distributions { if (!IsValidParameterSet(p)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } _random = randomSource ?? SystemRandomSource.Default; @@ -231,7 +230,7 @@ namespace MathNet.Numerics.Distributions { if (!(p >= 0.0 && p <= 1.0)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } if (k == 0) @@ -257,7 +256,7 @@ namespace MathNet.Numerics.Distributions { if (!(p >= 0.0 && p <= 1.0)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } if (k == 0) @@ -279,7 +278,7 @@ namespace MathNet.Numerics.Distributions { if (!(p >= 0.0 && p <= 1.0)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } if (x < 0.0) @@ -367,7 +366,7 @@ namespace MathNet.Numerics.Distributions { if (!(p >= 0.0 && p <= 1.0)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return SampleUnchecked(rnd, p); @@ -383,7 +382,7 @@ namespace MathNet.Numerics.Distributions { if (!(p >= 0.0 && p <= 1.0)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return SamplesUnchecked(rnd, p); @@ -400,7 +399,7 @@ namespace MathNet.Numerics.Distributions { if (!(p >= 0.0 && p <= 1.0)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } SamplesUnchecked(rnd, values, p); @@ -415,7 +414,7 @@ namespace MathNet.Numerics.Distributions { if (!(p >= 0.0 && p <= 1.0)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return SampleUnchecked(SystemRandomSource.Default, p); @@ -430,7 +429,7 @@ namespace MathNet.Numerics.Distributions { if (!(p >= 0.0 && p <= 1.0)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return SamplesUnchecked(SystemRandomSource.Default, p); @@ -446,7 +445,7 @@ namespace MathNet.Numerics.Distributions { if (!(p >= 0.0 && p <= 1.0)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } SamplesUnchecked(SystemRandomSource.Default, values, p); diff --git a/src/Numerics/Distributions/Beta.cs b/src/Numerics/Distributions/Beta.cs index e2c45631..591317fe 100644 --- a/src/Numerics/Distributions/Beta.cs +++ b/src/Numerics/Distributions/Beta.cs @@ -29,7 +29,6 @@ using System; using System.Collections.Generic; -using MathNet.Numerics.Properties; using MathNet.Numerics.Random; using MathNet.Numerics.RootFinding; using MathNet.Numerics.Threading; @@ -65,7 +64,7 @@ namespace MathNet.Numerics.Distributions { if (!IsValidParameterSet(a, b)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } _random = SystemRandomSource.Default; @@ -83,7 +82,7 @@ namespace MathNet.Numerics.Distributions { if (!IsValidParameterSet(a, b)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } _random = randomSource ?? SystemRandomSource.Default; @@ -432,7 +431,7 @@ namespace MathNet.Numerics.Distributions { if (a < 0.0 || b < 0.0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } if (x < 0.0 || x > 1.0) @@ -501,7 +500,7 @@ namespace MathNet.Numerics.Distributions { if (a < 0.0 || b < 0.0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } if (x < 0.0 || x > 1.0) @@ -563,7 +562,7 @@ namespace MathNet.Numerics.Distributions { if (a < 0.0 || b < 0.0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } if (x < 0.0) @@ -633,7 +632,7 @@ namespace MathNet.Numerics.Distributions { if (a < 0.0 || b < 0.0 || p < 0.0 || p > 1.0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return Brent.FindRoot(x => SpecialFunctions.BetaRegularized(a, b, x) - p, 0.0, 1.0, accuracy: 1e-12); @@ -650,7 +649,7 @@ namespace MathNet.Numerics.Distributions { if (a < 0.0 || b < 0.0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return SampleUnchecked(rnd, a, b); @@ -667,7 +666,7 @@ namespace MathNet.Numerics.Distributions { if (a < 0.0 || b < 0.0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return SamplesUnchecked(rnd, a, b); @@ -685,7 +684,7 @@ namespace MathNet.Numerics.Distributions { if (a < 0.0 || b < 0.0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } SamplesUnchecked(rnd, values, a, b); @@ -701,7 +700,7 @@ namespace MathNet.Numerics.Distributions { if (a < 0.0 || b < 0.0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return SampleUnchecked(SystemRandomSource.Default, a, b); @@ -717,7 +716,7 @@ namespace MathNet.Numerics.Distributions { if (a < 0.0 || b < 0.0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return SamplesUnchecked(SystemRandomSource.Default, a, b); @@ -734,7 +733,7 @@ namespace MathNet.Numerics.Distributions { if (a < 0.0 || b < 0.0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } SamplesUnchecked(SystemRandomSource.Default, values, a, b); diff --git a/src/Numerics/Distributions/BetaBinomial.cs b/src/Numerics/Distributions/BetaBinomial.cs index af9661bf..b2727b85 100644 --- a/src/Numerics/Distributions/BetaBinomial.cs +++ b/src/Numerics/Distributions/BetaBinomial.cs @@ -34,7 +34,6 @@ using System; using System.Collections.Generic; -using MathNet.Numerics.Properties; using MathNet.Numerics.Random; namespace MathNet.Numerics.Distributions @@ -65,7 +64,7 @@ namespace MathNet.Numerics.Distributions { if (!IsValidParameterSet(n, a, b)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } _random = SystemRandomSource.Default; @@ -85,7 +84,7 @@ namespace MathNet.Numerics.Distributions { if (!IsValidParameterSet(n,a,b)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } _random = randomSource ?? SystemRandomSource.Default; @@ -226,7 +225,7 @@ namespace MathNet.Numerics.Distributions { if (!IsValidParameterSet(n, a, b, k)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } if (k > n) @@ -251,7 +250,7 @@ namespace MathNet.Numerics.Distributions { if (!IsValidParameterSet(n, a, b, k)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return SpecialFunctions.BinomialLn((n), k) @@ -272,7 +271,7 @@ namespace MathNet.Numerics.Distributions { if (!IsValidParameterSet(n,a,b,x)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } double accumulator = 0; @@ -357,7 +356,7 @@ namespace MathNet.Numerics.Distributions { if (!IsValidParameterSet(n,a,b)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return SampleUnchecked(rnd, n, a, b); } @@ -374,7 +373,7 @@ namespace MathNet.Numerics.Distributions { if (!IsValidParameterSet(n, a, b)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } SamplesUnchecked(rnd, values, n, a, b); @@ -391,7 +390,7 @@ namespace MathNet.Numerics.Distributions { if (!IsValidParameterSet(n, a, b)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return SamplesUnchecked(_random, n, a, b); } @@ -407,7 +406,7 @@ namespace MathNet.Numerics.Distributions { if (!IsValidParameterSet(n, a, b)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } SamplesUnchecked(_random, values, n, a, b); diff --git a/src/Numerics/Distributions/BetaScaled.cs b/src/Numerics/Distributions/BetaScaled.cs index ef8fdd92..aa90a06d 100644 --- a/src/Numerics/Distributions/BetaScaled.cs +++ b/src/Numerics/Distributions/BetaScaled.cs @@ -29,7 +29,6 @@ using System; using System.Collections.Generic; -using MathNet.Numerics.Properties; using MathNet.Numerics.Random; using MathNet.Numerics.Threading; @@ -55,7 +54,7 @@ namespace MathNet.Numerics.Distributions { if (!IsValidParameterSet(a, b, location, scale)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } _random = SystemRandomSource.Default; @@ -77,7 +76,7 @@ namespace MathNet.Numerics.Distributions { if (!IsValidParameterSet(a, b, location, scale)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } _random = randomSource ?? SystemRandomSource.Default; @@ -100,7 +99,7 @@ namespace MathNet.Numerics.Distributions { if (min > max || likely > max || likely < min) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } // specified to make the formulas match the literature; @@ -413,7 +412,7 @@ namespace MathNet.Numerics.Distributions { if (!(a > 0.0 && b > 0.0 && scale > 0.0) || double.IsNaN(location)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return Beta.PDF(a, b, (x - location)/scale)/Math.Abs(scale); @@ -433,7 +432,7 @@ namespace MathNet.Numerics.Distributions { if (!(a > 0.0 && b > 0.0 && scale > 0.0) || double.IsNaN(location)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return Beta.PDFLn(a, b, (x - location)/scale) - Math.Log(Math.Abs(scale)); @@ -453,7 +452,7 @@ namespace MathNet.Numerics.Distributions { if (!(a > 0.0 && b > 0.0 && scale > 0.0) || double.IsNaN(location)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return Beta.CDF(a, b, (x - location) / scale); @@ -475,7 +474,7 @@ namespace MathNet.Numerics.Distributions { if (!(a > 0.0 && b > 0.0 && scale > 0.0) || double.IsNaN(location)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return Beta.InvCDF(a, b, p)*scale + location; @@ -494,7 +493,7 @@ namespace MathNet.Numerics.Distributions { if (!(a > 0.0 && b > 0.0 && scale > 0.0) || double.IsNaN(location)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return SampleUnchecked(rnd, a, b, location, scale); @@ -513,7 +512,7 @@ namespace MathNet.Numerics.Distributions { if (!(a > 0.0 && b > 0.0 && scale > 0.0) || double.IsNaN(location)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return SamplesUnchecked(rnd, a, b, location, scale); @@ -533,7 +532,7 @@ namespace MathNet.Numerics.Distributions { if (!(a > 0.0 && b > 0.0 && scale > 0.0) || double.IsNaN(location)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } SamplesUnchecked(rnd, values, a, b, location, scale); @@ -551,7 +550,7 @@ namespace MathNet.Numerics.Distributions { if (!(a > 0.0 && b > 0.0 && scale > 0.0) || double.IsNaN(location)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return SampleUnchecked(SystemRandomSource.Default, a, b, location, scale); @@ -569,7 +568,7 @@ namespace MathNet.Numerics.Distributions { if (!(a > 0.0 && b > 0.0 && scale > 0.0) || double.IsNaN(location)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return SamplesUnchecked(SystemRandomSource.Default, a, b, location, scale); @@ -588,7 +587,7 @@ namespace MathNet.Numerics.Distributions { if (!(a > 0.0 && b > 0.0 && scale > 0.0) || double.IsNaN(location)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } SamplesUnchecked(SystemRandomSource.Default, values, a, b, location, scale); diff --git a/src/Numerics/Distributions/Binomial.cs b/src/Numerics/Distributions/Binomial.cs index f5516089..dc9e3ee5 100644 --- a/src/Numerics/Distributions/Binomial.cs +++ b/src/Numerics/Distributions/Binomial.cs @@ -29,7 +29,6 @@ using System; using System.Collections.Generic; -using MathNet.Numerics.Properties; using MathNet.Numerics.Random; using MathNet.Numerics.Threading; @@ -61,7 +60,7 @@ namespace MathNet.Numerics.Distributions { if (!IsValidParameterSet(p, n)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } _random = SystemRandomSource.Default; @@ -81,7 +80,7 @@ namespace MathNet.Numerics.Distributions { if (!IsValidParameterSet(p, n)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } _random = randomSource ?? SystemRandomSource.Default; @@ -270,7 +269,7 @@ namespace MathNet.Numerics.Distributions { if (!(p >= 0.0 && p <= 1.0 && n >= 0)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } if (k < 0 || k > n) @@ -302,7 +301,7 @@ namespace MathNet.Numerics.Distributions { if (!(p >= 0.0 && p <= 1.0 && n >= 0)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } if (k < 0 || k > n) @@ -335,7 +334,7 @@ namespace MathNet.Numerics.Distributions { if (!(p >= 0.0 && p <= 1.0 && n >= 0)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } if (x < 0.0) @@ -434,7 +433,7 @@ namespace MathNet.Numerics.Distributions { if (!(p >= 0.0 && p <= 1.0 && n >= 0)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return SampleUnchecked(rnd, p, n); @@ -451,7 +450,7 @@ namespace MathNet.Numerics.Distributions { if (!(p >= 0.0 && p <= 1.0 && n >= 0)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return SamplesUnchecked(rnd, p, n); @@ -469,7 +468,7 @@ namespace MathNet.Numerics.Distributions { if (!(p >= 0.0 && p <= 1.0 && n >= 0)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } SamplesUnchecked(rnd, values, p, n); @@ -485,7 +484,7 @@ namespace MathNet.Numerics.Distributions { if (!(p >= 0.0 && p <= 1.0 && n >= 0)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return SampleUnchecked(SystemRandomSource.Default, p, n); @@ -501,7 +500,7 @@ namespace MathNet.Numerics.Distributions { if (!(p >= 0.0 && p <= 1.0 && n >= 0)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return SamplesUnchecked(SystemRandomSource.Default, p, n); @@ -518,7 +517,7 @@ namespace MathNet.Numerics.Distributions { if (!(p >= 0.0 && p <= 1.0 && n >= 0)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } SamplesUnchecked(SystemRandomSource.Default, values, p, n); diff --git a/src/Numerics/Distributions/Burr.cs b/src/Numerics/Distributions/Burr.cs index f485afaa..a875f842 100644 --- a/src/Numerics/Distributions/Burr.cs +++ b/src/Numerics/Distributions/Burr.cs @@ -27,7 +27,6 @@ // OTHER DEALINGS IN THE SOFTWARE. // -using MathNet.Numerics.Properties; using MathNet.Numerics.Random; using System; using System.Collections.Generic; @@ -64,7 +63,7 @@ namespace MathNet.Numerics.Distributions { if (!IsValidParameterSet(a, c, k)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } _random = randomSource ?? SystemRandomSource.Default; this.a = a; @@ -197,7 +196,7 @@ namespace MathNet.Numerics.Distributions { if (!IsValidParameterSet(a, c, k)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return SampleUnchecked(rnd, a, c, k); } @@ -214,7 +213,7 @@ namespace MathNet.Numerics.Distributions { if (!IsValidParameterSet(a, c, k)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } SamplesUnchecked(rnd, values, a, c, k); } @@ -231,7 +230,7 @@ namespace MathNet.Numerics.Distributions { if (!IsValidParameterSet(a, c, k)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return SamplesUnchecked(rnd, a, c, k); } @@ -277,7 +276,7 @@ namespace MathNet.Numerics.Distributions { if (n > k * c) { - throw new ArgumentException(Resources.ArgumentParameterSetInvalid); + throw new ArgumentException("The chosen parameter set is invalid (probably some value is out of range)."); } var lambda_n = (n / c) * SpecialFunctions.Gamma(n / c) * SpecialFunctions.Gamma(k - n / c); return Math.Pow(a, n) * lambda_n / SpecialFunctions.Gamma(k); @@ -329,7 +328,7 @@ namespace MathNet.Numerics.Distributions { if (!IsValidParameterSet(a, c, k)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return DensityImpl(a, c, k, x); } @@ -347,7 +346,7 @@ namespace MathNet.Numerics.Distributions { if (!IsValidParameterSet(a, c, k)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return DensityLnImpl(a, c, k, x); } @@ -365,7 +364,7 @@ namespace MathNet.Numerics.Distributions { if (!IsValidParameterSet(a, c, k)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return CumulativeDistributionImpl(a, c, k, x); } diff --git a/src/Numerics/Distributions/Categorical.cs b/src/Numerics/Distributions/Categorical.cs index 70bf1152..ba22fafd 100644 --- a/src/Numerics/Distributions/Categorical.cs +++ b/src/Numerics/Distributions/Categorical.cs @@ -30,7 +30,6 @@ using System; using System.Collections.Generic; using System.Linq; -using MathNet.Numerics.Properties; using MathNet.Numerics.Random; using MathNet.Numerics.Statistics; using MathNet.Numerics.Threading; @@ -80,7 +79,7 @@ namespace MathNet.Numerics.Distributions { if (Control.CheckDistributionParameters && !IsValidProbabilityMass(probabilityMass)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } _random = randomSource ?? SystemRandomSource.Default; @@ -128,7 +127,7 @@ namespace MathNet.Numerics.Distributions if (Control.CheckDistributionParameters && !IsValidProbabilityMass(p)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } // Extract unnormalized cumulative distribution @@ -389,7 +388,7 @@ namespace MathNet.Numerics.Distributions { if (Control.CheckDistributionParameters && !IsValidProbabilityMass(probabilityMass)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } if (k < 0) @@ -429,7 +428,7 @@ namespace MathNet.Numerics.Distributions { if (Control.CheckDistributionParameters && !IsValidProbabilityMass(probabilityMass)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } if (x < 0.0) @@ -458,7 +457,7 @@ namespace MathNet.Numerics.Distributions { if (Control.CheckDistributionParameters && !IsValidProbabilityMass(probabilityMass)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } if (probability < 0.0 || probability > 1.0 || double.IsNaN(probability)) @@ -488,7 +487,7 @@ namespace MathNet.Numerics.Distributions { if (Control.CheckDistributionParameters && !IsValidCumulativeDistribution(cdfUnnormalized)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } if (probability < 0.0 || probability > 1.0 || double.IsNaN(probability)) @@ -629,7 +628,7 @@ namespace MathNet.Numerics.Distributions { if (Control.CheckDistributionParameters && !IsValidProbabilityMass(probabilityMass)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } var cdf = ProbabilityMassToCumulativeDistribution(probabilityMass); @@ -646,7 +645,7 @@ namespace MathNet.Numerics.Distributions { if (Control.CheckDistributionParameters && !IsValidProbabilityMass(probabilityMass)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } var cdf = ProbabilityMassToCumulativeDistribution(probabilityMass); @@ -664,7 +663,7 @@ namespace MathNet.Numerics.Distributions { if (Control.CheckDistributionParameters && !IsValidProbabilityMass(probabilityMass)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } var cdf = ProbabilityMassToCumulativeDistribution(probabilityMass); @@ -680,7 +679,7 @@ namespace MathNet.Numerics.Distributions { if (Control.CheckDistributionParameters && !IsValidProbabilityMass(probabilityMass)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } var cdf = ProbabilityMassToCumulativeDistribution(probabilityMass); @@ -696,7 +695,7 @@ namespace MathNet.Numerics.Distributions { if (Control.CheckDistributionParameters && !IsValidProbabilityMass(probabilityMass)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } var cdf = ProbabilityMassToCumulativeDistribution(probabilityMass); @@ -713,7 +712,7 @@ namespace MathNet.Numerics.Distributions { if (Control.CheckDistributionParameters && !IsValidProbabilityMass(probabilityMass)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } var cdf = ProbabilityMassToCumulativeDistribution(probabilityMass); @@ -730,7 +729,7 @@ namespace MathNet.Numerics.Distributions { if (Control.CheckDistributionParameters && !IsValidCumulativeDistribution(cdfUnnormalized)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return SampleUnchecked(rnd, cdfUnnormalized); @@ -746,7 +745,7 @@ namespace MathNet.Numerics.Distributions { if (Control.CheckDistributionParameters && !IsValidCumulativeDistribution(cdfUnnormalized)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return SamplesUnchecked(rnd, cdfUnnormalized); @@ -763,7 +762,7 @@ namespace MathNet.Numerics.Distributions { if (Control.CheckDistributionParameters && !IsValidCumulativeDistribution(cdfUnnormalized)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } SamplesUnchecked(rnd, values, cdfUnnormalized); @@ -778,7 +777,7 @@ namespace MathNet.Numerics.Distributions { if (Control.CheckDistributionParameters && !IsValidCumulativeDistribution(cdfUnnormalized)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return SampleUnchecked(SystemRandomSource.Default, cdfUnnormalized); @@ -793,7 +792,7 @@ namespace MathNet.Numerics.Distributions { if (Control.CheckDistributionParameters && !IsValidCumulativeDistribution(cdfUnnormalized)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return SamplesUnchecked(SystemRandomSource.Default, cdfUnnormalized); @@ -809,7 +808,7 @@ namespace MathNet.Numerics.Distributions { if (Control.CheckDistributionParameters && !IsValidCumulativeDistribution(cdfUnnormalized)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } SamplesUnchecked(SystemRandomSource.Default, values, cdfUnnormalized); diff --git a/src/Numerics/Distributions/Cauchy.cs b/src/Numerics/Distributions/Cauchy.cs index b129465a..c8af2860 100644 --- a/src/Numerics/Distributions/Cauchy.cs +++ b/src/Numerics/Distributions/Cauchy.cs @@ -29,7 +29,6 @@ using System; using System.Collections.Generic; -using MathNet.Numerics.Properties; using MathNet.Numerics.Random; using MathNet.Numerics.Threading; @@ -63,7 +62,7 @@ namespace MathNet.Numerics.Distributions { if (!IsValidParameterSet(location, scale)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } _random = SystemRandomSource.Default; @@ -81,7 +80,7 @@ namespace MathNet.Numerics.Distributions { if (!IsValidParameterSet(location, scale)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } _random = randomSource ?? SystemRandomSource.Default; @@ -281,7 +280,7 @@ namespace MathNet.Numerics.Distributions { if (scale <= 0.0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return 1.0/(Constants.Pi*scale*(1.0 + (((x - location)/scale)*((x - location)/scale)))); @@ -299,7 +298,7 @@ namespace MathNet.Numerics.Distributions { if (scale <= 0.0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return -Math.Log(Constants.Pi*scale*(1.0 + (((x - location)/scale)*((x - location)/scale)))); @@ -317,7 +316,7 @@ namespace MathNet.Numerics.Distributions { if (scale <= 0.0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return Math.Atan((x - location)/scale)/Constants.Pi + 0.5; @@ -336,7 +335,7 @@ namespace MathNet.Numerics.Distributions { if (scale <= 0.0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return p <= 0.0 ? double.NegativeInfinity : p >= 1.0 ? double.PositiveInfinity @@ -354,7 +353,7 @@ namespace MathNet.Numerics.Distributions { if (scale <= 0.0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return SampleUnchecked(rnd, location, scale); @@ -371,7 +370,7 @@ namespace MathNet.Numerics.Distributions { if (scale <= 0.0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return SamplesUnchecked(rnd, location, scale); @@ -389,7 +388,7 @@ namespace MathNet.Numerics.Distributions { if (scale <= 0.0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } SamplesUnchecked(rnd, values, location, scale); @@ -405,7 +404,7 @@ namespace MathNet.Numerics.Distributions { if (scale <= 0.0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return SampleUnchecked(SystemRandomSource.Default, location, scale); @@ -421,7 +420,7 @@ namespace MathNet.Numerics.Distributions { if (scale <= 0.0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return SamplesUnchecked(SystemRandomSource.Default, location, scale); @@ -438,7 +437,7 @@ namespace MathNet.Numerics.Distributions { if (scale <= 0.0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } SamplesUnchecked(SystemRandomSource.Default, values, location, scale); diff --git a/src/Numerics/Distributions/Chi.cs b/src/Numerics/Distributions/Chi.cs index 131d366a..f58e1aea 100644 --- a/src/Numerics/Distributions/Chi.cs +++ b/src/Numerics/Distributions/Chi.cs @@ -29,7 +29,6 @@ using System; using System.Collections.Generic; -using MathNet.Numerics.Properties; using MathNet.Numerics.Random; using MathNet.Numerics.Threading; @@ -56,7 +55,7 @@ namespace MathNet.Numerics.Distributions { if (!IsValidParameterSet(freedom)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } _random = SystemRandomSource.Default; @@ -72,7 +71,7 @@ namespace MathNet.Numerics.Distributions { if (!IsValidParameterSet(freedom)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } _random = randomSource ?? SystemRandomSource.Default; @@ -289,7 +288,7 @@ namespace MathNet.Numerics.Distributions { if (freedom <= 0.0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } if (double.IsPositiveInfinity(freedom) || double.IsPositiveInfinity(x) || x == 0.0) @@ -316,7 +315,7 @@ namespace MathNet.Numerics.Distributions { if (freedom <= 0.0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } if (double.IsPositiveInfinity(freedom) || double.IsPositiveInfinity(x) || x == 0.0) @@ -338,7 +337,7 @@ namespace MathNet.Numerics.Distributions { if (freedom <= 0.0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } if (double.IsPositiveInfinity(x)) @@ -364,7 +363,7 @@ namespace MathNet.Numerics.Distributions { if (freedom <= 0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return SampleUnchecked(rnd, freedom); @@ -380,7 +379,7 @@ namespace MathNet.Numerics.Distributions { if (freedom <= 0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return SamplesUnchecked(rnd, freedom); @@ -397,7 +396,7 @@ namespace MathNet.Numerics.Distributions { if (freedom <= 0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } SamplesUnchecked(rnd, values, freedom); @@ -412,7 +411,7 @@ namespace MathNet.Numerics.Distributions { if (freedom <= 0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return SampleUnchecked(SystemRandomSource.Default, freedom); @@ -427,7 +426,7 @@ namespace MathNet.Numerics.Distributions { if (freedom <= 0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return SamplesUnchecked(SystemRandomSource.Default, freedom); @@ -443,7 +442,7 @@ namespace MathNet.Numerics.Distributions { if (freedom <= 0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } SamplesUnchecked(SystemRandomSource.Default, values, freedom); diff --git a/src/Numerics/Distributions/ChiSquared.cs b/src/Numerics/Distributions/ChiSquared.cs index 7ca908ba..fcf5f494 100644 --- a/src/Numerics/Distributions/ChiSquared.cs +++ b/src/Numerics/Distributions/ChiSquared.cs @@ -29,7 +29,6 @@ using System; using System.Collections.Generic; -using MathNet.Numerics.Properties; using MathNet.Numerics.Random; using MathNet.Numerics.Threading; @@ -54,7 +53,7 @@ namespace MathNet.Numerics.Distributions { if (!IsValidParameterSet(freedom)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } _random = SystemRandomSource.Default; @@ -70,7 +69,7 @@ namespace MathNet.Numerics.Distributions { if (!IsValidParameterSet(freedom)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } _random = randomSource ?? SystemRandomSource.Default; @@ -300,7 +299,7 @@ namespace MathNet.Numerics.Distributions { if (freedom <= 0.0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } if (double.IsPositiveInfinity(freedom) || double.IsPositiveInfinity(x) || x == 0.0) @@ -327,7 +326,7 @@ namespace MathNet.Numerics.Distributions { if (freedom <= 0.0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } if (double.IsPositiveInfinity(freedom) || double.IsPositiveInfinity(x) || x == 0.0) @@ -349,7 +348,7 @@ namespace MathNet.Numerics.Distributions { if (freedom <= 0.0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } if (double.IsPositiveInfinity(x)) @@ -376,7 +375,7 @@ namespace MathNet.Numerics.Distributions { if(!IsValidParameterSet(freedom)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return SpecialFunctions.GammaLowerRegularizedInv(freedom / 2.0, p) / 0.5; @@ -392,7 +391,7 @@ namespace MathNet.Numerics.Distributions { if (freedom <= 0.0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return SampleUnchecked(rnd, freedom); @@ -408,7 +407,7 @@ namespace MathNet.Numerics.Distributions { if (freedom <= 0.0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return SamplesUnchecked(rnd, freedom); @@ -425,7 +424,7 @@ namespace MathNet.Numerics.Distributions { if (freedom <= 0.0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } SamplesUnchecked(rnd, values, freedom); @@ -440,7 +439,7 @@ namespace MathNet.Numerics.Distributions { if (freedom <= 0.0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return SampleUnchecked(SystemRandomSource.Default, freedom); @@ -455,7 +454,7 @@ namespace MathNet.Numerics.Distributions { if (freedom <= 0.0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return SamplesUnchecked(SystemRandomSource.Default, freedom); @@ -471,7 +470,7 @@ namespace MathNet.Numerics.Distributions { if (freedom <= 0.0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } SamplesUnchecked(SystemRandomSource.Default, values, freedom); diff --git a/src/Numerics/Distributions/ContinuousUniform.cs b/src/Numerics/Distributions/ContinuousUniform.cs index adf0c372..822ba1dd 100644 --- a/src/Numerics/Distributions/ContinuousUniform.cs +++ b/src/Numerics/Distributions/ContinuousUniform.cs @@ -29,7 +29,6 @@ using System; using System.Collections.Generic; -using MathNet.Numerics.Properties; using MathNet.Numerics.Random; using MathNet.Numerics.Threading; @@ -64,7 +63,7 @@ namespace MathNet.Numerics.Distributions { if (!IsValidParameterSet(lower, upper)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } _random = SystemRandomSource.Default; @@ -83,7 +82,7 @@ namespace MathNet.Numerics.Distributions { if (!IsValidParameterSet(lower, upper)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } _random = randomSource ?? SystemRandomSource.Default; @@ -287,7 +286,7 @@ namespace MathNet.Numerics.Distributions { if (upper < lower) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return x < lower || x > upper ? 0.0 : 1.0/(upper - lower); @@ -305,7 +304,7 @@ namespace MathNet.Numerics.Distributions { if (upper < lower) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return x < lower || x > upper ? double.NegativeInfinity : -Math.Log(upper - lower); @@ -323,7 +322,7 @@ namespace MathNet.Numerics.Distributions { if (upper < lower) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return x <= lower ? 0.0 : x >= upper ? 1.0 : (x - lower)/(upper - lower); @@ -342,7 +341,7 @@ namespace MathNet.Numerics.Distributions { if (upper < lower) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return p <= 0.0 ? lower : p >= 1.0 ? upper : lower*(1.0 - p) + upper*p; @@ -359,7 +358,7 @@ namespace MathNet.Numerics.Distributions { if (upper < lower) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return SampleUnchecked(rnd, lower, upper); @@ -376,7 +375,7 @@ namespace MathNet.Numerics.Distributions { if (upper < lower) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return SamplesUnchecked(rnd, lower, upper); @@ -394,7 +393,7 @@ namespace MathNet.Numerics.Distributions { if (upper < lower) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } SamplesUnchecked(rnd, values, lower, upper); @@ -410,7 +409,7 @@ namespace MathNet.Numerics.Distributions { if (upper < lower) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return SampleUnchecked(SystemRandomSource.Default, lower, upper); @@ -426,7 +425,7 @@ namespace MathNet.Numerics.Distributions { if (upper < lower) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return SamplesUnchecked(SystemRandomSource.Default, lower, upper); @@ -443,7 +442,7 @@ namespace MathNet.Numerics.Distributions { if (upper < lower) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } SamplesUnchecked(SystemRandomSource.Default, values, lower, upper); diff --git a/src/Numerics/Distributions/ConwayMaxwellPoisson.cs b/src/Numerics/Distributions/ConwayMaxwellPoisson.cs index 0c0540cf..e043192a 100644 --- a/src/Numerics/Distributions/ConwayMaxwellPoisson.cs +++ b/src/Numerics/Distributions/ConwayMaxwellPoisson.cs @@ -29,7 +29,6 @@ using System; using System.Collections.Generic; -using MathNet.Numerics.Properties; using MathNet.Numerics.Random; using MathNet.Numerics.Threading; @@ -84,7 +83,7 @@ namespace MathNet.Numerics.Distributions { if (!IsValidParameterSet(lambda, nu)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } _random = SystemRandomSource.Default; @@ -102,7 +101,7 @@ namespace MathNet.Numerics.Distributions { if (!IsValidParameterSet(lambda, nu)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } _random = randomSource ?? SystemRandomSource.Default; @@ -354,7 +353,7 @@ namespace MathNet.Numerics.Distributions { if (!(lambda > 0.0 && nu >= 0.0)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } var z = Normalization(lambda, nu); @@ -372,7 +371,7 @@ namespace MathNet.Numerics.Distributions { if (!(lambda > 0.0 && nu >= 0.0)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } var z = Normalization(lambda, nu); @@ -391,7 +390,7 @@ namespace MathNet.Numerics.Distributions { if (!(lambda > 0.0 && nu >= 0.0)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } var z = Normalization(lambda, nu); @@ -558,7 +557,7 @@ namespace MathNet.Numerics.Distributions { if (!(lambda > 0.0 && nu >= 0.0)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } var z = Normalization(lambda, nu); @@ -575,7 +574,7 @@ namespace MathNet.Numerics.Distributions { if (!(lambda > 0.0 && nu >= 0.0)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } var z = Normalization(lambda, nu); @@ -593,7 +592,7 @@ namespace MathNet.Numerics.Distributions { if (!(lambda > 0.0 && nu >= 0.0)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } var z = Normalization(lambda, nu); @@ -609,7 +608,7 @@ namespace MathNet.Numerics.Distributions { if (!(lambda > 0.0 && nu >= 0.0)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } var z = Normalization(lambda, nu); @@ -625,7 +624,7 @@ namespace MathNet.Numerics.Distributions { if (!(lambda > 0.0 && nu >= 0.0)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } var z = Normalization(lambda, nu); @@ -642,7 +641,7 @@ namespace MathNet.Numerics.Distributions { if (!(lambda > 0.0 && nu >= 0.0)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } var z = Normalization(lambda, nu); diff --git a/src/Numerics/Distributions/Dirichlet.cs b/src/Numerics/Distributions/Dirichlet.cs index c8822253..57eaf8b8 100644 --- a/src/Numerics/Distributions/Dirichlet.cs +++ b/src/Numerics/Distributions/Dirichlet.cs @@ -29,7 +29,6 @@ using System; using System.Linq; -using MathNet.Numerics.Properties; using MathNet.Numerics.Random; namespace MathNet.Numerics.Distributions @@ -53,7 +52,7 @@ namespace MathNet.Numerics.Distributions { if (Control.CheckDistributionParameters && !IsValidParameterSet(alpha)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } _random = SystemRandomSource.Default; @@ -70,7 +69,7 @@ namespace MathNet.Numerics.Distributions { if (Control.CheckDistributionParameters && !IsValidParameterSet(alpha)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } _random = randomSource ?? SystemRandomSource.Default; @@ -94,7 +93,7 @@ namespace MathNet.Numerics.Distributions _random = SystemRandomSource.Default; if (Control.CheckDistributionParameters && !IsValidParameterSet(parm)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } _alpha = (double[])parm.Clone(); @@ -118,7 +117,7 @@ namespace MathNet.Numerics.Distributions _random = randomSource ?? SystemRandomSource.Default; if (Control.CheckDistributionParameters && !IsValidParameterSet(parm)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } _alpha = (double[])parm.Clone(); @@ -317,7 +316,7 @@ namespace MathNet.Numerics.Distributions { if (Control.CheckDistributionParameters && !IsValidParameterSet(alpha)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } var n = alpha.Length; diff --git a/src/Numerics/Distributions/DiscreteUniform.cs b/src/Numerics/Distributions/DiscreteUniform.cs index d6921e47..99e75815 100644 --- a/src/Numerics/Distributions/DiscreteUniform.cs +++ b/src/Numerics/Distributions/DiscreteUniform.cs @@ -29,7 +29,6 @@ using System; using System.Collections.Generic; -using MathNet.Numerics.Properties; using MathNet.Numerics.Random; namespace MathNet.Numerics.Distributions @@ -56,7 +55,7 @@ namespace MathNet.Numerics.Distributions { if (!IsValidParameterSet(lower, upper)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } _random = SystemRandomSource.Default; @@ -74,7 +73,7 @@ namespace MathNet.Numerics.Distributions { if (!IsValidParameterSet(lower, upper)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } _random = randomSource ?? SystemRandomSource.Default; @@ -208,7 +207,7 @@ namespace MathNet.Numerics.Distributions { if (!(lower <= upper)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return k >= lower && k <= upper ? 1.0/(upper - lower + 1) : 0.0; @@ -225,7 +224,7 @@ namespace MathNet.Numerics.Distributions { if (!(lower <= upper)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return k >= lower && k <= upper ? -Math.Log(upper - lower + 1) : double.NegativeInfinity; @@ -243,7 +242,7 @@ namespace MathNet.Numerics.Distributions { if (!(lower <= upper)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } if (x < lower) @@ -318,7 +317,7 @@ namespace MathNet.Numerics.Distributions { if (!(lower <= upper)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return SampleUnchecked(rnd, lower, upper); @@ -335,7 +334,7 @@ namespace MathNet.Numerics.Distributions { if (!(lower <= upper)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return SamplesUnchecked(rnd, lower, upper); @@ -353,7 +352,7 @@ namespace MathNet.Numerics.Distributions { if (!(lower <= upper)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } SamplesUnchecked(rnd, values, lower, upper); @@ -369,7 +368,7 @@ namespace MathNet.Numerics.Distributions { if (!(lower <= upper)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return SampleUnchecked(SystemRandomSource.Default, lower, upper); @@ -385,7 +384,7 @@ namespace MathNet.Numerics.Distributions { if (!(lower <= upper)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return SamplesUnchecked(SystemRandomSource.Default, lower, upper); @@ -402,7 +401,7 @@ namespace MathNet.Numerics.Distributions { if (!(lower <= upper)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } SamplesUnchecked(SystemRandomSource.Default, values, lower, upper); diff --git a/src/Numerics/Distributions/Erlang.cs b/src/Numerics/Distributions/Erlang.cs index 6ff68e1e..01567ad1 100644 --- a/src/Numerics/Distributions/Erlang.cs +++ b/src/Numerics/Distributions/Erlang.cs @@ -29,7 +29,6 @@ using System; using System.Collections.Generic; -using MathNet.Numerics.Properties; using MathNet.Numerics.Random; namespace MathNet.Numerics.Distributions @@ -56,7 +55,7 @@ namespace MathNet.Numerics.Distributions { if (!IsValidParameterSet(shape, rate)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } _random = SystemRandomSource.Default; @@ -74,7 +73,7 @@ namespace MathNet.Numerics.Distributions { if (!IsValidParameterSet(shape, rate)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } _random = randomSource ?? SystemRandomSource.Default; @@ -369,7 +368,7 @@ namespace MathNet.Numerics.Distributions { if (shape < 0.0 || rate < 0.0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } if (double.IsPositiveInfinity(rate)) @@ -407,7 +406,7 @@ namespace MathNet.Numerics.Distributions { if (shape < 0.0 || rate < 0.0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } if (double.IsPositiveInfinity(rate)) @@ -440,7 +439,7 @@ namespace MathNet.Numerics.Distributions { if (shape < 0.0 || rate < 0.0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } if (double.IsPositiveInfinity(rate)) diff --git a/src/Numerics/Distributions/Exponential.cs b/src/Numerics/Distributions/Exponential.cs index d5d92fc6..d4aecf0b 100644 --- a/src/Numerics/Distributions/Exponential.cs +++ b/src/Numerics/Distributions/Exponential.cs @@ -30,7 +30,6 @@ using System; using System.Collections.Generic; using System.Linq; -using MathNet.Numerics.Properties; using MathNet.Numerics.Random; using MathNet.Numerics.Threading; @@ -55,7 +54,7 @@ namespace MathNet.Numerics.Distributions { if (!IsValidParameterSet(rate)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } _random = SystemRandomSource.Default; @@ -71,7 +70,7 @@ namespace MathNet.Numerics.Distributions { if (!IsValidParameterSet(rate)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } _random = randomSource ?? SystemRandomSource.Default; @@ -272,7 +271,7 @@ namespace MathNet.Numerics.Distributions { if (rate < 0.0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return x < 0.0 ? 0.0 : rate*Math.Exp(-rate*x); @@ -289,7 +288,7 @@ namespace MathNet.Numerics.Distributions { if (rate < 0.0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return Math.Log(rate) - (rate*x); @@ -306,7 +305,7 @@ namespace MathNet.Numerics.Distributions { if (rate < 0.0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return x < 0.0 ? 0.0 : 1.0 - Math.Exp(-rate*x); @@ -324,7 +323,7 @@ namespace MathNet.Numerics.Distributions { if (rate < 0.0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return p >= 1.0 ? double.PositiveInfinity : -Math.Log(1 - p)/rate; @@ -340,7 +339,7 @@ namespace MathNet.Numerics.Distributions { if (rate < 0.0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return SampleUnchecked(rnd, rate); @@ -357,7 +356,7 @@ namespace MathNet.Numerics.Distributions { if (rate < 0.0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } SamplesUnchecked(rnd, values, rate); @@ -373,7 +372,7 @@ namespace MathNet.Numerics.Distributions { if (rate < 0.0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return SamplesUnchecked(rnd, rate); @@ -388,7 +387,7 @@ namespace MathNet.Numerics.Distributions { if (rate < 0.0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return SampleUnchecked(SystemRandomSource.Default, rate); @@ -404,7 +403,7 @@ namespace MathNet.Numerics.Distributions { if (rate < 0.0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } SamplesUnchecked(SystemRandomSource.Default, values, rate); @@ -419,7 +418,7 @@ namespace MathNet.Numerics.Distributions { if (rate < 0.0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return SamplesUnchecked(SystemRandomSource.Default, rate); diff --git a/src/Numerics/Distributions/FisherSnedecor.cs b/src/Numerics/Distributions/FisherSnedecor.cs index 88dd7e93..1496a4cd 100644 --- a/src/Numerics/Distributions/FisherSnedecor.cs +++ b/src/Numerics/Distributions/FisherSnedecor.cs @@ -29,7 +29,6 @@ using System; using System.Collections.Generic; -using MathNet.Numerics.Properties; using MathNet.Numerics.Random; using MathNet.Numerics.RootFinding; using MathNet.Numerics.Threading; @@ -57,7 +56,7 @@ namespace MathNet.Numerics.Distributions { if (!IsValidParameterSet(d1, d2)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } _random = SystemRandomSource.Default; @@ -75,7 +74,7 @@ namespace MathNet.Numerics.Distributions { if (!IsValidParameterSet(d1, d2)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } _random = randomSource ?? SystemRandomSource.Default; @@ -328,7 +327,7 @@ namespace MathNet.Numerics.Distributions { if (d1 <= 0.0 || d2 <= 0.0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return Math.Sqrt(Math.Pow(d1*x, d1)*Math.Pow(d2, d2)/Math.Pow((d1*x) + d2, d1 + d2))/(x*SpecialFunctions.Beta(d1/2.0, d2/2.0)); @@ -359,7 +358,7 @@ namespace MathNet.Numerics.Distributions { if (d1 <= 0.0 || d2 <= 0.0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return SpecialFunctions.BetaRegularized(d1/2.0, d2/2.0, d1*x/(d1*x + d2)); @@ -379,7 +378,7 @@ namespace MathNet.Numerics.Distributions { if (d1 <= 0.0 || d2 <= 0.0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return Brent.FindRoot( @@ -398,7 +397,7 @@ namespace MathNet.Numerics.Distributions { if (d1 <= 0.0 || d2 <= 0.0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return SampleUnchecked(rnd, d1, d2); @@ -415,7 +414,7 @@ namespace MathNet.Numerics.Distributions { if (d1 <= 0.0 || d2 <= 0.0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return SamplesUnchecked(rnd, d1, d2); @@ -433,7 +432,7 @@ namespace MathNet.Numerics.Distributions { if (d1 <= 0.0 || d2 <= 0.0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } SamplesUnchecked(rnd, values, d1, d2); @@ -449,7 +448,7 @@ namespace MathNet.Numerics.Distributions { if (d1 <= 0.0 || d2 <= 0.0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return SampleUnchecked(SystemRandomSource.Default, d1, d2); @@ -465,7 +464,7 @@ namespace MathNet.Numerics.Distributions { if (d1 <= 0.0 || d2 <= 0.0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return SamplesUnchecked(SystemRandomSource.Default, d1, d2); @@ -482,7 +481,7 @@ namespace MathNet.Numerics.Distributions { if (d1 <= 0.0 || d2 <= 0.0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } SamplesUnchecked(SystemRandomSource.Default, values, d1, d2); diff --git a/src/Numerics/Distributions/Gamma.cs b/src/Numerics/Distributions/Gamma.cs index cf3ec699..307fcbd3 100644 --- a/src/Numerics/Distributions/Gamma.cs +++ b/src/Numerics/Distributions/Gamma.cs @@ -29,7 +29,6 @@ using System; using System.Collections.Generic; -using MathNet.Numerics.Properties; using MathNet.Numerics.Random; namespace MathNet.Numerics.Distributions @@ -65,7 +64,7 @@ namespace MathNet.Numerics.Distributions { if (!IsValidParameterSet(shape, rate)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } _random = SystemRandomSource.Default; @@ -83,7 +82,7 @@ namespace MathNet.Numerics.Distributions { if (!IsValidParameterSet(shape, rate)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } _random = randomSource ?? SystemRandomSource.Default; @@ -452,7 +451,7 @@ namespace MathNet.Numerics.Distributions { if (shape < 0.0 || rate < 0.0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } if (double.IsPositiveInfinity(rate)) @@ -490,7 +489,7 @@ namespace MathNet.Numerics.Distributions { if (shape < 0.0 || rate < 0.0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } if (double.IsPositiveInfinity(rate)) @@ -523,7 +522,7 @@ namespace MathNet.Numerics.Distributions { if (shape < 0.0 || rate < 0.0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } if (double.IsPositiveInfinity(rate)) @@ -552,7 +551,7 @@ namespace MathNet.Numerics.Distributions { if (shape < 0.0 || rate < 0.0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return SpecialFunctions.GammaLowerRegularizedInv(shape, p)/rate; @@ -569,7 +568,7 @@ namespace MathNet.Numerics.Distributions { if (shape < 0.0 || rate < 0.0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return SampleUnchecked(rnd, shape, rate); @@ -586,7 +585,7 @@ namespace MathNet.Numerics.Distributions { if (shape < 0.0 || rate < 0.0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return SamplesUnchecked(rnd, shape, rate); @@ -604,7 +603,7 @@ namespace MathNet.Numerics.Distributions { if (shape < 0.0 || rate < 0.0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } SamplesUnchecked(rnd, values, shape, rate); @@ -620,7 +619,7 @@ namespace MathNet.Numerics.Distributions { if (shape < 0.0 || rate < 0.0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return SampleUnchecked(SystemRandomSource.Default, shape, rate); @@ -636,7 +635,7 @@ namespace MathNet.Numerics.Distributions { if (shape < 0.0 || rate < 0.0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return SamplesUnchecked(SystemRandomSource.Default, shape, rate); @@ -653,7 +652,7 @@ namespace MathNet.Numerics.Distributions { if (shape < 0.0 || rate < 0.0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } SamplesUnchecked(SystemRandomSource.Default, values, shape, rate); diff --git a/src/Numerics/Distributions/Geometric.cs b/src/Numerics/Distributions/Geometric.cs index 4e5e7270..8023cc8c 100644 --- a/src/Numerics/Distributions/Geometric.cs +++ b/src/Numerics/Distributions/Geometric.cs @@ -30,7 +30,6 @@ using System; using System.Collections.Generic; using System.Linq; -using MathNet.Numerics.Properties; using MathNet.Numerics.Random; using MathNet.Numerics.Threading; @@ -56,7 +55,7 @@ namespace MathNet.Numerics.Distributions { if (!IsValidParameterSet(p)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } _random = SystemRandomSource.Default; @@ -72,7 +71,7 @@ namespace MathNet.Numerics.Distributions { if (!IsValidParameterSet(p)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } _random = randomSource ?? SystemRandomSource.Default; @@ -207,7 +206,7 @@ namespace MathNet.Numerics.Distributions { if (!(p >= 0.0 && p <= 1.0)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } if (k <= 0) @@ -228,7 +227,7 @@ namespace MathNet.Numerics.Distributions { if (!(p >= 0.0 && p <= 1.0)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } if (k <= 0) @@ -250,7 +249,7 @@ namespace MathNet.Numerics.Distributions { if (!(p >= 0.0 && p <= 1.0)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return 1.0 - Math.Pow(1.0 - p, x); @@ -338,7 +337,7 @@ namespace MathNet.Numerics.Distributions { if (!(p >= 0.0 && p <= 1.0)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return SampleUnchecked(rnd, p); @@ -353,7 +352,7 @@ namespace MathNet.Numerics.Distributions { if (!(p >= 0.0 && p <= 1.0)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return SamplesUnchecked(rnd, p); @@ -369,7 +368,7 @@ namespace MathNet.Numerics.Distributions { if (!(p >= 0.0 && p <= 1.0)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } SamplesUnchecked(rnd, values, p); @@ -383,7 +382,7 @@ namespace MathNet.Numerics.Distributions { if (!(p >= 0.0 && p <= 1.0)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return SampleUnchecked(SystemRandomSource.Default, p); @@ -397,7 +396,7 @@ namespace MathNet.Numerics.Distributions { if (!(p >= 0.0 && p <= 1.0)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return SamplesUnchecked(SystemRandomSource.Default, p); @@ -412,7 +411,7 @@ namespace MathNet.Numerics.Distributions { if (!(p >= 0.0 && p <= 1.0)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } SamplesUnchecked(SystemRandomSource.Default, values, p); diff --git a/src/Numerics/Distributions/Hypergeometric.cs b/src/Numerics/Distributions/Hypergeometric.cs index b48125e0..b15e82d8 100644 --- a/src/Numerics/Distributions/Hypergeometric.cs +++ b/src/Numerics/Distributions/Hypergeometric.cs @@ -29,7 +29,6 @@ using System; using System.Collections.Generic; -using MathNet.Numerics.Properties; using MathNet.Numerics.Random; namespace MathNet.Numerics.Distributions @@ -59,7 +58,7 @@ namespace MathNet.Numerics.Distributions { if (!IsValidParameterSet(population, success, draws)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } _random = SystemRandomSource.Default; @@ -79,7 +78,7 @@ namespace MathNet.Numerics.Distributions { if (!IsValidParameterSet(population, success, draws)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } _random = randomSource ?? SystemRandomSource.Default; @@ -221,7 +220,7 @@ namespace MathNet.Numerics.Distributions { if (!(population >= 0 && success >= 0 && draws >= 0 && success <= population && draws <= population)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return SpecialFunctions.Binomial(success, k)*SpecialFunctions.Binomial(population - success, draws - k)/SpecialFunctions.Binomial(population, draws); @@ -239,7 +238,7 @@ namespace MathNet.Numerics.Distributions { if (!(population >= 0 && success >= 0 && draws >= 0 && success <= population && draws <= population)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return SpecialFunctions.BinomialLn(success, k) + SpecialFunctions.BinomialLn(population - success, draws - k) - SpecialFunctions.BinomialLn(population, draws); @@ -258,7 +257,7 @@ namespace MathNet.Numerics.Distributions { if (!(population >= 0 && success >= 0 && draws >= 0 && success <= population && draws <= population)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } if (x < Math.Max(0, draws + success - population)) @@ -365,7 +364,7 @@ namespace MathNet.Numerics.Distributions { if (!(population >= 0 && success >= 0 && draws >= 0 && success <= population && draws <= population)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return SampleUnchecked(rnd, population, success, draws); @@ -382,7 +381,7 @@ namespace MathNet.Numerics.Distributions { if (!(population >= 0 && success >= 0 && draws >= 0 && success <= population && draws <= population)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return SamplesUnchecked(rnd, population, success, draws); @@ -400,7 +399,7 @@ namespace MathNet.Numerics.Distributions { if (!(population >= 0 && success >= 0 && draws >= 0 && success <= population && draws <= population)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } SamplesUnchecked(rnd, values, population, success, draws); @@ -416,7 +415,7 @@ namespace MathNet.Numerics.Distributions { if (!(population >= 0 && success >= 0 && draws >= 0 && success <= population && draws <= population)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return SampleUnchecked(SystemRandomSource.Default, population, success, draws); @@ -432,7 +431,7 @@ namespace MathNet.Numerics.Distributions { if (!(population >= 0 && success >= 0 && draws >= 0 && success <= population && draws <= population)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return SamplesUnchecked(SystemRandomSource.Default, population, success, draws); @@ -449,7 +448,7 @@ namespace MathNet.Numerics.Distributions { if (!(population >= 0 && success >= 0 && draws >= 0 && success <= population && draws <= population)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } SamplesUnchecked(SystemRandomSource.Default, values, population, success, draws); diff --git a/src/Numerics/Distributions/InverseGamma.cs b/src/Numerics/Distributions/InverseGamma.cs index b47441cf..74eb981b 100644 --- a/src/Numerics/Distributions/InverseGamma.cs +++ b/src/Numerics/Distributions/InverseGamma.cs @@ -30,7 +30,6 @@ using System; using System.Collections.Generic; using System.Linq; -using MathNet.Numerics.Properties; using MathNet.Numerics.Random; using MathNet.Numerics.Threading; @@ -58,7 +57,7 @@ namespace MathNet.Numerics.Distributions { if (!IsValidParameterSet(shape, scale)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } _random = SystemRandomSource.Default; @@ -76,7 +75,7 @@ namespace MathNet.Numerics.Distributions { if (!IsValidParameterSet(shape, scale)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } _random = randomSource ?? SystemRandomSource.Default; @@ -294,7 +293,7 @@ namespace MathNet.Numerics.Distributions { if (shape <= 0.0 || scale <= 0.0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return x < 0.0 ? 0.0 : Math.Pow(scale, shape)*Math.Pow(x, -shape - 1.0)*Math.Exp(-scale/x)/SpecialFunctions.Gamma(shape); @@ -325,7 +324,7 @@ namespace MathNet.Numerics.Distributions { if (shape <= 0.0 || scale <= 0.0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return SpecialFunctions.GammaUpperRegularized(shape, scale/x); @@ -342,7 +341,7 @@ namespace MathNet.Numerics.Distributions { if (shape <= 0.0 || scale <= 0.0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return SampleUnchecked(rnd, shape, scale); @@ -359,7 +358,7 @@ namespace MathNet.Numerics.Distributions { if (shape <= 0.0 || scale <= 0.0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return SamplesUnchecked(rnd, shape, scale); @@ -377,7 +376,7 @@ namespace MathNet.Numerics.Distributions { if (shape <= 0.0 || scale <= 0.0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } SamplesUnchecked(rnd, values, shape, scale); @@ -393,7 +392,7 @@ namespace MathNet.Numerics.Distributions { if (shape <= 0.0 || scale <= 0.0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return SampleUnchecked(SystemRandomSource.Default, shape, scale); @@ -409,7 +408,7 @@ namespace MathNet.Numerics.Distributions { if (shape <= 0.0 || scale <= 0.0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return SamplesUnchecked(SystemRandomSource.Default, shape, scale); @@ -426,7 +425,7 @@ namespace MathNet.Numerics.Distributions { if (shape <= 0.0 || scale <= 0.0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } SamplesUnchecked(SystemRandomSource.Default, values, shape, scale); diff --git a/src/Numerics/Distributions/InverseGaussian.cs b/src/Numerics/Distributions/InverseGaussian.cs index 9b8d7f61..66b8a085 100644 --- a/src/Numerics/Distributions/InverseGaussian.cs +++ b/src/Numerics/Distributions/InverseGaussian.cs @@ -27,7 +27,6 @@ // OTHER DEALINGS IN THE SOFTWARE. // -using MathNet.Numerics.Properties; using MathNet.Numerics.Random; using MathNet.Numerics.Statistics; using System; @@ -60,7 +59,7 @@ namespace MathNet.Numerics.Distributions { if (!IsValidParameterSet(mu, lambda)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } _random = randomSource ?? SystemRandomSource.Default; Mu = mu; @@ -185,7 +184,7 @@ namespace MathNet.Numerics.Distributions { if (!IsValidParameterSet(mu, lambda)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return SampleUnchecked(rnd, mu, lambda); } @@ -201,7 +200,7 @@ namespace MathNet.Numerics.Distributions { if (!IsValidParameterSet(mu, lambda)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } SamplesUnchecked(rnd, values, mu, lambda); } @@ -217,7 +216,7 @@ namespace MathNet.Numerics.Distributions { if (!IsValidParameterSet(mu, lambda)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return SamplesUnchecked(rnd, mu, lambda); } @@ -306,7 +305,7 @@ namespace MathNet.Numerics.Distributions if (RootFinding.NewtonRaphson.TryFindRoot(equationToSolve, Density, Mode, 0, double.PositiveInfinity, 1e-8, 100, out double quantile)) return quantile; else - throw new NonConvergenceException(Resources.NumericalEstimationFailed); + throw new NonConvergenceException("Numerical estimation of the statistic has failed. The used solver did not succeed in finding a root."); } /// @@ -321,7 +320,7 @@ namespace MathNet.Numerics.Distributions { if (!IsValidParameterSet(mu, lambda)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return DensityImpl(mu, lambda, x); } @@ -338,7 +337,7 @@ namespace MathNet.Numerics.Distributions { if (!IsValidParameterSet(mu, lambda)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return DensityLnImpl(mu, lambda, x); } @@ -355,7 +354,7 @@ namespace MathNet.Numerics.Distributions { if (!IsValidParameterSet(mu, lambda)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return CumulativeDistributionImpl(mu, lambda, x); } @@ -372,7 +371,7 @@ namespace MathNet.Numerics.Distributions { if (!IsValidParameterSet(mu, lambda)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } var igDist = new InverseGaussian(mu, lambda); return igDist.InvCDF(p); diff --git a/src/Numerics/Distributions/InverseWishart.cs b/src/Numerics/Distributions/InverseWishart.cs index 07600ec7..d0394d08 100644 --- a/src/Numerics/Distributions/InverseWishart.cs +++ b/src/Numerics/Distributions/InverseWishart.cs @@ -30,7 +30,6 @@ using System; using MathNet.Numerics.LinearAlgebra; using MathNet.Numerics.LinearAlgebra.Factorization; -using MathNet.Numerics.Properties; using MathNet.Numerics.Random; namespace MathNet.Numerics.Distributions @@ -62,7 +61,7 @@ namespace MathNet.Numerics.Distributions { if (Control.CheckDistributionParameters && !IsValidParameterSet(degreesOfFreedom, scale)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } _random = SystemRandomSource.Default; @@ -81,7 +80,7 @@ namespace MathNet.Numerics.Distributions { if (Control.CheckDistributionParameters && !IsValidParameterSet(degreesOfFreedom, scale)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } _random = randomSource ?? SystemRandomSource.Default; @@ -184,7 +183,7 @@ namespace MathNet.Numerics.Distributions if (x.RowCount != p || x.ColumnCount != p) { - throw new ArgumentOutOfRangeException(nameof(x), Resources.ArgumentMatrixDimensions); + throw new ArgumentOutOfRangeException(nameof(x), "Matrix dimensions must agree."); } var chol = x.Cholesky(); @@ -227,7 +226,7 @@ namespace MathNet.Numerics.Distributions { if (Control.CheckDistributionParameters && !IsValidParameterSet(degreesOfFreedom, scale)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } var r = Wishart.Sample(rnd, degreesOfFreedom, scale.Inverse()); diff --git a/src/Numerics/Distributions/Laplace.cs b/src/Numerics/Distributions/Laplace.cs index b41e0089..8d7f6bc8 100644 --- a/src/Numerics/Distributions/Laplace.cs +++ b/src/Numerics/Distributions/Laplace.cs @@ -29,7 +29,6 @@ using System; using System.Collections.Generic; -using MathNet.Numerics.Properties; using MathNet.Numerics.Random; using MathNet.Numerics.Threading; @@ -67,7 +66,7 @@ namespace MathNet.Numerics.Distributions { if (!IsValidParameterSet(location, scale)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } _random = SystemRandomSource.Default; @@ -86,7 +85,7 @@ namespace MathNet.Numerics.Distributions { if (!IsValidParameterSet(location, scale)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } _random = randomSource ?? SystemRandomSource.Default; @@ -275,7 +274,7 @@ namespace MathNet.Numerics.Distributions { if (scale <= 0.0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return Math.Exp(-Math.Abs(x - location)/scale)/(2.0*scale); @@ -293,7 +292,7 @@ namespace MathNet.Numerics.Distributions { if (scale <= 0.0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return -Math.Abs(x - location)/scale - Math.Log(2.0*scale); @@ -311,7 +310,7 @@ namespace MathNet.Numerics.Distributions { if (scale <= 0.0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return 0.5*(1.0 + (Math.Sign(x - location)*(1.0 - Math.Exp(-Math.Abs(x - location)/scale)))); @@ -328,7 +327,7 @@ namespace MathNet.Numerics.Distributions { if (scale <= 0.0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return SampleUnchecked(rnd, location, scale); @@ -345,7 +344,7 @@ namespace MathNet.Numerics.Distributions { if (scale <= 0.0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return SamplesUnchecked(rnd, location, scale); @@ -363,7 +362,7 @@ namespace MathNet.Numerics.Distributions { if (scale <= 0.0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } SamplesUnchecked(rnd, values, location, scale); @@ -379,7 +378,7 @@ namespace MathNet.Numerics.Distributions { if (scale <= 0.0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return SampleUnchecked(SystemRandomSource.Default, location, scale); @@ -395,7 +394,7 @@ namespace MathNet.Numerics.Distributions { if (scale <= 0.0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return SamplesUnchecked(SystemRandomSource.Default, location, scale); @@ -412,7 +411,7 @@ namespace MathNet.Numerics.Distributions { if (scale <= 0.0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } SamplesUnchecked(SystemRandomSource.Default, values, location, scale); diff --git a/src/Numerics/Distributions/LogNormal.cs b/src/Numerics/Distributions/LogNormal.cs index 8471fee3..daeb174f 100644 --- a/src/Numerics/Distributions/LogNormal.cs +++ b/src/Numerics/Distributions/LogNormal.cs @@ -30,7 +30,6 @@ using System; using System.Collections.Generic; using System.Linq; -using MathNet.Numerics.Properties; using MathNet.Numerics.Random; using MathNet.Numerics.Statistics; using MathNet.Numerics.Threading; @@ -60,7 +59,7 @@ namespace MathNet.Numerics.Distributions { if (!IsValidParameterSet(mu, sigma)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } _random = SystemRandomSource.Default; @@ -80,7 +79,7 @@ namespace MathNet.Numerics.Distributions { if (!IsValidParameterSet(mu, sigma)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } _random = randomSource ?? SystemRandomSource.Default; @@ -350,7 +349,7 @@ namespace MathNet.Numerics.Distributions { if (sigma < 0.0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } if (x < 0.0) @@ -374,7 +373,7 @@ namespace MathNet.Numerics.Distributions { if (sigma < 0.0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } if (x < 0.0) @@ -399,7 +398,7 @@ namespace MathNet.Numerics.Distributions { if (sigma < 0.0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return x < 0.0 ? 0.0 @@ -420,7 +419,7 @@ namespace MathNet.Numerics.Distributions { if (sigma < 0.0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return p <= 0.0 ? 0.0 : p >= 1.0 ? double.PositiveInfinity @@ -438,7 +437,7 @@ namespace MathNet.Numerics.Distributions { if (sigma < 0.0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return SampleUnchecked(rnd, mu, sigma); @@ -455,7 +454,7 @@ namespace MathNet.Numerics.Distributions { if (sigma < 0.0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return SamplesUnchecked(rnd, mu, sigma); @@ -473,7 +472,7 @@ namespace MathNet.Numerics.Distributions { if (sigma < 0.0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } SamplesUnchecked(rnd, values, mu, sigma); @@ -489,7 +488,7 @@ namespace MathNet.Numerics.Distributions { if (sigma < 0.0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return SampleUnchecked(SystemRandomSource.Default, mu, sigma); @@ -505,7 +504,7 @@ namespace MathNet.Numerics.Distributions { if (sigma < 0.0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return SamplesUnchecked(SystemRandomSource.Default, mu, sigma); @@ -522,7 +521,7 @@ namespace MathNet.Numerics.Distributions { if (sigma < 0.0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } SamplesUnchecked(SystemRandomSource.Default, values, mu, sigma); diff --git a/src/Numerics/Distributions/MatrixNormal.cs b/src/Numerics/Distributions/MatrixNormal.cs index 048b698a..791c29f2 100644 --- a/src/Numerics/Distributions/MatrixNormal.cs +++ b/src/Numerics/Distributions/MatrixNormal.cs @@ -30,7 +30,6 @@ using System; using MathNet.Numerics.LinearAlgebra; using MathNet.Numerics.LinearAlgebra.Double; -using MathNet.Numerics.Properties; using MathNet.Numerics.Random; namespace MathNet.Numerics.Distributions @@ -71,7 +70,7 @@ namespace MathNet.Numerics.Distributions { if (Control.CheckDistributionParameters && !IsValidParameterSet(m, v, k)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } _random = SystemRandomSource.Default; @@ -92,7 +91,7 @@ namespace MathNet.Numerics.Distributions { if (Control.CheckDistributionParameters && !IsValidParameterSet(m, v, k)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } _random = randomSource ?? SystemRandomSource.Default; @@ -223,7 +222,7 @@ namespace MathNet.Numerics.Distributions { if (Control.CheckDistributionParameters && !IsValidParameterSet(m, v, k)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } var n = m.RowCount; diff --git a/src/Numerics/Distributions/Multinomial.cs b/src/Numerics/Distributions/Multinomial.cs index 49cbbe02..e427323c 100644 --- a/src/Numerics/Distributions/Multinomial.cs +++ b/src/Numerics/Distributions/Multinomial.cs @@ -32,7 +32,6 @@ using System.Collections.Generic; using System.Linq; using MathNet.Numerics.LinearAlgebra; using MathNet.Numerics.LinearAlgebra.Double; -using MathNet.Numerics.Properties; using MathNet.Numerics.Random; using MathNet.Numerics.Statistics; @@ -73,7 +72,7 @@ namespace MathNet.Numerics.Distributions { if (Control.CheckDistributionParameters && !IsValidParameterSet(p, n)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } _random = SystemRandomSource.Default; @@ -94,7 +93,7 @@ namespace MathNet.Numerics.Distributions { if (Control.CheckDistributionParameters && !IsValidParameterSet(p, n)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } _random = randomSource ?? SystemRandomSource.Default; @@ -128,7 +127,7 @@ namespace MathNet.Numerics.Distributions if (Control.CheckDistributionParameters && !IsValidParameterSet(p, n)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } _p = (double[])p.Clone(); @@ -250,7 +249,7 @@ namespace MathNet.Numerics.Distributions if (x.Length != _p.Length) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength, nameof(x)); + throw new ArgumentException("All vectors must have the same dimensionality.", nameof(x)); } if (x.Sum() == _trials) @@ -284,7 +283,7 @@ namespace MathNet.Numerics.Distributions if (x.Length != _p.Length) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength, nameof(x)); + throw new ArgumentException("All vectors must have the same dimensionality.", nameof(x)); } if (x.Sum() == _trials) @@ -330,7 +329,7 @@ namespace MathNet.Numerics.Distributions { if (Control.CheckDistributionParameters && !IsValidParameterSet(p, n)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } // The cumulative density of p. @@ -359,7 +358,7 @@ namespace MathNet.Numerics.Distributions { if (Control.CheckDistributionParameters && !IsValidParameterSet(p, n)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } // The cumulative density of p. diff --git a/src/Numerics/Distributions/NegativeBinomial.cs b/src/Numerics/Distributions/NegativeBinomial.cs index 378d235d..f6d17769 100644 --- a/src/Numerics/Distributions/NegativeBinomial.cs +++ b/src/Numerics/Distributions/NegativeBinomial.cs @@ -29,7 +29,6 @@ using System; using System.Collections.Generic; -using MathNet.Numerics.Properties; using MathNet.Numerics.Random; namespace MathNet.Numerics.Distributions @@ -57,7 +56,7 @@ namespace MathNet.Numerics.Distributions { if (!IsValidParameterSet(r, p)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } _random = SystemRandomSource.Default; @@ -75,7 +74,7 @@ namespace MathNet.Numerics.Distributions { if (!IsValidParameterSet(r, p)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } _random = randomSource ?? SystemRandomSource.Default; @@ -221,7 +220,7 @@ namespace MathNet.Numerics.Distributions { if (!(r >= 0.0 && p >= 0.0 && p <= 1.0)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return SpecialFunctions.GammaLn(r + k) @@ -243,7 +242,7 @@ namespace MathNet.Numerics.Distributions { if (!(r >= 0.0 && p >= 0.0 && p <= 1.0)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return 1 - SpecialFunctions.BetaRegularized(x + 1, r, 1 - p); @@ -323,7 +322,7 @@ namespace MathNet.Numerics.Distributions { if (!(r >= 0.0 && p >= 0.0 && p <= 1.0)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return SampleUnchecked(rnd, r, p); @@ -339,7 +338,7 @@ namespace MathNet.Numerics.Distributions { if (!(r >= 0.0 && p >= 0.0 && p <= 1.0)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return SamplesUnchecked(rnd, r, p); @@ -356,7 +355,7 @@ namespace MathNet.Numerics.Distributions { if (!(r >= 0.0 && p >= 0.0 && p <= 1.0)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } SamplesUnchecked(rnd, values, r, p); @@ -371,7 +370,7 @@ namespace MathNet.Numerics.Distributions { if (!(r >= 0.0 && p >= 0.0 && p <= 1.0)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return SampleUnchecked(SystemRandomSource.Default, r, p); @@ -386,7 +385,7 @@ namespace MathNet.Numerics.Distributions { if (!(r >= 0.0 && p >= 0.0 && p <= 1.0)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return SamplesUnchecked(SystemRandomSource.Default, r, p); @@ -402,7 +401,7 @@ namespace MathNet.Numerics.Distributions { if (!(r >= 0.0 && p >= 0.0 && p <= 1.0)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } SamplesUnchecked(SystemRandomSource.Default, values, r, p); diff --git a/src/Numerics/Distributions/Normal.cs b/src/Numerics/Distributions/Normal.cs index bbd14304..93ca765e 100644 --- a/src/Numerics/Distributions/Normal.cs +++ b/src/Numerics/Distributions/Normal.cs @@ -29,7 +29,6 @@ using System; using System.Collections.Generic; -using MathNet.Numerics.Properties; using MathNet.Numerics.Random; using MathNet.Numerics.Statistics; @@ -78,7 +77,7 @@ namespace MathNet.Numerics.Distributions { if (!IsValidParameterSet(mean, stddev)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } _random = SystemRandomSource.Default; @@ -97,7 +96,7 @@ namespace MathNet.Numerics.Distributions { if (!IsValidParameterSet(mean, stddev)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } _random = randomSource ?? SystemRandomSource.Default; @@ -423,7 +422,7 @@ namespace MathNet.Numerics.Distributions { if (stddev < 0.0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } var d = (x - mean)/stddev; @@ -442,7 +441,7 @@ namespace MathNet.Numerics.Distributions { if (stddev < 0.0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } var d = (x - mean)/stddev; @@ -462,7 +461,7 @@ namespace MathNet.Numerics.Distributions { if (stddev < 0.0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return 0.5*SpecialFunctions.Erfc((mean - x)/(stddev*Constants.Sqrt2)); @@ -482,7 +481,7 @@ namespace MathNet.Numerics.Distributions { if (stddev < 0.0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return mean - (stddev*Constants.Sqrt2*SpecialFunctions.ErfcInv(2.0*p)); @@ -499,7 +498,7 @@ namespace MathNet.Numerics.Distributions { if (stddev < 0.0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return SampleUnchecked(rnd, mean, stddev); @@ -516,7 +515,7 @@ namespace MathNet.Numerics.Distributions { if (stddev < 0.0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return SamplesUnchecked(rnd, mean, stddev); @@ -534,7 +533,7 @@ namespace MathNet.Numerics.Distributions { if (stddev < 0.0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } SamplesUnchecked(rnd, values, mean, stddev); @@ -550,7 +549,7 @@ namespace MathNet.Numerics.Distributions { if (stddev < 0.0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return SampleUnchecked(SystemRandomSource.Default, mean, stddev); @@ -566,7 +565,7 @@ namespace MathNet.Numerics.Distributions { if (stddev < 0.0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return SamplesUnchecked(SystemRandomSource.Default, mean, stddev); @@ -583,7 +582,7 @@ namespace MathNet.Numerics.Distributions { if (stddev < 0.0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } SamplesUnchecked(SystemRandomSource.Default, values, mean, stddev); diff --git a/src/Numerics/Distributions/NormalGamma.cs b/src/Numerics/Distributions/NormalGamma.cs index 8045c844..8317909a 100644 --- a/src/Numerics/Distributions/NormalGamma.cs +++ b/src/Numerics/Distributions/NormalGamma.cs @@ -29,7 +29,6 @@ using System; using System.Collections.Generic; -using MathNet.Numerics.Properties; using MathNet.Numerics.Random; namespace MathNet.Numerics.Distributions @@ -95,7 +94,7 @@ namespace MathNet.Numerics.Distributions { if (Control.CheckDistributionParameters && !IsValidParameterSet(meanLocation, meanScale, precisionShape, precisionInverseScale)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } _random = SystemRandomSource.Default; @@ -117,7 +116,7 @@ namespace MathNet.Numerics.Distributions { if (Control.CheckDistributionParameters && !IsValidParameterSet(meanLocation, meanScale, precisionShape, precisionInverseScale)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } _random = randomSource ?? SystemRandomSource.Default; @@ -330,7 +329,7 @@ namespace MathNet.Numerics.Distributions { if (Control.CheckDistributionParameters && !IsValidParameterSet(meanLocation, meanScale, precisionShape, precisionInverseScale)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } var mp = new MeanPrecisionPair(); @@ -357,7 +356,7 @@ namespace MathNet.Numerics.Distributions { if (Control.CheckDistributionParameters && !IsValidParameterSet(meanLocation, meanScale, precisionShape, precisionInvScale)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } while (true) diff --git a/src/Numerics/Distributions/Pareto.cs b/src/Numerics/Distributions/Pareto.cs index 13c1c04f..672505cd 100644 --- a/src/Numerics/Distributions/Pareto.cs +++ b/src/Numerics/Distributions/Pareto.cs @@ -30,7 +30,6 @@ using System; using System.Collections.Generic; using System.Linq; -using MathNet.Numerics.Properties; using MathNet.Numerics.Random; using MathNet.Numerics.Threading; @@ -60,7 +59,7 @@ namespace MathNet.Numerics.Distributions { if (!IsValidParameterSet(scale, shape)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } _random = SystemRandomSource.Default; @@ -79,7 +78,7 @@ namespace MathNet.Numerics.Distributions { if (!IsValidParameterSet(scale, shape)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } _random = randomSource ?? SystemRandomSource.Default; @@ -299,7 +298,7 @@ namespace MathNet.Numerics.Distributions { if (scale <= 0.0 || shape <= 0.0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return shape*Math.Pow(scale, shape)/Math.Pow(x, shape + 1.0); @@ -317,7 +316,7 @@ namespace MathNet.Numerics.Distributions { if (scale <= 0.0 || shape <= 0.0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return Math.Log(shape) + shape*Math.Log(scale) - (shape + 1.0)*Math.Log(x); @@ -335,7 +334,7 @@ namespace MathNet.Numerics.Distributions { if (scale <= 0.0 || shape <= 0.0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return 1.0 - Math.Pow(scale/x, shape); @@ -354,7 +353,7 @@ namespace MathNet.Numerics.Distributions { if (scale <= 0.0 || shape <= 0.0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return scale*Math.Pow(1.0 - p, -1.0/shape); @@ -371,7 +370,7 @@ namespace MathNet.Numerics.Distributions { if (scale <= 0.0 || shape <= 0.0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return scale*Math.Pow(rnd.NextDouble(), -1.0/shape); @@ -388,7 +387,7 @@ namespace MathNet.Numerics.Distributions { if (scale <= 0.0 || shape <= 0.0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return SamplesUnchecked(rnd, scale, shape); @@ -406,7 +405,7 @@ namespace MathNet.Numerics.Distributions { if (scale <= 0.0 || shape <= 0.0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } SamplesUnchecked(rnd, values, scale, shape); @@ -422,7 +421,7 @@ namespace MathNet.Numerics.Distributions { if (scale <= 0.0 || shape <= 0.0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return SampleUnchecked(SystemRandomSource.Default, scale, shape); @@ -438,7 +437,7 @@ namespace MathNet.Numerics.Distributions { if (scale <= 0.0 || shape <= 0.0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return SamplesUnchecked(SystemRandomSource.Default, scale, shape); @@ -455,7 +454,7 @@ namespace MathNet.Numerics.Distributions { if (scale <= 0.0 || shape <= 0.0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } SamplesUnchecked(SystemRandomSource.Default, values, scale, shape); diff --git a/src/Numerics/Distributions/Poisson.cs b/src/Numerics/Distributions/Poisson.cs index d030aa96..e835ac00 100644 --- a/src/Numerics/Distributions/Poisson.cs +++ b/src/Numerics/Distributions/Poisson.cs @@ -29,7 +29,6 @@ using System; using System.Collections.Generic; -using MathNet.Numerics.Properties; using MathNet.Numerics.Random; namespace MathNet.Numerics.Distributions @@ -57,7 +56,7 @@ namespace MathNet.Numerics.Distributions { if (!IsValidParameterSet(lambda)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } _random = SystemRandomSource.Default; @@ -74,7 +73,7 @@ namespace MathNet.Numerics.Distributions { if (!IsValidParameterSet(lambda)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } _random = randomSource ?? SystemRandomSource.Default; @@ -202,7 +201,7 @@ namespace MathNet.Numerics.Distributions { if (!(lambda > 0.0)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return Math.Exp(-lambda + (k*Math.Log(lambda)) - SpecialFunctions.FactorialLn(k)); @@ -218,7 +217,7 @@ namespace MathNet.Numerics.Distributions { if (!(lambda > 0.0)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return -lambda + (k*Math.Log(lambda)) - SpecialFunctions.FactorialLn(k); @@ -235,7 +234,7 @@ namespace MathNet.Numerics.Distributions { if (!(lambda > 0.0)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return 1.0 - SpecialFunctions.GammaLowerRegularized(x + 1, lambda); @@ -411,7 +410,7 @@ namespace MathNet.Numerics.Distributions { if (!(lambda > 0.0)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return SampleUnchecked(rnd, lambda); @@ -427,7 +426,7 @@ namespace MathNet.Numerics.Distributions { if (!(lambda > 0.0)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return SamplesUnchecked(rnd, lambda); @@ -444,7 +443,7 @@ namespace MathNet.Numerics.Distributions { if (!(lambda > 0.0)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } SamplesUnchecked(rnd, values, lambda); @@ -459,7 +458,7 @@ namespace MathNet.Numerics.Distributions { if (!(lambda > 0.0)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return SampleUnchecked(SystemRandomSource.Default, lambda); @@ -474,7 +473,7 @@ namespace MathNet.Numerics.Distributions { if (!(lambda > 0.0)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return SamplesUnchecked(SystemRandomSource.Default, lambda); @@ -490,7 +489,7 @@ namespace MathNet.Numerics.Distributions { if (!(lambda > 0.0)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } SamplesUnchecked(SystemRandomSource.Default, values, lambda); diff --git a/src/Numerics/Distributions/Rayleigh.cs b/src/Numerics/Distributions/Rayleigh.cs index 28e0f5f9..432d7813 100644 --- a/src/Numerics/Distributions/Rayleigh.cs +++ b/src/Numerics/Distributions/Rayleigh.cs @@ -30,7 +30,6 @@ using System; using System.Collections.Generic; using System.Linq; -using MathNet.Numerics.Properties; using MathNet.Numerics.Random; using MathNet.Numerics.Threading; @@ -59,7 +58,7 @@ namespace MathNet.Numerics.Distributions { if (!IsValidParameterSet(scale)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } _random = SystemRandomSource.Default; @@ -76,7 +75,7 @@ namespace MathNet.Numerics.Distributions { if (!IsValidParameterSet(scale)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } _random = randomSource ?? SystemRandomSource.Default; @@ -264,7 +263,7 @@ namespace MathNet.Numerics.Distributions { if (scale <= 0.0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return (x/(scale*scale))*Math.Exp(-x*x/(2.0*scale*scale)); @@ -281,7 +280,7 @@ namespace MathNet.Numerics.Distributions { if (scale <= 0.0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return Math.Log(x/(scale*scale)) - (x*x/(2.0*scale*scale)); @@ -298,7 +297,7 @@ namespace MathNet.Numerics.Distributions { if (scale <= 0.0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return 1.0 - Math.Exp(-x*x/(2.0*scale*scale)); @@ -316,7 +315,7 @@ namespace MathNet.Numerics.Distributions { if (scale <= 0.0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return scale*Math.Sqrt(-2*Math.Log(1 - p)); @@ -332,7 +331,7 @@ namespace MathNet.Numerics.Distributions { if (scale <= 0.0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return SampleUnchecked(rnd, scale); @@ -348,7 +347,7 @@ namespace MathNet.Numerics.Distributions { if (scale <= 0.0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return SamplesUnchecked(rnd, scale); @@ -365,7 +364,7 @@ namespace MathNet.Numerics.Distributions { if (scale <= 0.0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } SamplesUnchecked(rnd, values, scale); @@ -380,7 +379,7 @@ namespace MathNet.Numerics.Distributions { if (scale <= 0.0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return SampleUnchecked(SystemRandomSource.Default, scale); @@ -395,7 +394,7 @@ namespace MathNet.Numerics.Distributions { if (scale <= 0.0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return SamplesUnchecked(SystemRandomSource.Default, scale); @@ -411,7 +410,7 @@ namespace MathNet.Numerics.Distributions { if (scale <= 0.0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } SamplesUnchecked(SystemRandomSource.Default, values, scale); diff --git a/src/Numerics/Distributions/SkewedGeneralizedError.cs b/src/Numerics/Distributions/SkewedGeneralizedError.cs index 05683941..45a90f1a 100644 --- a/src/Numerics/Distributions/SkewedGeneralizedError.cs +++ b/src/Numerics/Distributions/SkewedGeneralizedError.cs @@ -27,7 +27,6 @@ // OTHER DEALINGS IN THE SOFTWARE. // -using MathNet.Numerics.Properties; using MathNet.Numerics.Random; using System; using System.Collections.Generic; @@ -85,7 +84,7 @@ namespace MathNet.Numerics.Distributions { if (!IsValidParameterSet(location, scale, skew, p)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } _random = SystemRandomSource.Default; @@ -220,7 +219,7 @@ namespace MathNet.Numerics.Distributions { if (!IsValidParameterSet(location, scale, skew, p)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } scale = AdjustScale(scale, skew, p); @@ -237,7 +236,7 @@ namespace MathNet.Numerics.Distributions { if (!IsValidParameterSet(location, scale, skew, p)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } scale = AdjustScale(scale, skew, p); @@ -251,7 +250,7 @@ namespace MathNet.Numerics.Distributions { if (!IsValidParameterSet(location, scale, skew, p)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } scale = AdjustScale(scale, skew, p); @@ -272,7 +271,7 @@ namespace MathNet.Numerics.Distributions { if (!IsValidParameterSet(location, scale, skew, p)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } scale = AdjustScale(scale, skew, p); @@ -363,7 +362,7 @@ namespace MathNet.Numerics.Distributions { if (!IsValidParameterSet(location, scale, skew, p)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return SampleUnchecked(rnd, location, scale, skew, p); @@ -382,7 +381,7 @@ namespace MathNet.Numerics.Distributions { if (!IsValidParameterSet(location, scale, skew, p)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return SamplesUnchecked(rnd, location, scale, skew, p); @@ -402,7 +401,7 @@ namespace MathNet.Numerics.Distributions { if (!IsValidParameterSet(location, scale, skew, p)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } SamplesUnchecked(rnd, values, location, scale, skew, p); @@ -420,7 +419,7 @@ namespace MathNet.Numerics.Distributions { if (!IsValidParameterSet(location, scale, skew, p)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return SampleUnchecked(SystemRandomSource.Default, location, scale, skew, p); @@ -438,7 +437,7 @@ namespace MathNet.Numerics.Distributions { if (!IsValidParameterSet(location, scale, skew, p)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return SamplesUnchecked(SystemRandomSource.Default, location, scale, skew, p); @@ -457,7 +456,7 @@ namespace MathNet.Numerics.Distributions { if (!IsValidParameterSet(location, scale, skew, p)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } SamplesUnchecked(SystemRandomSource.Default, values, location, scale, skew, p); diff --git a/src/Numerics/Distributions/SkewedGeneralizedT.cs b/src/Numerics/Distributions/SkewedGeneralizedT.cs index c6cef174..295bb697 100644 --- a/src/Numerics/Distributions/SkewedGeneralizedT.cs +++ b/src/Numerics/Distributions/SkewedGeneralizedT.cs @@ -29,7 +29,6 @@ using System; using System.Collections.Generic; -using MathNet.Numerics.Properties; using MathNet.Numerics.Random; namespace MathNet.Numerics.Distributions @@ -95,7 +94,7 @@ namespace MathNet.Numerics.Distributions { if (!IsValidParameterSet(location, scale, skew, p, q)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } _random = SystemRandomSource.Default; @@ -277,7 +276,7 @@ namespace MathNet.Numerics.Distributions { if (!IsValidParameterSet(location, scale, skew, p, q)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } var fn = PDFunc(location, scale, skew, p, q, false); @@ -299,7 +298,7 @@ namespace MathNet.Numerics.Distributions { if (!IsValidParameterSet(location, scale, skew, p, q)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } var fn = PDFunc(location, scale, skew, p, q, true); @@ -366,7 +365,7 @@ namespace MathNet.Numerics.Distributions { if (!IsValidParameterSet(location, scale, skew, p, q)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } // Note: Adapted from the R package, @@ -403,7 +402,7 @@ namespace MathNet.Numerics.Distributions { if (!IsValidParameterSet(location, scale, skew, p, q)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } // If parameters represent a specialized distribution, then we use that distribution to avoid @@ -533,7 +532,7 @@ namespace MathNet.Numerics.Distributions { if (!IsValidParameterSet(location, scale, skew, p, q)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return SampleUnchecked(rnd, location, scale, skew, p, q); @@ -553,7 +552,7 @@ namespace MathNet.Numerics.Distributions { if (!IsValidParameterSet(location, scale, skew, p, q)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return SamplesUnchecked(rnd, location, scale, skew, p, q); @@ -574,7 +573,7 @@ namespace MathNet.Numerics.Distributions { if (!IsValidParameterSet(location, scale, skew, p, q)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } SamplesUnchecked(rnd, values, location, scale, skew, p, q); @@ -593,7 +592,7 @@ namespace MathNet.Numerics.Distributions { if (!IsValidParameterSet(location, scale, skew, p, q)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return SampleUnchecked(SystemRandomSource.Default, location, scale, skew, p, q); @@ -612,7 +611,7 @@ namespace MathNet.Numerics.Distributions { if (!IsValidParameterSet(location, scale, skew, p, q)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return SamplesUnchecked(SystemRandomSource.Default, location, scale, skew, p, q); @@ -632,7 +631,7 @@ namespace MathNet.Numerics.Distributions { if (!IsValidParameterSet(location, scale, skew, p, q)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } SamplesUnchecked(SystemRandomSource.Default, values, location, scale, skew, p, q); diff --git a/src/Numerics/Distributions/Stable.cs b/src/Numerics/Distributions/Stable.cs index ae77fcb0..44707013 100644 --- a/src/Numerics/Distributions/Stable.cs +++ b/src/Numerics/Distributions/Stable.cs @@ -29,7 +29,6 @@ using System; using System.Collections.Generic; -using MathNet.Numerics.Properties; using MathNet.Numerics.Random; namespace MathNet.Numerics.Distributions @@ -62,7 +61,7 @@ namespace MathNet.Numerics.Distributions { if (!IsValidParameterSet(alpha, beta, scale, location)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } _random = SystemRandomSource.Default; @@ -84,7 +83,7 @@ namespace MathNet.Numerics.Distributions { if (!IsValidParameterSet(alpha, beta, scale, location)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } _random = randomSource ?? SystemRandomSource.Default; @@ -424,7 +423,7 @@ namespace MathNet.Numerics.Distributions { if (alpha <= 0.0 || alpha > 2.0 || beta < -1.0 || beta > 1.0 || scale <= 0.0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } if (alpha == 2d) @@ -459,7 +458,7 @@ namespace MathNet.Numerics.Distributions { if (alpha <= 0.0 || alpha > 2.0 || beta < -1.0 || beta > 1.0 || scale <= 0.0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } if (alpha == 2d) @@ -494,7 +493,7 @@ namespace MathNet.Numerics.Distributions { if (alpha <= 0.0 || alpha > 2.0 || beta < -1.0 || beta > 1.0 || scale <= 0.0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } if (alpha == 2d) @@ -528,7 +527,7 @@ namespace MathNet.Numerics.Distributions { if (alpha <= 0.0 || alpha > 2.0 || beta < -1.0 || beta > 1.0 || scale <= 0.0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return SampleUnchecked(rnd, alpha, beta, scale, location); @@ -547,7 +546,7 @@ namespace MathNet.Numerics.Distributions { if (alpha <= 0.0 || alpha > 2.0 || beta < -1.0 || beta > 1.0 || scale <= 0.0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return SamplesUnchecked(rnd, alpha, beta, scale, location); @@ -567,7 +566,7 @@ namespace MathNet.Numerics.Distributions { if (alpha <= 0.0 || alpha > 2.0 || beta < -1.0 || beta > 1.0 || scale <= 0.0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } SamplesUnchecked(rnd, values, alpha, beta, scale, location); @@ -585,7 +584,7 @@ namespace MathNet.Numerics.Distributions { if (alpha <= 0.0 || alpha > 2.0 || beta < -1.0 || beta > 1.0 || scale <= 0.0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return SampleUnchecked(SystemRandomSource.Default, alpha, beta, scale, location); @@ -603,7 +602,7 @@ namespace MathNet.Numerics.Distributions { if (alpha <= 0.0 || alpha > 2.0 || beta < -1.0 || beta > 1.0 || scale <= 0.0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return SamplesUnchecked(SystemRandomSource.Default, alpha, beta, scale, location); @@ -622,7 +621,7 @@ namespace MathNet.Numerics.Distributions { if (alpha <= 0.0 || alpha > 2.0 || beta < -1.0 || beta > 1.0 || scale <= 0.0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } SamplesUnchecked(SystemRandomSource.Default, values, alpha, beta, scale, location); diff --git a/src/Numerics/Distributions/StudentT.cs b/src/Numerics/Distributions/StudentT.cs index e1e1f16d..2359b6ee 100644 --- a/src/Numerics/Distributions/StudentT.cs +++ b/src/Numerics/Distributions/StudentT.cs @@ -29,7 +29,6 @@ using System; using System.Collections.Generic; -using MathNet.Numerics.Properties; using MathNet.Numerics.Random; using MathNet.Numerics.RootFinding; @@ -87,7 +86,7 @@ namespace MathNet.Numerics.Distributions { if (!IsValidParameterSet(location, scale, freedom)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } _random = SystemRandomSource.Default; @@ -108,7 +107,7 @@ namespace MathNet.Numerics.Distributions { if (!IsValidParameterSet(location, scale, freedom)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } _random = randomSource ?? SystemRandomSource.Default; @@ -376,7 +375,7 @@ namespace MathNet.Numerics.Distributions { if (scale <= 0.0 || freedom <= 0.0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } // TODO JVG we can probably do a better job for Cauchy special case @@ -405,7 +404,7 @@ namespace MathNet.Numerics.Distributions { if (scale <= 0.0 || freedom <= 0.0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } // TODO JVG we can probably do a better job for Cauchy special case @@ -434,7 +433,7 @@ namespace MathNet.Numerics.Distributions { if (scale <= 0.0 || freedom <= 0.0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } // TODO JVG we can probably do a better job for Cauchy special case @@ -464,7 +463,7 @@ namespace MathNet.Numerics.Distributions { if (scale <= 0.0 || freedom <= 0.0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } // TODO JVG we can probably do a better job for Cauchy special case @@ -500,7 +499,7 @@ namespace MathNet.Numerics.Distributions { if (scale <= 0.0 || freedom <= 0.0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return SampleUnchecked(rnd, location, scale, freedom); @@ -518,7 +517,7 @@ namespace MathNet.Numerics.Distributions { if (scale <= 0.0 || freedom <= 0.0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return SamplesUnchecked(rnd, location, scale, freedom); @@ -537,7 +536,7 @@ namespace MathNet.Numerics.Distributions { if (scale <= 0.0 || freedom <= 0.0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } SamplesUnchecked(rnd, values, location, scale, freedom); @@ -554,7 +553,7 @@ namespace MathNet.Numerics.Distributions { if (scale <= 0.0 || freedom <= 0.0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return SampleUnchecked(SystemRandomSource.Default, location, scale, freedom); @@ -571,7 +570,7 @@ namespace MathNet.Numerics.Distributions { if (scale <= 0.0 || freedom <= 0.0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return SamplesUnchecked(SystemRandomSource.Default, location, scale, freedom); @@ -589,7 +588,7 @@ namespace MathNet.Numerics.Distributions { if (scale <= 0.0 || freedom <= 0.0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } SamplesUnchecked(SystemRandomSource.Default, values, location, scale, freedom); diff --git a/src/Numerics/Distributions/Triangular.cs b/src/Numerics/Distributions/Triangular.cs index cfb04fed..8f3b75d3 100644 --- a/src/Numerics/Distributions/Triangular.cs +++ b/src/Numerics/Distributions/Triangular.cs @@ -30,7 +30,6 @@ using System; using System.Collections.Generic; using System.Linq; -using MathNet.Numerics.Properties; using MathNet.Numerics.Random; using MathNet.Numerics.Threading; @@ -63,7 +62,7 @@ namespace MathNet.Numerics.Distributions { if (!IsValidParameterSet(lower, upper, mode)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } _random = SystemRandomSource.Default; @@ -84,7 +83,7 @@ namespace MathNet.Numerics.Distributions { if (!IsValidParameterSet(lower, upper, mode)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } _random = randomSource ?? SystemRandomSource.Default; @@ -327,7 +326,7 @@ namespace MathNet.Numerics.Distributions { if (!(upper >= mode && mode >= lower)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } var a = lower; @@ -374,7 +373,7 @@ namespace MathNet.Numerics.Distributions { if (!(upper >= mode && mode >= lower)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } var a = lower; @@ -413,7 +412,7 @@ namespace MathNet.Numerics.Distributions { if (!(upper >= mode && mode >= lower)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } var a = lower; @@ -451,7 +450,7 @@ namespace MathNet.Numerics.Distributions { if (!(upper >= mode && mode >= lower)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return SampleUnchecked(rnd, lower, upper, mode); @@ -469,7 +468,7 @@ namespace MathNet.Numerics.Distributions { if (!(upper >= mode && mode >= lower)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return SamplesUnchecked(rnd, lower, upper, mode); @@ -488,7 +487,7 @@ namespace MathNet.Numerics.Distributions { if (!(upper >= mode && mode >= lower)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } SamplesUnchecked(rnd, values, lower, upper, mode); @@ -505,7 +504,7 @@ namespace MathNet.Numerics.Distributions { if (!(upper >= mode && mode >= lower)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return SampleUnchecked(SystemRandomSource.Default, lower, upper, mode); @@ -522,7 +521,7 @@ namespace MathNet.Numerics.Distributions { if (!(upper >= mode && mode >= lower)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return SamplesUnchecked(SystemRandomSource.Default, lower, upper, mode); @@ -540,7 +539,7 @@ namespace MathNet.Numerics.Distributions { if (!(upper >= mode && mode >= lower)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } SamplesUnchecked(SystemRandomSource.Default, values, lower, upper, mode); diff --git a/src/Numerics/Distributions/TruncatedPareto.cs b/src/Numerics/Distributions/TruncatedPareto.cs index 155266c8..e35fbe9f 100644 --- a/src/Numerics/Distributions/TruncatedPareto.cs +++ b/src/Numerics/Distributions/TruncatedPareto.cs @@ -27,7 +27,6 @@ // OTHER DEALINGS IN THE SOFTWARE. // -using MathNet.Numerics.Properties; using MathNet.Numerics.Random; using System; using System.Collections.Generic; @@ -50,7 +49,7 @@ namespace MathNet.Numerics.Distributions { if (!IsValidParameterSet(scale, shape, truncation)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } _random = randomSource ?? SystemRandomSource.Default; Scale = scale; @@ -216,7 +215,7 @@ namespace MathNet.Numerics.Distributions { if (!IsValidParameterSet(scale, shape, truncation)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return SampleUnchecked(rnd, scale, shape, truncation); } @@ -233,7 +232,7 @@ namespace MathNet.Numerics.Distributions { if (!IsValidParameterSet(scale, shape, truncation)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } SamplesUnchecked(rnd, values, scale, shape, truncation); } @@ -250,7 +249,7 @@ namespace MathNet.Numerics.Distributions { if (!IsValidParameterSet(scale, shape, truncation)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return SamplesUnchecked(rnd, scale, shape, truncation); } @@ -338,7 +337,7 @@ namespace MathNet.Numerics.Distributions { if (!IsValidParameterSet(scale, shape, truncation)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return InvCDFUncheckedImpl(scale, shape, truncation, p); } @@ -356,7 +355,7 @@ namespace MathNet.Numerics.Distributions { if (!IsValidParameterSet(scale, shape, truncation)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return DensityImpl(scale, shape, truncation, x); } @@ -374,7 +373,7 @@ namespace MathNet.Numerics.Distributions { if (!IsValidParameterSet(scale, shape, truncation)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return DensityLnImpl(scale, shape, truncation, x); } @@ -392,7 +391,7 @@ namespace MathNet.Numerics.Distributions { if (!IsValidParameterSet(scale, shape, truncation)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return CumulativeDistributionImpl(scale, shape, truncation, x); } diff --git a/src/Numerics/Distributions/Weibull.cs b/src/Numerics/Distributions/Weibull.cs index c54c74a1..97ec2741 100644 --- a/src/Numerics/Distributions/Weibull.cs +++ b/src/Numerics/Distributions/Weibull.cs @@ -30,7 +30,6 @@ using System; using System.Collections.Generic; using System.Linq; -using MathNet.Numerics.Properties; using MathNet.Numerics.Random; using MathNet.Numerics.Threading; @@ -69,7 +68,7 @@ namespace MathNet.Numerics.Distributions { if (!IsValidParameterSet(shape, scale)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } _random = SystemRandomSource.Default; @@ -88,7 +87,7 @@ namespace MathNet.Numerics.Distributions { if (!IsValidParameterSet(shape, scale)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } _random = randomSource ?? SystemRandomSource.Default; @@ -319,7 +318,7 @@ namespace MathNet.Numerics.Distributions { if (shape <= 0.0 || scale <= 0.0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } if (x >= 0.0) @@ -350,7 +349,7 @@ namespace MathNet.Numerics.Distributions { if (shape <= 0.0 || scale <= 0.0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } if (x >= 0.0) @@ -381,7 +380,7 @@ namespace MathNet.Numerics.Distributions { if (shape <= 0.0 || scale <= 0.0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } if (x < 0.0) @@ -450,7 +449,7 @@ namespace MathNet.Numerics.Distributions { if (shape <= 0.0 || scale <= 0.0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return SampleUnchecked(rnd, shape, scale); @@ -467,7 +466,7 @@ namespace MathNet.Numerics.Distributions { if (shape <= 0.0 || scale <= 0.0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return SamplesUnchecked(rnd, shape, scale); @@ -485,7 +484,7 @@ namespace MathNet.Numerics.Distributions { if (shape <= 0.0 || scale <= 0.0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } SamplesUnchecked(rnd, values, shape, scale); @@ -501,7 +500,7 @@ namespace MathNet.Numerics.Distributions { if (shape <= 0.0 || scale <= 0.0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return SampleUnchecked(SystemRandomSource.Default, shape, scale); @@ -517,7 +516,7 @@ namespace MathNet.Numerics.Distributions { if (shape <= 0.0 || scale <= 0.0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return SamplesUnchecked(SystemRandomSource.Default, shape, scale); @@ -534,7 +533,7 @@ namespace MathNet.Numerics.Distributions { if (shape <= 0.0 || scale <= 0.0) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } SamplesUnchecked(SystemRandomSource.Default, values, shape, scale); diff --git a/src/Numerics/Distributions/Wishart.cs b/src/Numerics/Distributions/Wishart.cs index 1a446095..33a57a69 100644 --- a/src/Numerics/Distributions/Wishart.cs +++ b/src/Numerics/Distributions/Wishart.cs @@ -31,7 +31,6 @@ using System; using MathNet.Numerics.LinearAlgebra; using MathNet.Numerics.LinearAlgebra.Double; using MathNet.Numerics.LinearAlgebra.Factorization; -using MathNet.Numerics.Properties; using MathNet.Numerics.Random; namespace MathNet.Numerics.Distributions @@ -71,7 +70,7 @@ namespace MathNet.Numerics.Distributions { if (Control.CheckDistributionParameters && !IsValidParameterSet(degreesOfFreedom, scale)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } _random = SystemRandomSource.Default; @@ -90,7 +89,7 @@ namespace MathNet.Numerics.Distributions { if (Control.CheckDistributionParameters && !IsValidParameterSet(degreesOfFreedom, scale)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } _random = randomSource ?? SystemRandomSource.Default; @@ -238,7 +237,7 @@ namespace MathNet.Numerics.Distributions { if (Control.CheckDistributionParameters && !IsValidParameterSet(degreesOfFreedom, scale)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return DoSample(rnd, degreesOfFreedom, scale, scale.Cholesky()); diff --git a/src/Numerics/Distributions/Zipf.cs b/src/Numerics/Distributions/Zipf.cs index d925c85c..a5d91956 100644 --- a/src/Numerics/Distributions/Zipf.cs +++ b/src/Numerics/Distributions/Zipf.cs @@ -29,7 +29,6 @@ using System; using System.Collections.Generic; -using MathNet.Numerics.Properties; using MathNet.Numerics.Random; namespace MathNet.Numerics.Distributions @@ -65,7 +64,7 @@ namespace MathNet.Numerics.Distributions { if (!IsValidParameterSet(s, n)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } _random = SystemRandomSource.Default; @@ -83,7 +82,7 @@ namespace MathNet.Numerics.Distributions { if (!IsValidParameterSet(s, n)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } _random = randomSource ?? SystemRandomSource.Default; @@ -256,7 +255,7 @@ namespace MathNet.Numerics.Distributions { if (!(n > 0 && s > 0.0)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return (1.0/Math.Pow(k, s))/SpecialFunctions.GeneralHarmonic(n, s); @@ -273,7 +272,7 @@ namespace MathNet.Numerics.Distributions { if (!(n > 0 && s > 0.0)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return Math.Log(PMF(s, n, k)); @@ -291,7 +290,7 @@ namespace MathNet.Numerics.Distributions { if (!(n > 0 && s > 0.0)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } if (x < 1) @@ -384,7 +383,7 @@ namespace MathNet.Numerics.Distributions { if (!(n > 0 && s > 0.0)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return SampleUnchecked(rnd, s, n); @@ -400,7 +399,7 @@ namespace MathNet.Numerics.Distributions { if (!(n > 0 && s > 0.0)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return SamplesUnchecked(rnd, s, n); @@ -417,7 +416,7 @@ namespace MathNet.Numerics.Distributions { if (!(n > 0 && s > 0.0)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } SamplesUnchecked(rnd, values, s, n); @@ -432,7 +431,7 @@ namespace MathNet.Numerics.Distributions { if (!(n > 0 && s > 0.0)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return SampleUnchecked(SystemRandomSource.Default, s, n); @@ -447,7 +446,7 @@ namespace MathNet.Numerics.Distributions { if (!(n > 0 && s > 0.0)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } return SamplesUnchecked(SystemRandomSource.Default, s, n); @@ -463,7 +462,7 @@ namespace MathNet.Numerics.Distributions { if (!(n > 0 && s > 0.0)) { - throw new ArgumentException(Resources.InvalidDistributionParameters); + throw new ArgumentException("Invalid parametrization for the distribution."); } SamplesUnchecked(SystemRandomSource.Default, values, s, n); diff --git a/src/Numerics/Exceptions.cs b/src/Numerics/Exceptions.cs index 2cc6c10e..d0b28fee 100644 --- a/src/Numerics/Exceptions.cs +++ b/src/Numerics/Exceptions.cs @@ -1,5 +1,4 @@ using System; -using MathNet.Numerics.Properties; namespace MathNet.Numerics { @@ -9,7 +8,7 @@ namespace MathNet.Numerics [Serializable] public class NonConvergenceException : Exception { - public NonConvergenceException() : base(Resources.ConvergenceFailed) + public NonConvergenceException() : base("An algorithm failed to converge.") { } @@ -35,7 +34,7 @@ namespace MathNet.Numerics public class NumericalBreakdownException : NonConvergenceException { public NumericalBreakdownException() - : base(Resources.NumericalBreakdown) + : base("Algorithm experience a numerical break down.") { } @@ -90,17 +89,17 @@ namespace MathNet.Numerics public class InvalidParameterException : NativeInterfaceException { public InvalidParameterException() - : base(Resources.InvalidParameter) + : base("An invalid parameter was passed to a native method.") { } public InvalidParameterException(int parameter) - : base(string.Format(Resources.InvalidParameterWithNumber, parameter)) + : base($"An invalid parameter was passed to a native method, parameter number : {parameter}") { } public InvalidParameterException(int parameter, Exception innerException) - : base(string.Format(Resources.InvalidParameterWithNumber, parameter), innerException) + : base($"An invalid parameter was passed to a native method, parameter number : {parameter}", innerException) { } #if !NETSTANDARD1_3 @@ -118,12 +117,12 @@ namespace MathNet.Numerics public class MemoryAllocationException : NativeInterfaceException { public MemoryAllocationException() - : base(Resources.MemoryAllocation) + : base("Unable to allocate native memory.") { } public MemoryAllocationException(Exception innerException) - : base(Resources.MemoryAllocation, innerException) + : base("Unable to allocate native memory.", innerException) { } #if !NETSTANDARD1_3 @@ -141,17 +140,17 @@ namespace MathNet.Numerics public class SingularUMatrixException : NativeInterfaceException { public SingularUMatrixException() - : base(Resources.SingularUMatrix) + : base("U is singular, and the inversion could not be completed.") { } public SingularUMatrixException(int element) - : base(string.Format(Resources.SingularUMatrixWithElement, element)) + : base($"U is singular, and the inversion could not be completed. The {element}-th diagonal element of the factor U is zero.") { } public SingularUMatrixException(int element, Exception innerException) - : base(string.Format(Resources.SingularUMatrixWithElement, element), innerException) + : base($"U is singular, and the inversion could not be completed. The {element}-th diagonal element of the factor U is zero.", innerException) { } #if !NETSTANDARD1_3 diff --git a/src/Numerics/FindRoots.cs b/src/Numerics/FindRoots.cs index 3323d65d..b9604f6e 100644 --- a/src/Numerics/FindRoots.cs +++ b/src/Numerics/FindRoots.cs @@ -28,7 +28,6 @@ // using System; -using MathNet.Numerics.Properties; using MathNet.Numerics.RootFinding; using Complex = System.Numerics.Complex; @@ -44,14 +43,12 @@ namespace MathNet.Numerics /// Maximum number of iterations. Example: 100. public static double OfFunction(Func f, double lowerBound, double upperBound, double accuracy = 1e-8, int maxIterations = 100) { - double root; - if (!ZeroCrossingBracketing.ExpandReduce(f, ref lowerBound, ref upperBound, 1.6, maxIterations, maxIterations*10)) { - throw new NonConvergenceException(Resources.RootFindingFailed); + throw new NonConvergenceException("The algorithm has failed, exceeded the number of iterations allowed or there is no root within the provided bounds."); } - if (Brent.TryFindRoot(f, lowerBound, upperBound, accuracy, maxIterations, out root)) + if (Brent.TryFindRoot(f, lowerBound, upperBound, accuracy, maxIterations, out var root)) { return root; } @@ -61,7 +58,7 @@ namespace MathNet.Numerics return root; } - throw new NonConvergenceException(Resources.RootFindingFailed); + throw new NonConvergenceException("The algorithm has failed, exceeded the number of iterations allowed or there is no root within the provided bounds."); } /// Find a solution of the equation f(x)=0. diff --git a/src/Numerics/Generate.cs b/src/Numerics/Generate.cs index 1bdd7205..4258f961 100644 --- a/src/Numerics/Generate.cs +++ b/src/Numerics/Generate.cs @@ -31,7 +31,6 @@ using System; using System.Collections.Generic; using System.Linq; using MathNet.Numerics.Distributions; -using MathNet.Numerics.Properties; using MathNet.Numerics.Random; using MathNet.Numerics.Threading; using BigInteger = System.Numerics.BigInteger; @@ -69,7 +68,7 @@ namespace MathNet.Numerics { if (pointsA.Length != pointsB.Length) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(pointsB)); + throw new ArgumentException("The array arguments must have the same length.", nameof(pointsB)); } var res = new T[pointsA.Length]; diff --git a/src/Numerics/GoodnessOfFit.cs b/src/Numerics/GoodnessOfFit.cs index 65b04012..d72c8a14 100644 --- a/src/Numerics/GoodnessOfFit.cs +++ b/src/Numerics/GoodnessOfFit.cs @@ -29,7 +29,6 @@ using System; using System.Collections.Generic; -using MathNet.Numerics.Properties; using MathNet.Numerics.Statistics; namespace MathNet.Numerics @@ -94,7 +93,7 @@ namespace MathNet.Numerics { if (!ieO.MoveNext()) { - throw new ArgumentOutOfRangeException(nameof(modelledValues), Resources.ArgumentArraysSameLength); + throw new ArgumentOutOfRangeException(nameof(modelledValues), "The array arguments must have the same length."); } double currentM = ieM.Current; double currentO = ieO.Current; @@ -105,7 +104,7 @@ namespace MathNet.Numerics if (degreesOfFreedom >= n) { - throw new ArgumentOutOfRangeException(nameof(degreesOfFreedom), Resources.DegreesOfFreedomMustBeLessThanSampleSize); + throw new ArgumentOutOfRangeException(nameof(degreesOfFreedom), "The sample size must be larger than the given degrees of freedom."); } return Math.Sqrt(accumulator / (n - degreesOfFreedom)); } @@ -135,7 +134,7 @@ namespace MathNet.Numerics { if (!ieF.MoveNext()) { - throw new ArgumentOutOfRangeException(nameof(modelledValues), Resources.ArgumentArraysSameLength); + throw new ArgumentOutOfRangeException(nameof(modelledValues), "The array arguments must have the same length."); } double currentY = ieY.Current; @@ -165,7 +164,7 @@ namespace MathNet.Numerics if (ieF.MoveNext()) { - throw new ArgumentOutOfRangeException(nameof(observedValues), Resources.ArgumentArraysSameLength); + throw new ArgumentOutOfRangeException(nameof(observedValues), "The array arguments must have the same length."); } } return 1 - ssRes/ssTot; diff --git a/src/Numerics/IntegralTransforms/Fourier.cs b/src/Numerics/IntegralTransforms/Fourier.cs index 0897ac63..9653853d 100644 --- a/src/Numerics/IntegralTransforms/Fourier.cs +++ b/src/Numerics/IntegralTransforms/Fourier.cs @@ -30,7 +30,6 @@ using System; using MathNet.Numerics.LinearAlgebra; using MathNet.Numerics.LinearAlgebra.Storage; -using MathNet.Numerics.Properties; using MathNet.Numerics.Providers.FourierTransform; using Complex = System.Numerics.Complex; @@ -121,7 +120,7 @@ namespace MathNet.Numerics.IntegralTransforms { if (real.Length != imaginary.Length) { - throw new ArgumentException(Resources.ArgumentArraysSameLength); + throw new ArgumentException("The array arguments must have the same length."); } // TODO: consider to support this natively by the provider, without the need for copying @@ -152,7 +151,7 @@ namespace MathNet.Numerics.IntegralTransforms { if (real.Length != imaginary.Length) { - throw new ArgumentException(Resources.ArgumentArraysSameLength); + throw new ArgumentException("The array arguments must have the same length."); } // TODO: consider to support this natively by the provider, without the need for copying @@ -187,7 +186,7 @@ namespace MathNet.Numerics.IntegralTransforms int length = n.IsEven() ? n + 2 : n + 1; if (data.Length < length) { - throw new ArgumentException(string.Format(Resources.ArrayTooSmall, length)); + throw new ArgumentException($"The given array is too small. It must be at least {length} long."); } if ((options & FourierOptions.InverseExponent) == FourierOptions.InverseExponent) @@ -221,7 +220,7 @@ namespace MathNet.Numerics.IntegralTransforms int length = n.IsEven() ? n + 2 : n + 1; if (data.Length < length) { - throw new ArgumentException(string.Format(Resources.ArrayTooSmall, length)); + throw new ArgumentException($"The given array is too small. It must be at least {length} long."); } if ((options & FourierOptions.InverseExponent) == FourierOptions.InverseExponent) @@ -471,7 +470,7 @@ namespace MathNet.Numerics.IntegralTransforms { if (real.Length != imaginary.Length) { - throw new ArgumentException(Resources.ArgumentArraysSameLength); + throw new ArgumentException("The array arguments must have the same length."); } // TODO: consider to support this natively by the provider, without the need for copying @@ -502,7 +501,7 @@ namespace MathNet.Numerics.IntegralTransforms { if (real.Length != imaginary.Length) { - throw new ArgumentException(Resources.ArgumentArraysSameLength); + throw new ArgumentException("The array arguments must have the same length."); } // TODO: consider to support this natively by the provider, without the need for copying @@ -537,7 +536,7 @@ namespace MathNet.Numerics.IntegralTransforms int length = n.IsEven() ? n + 2 : n + 1; if (data.Length < length) { - throw new ArgumentException(string.Format(Resources.ArrayTooSmall, length)); + throw new ArgumentException($"The given array is too small. It must be at least {length} long."); } if ((options & FourierOptions.InverseExponent) == FourierOptions.InverseExponent) @@ -573,7 +572,7 @@ namespace MathNet.Numerics.IntegralTransforms int length = n.IsEven() ? n + 2 : n + 1; if (data.Length < length) { - throw new ArgumentException(string.Format(Resources.ArrayTooSmall, length)); + throw new ArgumentException($"The given array is too small. It must be at least {length} long."); } if ((options & FourierOptions.InverseExponent) == FourierOptions.InverseExponent) diff --git a/src/Numerics/Integration/NewtonCotesTrapeziumRule.cs b/src/Numerics/Integration/NewtonCotesTrapeziumRule.cs index b29037b1..7e421349 100644 --- a/src/Numerics/Integration/NewtonCotesTrapeziumRule.cs +++ b/src/Numerics/Integration/NewtonCotesTrapeziumRule.cs @@ -30,7 +30,6 @@ using System; using System.Collections.Generic; using System.Numerics; -using MathNet.Numerics.Properties; namespace MathNet.Numerics.Integration { @@ -93,7 +92,7 @@ namespace MathNet.Numerics.Integration if (numberOfPartitions <= 0) { - throw new ArgumentOutOfRangeException(nameof(numberOfPartitions), Resources.ArgumentPositive); + throw new ArgumentOutOfRangeException(nameof(numberOfPartitions), "Value must be positive (and not zero)."); } double step = (intervalEnd - intervalBegin)/numberOfPartitions; @@ -127,7 +126,7 @@ namespace MathNet.Numerics.Integration if (numberOfPartitions <= 0) { - throw new ArgumentOutOfRangeException(nameof(numberOfPartitions), Resources.ArgumentPositive); + throw new ArgumentOutOfRangeException(nameof(numberOfPartitions), "Value must be positive (and not zero)."); } double step = (intervalEnd - intervalBegin) / numberOfPartitions; @@ -143,7 +142,7 @@ namespace MathNet.Numerics.Integration return step * sum; } - + /// /// Adaptive approximation of the definite integral in the provided interval by the trapezium rule. /// diff --git a/src/Numerics/Integration/SimpsonRule.cs b/src/Numerics/Integration/SimpsonRule.cs index e98ab7e4..e4c17681 100644 --- a/src/Numerics/Integration/SimpsonRule.cs +++ b/src/Numerics/Integration/SimpsonRule.cs @@ -28,7 +28,6 @@ // using System; -using MathNet.Numerics.Properties; namespace MathNet.Numerics.Integration { @@ -72,12 +71,12 @@ namespace MathNet.Numerics.Integration if (numberOfPartitions <= 0) { - throw new ArgumentOutOfRangeException(nameof(numberOfPartitions), Resources.ArgumentPositive); + throw new ArgumentOutOfRangeException(nameof(numberOfPartitions), "Value must be positive (and not zero)."); } if (numberOfPartitions.IsOdd()) { - throw new ArgumentException(Resources.ArgumentEven, nameof(numberOfPartitions)); + throw new ArgumentException("Value must be even.", nameof(numberOfPartitions)); } double step = (intervalEnd - intervalBegin)/numberOfPartitions; diff --git a/src/Numerics/Interpolation/Barycentric.cs b/src/Numerics/Interpolation/Barycentric.cs index a9c6c972..977c52ff 100644 --- a/src/Numerics/Interpolation/Barycentric.cs +++ b/src/Numerics/Interpolation/Barycentric.cs @@ -30,7 +30,6 @@ using System; using System.Collections.Generic; using System.Linq; -using MathNet.Numerics.Properties; namespace MathNet.Numerics.Interpolation { @@ -51,12 +50,12 @@ namespace MathNet.Numerics.Interpolation { if (x.Length != y.Length || x.Length != w.Length) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } if (x.Length < 1) { - throw new ArgumentException(string.Format(Resources.ArrayTooSmall, 1), nameof(x)); + throw new ArgumentException("The given array is too small. It must be at least 1 long.", nameof(x)); } _x = x; @@ -71,12 +70,12 @@ namespace MathNet.Numerics.Interpolation { if (x.Length != y.Length) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } if (x.Length < 1) { - throw new ArgumentException(string.Format(Resources.ArrayTooSmall, 1), nameof(x)); + throw new ArgumentException("The given array is too small. It must be at least 1 long.", nameof(x)); } var weights = new double[x.Length]; @@ -97,7 +96,7 @@ namespace MathNet.Numerics.Interpolation { if (x.Length != y.Length) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } Sorting.Sort(x, y); @@ -137,12 +136,12 @@ namespace MathNet.Numerics.Interpolation { if (x.Length != y.Length) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } if (x.Length < 1) { - throw new ArgumentException(string.Format(Resources.ArrayTooSmall, 1), nameof(x)); + throw new ArgumentException("The given array is too small. It must be at least 1 long.", nameof(x)); } if (0 > order || x.Length <= order) @@ -194,7 +193,7 @@ namespace MathNet.Numerics.Interpolation { if (x.Length != y.Length) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } Sorting.Sort(x, y); diff --git a/src/Numerics/Interpolation/BulirschStoerRationalInterpolation.cs b/src/Numerics/Interpolation/BulirschStoerRationalInterpolation.cs index 84b95367..cc9797e9 100644 --- a/src/Numerics/Interpolation/BulirschStoerRationalInterpolation.cs +++ b/src/Numerics/Interpolation/BulirschStoerRationalInterpolation.cs @@ -30,7 +30,6 @@ using System; using System.Collections.Generic; using System.Linq; -using MathNet.Numerics.Properties; namespace MathNet.Numerics.Interpolation { @@ -53,12 +52,12 @@ namespace MathNet.Numerics.Interpolation { if (x.Length != y.Length) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } if (x.Length < 1) { - throw new ArgumentException(string.Format(Resources.ArrayTooSmall, 1), nameof(x)); + throw new ArgumentException("The given array is too small. It must be at least 1 long.", nameof(x)); } _x = x; @@ -81,7 +80,7 @@ namespace MathNet.Numerics.Interpolation { if (x.Length != y.Length) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } Sorting.Sort(x, y); diff --git a/src/Numerics/Interpolation/CubicSpline.cs b/src/Numerics/Interpolation/CubicSpline.cs index d03f9682..f2284506 100644 --- a/src/Numerics/Interpolation/CubicSpline.cs +++ b/src/Numerics/Interpolation/CubicSpline.cs @@ -30,7 +30,6 @@ using System; using System.Collections.Generic; using System.Linq; -using MathNet.Numerics.Properties; namespace MathNet.Numerics.Interpolation { @@ -56,12 +55,12 @@ namespace MathNet.Numerics.Interpolation { if (x.Length != c0.Length + 1 || x.Length != c1.Length + 1 || x.Length != c2.Length + 1 || x.Length != c3.Length + 1) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } if (x.Length < 2) { - throw new ArgumentException(string.Format(Resources.ArrayTooSmall, 2), nameof(x)); + throw new ArgumentException("The given array is too small. It must be at least 2 long.", nameof(x)); } _x = x; @@ -79,12 +78,12 @@ namespace MathNet.Numerics.Interpolation { if (x.Length != y.Length || x.Length != firstDerivatives.Length) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } if (x.Length < 2) { - throw new ArgumentException(string.Format(Resources.ArrayTooSmall, 2), nameof(x)); + throw new ArgumentException("The given array is too small. It must be at least 2 long.", nameof(x)); } var c0 = new double[x.Length - 1]; @@ -112,12 +111,12 @@ namespace MathNet.Numerics.Interpolation { if (x.Length != y.Length || x.Length != firstDerivatives.Length) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } if (x.Length < 2) { - throw new ArgumentException(string.Format(Resources.ArrayTooSmall, 2), nameof(x)); + throw new ArgumentException("The given array is too small. It must be at least 2 long.", nameof(x)); } Sorting.Sort(x, y, firstDerivatives); @@ -141,12 +140,12 @@ namespace MathNet.Numerics.Interpolation { if (x.Length != y.Length) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } if (x.Length < 5) { - throw new ArgumentException(string.Format(Resources.ArrayTooSmall, 5), nameof(x)); + throw new ArgumentException("The given array is too small. It must be at least 5 long.", nameof(x)); } /* Prepare divided differences (diff) and weights (w) */ @@ -194,7 +193,7 @@ namespace MathNet.Numerics.Interpolation { if (x.Length != y.Length) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } Sorting.Sort(x, y); @@ -221,12 +220,12 @@ namespace MathNet.Numerics.Interpolation { if (x.Length != y.Length) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } if (x.Length < 2) { - throw new ArgumentException(string.Format(Resources.ArrayTooSmall, 2), nameof(x)); + throw new ArgumentException("The given array is too small. It must be at least 2 long.", nameof(x)); } int n = x.Length; @@ -281,7 +280,7 @@ namespace MathNet.Numerics.Interpolation b[0] = (3*((y[1] - y[0])/(x[1] - x[0]))) - (0.5*leftBoundary*(x[1] - x[0])); break; default: - throw new NotSupportedException(Resources.InvalidLeftBoundaryCondition); + throw new NotSupportedException("Invalid Left Boundary Condition."); } // Central Conditions @@ -315,7 +314,7 @@ namespace MathNet.Numerics.Interpolation b[n - 1] = (3*(y[n - 1] - y[n - 2])/(x[n - 1] - x[n - 2])) + (0.5*rightBoundary*(x[n - 1] - x[n - 2])); break; default: - throw new NotSupportedException(Resources.InvalidRightBoundaryCondition); + throw new NotSupportedException("Invalid Right Boundary Condition."); } // Build Spline @@ -333,7 +332,7 @@ namespace MathNet.Numerics.Interpolation { if (x.Length != y.Length) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } Sorting.Sort(x, y); diff --git a/src/Numerics/Interpolation/LinearSpline.cs b/src/Numerics/Interpolation/LinearSpline.cs index 4761fabc..ef38992a 100644 --- a/src/Numerics/Interpolation/LinearSpline.cs +++ b/src/Numerics/Interpolation/LinearSpline.cs @@ -30,7 +30,6 @@ using System; using System.Collections.Generic; using System.Linq; -using MathNet.Numerics.Properties; namespace MathNet.Numerics.Interpolation { @@ -52,12 +51,12 @@ namespace MathNet.Numerics.Interpolation { if ((x.Length != c0.Length + 1 && x.Length != c0.Length) || x.Length != c1.Length + 1) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } if (x.Length < 2) { - throw new ArgumentException(string.Format(Resources.ArrayTooSmall, 2), nameof(x)); + throw new ArgumentException("The given array is too small. It must be at least 2 long.", nameof(x)); } _x = x; @@ -73,12 +72,12 @@ namespace MathNet.Numerics.Interpolation { if (x.Length != y.Length) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } if (x.Length < 2) { - throw new ArgumentException(string.Format(Resources.ArrayTooSmall, 2), nameof(x)); + throw new ArgumentException("The given array is too small. It must be at least 2 long.", nameof(x)); } var c1 = new double[x.Length - 1]; @@ -98,7 +97,7 @@ namespace MathNet.Numerics.Interpolation { if (x.Length != y.Length) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } Sorting.Sort(x, y); diff --git a/src/Numerics/Interpolation/LogLinear.cs b/src/Numerics/Interpolation/LogLinear.cs index 88f82e74..b56bf2e3 100644 --- a/src/Numerics/Interpolation/LogLinear.cs +++ b/src/Numerics/Interpolation/LogLinear.cs @@ -30,7 +30,6 @@ using System; using System.Collections.Generic; using System.Linq; -using MathNet.Numerics.Properties; using MathNet.Numerics.Threading; namespace MathNet.Numerics.Interpolation @@ -60,7 +59,7 @@ namespace MathNet.Numerics.Interpolation { if (x.Length != y.Length) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } var logy = new double[y.Length]; @@ -83,7 +82,7 @@ namespace MathNet.Numerics.Interpolation { if (x.Length != y.Length) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } Sorting.Sort(x, y); diff --git a/src/Numerics/Interpolation/NevillePolynomialInterpolation.cs b/src/Numerics/Interpolation/NevillePolynomialInterpolation.cs index e0d932d9..9344a44c 100644 --- a/src/Numerics/Interpolation/NevillePolynomialInterpolation.cs +++ b/src/Numerics/Interpolation/NevillePolynomialInterpolation.cs @@ -30,7 +30,6 @@ using System; using System.Collections.Generic; using System.Linq; -using MathNet.Numerics.Properties; namespace MathNet.Numerics.Interpolation { @@ -58,19 +57,19 @@ namespace MathNet.Numerics.Interpolation { if (x.Length != y.Length) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } if (x.Length < 1) { - throw new ArgumentException(string.Format(Resources.ArrayTooSmall, 1), nameof(x)); + throw new ArgumentException("The given array is too small. It must be at least 1 long.", nameof(x)); } for (var i = 1; i < x.Length; ++i) { if (x[i] == x[i - 1]) { - throw new ArgumentException(Resources.Interpolation_Initialize_SamplePointsNotUnique, nameof(x)); + throw new ArgumentException("All sample points should be unique.", nameof(x)); } } @@ -94,7 +93,7 @@ namespace MathNet.Numerics.Interpolation { if (x.Length != y.Length) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } Sorting.Sort(x, y); diff --git a/src/Numerics/Interpolation/QuadraticSpline.cs b/src/Numerics/Interpolation/QuadraticSpline.cs index 3cd8eca0..843345c4 100644 --- a/src/Numerics/Interpolation/QuadraticSpline.cs +++ b/src/Numerics/Interpolation/QuadraticSpline.cs @@ -28,7 +28,6 @@ // using System; -using MathNet.Numerics.Properties; namespace MathNet.Numerics.Interpolation { @@ -52,12 +51,12 @@ namespace MathNet.Numerics.Interpolation { if (x.Length != c0.Length + 1 || x.Length != c1.Length + 1 || x.Length != c2.Length + 1) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } if (x.Length < 2) { - throw new ArgumentException(string.Format(Resources.ArrayTooSmall, 2), nameof(x)); + throw new ArgumentException("The given array is too small. It must be at least 2 long.", nameof(x)); } _x = x; diff --git a/src/Numerics/Interpolation/StepInterpolation.cs b/src/Numerics/Interpolation/StepInterpolation.cs index 81eeb842..e2018224 100644 --- a/src/Numerics/Interpolation/StepInterpolation.cs +++ b/src/Numerics/Interpolation/StepInterpolation.cs @@ -30,7 +30,6 @@ using System; using System.Collections.Generic; using System.Linq; -using MathNet.Numerics.Properties; namespace MathNet.Numerics.Interpolation { @@ -52,12 +51,12 @@ namespace MathNet.Numerics.Interpolation { if (x.Length != sy.Length) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } if (x.Length < 1) { - throw new ArgumentException(string.Format(Resources.ArrayTooSmall, 1), nameof(x)); + throw new ArgumentException("The given array is too small. It must be at least 1 long.", nameof(x)); } _x = x; @@ -81,7 +80,7 @@ namespace MathNet.Numerics.Interpolation { if (x.Length != y.Length) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } Sorting.Sort(x, y); diff --git a/src/Numerics/Interpolation/TransformedInterpolation.cs b/src/Numerics/Interpolation/TransformedInterpolation.cs index b9d0de9b..b2da0435 100644 --- a/src/Numerics/Interpolation/TransformedInterpolation.cs +++ b/src/Numerics/Interpolation/TransformedInterpolation.cs @@ -30,7 +30,6 @@ using System; using System.Collections.Generic; using System.Linq; -using MathNet.Numerics.Properties; using MathNet.Numerics.Threading; namespace MathNet.Numerics.Interpolation @@ -61,7 +60,7 @@ namespace MathNet.Numerics.Interpolation { if (x.Length != y.Length) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } var yhat = new double[y.Length]; @@ -88,7 +87,7 @@ namespace MathNet.Numerics.Interpolation { if (x.Length != y.Length) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } Sorting.Sort(x, y); diff --git a/src/Numerics/LinearAlgebra/Complex/DenseMatrix.cs b/src/Numerics/LinearAlgebra/Complex/DenseMatrix.cs index 1cf0f3aa..0cee1de6 100644 --- a/src/Numerics/LinearAlgebra/Complex/DenseMatrix.cs +++ b/src/Numerics/LinearAlgebra/Complex/DenseMatrix.cs @@ -35,7 +35,6 @@ using MathNet.Numerics.Distributions; using MathNet.Numerics.LinearAlgebra.Complex.Factorization; using MathNet.Numerics.LinearAlgebra.Factorization; using MathNet.Numerics.LinearAlgebra.Storage; -using MathNet.Numerics.Properties; using MathNet.Numerics.Providers.LinearAlgebra; using MathNet.Numerics.Threading; @@ -967,7 +966,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex { if (_rowCount != _columnCount) { - throw new ArgumentException(Resources.ArgumentMatrixSquare); + throw new ArgumentException("Matrix must be square."); } var sum = Complex.Zero; diff --git a/src/Numerics/LinearAlgebra/Complex/DiagonalMatrix.cs b/src/Numerics/LinearAlgebra/Complex/DiagonalMatrix.cs index 08319abb..2cdb8165 100644 --- a/src/Numerics/LinearAlgebra/Complex/DiagonalMatrix.cs +++ b/src/Numerics/LinearAlgebra/Complex/DiagonalMatrix.cs @@ -33,7 +33,6 @@ using System.Diagnostics; using System.Linq; using MathNet.Numerics.Distributions; using MathNet.Numerics.LinearAlgebra.Storage; -using MathNet.Numerics.Properties; using MathNet.Numerics.Providers.LinearAlgebra; using MathNet.Numerics.Threading; @@ -678,7 +677,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex { if (RowCount != ColumnCount) { - throw new ArgumentException(Resources.ArgumentMatrixSquare); + throw new ArgumentException("Matrix must be square."); } return _data.Aggregate(Complex.One, (current, t) => current * t); @@ -708,7 +707,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex { if (source.Length != _data.Length) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(source)); + throw new ArgumentException("The array arguments must have the same length.", nameof(source)); } Array.Copy(source, 0, _data, 0, source.Length); @@ -729,7 +728,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex { if (_data.Length != denseSource.Values.Length) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength, nameof(source)); + throw new ArgumentException("All vectors must have the same dimensionality.", nameof(source)); } Array.Copy(denseSource.Values, 0, _data, 0, denseSource.Values.Length); @@ -791,7 +790,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex { if (RowCount != ColumnCount) { - throw new ArgumentException(Resources.ArgumentMatrixSquare); + throw new ArgumentException("Matrix must be square."); } var inverse = (DiagonalMatrix)Clone(); @@ -803,7 +802,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex } else { - throw new ArgumentException(Resources.ArgumentMatrixNotSingular); + throw new ArgumentException("Matrix must not be singular."); } } diff --git a/src/Numerics/LinearAlgebra/Complex/Factorization/DenseCholesky.cs b/src/Numerics/LinearAlgebra/Complex/Factorization/DenseCholesky.cs index 03de8c52..124ed729 100644 --- a/src/Numerics/LinearAlgebra/Complex/Factorization/DenseCholesky.cs +++ b/src/Numerics/LinearAlgebra/Complex/Factorization/DenseCholesky.cs @@ -28,7 +28,6 @@ // using System; -using MathNet.Numerics.Properties; using MathNet.Numerics.Providers.LinearAlgebra; namespace MathNet.Numerics.LinearAlgebra.Complex.Factorization @@ -58,7 +57,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex.Factorization { if (matrix.RowCount != matrix.ColumnCount) { - throw new ArgumentException(Resources.ArgumentMatrixSquare); + throw new ArgumentException("Matrix must be square."); } // Create a new matrix for the Cholesky factor, then perform factorization (while overwriting). @@ -81,12 +80,12 @@ namespace MathNet.Numerics.LinearAlgebra.Complex.Factorization { if (result.RowCount != input.RowCount) { - throw new ArgumentException(Resources.ArgumentMatrixSameRowDimension); + throw new ArgumentException("Matrix row dimensions must agree."); } if (result.ColumnCount != input.ColumnCount) { - throw new ArgumentException(Resources.ArgumentMatrixSameColumnDimension); + throw new ArgumentException("Matrix column dimensions must agree."); } if (input.RowCount != Factor.RowCount) @@ -118,7 +117,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex.Factorization { if (input.Count != result.Count) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } if (input.Count != Factor.RowCount) @@ -153,7 +152,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex.Factorization { if (matrix.RowCount != matrix.ColumnCount) { - throw new ArgumentException(Resources.ArgumentMatrixSquare); + throw new ArgumentException("Matrix must be square."); } if (matrix.RowCount != Factor.RowCount || matrix.ColumnCount != Factor.ColumnCount) diff --git a/src/Numerics/LinearAlgebra/Complex/Factorization/DenseEvd.cs b/src/Numerics/LinearAlgebra/Complex/Factorization/DenseEvd.cs index bb65e2bb..17b6166d 100644 --- a/src/Numerics/LinearAlgebra/Complex/Factorization/DenseEvd.cs +++ b/src/Numerics/LinearAlgebra/Complex/Factorization/DenseEvd.cs @@ -28,7 +28,6 @@ // using System; -using MathNet.Numerics.Properties; using MathNet.Numerics.Providers.LinearAlgebra; namespace MathNet.Numerics.LinearAlgebra.Complex.Factorization @@ -64,7 +63,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex.Factorization { if (matrix.RowCount != matrix.ColumnCount) { - throw new ArgumentException(Resources.ArgumentMatrixSquare); + throw new ArgumentException("Matrix must be square."); } var order = matrix.RowCount; @@ -108,19 +107,19 @@ namespace MathNet.Numerics.LinearAlgebra.Complex.Factorization // The solution X should have the same number of columns as B if (input.ColumnCount != result.ColumnCount) { - throw new ArgumentException(Resources.ArgumentMatrixSameColumnDimension); + throw new ArgumentException("Matrix column dimensions must agree."); } // The dimension compatibility conditions for X = A\B require the two matrices A and B to have the same number of rows if (EigenValues.Count != input.RowCount) { - throw new ArgumentException(Resources.ArgumentMatrixSameRowDimension); + throw new ArgumentException("Matrix row dimensions must agree."); } // The solution X row dimension is equal to the column dimension of A if (EigenValues.Count != result.RowCount) { - throw new ArgumentException(Resources.ArgumentMatrixSameColumnDimension); + throw new ArgumentException("Matrix column dimensions must agree."); } if (IsSymmetric) @@ -160,7 +159,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex.Factorization } else { - throw new ArgumentException(Resources.ArgumentMatrixSymmetric); + throw new ArgumentException("Matrix must be symmetric."); } } @@ -175,7 +174,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex.Factorization // Check that b is a column vector with m entries if (EigenValues.Count != input.Count) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } // Check that x is a column vector with n entries @@ -220,7 +219,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex.Factorization } else { - throw new ArgumentException(Resources.ArgumentMatrixSymmetric); + throw new ArgumentException("Matrix must be symmetric."); } } } diff --git a/src/Numerics/LinearAlgebra/Complex/Factorization/DenseGramSchmidt.cs b/src/Numerics/LinearAlgebra/Complex/Factorization/DenseGramSchmidt.cs index 7a232f96..031b8461 100644 --- a/src/Numerics/LinearAlgebra/Complex/Factorization/DenseGramSchmidt.cs +++ b/src/Numerics/LinearAlgebra/Complex/Factorization/DenseGramSchmidt.cs @@ -29,7 +29,6 @@ using System; using MathNet.Numerics.LinearAlgebra.Factorization; -using MathNet.Numerics.Properties; using MathNet.Numerics.Providers.LinearAlgebra; namespace MathNet.Numerics.LinearAlgebra.Complex.Factorization @@ -92,7 +91,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex.Factorization norm = Math.Sqrt(norm); if (norm == 0.0) { - throw new ArgumentException(Resources.ArgumentMatrixNotRankDeficient); + throw new ArgumentException("Matrix must not be rank deficient."); } r[(k * columnsQ) + k] = norm; @@ -132,19 +131,19 @@ namespace MathNet.Numerics.LinearAlgebra.Complex.Factorization // The solution X should have the same number of columns as B if (input.ColumnCount != result.ColumnCount) { - throw new ArgumentException(Resources.ArgumentMatrixSameColumnDimension); + throw new ArgumentException("Matrix column dimensions must agree."); } // The dimension compatibility conditions for X = A\B require the two matrices A and B to have the same number of rows if (Q.RowCount != input.RowCount) { - throw new ArgumentException(Resources.ArgumentMatrixSameRowDimension); + throw new ArgumentException("Matrix row dimensions must agree."); } // The solution X row dimension is equal to the column dimension of A if (Q.ColumnCount != result.RowCount) { - throw new ArgumentException(Resources.ArgumentMatrixSameColumnDimension); + throw new ArgumentException("Matrix column dimensions must agree."); } if (input is DenseMatrix dinput && result is DenseMatrix dresult) @@ -168,7 +167,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex.Factorization // Check that b is a column vector with m entries if (Q.RowCount != input.Count) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } // Check that x is a column vector with n entries diff --git a/src/Numerics/LinearAlgebra/Complex/Factorization/DenseLU.cs b/src/Numerics/LinearAlgebra/Complex/Factorization/DenseLU.cs index 73e33d68..f22d1a1f 100644 --- a/src/Numerics/LinearAlgebra/Complex/Factorization/DenseLU.cs +++ b/src/Numerics/LinearAlgebra/Complex/Factorization/DenseLU.cs @@ -28,7 +28,6 @@ // using System; -using MathNet.Numerics.Properties; using MathNet.Numerics.Providers.LinearAlgebra; namespace MathNet.Numerics.LinearAlgebra.Complex.Factorization @@ -61,7 +60,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex.Factorization if (matrix.RowCount != matrix.ColumnCount) { - throw new ArgumentException(Resources.ArgumentMatrixSquare); + throw new ArgumentException("Matrix must be square."); } // Create an array for the pivot indices. @@ -100,12 +99,12 @@ namespace MathNet.Numerics.LinearAlgebra.Complex.Factorization // Check for proper dimensions. if (result.RowCount != input.RowCount) { - throw new ArgumentException(Resources.ArgumentMatrixSameRowDimension); + throw new ArgumentException("Matrix row dimensions must agree."); } if (result.ColumnCount != input.ColumnCount) { - throw new ArgumentException(Resources.ArgumentMatrixSameColumnDimension); + throw new ArgumentException("Matrix column dimensions must agree."); } if (input.RowCount != Factors.RowCount) @@ -149,7 +148,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex.Factorization // Check for proper dimensions. if (input.Count != result.Count) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } if (input.Count != Factors.RowCount) diff --git a/src/Numerics/LinearAlgebra/Complex/Factorization/DenseQR.cs b/src/Numerics/LinearAlgebra/Complex/Factorization/DenseQR.cs index 688617db..229571f7 100644 --- a/src/Numerics/LinearAlgebra/Complex/Factorization/DenseQR.cs +++ b/src/Numerics/LinearAlgebra/Complex/Factorization/DenseQR.cs @@ -29,7 +29,6 @@ using System; using MathNet.Numerics.LinearAlgebra.Factorization; -using MathNet.Numerics.Properties; using MathNet.Numerics.Providers.LinearAlgebra; namespace MathNet.Numerics.LinearAlgebra.Complex.Factorization @@ -103,19 +102,19 @@ namespace MathNet.Numerics.LinearAlgebra.Complex.Factorization // The solution X should have the same number of columns as B if (input.ColumnCount != result.ColumnCount) { - throw new ArgumentException(Resources.ArgumentMatrixSameColumnDimension); + throw new ArgumentException("Matrix column dimensions must agree."); } // The dimension compatibility conditions for X = A\B require the two matrices A and B to have the same number of rows if (Q.RowCount != input.RowCount) { - throw new ArgumentException(Resources.ArgumentMatrixSameRowDimension); + throw new ArgumentException("Matrix row dimensions must agree."); } // The solution X row dimension is equal to the column dimension of A if (FullR.ColumnCount != result.RowCount) { - throw new ArgumentException(Resources.ArgumentMatrixSameColumnDimension); + throw new ArgumentException("Matrix column dimensions must agree."); } if (input is DenseMatrix dinput && result is DenseMatrix dresult) @@ -139,7 +138,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex.Factorization // Check that b is a column vector with m entries if (Q.RowCount != input.Count) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } // Check that x is a column vector with n entries diff --git a/src/Numerics/LinearAlgebra/Complex/Factorization/DenseSvd.cs b/src/Numerics/LinearAlgebra/Complex/Factorization/DenseSvd.cs index 03bb4cc1..78042256 100644 --- a/src/Numerics/LinearAlgebra/Complex/Factorization/DenseSvd.cs +++ b/src/Numerics/LinearAlgebra/Complex/Factorization/DenseSvd.cs @@ -28,7 +28,6 @@ // using System; -using MathNet.Numerics.Properties; using MathNet.Numerics.Providers.LinearAlgebra; namespace MathNet.Numerics.LinearAlgebra.Complex.Factorization @@ -84,25 +83,25 @@ namespace MathNet.Numerics.LinearAlgebra.Complex.Factorization { if (!VectorsComputed) { - throw new InvalidOperationException(Resources.SingularVectorsNotComputed); + throw new InvalidOperationException("The singular vectors were not computed."); } // The solution X should have the same number of columns as B if (input.ColumnCount != result.ColumnCount) { - throw new ArgumentException(Resources.ArgumentMatrixSameColumnDimension); + throw new ArgumentException("Matrix column dimensions must agree."); } // The dimension compatibility conditions for X = A\B require the two matrices A and B to have the same number of rows if (U.RowCount != input.RowCount) { - throw new ArgumentException(Resources.ArgumentMatrixSameRowDimension); + throw new ArgumentException("Matrix row dimensions must agree."); } // The solution X row dimension is equal to the column dimension of A if (VT.ColumnCount != result.RowCount) { - throw new ArgumentException(Resources.ArgumentMatrixSameColumnDimension); + throw new ArgumentException("Matrix column dimensions must agree."); } if (input is DenseMatrix dinput && result is DenseMatrix dresult) @@ -124,14 +123,14 @@ namespace MathNet.Numerics.LinearAlgebra.Complex.Factorization { if (!VectorsComputed) { - throw new InvalidOperationException(Resources.SingularVectorsNotComputed); + throw new InvalidOperationException("The singular vectors were not computed."); } // Ax=b where A is an m x n matrix // Check that b is a column vector with m entries if (U.RowCount != input.Count) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } // Check that x is a column vector with n entries diff --git a/src/Numerics/LinearAlgebra/Complex/Factorization/GramSchmidt.cs b/src/Numerics/LinearAlgebra/Complex/Factorization/GramSchmidt.cs index b805aaa0..6049bac7 100644 --- a/src/Numerics/LinearAlgebra/Complex/Factorization/GramSchmidt.cs +++ b/src/Numerics/LinearAlgebra/Complex/Factorization/GramSchmidt.cs @@ -29,7 +29,6 @@ using System; using MathNet.Numerics.LinearAlgebra.Factorization; -using MathNet.Numerics.Properties; namespace MathNet.Numerics.LinearAlgebra.Complex.Factorization { @@ -58,7 +57,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex.Factorization { if (FullR.RowCount != FullR.ColumnCount) { - throw new ArgumentException(Resources.ArgumentMatrixSquare); + throw new ArgumentException("Matrix must be square."); } var det = Complex.One; diff --git a/src/Numerics/LinearAlgebra/Complex/Factorization/QR.cs b/src/Numerics/LinearAlgebra/Complex/Factorization/QR.cs index 3b685f5c..f0b7e785 100644 --- a/src/Numerics/LinearAlgebra/Complex/Factorization/QR.cs +++ b/src/Numerics/LinearAlgebra/Complex/Factorization/QR.cs @@ -29,7 +29,6 @@ using System; using MathNet.Numerics.LinearAlgebra.Factorization; -using MathNet.Numerics.Properties; namespace MathNet.Numerics.LinearAlgebra.Complex.Factorization { @@ -63,7 +62,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex.Factorization { if (FullR.RowCount != FullR.ColumnCount) { - throw new ArgumentException(Resources.ArgumentMatrixSquare); + throw new ArgumentException("Matrix must be square."); } var det = Complex.One; diff --git a/src/Numerics/LinearAlgebra/Complex/Factorization/Svd.cs b/src/Numerics/LinearAlgebra/Complex/Factorization/Svd.cs index 79877a2d..455a7c9b 100644 --- a/src/Numerics/LinearAlgebra/Complex/Factorization/Svd.cs +++ b/src/Numerics/LinearAlgebra/Complex/Factorization/Svd.cs @@ -30,7 +30,6 @@ using System; using System.Linq; using MathNet.Numerics.LinearAlgebra.Factorization; -using MathNet.Numerics.Properties; namespace MathNet.Numerics.LinearAlgebra.Complex.Factorization { @@ -98,7 +97,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex.Factorization { if (U.RowCount != VT.ColumnCount) { - throw new ArgumentException(Resources.ArgumentMatrixSquare); + throw new ArgumentException("Matrix must be square."); } var det = Complex.One; diff --git a/src/Numerics/LinearAlgebra/Complex/Factorization/UserCholesky.cs b/src/Numerics/LinearAlgebra/Complex/Factorization/UserCholesky.cs index 4698aff3..350af333 100644 --- a/src/Numerics/LinearAlgebra/Complex/Factorization/UserCholesky.cs +++ b/src/Numerics/LinearAlgebra/Complex/Factorization/UserCholesky.cs @@ -28,7 +28,6 @@ // using System; -using MathNet.Numerics.Properties; using MathNet.Numerics.Threading; namespace MathNet.Numerics.LinearAlgebra.Complex.Factorization @@ -57,7 +56,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex.Factorization { if (factor.RowCount != factor.ColumnCount) { - throw new ArgumentException(Resources.ArgumentMatrixSquare); + throw new ArgumentException("Matrix must be square."); } // Create a new matrix for the Cholesky factor, then perform factorization (while overwriting). @@ -88,7 +87,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex.Factorization } else { - throw new ArgumentException(Resources.ArgumentMatrixPositiveDefinite); + throw new ArgumentException("Matrix must be positive definite."); } for (var i = ij + 1; i < factor.RowCount; i++) @@ -182,12 +181,12 @@ namespace MathNet.Numerics.LinearAlgebra.Complex.Factorization { if (result.RowCount != input.RowCount) { - throw new ArgumentException(Resources.ArgumentMatrixSameRowDimension); + throw new ArgumentException("Matrix row dimensions must agree."); } if (result.ColumnCount != input.ColumnCount) { - throw new ArgumentException(Resources.ArgumentMatrixSameColumnDimension); + throw new ArgumentException("Matrix column dimensions must agree."); } if (input.RowCount != Factor.RowCount) @@ -236,7 +235,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex.Factorization { if (input.Count != result.Count) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } if (input.Count != Factor.RowCount) diff --git a/src/Numerics/LinearAlgebra/Complex/Factorization/UserEvd.cs b/src/Numerics/LinearAlgebra/Complex/Factorization/UserEvd.cs index c42697e0..b8409882 100644 --- a/src/Numerics/LinearAlgebra/Complex/Factorization/UserEvd.cs +++ b/src/Numerics/LinearAlgebra/Complex/Factorization/UserEvd.cs @@ -28,7 +28,6 @@ // using System; -using MathNet.Numerics.Properties; namespace MathNet.Numerics.LinearAlgebra.Complex.Factorization { @@ -63,7 +62,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex.Factorization { if (matrix.RowCount != matrix.ColumnCount) { - throw new ArgumentException(Resources.ArgumentMatrixSquare); + throw new ArgumentException("Matrix must be square."); } var order = matrix.RowCount; @@ -820,19 +819,19 @@ namespace MathNet.Numerics.LinearAlgebra.Complex.Factorization // The solution X should have the same number of columns as B if (input.ColumnCount != result.ColumnCount) { - throw new ArgumentException(Resources.ArgumentMatrixSameColumnDimension); + throw new ArgumentException("Matrix column dimensions must agree."); } // The dimension compatibility conditions for X = A\B require the two matrices A and B to have the same number of rows if (EigenValues.Count != input.RowCount) { - throw new ArgumentException(Resources.ArgumentMatrixSameRowDimension); + throw new ArgumentException("Matrix row dimensions must agree."); } // The solution X row dimension is equal to the column dimension of A if (EigenValues.Count != result.RowCount) { - throw new ArgumentException(Resources.ArgumentMatrixSameColumnDimension); + throw new ArgumentException("Matrix column dimensions must agree."); } if (IsSymmetric) @@ -872,7 +871,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex.Factorization } else { - throw new ArgumentException(Resources.ArgumentMatrixSymmetric); + throw new ArgumentException("Matrix must be symmetric."); } } @@ -887,7 +886,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex.Factorization // Check that b is a column vector with m entries if (EigenValues.Count != input.Count) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } // Check that x is a column vector with n entries @@ -932,7 +931,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex.Factorization } else { - throw new ArgumentException(Resources.ArgumentMatrixSymmetric); + throw new ArgumentException("Matrix must be symmetric."); } } } diff --git a/src/Numerics/LinearAlgebra/Complex/Factorization/UserGramSchmidt.cs b/src/Numerics/LinearAlgebra/Complex/Factorization/UserGramSchmidt.cs index eab07099..b4534efe 100644 --- a/src/Numerics/LinearAlgebra/Complex/Factorization/UserGramSchmidt.cs +++ b/src/Numerics/LinearAlgebra/Complex/Factorization/UserGramSchmidt.cs @@ -28,7 +28,6 @@ // using System; -using MathNet.Numerics.Properties; namespace MathNet.Numerics.LinearAlgebra.Complex.Factorization { @@ -66,7 +65,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex.Factorization var norm = q.Column(k).L2Norm(); if (norm == 0.0) { - throw new ArgumentException(Resources.ArgumentMatrixNotRankDeficient); + throw new ArgumentException("Matrix must not be rank deficient."); } r.At(k, k, norm); @@ -110,19 +109,19 @@ namespace MathNet.Numerics.LinearAlgebra.Complex.Factorization // The solution X should have the same number of columns as B if (input.ColumnCount != result.ColumnCount) { - throw new ArgumentException(Resources.ArgumentMatrixSameColumnDimension); + throw new ArgumentException("Matrix column dimensions must agree."); } // The dimension compatibility conditions for X = A\B require the two matrices A and B to have the same number of rows if (Q.RowCount != input.RowCount) { - throw new ArgumentException(Resources.ArgumentMatrixSameRowDimension); + throw new ArgumentException("Matrix row dimensions must agree."); } // The solution X row dimension is equal to the column dimension of A if (Q.ColumnCount != result.RowCount) { - throw new ArgumentException(Resources.ArgumentMatrixSameColumnDimension); + throw new ArgumentException("Matrix column dimensions must agree."); } var inputCopy = input.Clone(); @@ -185,7 +184,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex.Factorization // Check that b is a column vector with m entries if (Q.RowCount != input.Count) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } // Check that x is a column vector with n entries diff --git a/src/Numerics/LinearAlgebra/Complex/Factorization/UserLU.cs b/src/Numerics/LinearAlgebra/Complex/Factorization/UserLU.cs index eb3afe36..6a39266c 100644 --- a/src/Numerics/LinearAlgebra/Complex/Factorization/UserLU.cs +++ b/src/Numerics/LinearAlgebra/Complex/Factorization/UserLU.cs @@ -28,7 +28,6 @@ // using System; -using MathNet.Numerics.Properties; namespace MathNet.Numerics.LinearAlgebra.Complex.Factorization { @@ -60,7 +59,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex.Factorization if (matrix.RowCount != matrix.ColumnCount) { - throw new ArgumentException(Resources.ArgumentMatrixSquare); + throw new ArgumentException("Matrix must be square."); } // Create an array for the pivot indices. @@ -158,12 +157,12 @@ namespace MathNet.Numerics.LinearAlgebra.Complex.Factorization // Check for proper dimensions. if (result.RowCount != input.RowCount) { - throw new ArgumentException(Resources.ArgumentMatrixSameRowDimension); + throw new ArgumentException("Matrix row dimensions must agree."); } if (result.ColumnCount != input.ColumnCount) { - throw new ArgumentException(Resources.ArgumentMatrixSameColumnDimension); + throw new ArgumentException("Matrix column dimensions must agree."); } if (input.RowCount != Factors.RowCount) @@ -244,7 +243,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex.Factorization // Check for proper dimensions. if (input.Count != result.Count) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } if (input.Count != Factors.RowCount) diff --git a/src/Numerics/LinearAlgebra/Complex/Factorization/UserQR.cs b/src/Numerics/LinearAlgebra/Complex/Factorization/UserQR.cs index 307944ee..c528758d 100644 --- a/src/Numerics/LinearAlgebra/Complex/Factorization/UserQR.cs +++ b/src/Numerics/LinearAlgebra/Complex/Factorization/UserQR.cs @@ -30,7 +30,6 @@ using System; using System.Linq; using MathNet.Numerics.LinearAlgebra.Factorization; -using MathNet.Numerics.Properties; using MathNet.Numerics.Threading; namespace MathNet.Numerics.LinearAlgebra.Complex.Factorization @@ -228,19 +227,19 @@ namespace MathNet.Numerics.LinearAlgebra.Complex.Factorization // The solution X should have the same number of columns as B if (input.ColumnCount != result.ColumnCount) { - throw new ArgumentException(Resources.ArgumentMatrixSameColumnDimension); + throw new ArgumentException("Matrix column dimensions must agree."); } // The dimension compatibility conditions for X = A\B require the two matrices A and B to have the same number of rows if (FullR.RowCount != input.RowCount) { - throw new ArgumentException(Resources.ArgumentMatrixSameRowDimension); + throw new ArgumentException("Matrix row dimensions must agree."); } // The solution X row dimension is equal to the column dimension of A if (FullR.ColumnCount != result.RowCount) { - throw new ArgumentException(Resources.ArgumentMatrixSameColumnDimension); + throw new ArgumentException("Matrix column dimensions must agree."); } var inputCopy = input.Clone(); @@ -303,7 +302,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex.Factorization // Check that b is a column vector with m entries if (FullR.RowCount != input.Count) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } // Check that x is a column vector with n entries diff --git a/src/Numerics/LinearAlgebra/Complex/Factorization/UserSvd.cs b/src/Numerics/LinearAlgebra/Complex/Factorization/UserSvd.cs index a68c9785..e4fe2ece 100644 --- a/src/Numerics/LinearAlgebra/Complex/Factorization/UserSvd.cs +++ b/src/Numerics/LinearAlgebra/Complex/Factorization/UserSvd.cs @@ -28,7 +28,6 @@ // using System; -using MathNet.Numerics.Properties; namespace MathNet.Numerics.LinearAlgebra.Complex.Factorization { @@ -804,25 +803,25 @@ namespace MathNet.Numerics.LinearAlgebra.Complex.Factorization { if (!VectorsComputed) { - throw new InvalidOperationException(Resources.SingularVectorsNotComputed); + throw new InvalidOperationException("The singular vectors were not computed."); } // The solution X should have the same number of columns as B if (input.ColumnCount != result.ColumnCount) { - throw new ArgumentException(Resources.ArgumentMatrixSameColumnDimension); + throw new ArgumentException("Matrix column dimensions must agree."); } // The dimension compatibility conditions for X = A\B require the two matrices A and B to have the same number of rows if (U.RowCount != input.RowCount) { - throw new ArgumentException(Resources.ArgumentMatrixSameRowDimension); + throw new ArgumentException("Matrix row dimensions must agree."); } // The solution X row dimension is equal to the column dimension of A if (VT.ColumnCount != result.RowCount) { - throw new ArgumentException(Resources.ArgumentMatrixSameColumnDimension); + throw new ArgumentException("Matrix column dimensions must agree."); } var mn = Math.Min(U.RowCount, VT.ColumnCount); @@ -870,14 +869,14 @@ namespace MathNet.Numerics.LinearAlgebra.Complex.Factorization { if (!VectorsComputed) { - throw new InvalidOperationException(Resources.SingularVectorsNotComputed); + throw new InvalidOperationException("The singular vectors were not computed."); } // Ax=b where A is an m x n matrix // Check that b is a column vector with m entries if (U.RowCount != input.Count) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } // Check that x is a column vector with n entries diff --git a/src/Numerics/LinearAlgebra/Complex/Matrix.cs b/src/Numerics/LinearAlgebra/Complex/Matrix.cs index 841b8e30..6badc6f3 100644 --- a/src/Numerics/LinearAlgebra/Complex/Matrix.cs +++ b/src/Numerics/LinearAlgebra/Complex/Matrix.cs @@ -31,7 +31,6 @@ using System; using MathNet.Numerics.LinearAlgebra.Complex.Factorization; using MathNet.Numerics.LinearAlgebra.Factorization; using MathNet.Numerics.LinearAlgebra.Storage; -using MathNet.Numerics.Properties; namespace MathNet.Numerics.LinearAlgebra.Complex { @@ -551,7 +550,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex { if (RowCount != ColumnCount) { - throw new ArgumentException(Resources.ArgumentMatrixSquare); + throw new ArgumentException("Matrix must be square."); } var sum = Complex.Zero; @@ -661,7 +660,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex { if (norm <= 0.0) { - throw new ArgumentOutOfRangeException(nameof(norm), Resources.ArgumentMustBePositive); + throw new ArgumentOutOfRangeException(nameof(norm), "Value must be positive."); } var ret = new double[RowCount]; @@ -693,7 +692,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex { if (norm <= 0.0) { - throw new ArgumentOutOfRangeException(nameof(norm), Resources.ArgumentMustBePositive); + throw new ArgumentOutOfRangeException(nameof(norm), "Value must be positive."); } var ret = new double[ColumnCount]; diff --git a/src/Numerics/LinearAlgebra/Complex/Solvers/BiCgStab.cs b/src/Numerics/LinearAlgebra/Complex/Solvers/BiCgStab.cs index 1248464d..ce9f7ad4 100644 --- a/src/Numerics/LinearAlgebra/Complex/Solvers/BiCgStab.cs +++ b/src/Numerics/LinearAlgebra/Complex/Solvers/BiCgStab.cs @@ -29,7 +29,6 @@ using System; using MathNet.Numerics.LinearAlgebra.Solvers; -using MathNet.Numerics.Properties; namespace MathNet.Numerics.LinearAlgebra.Complex.Solvers { @@ -98,12 +97,12 @@ namespace MathNet.Numerics.LinearAlgebra.Complex.Solvers { if (matrix.RowCount != matrix.ColumnCount) { - throw new ArgumentException(Resources.ArgumentMatrixSquare, nameof(matrix)); + throw new ArgumentException("Matrix must be square.", nameof(matrix)); } if (result.Count != input.Count) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } if (input.Count != matrix.RowCount) diff --git a/src/Numerics/LinearAlgebra/Complex/Solvers/CompositeSolver.cs b/src/Numerics/LinearAlgebra/Complex/Solvers/CompositeSolver.cs index e4857db1..44b73f46 100644 --- a/src/Numerics/LinearAlgebra/Complex/Solvers/CompositeSolver.cs +++ b/src/Numerics/LinearAlgebra/Complex/Solvers/CompositeSolver.cs @@ -31,7 +31,6 @@ using System; using System.Collections.Generic; using System.Linq; using MathNet.Numerics.LinearAlgebra.Solvers; -using MathNet.Numerics.Properties; namespace MathNet.Numerics.LinearAlgebra.Complex.Solvers { @@ -77,12 +76,12 @@ namespace MathNet.Numerics.LinearAlgebra.Complex.Solvers { if (matrix.RowCount != matrix.ColumnCount) { - throw new ArgumentException(Resources.ArgumentMatrixSquare, nameof(matrix)); + throw new ArgumentException("Matrix must be square.", nameof(matrix)); } if (result.Count != input.Count) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } if (iterator == null) diff --git a/src/Numerics/LinearAlgebra/Complex/Solvers/DiagonalPreconditioner.cs b/src/Numerics/LinearAlgebra/Complex/Solvers/DiagonalPreconditioner.cs index 24dee1c9..035880d3 100644 --- a/src/Numerics/LinearAlgebra/Complex/Solvers/DiagonalPreconditioner.cs +++ b/src/Numerics/LinearAlgebra/Complex/Solvers/DiagonalPreconditioner.cs @@ -29,7 +29,6 @@ using System; using MathNet.Numerics.LinearAlgebra.Solvers; -using MathNet.Numerics.Properties; namespace MathNet.Numerics.LinearAlgebra.Complex.Solvers { @@ -72,7 +71,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex.Solvers { if (matrix.RowCount != matrix.ColumnCount) { - throw new ArgumentException(Resources.ArgumentMatrixSquare, nameof(matrix)); + throw new ArgumentException("Matrix must be square.", nameof(matrix)); } _inverseDiagonals = new Complex[matrix.RowCount]; @@ -91,12 +90,12 @@ namespace MathNet.Numerics.LinearAlgebra.Complex.Solvers { if (_inverseDiagonals == null) { - throw new ArgumentException(Resources.ArgumentMatrixDoesNotExist); + throw new ArgumentException("The requested matrix does not exist."); } if ((lhs.Count != rhs.Count) || (lhs.Count != _inverseDiagonals.Length)) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength, nameof(rhs)); + throw new ArgumentException("All vectors must have the same dimensionality.", nameof(rhs)); } for (var i = 0; i < _inverseDiagonals.Length; i++) diff --git a/src/Numerics/LinearAlgebra/Complex/Solvers/GpBiCg.cs b/src/Numerics/LinearAlgebra/Complex/Solvers/GpBiCg.cs index f8c1da22..eb870acb 100644 --- a/src/Numerics/LinearAlgebra/Complex/Solvers/GpBiCg.cs +++ b/src/Numerics/LinearAlgebra/Complex/Solvers/GpBiCg.cs @@ -29,7 +29,6 @@ using System; using MathNet.Numerics.LinearAlgebra.Solvers; -using MathNet.Numerics.Properties; namespace MathNet.Numerics.LinearAlgebra.Complex.Solvers { @@ -161,7 +160,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex.Solvers { if (matrix.RowCount != matrix.ColumnCount) { - throw new ArgumentException(Resources.ArgumentMatrixSquare, nameof(matrix)); + throw new ArgumentException("Matrix must be square.", nameof(matrix)); } if (input.Count != matrix.RowCount || result.Count != input.Count) diff --git a/src/Numerics/LinearAlgebra/Complex/Solvers/ILU0Preconditioner.cs b/src/Numerics/LinearAlgebra/Complex/Solvers/ILU0Preconditioner.cs index cc1b1557..77fc9f90 100644 --- a/src/Numerics/LinearAlgebra/Complex/Solvers/ILU0Preconditioner.cs +++ b/src/Numerics/LinearAlgebra/Complex/Solvers/ILU0Preconditioner.cs @@ -29,7 +29,6 @@ using System; using MathNet.Numerics.LinearAlgebra.Solvers; -using MathNet.Numerics.Properties; namespace MathNet.Numerics.LinearAlgebra.Complex.Solvers { @@ -110,7 +109,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex.Solvers if (matrix.RowCount != matrix.ColumnCount) { - throw new ArgumentException(Resources.ArgumentMatrixSquare, nameof(matrix)); + throw new ArgumentException("Matrix must be square.", nameof(matrix)); } _decompositionLU = SparseMatrix.OfMatrix(matrix); @@ -167,12 +166,12 @@ namespace MathNet.Numerics.LinearAlgebra.Complex.Solvers { if (_decompositionLU == null) { - throw new ArgumentException(Resources.ArgumentMatrixDoesNotExist); + throw new ArgumentException("The requested matrix does not exist."); } if ((lhs.Count != rhs.Count) || (lhs.Count != _decompositionLU.RowCount)) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } // Solve: diff --git a/src/Numerics/LinearAlgebra/Complex/Solvers/ILUTPPreconditioner.cs b/src/Numerics/LinearAlgebra/Complex/Solvers/ILUTPPreconditioner.cs index 78328347..ebf1ba99 100644 --- a/src/Numerics/LinearAlgebra/Complex/Solvers/ILUTPPreconditioner.cs +++ b/src/Numerics/LinearAlgebra/Complex/Solvers/ILUTPPreconditioner.cs @@ -30,7 +30,6 @@ using System; using System.Collections.Generic; using MathNet.Numerics.LinearAlgebra.Solvers; -using MathNet.Numerics.Properties; namespace MathNet.Numerics.LinearAlgebra.Complex.Solvers { @@ -300,7 +299,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex.Solvers if (matrix.RowCount != matrix.ColumnCount) { - throw new ArgumentException(Resources.ArgumentMatrixSquare, nameof(matrix)); + throw new ArgumentException("Matrix must be square.", nameof(matrix)); } var sparseMatrix = matrix as SparseMatrix ?? SparseMatrix.OfMatrix(matrix); @@ -612,12 +611,12 @@ namespace MathNet.Numerics.LinearAlgebra.Complex.Solvers { if (_upper == null) { - throw new ArgumentException(Resources.ArgumentMatrixDoesNotExist); + throw new ArgumentException("The requested matrix does not exist."); } if ((lhs.Count != rhs.Count) || (lhs.Count != _upper.RowCount)) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength, nameof(rhs)); + throw new ArgumentException("All vectors must have the same dimensionality.", nameof(rhs)); } // Solve equation here diff --git a/src/Numerics/LinearAlgebra/Complex/Solvers/MILU0Preconditioner.cs b/src/Numerics/LinearAlgebra/Complex/Solvers/MILU0Preconditioner.cs index 474b4884..aab88c5b 100644 --- a/src/Numerics/LinearAlgebra/Complex/Solvers/MILU0Preconditioner.cs +++ b/src/Numerics/LinearAlgebra/Complex/Solvers/MILU0Preconditioner.cs @@ -30,7 +30,6 @@ using System; using MathNet.Numerics.LinearAlgebra.Solvers; using MathNet.Numerics.LinearAlgebra.Storage; -using MathNet.Numerics.Properties; namespace MathNet.Numerics.LinearAlgebra.Complex.Solvers { @@ -86,14 +85,14 @@ namespace MathNet.Numerics.LinearAlgebra.Complex.Solvers var csr = matrix.Storage as SparseCompressedRowMatrixStorage; if (csr == null) { - throw new ArgumentException(Resources.MatrixMustBeSparse, nameof(matrix)); + throw new ArgumentException("Matrix must be in sparse storage format", nameof(matrix)); } // Dimension of matrix int n = csr.RowCount; if (n != csr.ColumnCount) { - throw new ArgumentException(Resources.ArgumentMatrixSquare, nameof(matrix)); + throw new ArgumentException("Matrix must be square.", nameof(matrix)); } // Original matrix compressed sparse row storage. @@ -123,12 +122,12 @@ namespace MathNet.Numerics.LinearAlgebra.Complex.Solvers { if (_alu == null) { - throw new ArgumentException(Resources.ArgumentMatrixDoesNotExist); + throw new ArgumentException("The requested matrix does not exist."); } if ((result.Count != input.Count) || (result.Count != _diag.Length)) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } int n = _diag.Length; diff --git a/src/Numerics/LinearAlgebra/Complex/Solvers/MlkBiCgStab.cs b/src/Numerics/LinearAlgebra/Complex/Solvers/MlkBiCgStab.cs index eb5f9348..04232d17 100644 --- a/src/Numerics/LinearAlgebra/Complex/Solvers/MlkBiCgStab.cs +++ b/src/Numerics/LinearAlgebra/Complex/Solvers/MlkBiCgStab.cs @@ -33,7 +33,6 @@ using System.Diagnostics; using System.Linq; using MathNet.Numerics.Distributions; using MathNet.Numerics.LinearAlgebra.Solvers; -using MathNet.Numerics.Properties; namespace MathNet.Numerics.LinearAlgebra.Complex.Solvers { @@ -247,7 +246,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex.Solvers { if (matrix.RowCount != matrix.ColumnCount) { - throw new ArgumentException(Resources.ArgumentMatrixSquare, nameof(matrix)); + throw new ArgumentException("Matrix must be square.", nameof(matrix)); } if (input.Count != matrix.RowCount || result.Count != input.Count) diff --git a/src/Numerics/LinearAlgebra/Complex/Solvers/TFQMR.cs b/src/Numerics/LinearAlgebra/Complex/Solvers/TFQMR.cs index b1af1457..f88edfb4 100644 --- a/src/Numerics/LinearAlgebra/Complex/Solvers/TFQMR.cs +++ b/src/Numerics/LinearAlgebra/Complex/Solvers/TFQMR.cs @@ -29,7 +29,6 @@ using System; using MathNet.Numerics.LinearAlgebra.Solvers; -using MathNet.Numerics.Properties; namespace MathNet.Numerics.LinearAlgebra.Complex.Solvers { @@ -94,7 +93,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex.Solvers { if (matrix.RowCount != matrix.ColumnCount) { - throw new ArgumentException(Resources.ArgumentMatrixSquare, nameof(matrix)); + throw new ArgumentException("Matrix must be square.", nameof(matrix)); } if (input.Count != matrix.RowCount || result.Count != input.Count) diff --git a/src/Numerics/LinearAlgebra/Complex32/DenseMatrix.cs b/src/Numerics/LinearAlgebra/Complex32/DenseMatrix.cs index 27dab0e7..a30191b7 100644 --- a/src/Numerics/LinearAlgebra/Complex32/DenseMatrix.cs +++ b/src/Numerics/LinearAlgebra/Complex32/DenseMatrix.cs @@ -35,7 +35,6 @@ using MathNet.Numerics.Distributions; using MathNet.Numerics.LinearAlgebra.Complex32.Factorization; using MathNet.Numerics.LinearAlgebra.Factorization; using MathNet.Numerics.LinearAlgebra.Storage; -using MathNet.Numerics.Properties; using MathNet.Numerics.Providers.LinearAlgebra; using MathNet.Numerics.Threading; @@ -968,7 +967,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32 { if (_rowCount != _columnCount) { - throw new ArgumentException(Resources.ArgumentMatrixSquare); + throw new ArgumentException("Matrix must be square."); } var sum = Complex32.Zero; diff --git a/src/Numerics/LinearAlgebra/Complex32/DiagonalMatrix.cs b/src/Numerics/LinearAlgebra/Complex32/DiagonalMatrix.cs index b8dee3d2..ac16cc69 100644 --- a/src/Numerics/LinearAlgebra/Complex32/DiagonalMatrix.cs +++ b/src/Numerics/LinearAlgebra/Complex32/DiagonalMatrix.cs @@ -33,7 +33,6 @@ using System.Diagnostics; using System.Linq; using MathNet.Numerics.Distributions; using MathNet.Numerics.LinearAlgebra.Storage; -using MathNet.Numerics.Properties; using MathNet.Numerics.Providers.LinearAlgebra; using MathNet.Numerics.Threading; @@ -677,7 +676,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32 { if (RowCount != ColumnCount) { - throw new ArgumentException(Resources.ArgumentMatrixSquare); + throw new ArgumentException("Matrix must be square."); } return _data.Aggregate(Complex32.One, (current, t) => current * t); @@ -707,7 +706,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32 { if (source.Length != _data.Length) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(source)); + throw new ArgumentException("The array arguments must have the same length.", nameof(source)); } Array.Copy(source, 0, _data, 0, source.Length); @@ -728,7 +727,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32 { if (_data.Length != denseSource.Values.Length) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength, nameof(source)); + throw new ArgumentException("All vectors must have the same dimensionality.", nameof(source)); } Array.Copy(denseSource.Values, 0, _data, 0, denseSource.Values.Length); @@ -790,7 +789,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32 { if (RowCount != ColumnCount) { - throw new ArgumentException(Resources.ArgumentMatrixSquare); + throw new ArgumentException("Matrix must be square."); } var inverse = (DiagonalMatrix)Clone(); @@ -802,7 +801,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32 } else { - throw new ArgumentException(Resources.ArgumentMatrixNotSingular); + throw new ArgumentException("Matrix must not be singular."); } } diff --git a/src/Numerics/LinearAlgebra/Complex32/Factorization/DenseCholesky.cs b/src/Numerics/LinearAlgebra/Complex32/Factorization/DenseCholesky.cs index 6b84e096..a6ed4113 100644 --- a/src/Numerics/LinearAlgebra/Complex32/Factorization/DenseCholesky.cs +++ b/src/Numerics/LinearAlgebra/Complex32/Factorization/DenseCholesky.cs @@ -28,7 +28,6 @@ // using System; -using MathNet.Numerics.Properties; using MathNet.Numerics.Providers.LinearAlgebra; namespace MathNet.Numerics.LinearAlgebra.Complex32.Factorization @@ -58,7 +57,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32.Factorization { if (matrix.RowCount != matrix.ColumnCount) { - throw new ArgumentException(Resources.ArgumentMatrixSquare); + throw new ArgumentException("Matrix must be square."); } // Create a new matrix for the Cholesky factor, then perform factorization (while overwriting). @@ -81,12 +80,12 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32.Factorization { if (result.RowCount != input.RowCount) { - throw new ArgumentException(Resources.ArgumentMatrixSameRowDimension); + throw new ArgumentException("Matrix row dimensions must agree."); } if (result.ColumnCount != input.ColumnCount) { - throw new ArgumentException(Resources.ArgumentMatrixSameColumnDimension); + throw new ArgumentException("Matrix column dimensions must agree."); } if (input.RowCount != Factor.RowCount) @@ -118,7 +117,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32.Factorization { if (input.Count != result.Count) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } if (input.Count != Factor.RowCount) @@ -153,7 +152,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32.Factorization { if (matrix.RowCount != matrix.ColumnCount) { - throw new ArgumentException(Resources.ArgumentMatrixSquare); + throw new ArgumentException("Matrix must be square."); } if (matrix.RowCount != Factor.RowCount || matrix.ColumnCount != Factor.ColumnCount) diff --git a/src/Numerics/LinearAlgebra/Complex32/Factorization/DenseEvd.cs b/src/Numerics/LinearAlgebra/Complex32/Factorization/DenseEvd.cs index e54487f7..f18de8d4 100644 --- a/src/Numerics/LinearAlgebra/Complex32/Factorization/DenseEvd.cs +++ b/src/Numerics/LinearAlgebra/Complex32/Factorization/DenseEvd.cs @@ -28,7 +28,6 @@ // using System; -using MathNet.Numerics.Properties; using MathNet.Numerics.Providers.LinearAlgebra; namespace MathNet.Numerics.LinearAlgebra.Complex32.Factorization @@ -65,7 +64,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32.Factorization { if (matrix.RowCount != matrix.ColumnCount) { - throw new ArgumentException(Resources.ArgumentMatrixSquare); + throw new ArgumentException("Matrix must be square."); } var order = matrix.RowCount; @@ -109,19 +108,19 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32.Factorization // The solution X should have the same number of columns as B if (input.ColumnCount != result.ColumnCount) { - throw new ArgumentException(Resources.ArgumentMatrixSameColumnDimension); + throw new ArgumentException("Matrix column dimensions must agree."); } // The dimension compatibility conditions for X = A\B require the two matrices A and B to have the same number of rows if (EigenValues.Count != input.RowCount) { - throw new ArgumentException(Resources.ArgumentMatrixSameRowDimension); + throw new ArgumentException("Matrix row dimensions must agree."); } // The solution X row dimension is equal to the column dimension of A if (EigenValues.Count != result.RowCount) { - throw new ArgumentException(Resources.ArgumentMatrixSameColumnDimension); + throw new ArgumentException("Matrix column dimensions must agree."); } if (IsSymmetric) @@ -161,7 +160,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32.Factorization } else { - throw new ArgumentException(Resources.ArgumentMatrixSymmetric); + throw new ArgumentException("Matrix must be symmetric."); } } @@ -176,13 +175,13 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32.Factorization // Check that b is a column vector with m entries if (EigenValues.Count != input.Count) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } // Check that x is a column vector with n entries if (EigenValues.Count != result.Count) { - throw new ArgumentException(Resources.ArgumentMatrixDimensions); + throw new ArgumentException("Matrix dimensions must agree."); } if (IsSymmetric) @@ -221,7 +220,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32.Factorization } else { - throw new ArgumentException(Resources.ArgumentMatrixSymmetric); + throw new ArgumentException("Matrix must be symmetric."); } } } diff --git a/src/Numerics/LinearAlgebra/Complex32/Factorization/DenseGramSchmidt.cs b/src/Numerics/LinearAlgebra/Complex32/Factorization/DenseGramSchmidt.cs index afd641cf..4f48fa3b 100644 --- a/src/Numerics/LinearAlgebra/Complex32/Factorization/DenseGramSchmidt.cs +++ b/src/Numerics/LinearAlgebra/Complex32/Factorization/DenseGramSchmidt.cs @@ -29,7 +29,6 @@ using System; using MathNet.Numerics.LinearAlgebra.Factorization; -using MathNet.Numerics.Properties; using MathNet.Numerics.Providers.LinearAlgebra; namespace MathNet.Numerics.LinearAlgebra.Complex32.Factorization @@ -92,7 +91,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32.Factorization norm = (float)Math.Sqrt(norm); if (norm == 0.0f) { - throw new ArgumentException(Resources.ArgumentMatrixNotRankDeficient); + throw new ArgumentException("Matrix must not be rank deficient."); } r[(k * columnsQ) + k] = norm; @@ -132,19 +131,19 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32.Factorization // The solution X should have the same number of columns as B if (input.ColumnCount != result.ColumnCount) { - throw new ArgumentException(Resources.ArgumentMatrixSameColumnDimension); + throw new ArgumentException("Matrix column dimensions must agree."); } // The dimension compatibility conditions for X = A\B require the two matrices A and B to have the same number of rows if (Q.RowCount != input.RowCount) { - throw new ArgumentException(Resources.ArgumentMatrixSameRowDimension); + throw new ArgumentException("Matrix row dimensions must agree."); } // The solution X row dimension is equal to the column dimension of A if (Q.ColumnCount != result.RowCount) { - throw new ArgumentException(Resources.ArgumentMatrixSameColumnDimension); + throw new ArgumentException("Matrix column dimensions must agree."); } if (input is DenseMatrix dinput && result is DenseMatrix dresult) @@ -168,7 +167,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32.Factorization // Check that b is a column vector with m entries if (Q.RowCount != input.Count) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } // Check that x is a column vector with n entries diff --git a/src/Numerics/LinearAlgebra/Complex32/Factorization/DenseLU.cs b/src/Numerics/LinearAlgebra/Complex32/Factorization/DenseLU.cs index 856ed21f..9e9c220c 100644 --- a/src/Numerics/LinearAlgebra/Complex32/Factorization/DenseLU.cs +++ b/src/Numerics/LinearAlgebra/Complex32/Factorization/DenseLU.cs @@ -28,7 +28,6 @@ // using System; -using MathNet.Numerics.Properties; using MathNet.Numerics.Providers.LinearAlgebra; namespace MathNet.Numerics.LinearAlgebra.Complex32.Factorization @@ -61,7 +60,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32.Factorization if (matrix.RowCount != matrix.ColumnCount) { - throw new ArgumentException(Resources.ArgumentMatrixSquare); + throw new ArgumentException("Matrix must be square."); } // Create an array for the pivot indices. @@ -100,12 +99,12 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32.Factorization // Check for proper dimensions. if (result.RowCount != input.RowCount) { - throw new ArgumentException(Resources.ArgumentMatrixSameRowDimension); + throw new ArgumentException("Matrix row dimensions must agree."); } if (result.ColumnCount != input.ColumnCount) { - throw new ArgumentException(Resources.ArgumentMatrixSameColumnDimension); + throw new ArgumentException("Matrix column dimensions must agree."); } if (input.RowCount != Factors.RowCount) @@ -149,7 +148,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32.Factorization // Check for proper dimensions. if (input.Count != result.Count) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } if (input.Count != Factors.RowCount) diff --git a/src/Numerics/LinearAlgebra/Complex32/Factorization/DenseQR.cs b/src/Numerics/LinearAlgebra/Complex32/Factorization/DenseQR.cs index 4921136a..dd5bfc10 100644 --- a/src/Numerics/LinearAlgebra/Complex32/Factorization/DenseQR.cs +++ b/src/Numerics/LinearAlgebra/Complex32/Factorization/DenseQR.cs @@ -29,7 +29,6 @@ using System; using MathNet.Numerics.LinearAlgebra.Factorization; -using MathNet.Numerics.Properties; using MathNet.Numerics.Providers.LinearAlgebra; namespace MathNet.Numerics.LinearAlgebra.Complex32.Factorization @@ -103,19 +102,19 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32.Factorization // The solution X should have the same number of columns as B if (input.ColumnCount != result.ColumnCount) { - throw new ArgumentException(Resources.ArgumentMatrixSameColumnDimension); + throw new ArgumentException("Matrix column dimensions must agree."); } // The dimension compatibility conditions for X = A\B require the two matrices A and B to have the same number of rows if (Q.RowCount != input.RowCount) { - throw new ArgumentException(Resources.ArgumentMatrixSameRowDimension); + throw new ArgumentException("Matrix row dimensions must agree."); } // The solution X row dimension is equal to the column dimension of A if (FullR.ColumnCount != result.RowCount) { - throw new ArgumentException(Resources.ArgumentMatrixSameColumnDimension); + throw new ArgumentException("Matrix column dimensions must agree."); } if (input is DenseMatrix dinput && result is DenseMatrix dresult) @@ -139,7 +138,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32.Factorization // Check that b is a column vector with m entries if (Q.RowCount != input.Count) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } // Check that x is a column vector with n entries diff --git a/src/Numerics/LinearAlgebra/Complex32/Factorization/DenseSvd.cs b/src/Numerics/LinearAlgebra/Complex32/Factorization/DenseSvd.cs index cb00ce16..ed275085 100644 --- a/src/Numerics/LinearAlgebra/Complex32/Factorization/DenseSvd.cs +++ b/src/Numerics/LinearAlgebra/Complex32/Factorization/DenseSvd.cs @@ -28,7 +28,6 @@ // using System; -using MathNet.Numerics.Properties; using MathNet.Numerics.Providers.LinearAlgebra; namespace MathNet.Numerics.LinearAlgebra.Complex32.Factorization @@ -84,25 +83,25 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32.Factorization { if (!VectorsComputed) { - throw new InvalidOperationException(Resources.SingularVectorsNotComputed); + throw new InvalidOperationException("The singular vectors were not computed."); } // The solution X should have the same number of columns as B if (input.ColumnCount != result.ColumnCount) { - throw new ArgumentException(Resources.ArgumentMatrixSameColumnDimension); + throw new ArgumentException("Matrix column dimensions must agree."); } // The dimension compatibility conditions for X = A\B require the two matrices A and B to have the same number of rows if (U.RowCount != input.RowCount) { - throw new ArgumentException(Resources.ArgumentMatrixSameRowDimension); + throw new ArgumentException("Matrix row dimensions must agree."); } // The solution X row dimension is equal to the column dimension of A if (VT.ColumnCount != result.RowCount) { - throw new ArgumentException(Resources.ArgumentMatrixSameColumnDimension); + throw new ArgumentException("Matrix column dimensions must agree."); } if (input is DenseMatrix dinput && result is DenseMatrix dresult) @@ -124,14 +123,14 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32.Factorization { if (!VectorsComputed) { - throw new InvalidOperationException(Resources.SingularVectorsNotComputed); + throw new InvalidOperationException("The singular vectors were not computed."); } // Ax=b where A is an m x n matrix // Check that b is a column vector with m entries if (U.RowCount != input.Count) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } // Check that x is a column vector with n entries diff --git a/src/Numerics/LinearAlgebra/Complex32/Factorization/GramSchmidt.cs b/src/Numerics/LinearAlgebra/Complex32/Factorization/GramSchmidt.cs index 0dfa6ab1..f9349056 100644 --- a/src/Numerics/LinearAlgebra/Complex32/Factorization/GramSchmidt.cs +++ b/src/Numerics/LinearAlgebra/Complex32/Factorization/GramSchmidt.cs @@ -29,7 +29,6 @@ using System; using MathNet.Numerics.LinearAlgebra.Factorization; -using MathNet.Numerics.Properties; namespace MathNet.Numerics.LinearAlgebra.Complex32.Factorization { @@ -58,7 +57,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32.Factorization { if (FullR.RowCount != FullR.ColumnCount) { - throw new ArgumentException(Resources.ArgumentMatrixSquare); + throw new ArgumentException("Matrix must be square."); } var det = Complex32.One; diff --git a/src/Numerics/LinearAlgebra/Complex32/Factorization/QR.cs b/src/Numerics/LinearAlgebra/Complex32/Factorization/QR.cs index b4148fa0..34397b9d 100644 --- a/src/Numerics/LinearAlgebra/Complex32/Factorization/QR.cs +++ b/src/Numerics/LinearAlgebra/Complex32/Factorization/QR.cs @@ -29,7 +29,6 @@ using System; using MathNet.Numerics.LinearAlgebra.Factorization; -using MathNet.Numerics.Properties; namespace MathNet.Numerics.LinearAlgebra.Complex32.Factorization { @@ -63,7 +62,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32.Factorization { if (FullR.RowCount != FullR.ColumnCount) { - throw new ArgumentException(Resources.ArgumentMatrixSquare); + throw new ArgumentException("Matrix must be square."); } var det = Complex32.One; diff --git a/src/Numerics/LinearAlgebra/Complex32/Factorization/Svd.cs b/src/Numerics/LinearAlgebra/Complex32/Factorization/Svd.cs index 688c847e..ad5cfc1c 100644 --- a/src/Numerics/LinearAlgebra/Complex32/Factorization/Svd.cs +++ b/src/Numerics/LinearAlgebra/Complex32/Factorization/Svd.cs @@ -30,7 +30,6 @@ using System; using System.Linq; using MathNet.Numerics.LinearAlgebra.Factorization; -using MathNet.Numerics.Properties; namespace MathNet.Numerics.LinearAlgebra.Complex32.Factorization { @@ -98,7 +97,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32.Factorization { if (U.RowCount != VT.ColumnCount) { - throw new ArgumentException(Resources.ArgumentMatrixSquare); + throw new ArgumentException("Matrix must be square."); } var det = Complex32.One; diff --git a/src/Numerics/LinearAlgebra/Complex32/Factorization/UserCholesky.cs b/src/Numerics/LinearAlgebra/Complex32/Factorization/UserCholesky.cs index 62aa849d..d3e0c3a4 100644 --- a/src/Numerics/LinearAlgebra/Complex32/Factorization/UserCholesky.cs +++ b/src/Numerics/LinearAlgebra/Complex32/Factorization/UserCholesky.cs @@ -28,7 +28,6 @@ // using System; -using MathNet.Numerics.Properties; using MathNet.Numerics.Threading; namespace MathNet.Numerics.LinearAlgebra.Complex32.Factorization @@ -57,7 +56,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32.Factorization { if (factor.RowCount != factor.ColumnCount) { - throw new ArgumentException(Resources.ArgumentMatrixSquare); + throw new ArgumentException("Matrix must be square."); } // Create a new matrix for the Cholesky factor, then perform factorization (while overwriting). @@ -88,7 +87,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32.Factorization } else { - throw new ArgumentException(Resources.ArgumentMatrixPositiveDefinite); + throw new ArgumentException("Matrix must be positive definite."); } for (var i = ij + 1; i < factor.RowCount; i++) @@ -182,12 +181,12 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32.Factorization { if (result.RowCount != input.RowCount) { - throw new ArgumentException(Resources.ArgumentMatrixSameRowDimension); + throw new ArgumentException("Matrix row dimensions must agree."); } if (result.ColumnCount != input.ColumnCount) { - throw new ArgumentException(Resources.ArgumentMatrixSameColumnDimension); + throw new ArgumentException("Matrix column dimensions must agree."); } if (input.RowCount != Factor.RowCount) @@ -236,7 +235,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32.Factorization { if (input.Count != result.Count) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } if (input.Count != Factor.RowCount) diff --git a/src/Numerics/LinearAlgebra/Complex32/Factorization/UserEvd.cs b/src/Numerics/LinearAlgebra/Complex32/Factorization/UserEvd.cs index a9192442..d5dbca34 100644 --- a/src/Numerics/LinearAlgebra/Complex32/Factorization/UserEvd.cs +++ b/src/Numerics/LinearAlgebra/Complex32/Factorization/UserEvd.cs @@ -28,7 +28,6 @@ // using System; -using MathNet.Numerics.Properties; namespace MathNet.Numerics.LinearAlgebra.Complex32.Factorization { @@ -64,7 +63,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32.Factorization { if (matrix.RowCount != matrix.ColumnCount) { - throw new ArgumentException(Resources.ArgumentMatrixSquare); + throw new ArgumentException("Matrix must be square."); } var order = matrix.RowCount; @@ -824,19 +823,19 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32.Factorization // The solution X should have the same number of columns as B if (input.ColumnCount != result.ColumnCount) { - throw new ArgumentException(Resources.ArgumentMatrixSameColumnDimension); + throw new ArgumentException("Matrix column dimensions must agree."); } // The dimension compatibility conditions for X = A\B require the two matrices A and B to have the same number of rows if (EigenValues.Count != input.RowCount) { - throw new ArgumentException(Resources.ArgumentMatrixSameRowDimension); + throw new ArgumentException("Matrix row dimensions must agree."); } // The solution X row dimension is equal to the column dimension of A if (EigenValues.Count != result.RowCount) { - throw new ArgumentException(Resources.ArgumentMatrixSameColumnDimension); + throw new ArgumentException("Matrix column dimensions must agree."); } if (IsSymmetric) @@ -876,7 +875,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32.Factorization } else { - throw new ArgumentException(Resources.ArgumentMatrixSymmetric); + throw new ArgumentException("Matrix must be symmetric."); } } @@ -891,13 +890,13 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32.Factorization // Check that b is a column vector with m entries if (EigenValues.Count != input.Count) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } // Check that x is a column vector with n entries if (EigenValues.Count != result.Count) { - throw new ArgumentException(Resources.ArgumentMatrixDimensions); + throw new ArgumentException("Matrix dimensions must agree."); } if (IsSymmetric) @@ -936,7 +935,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32.Factorization } else { - throw new ArgumentException(Resources.ArgumentMatrixSymmetric); + throw new ArgumentException("Matrix must be symmetric."); } } } diff --git a/src/Numerics/LinearAlgebra/Complex32/Factorization/UserGramSchmidt.cs b/src/Numerics/LinearAlgebra/Complex32/Factorization/UserGramSchmidt.cs index aab36498..ca990e85 100644 --- a/src/Numerics/LinearAlgebra/Complex32/Factorization/UserGramSchmidt.cs +++ b/src/Numerics/LinearAlgebra/Complex32/Factorization/UserGramSchmidt.cs @@ -28,7 +28,6 @@ // using System; -using MathNet.Numerics.Properties; namespace MathNet.Numerics.LinearAlgebra.Complex32.Factorization { @@ -66,7 +65,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32.Factorization var norm = (float) q.Column(k).L2Norm(); if (norm == 0f) { - throw new ArgumentException(Resources.ArgumentMatrixNotRankDeficient); + throw new ArgumentException("Matrix must not be rank deficient."); } r.At(k, k, norm); @@ -110,19 +109,19 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32.Factorization // The solution X should have the same number of columns as B if (input.ColumnCount != result.ColumnCount) { - throw new ArgumentException(Resources.ArgumentMatrixSameColumnDimension); + throw new ArgumentException("Matrix column dimensions must agree."); } // The dimension compatibility conditions for X = A\B require the two matrices A and B to have the same number of rows if (Q.RowCount != input.RowCount) { - throw new ArgumentException(Resources.ArgumentMatrixSameRowDimension); + throw new ArgumentException("Matrix row dimensions must agree."); } // The solution X row dimension is equal to the column dimension of A if (Q.ColumnCount != result.RowCount) { - throw new ArgumentException(Resources.ArgumentMatrixSameColumnDimension); + throw new ArgumentException("Matrix column dimensions must agree."); } var inputCopy = input.Clone(); @@ -185,7 +184,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32.Factorization // Check that b is a column vector with m entries if (Q.RowCount != input.Count) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } // Check that x is a column vector with n entries diff --git a/src/Numerics/LinearAlgebra/Complex32/Factorization/UserLU.cs b/src/Numerics/LinearAlgebra/Complex32/Factorization/UserLU.cs index 3b913767..99a1f758 100644 --- a/src/Numerics/LinearAlgebra/Complex32/Factorization/UserLU.cs +++ b/src/Numerics/LinearAlgebra/Complex32/Factorization/UserLU.cs @@ -28,7 +28,6 @@ // using System; -using MathNet.Numerics.Properties; namespace MathNet.Numerics.LinearAlgebra.Complex32.Factorization { @@ -60,7 +59,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32.Factorization if (matrix.RowCount != matrix.ColumnCount) { - throw new ArgumentException(Resources.ArgumentMatrixSquare); + throw new ArgumentException("Matrix must be square."); } // Create an array for the pivot indices. @@ -158,12 +157,12 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32.Factorization // Check for proper dimensions. if (result.RowCount != input.RowCount) { - throw new ArgumentException(Resources.ArgumentMatrixSameRowDimension); + throw new ArgumentException("Matrix row dimensions must agree."); } if (result.ColumnCount != input.ColumnCount) { - throw new ArgumentException(Resources.ArgumentMatrixSameColumnDimension); + throw new ArgumentException("Matrix column dimensions must agree."); } if (input.RowCount != Factors.RowCount) @@ -244,7 +243,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32.Factorization // Check for proper dimensions. if (input.Count != result.Count) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } if (input.Count != Factors.RowCount) diff --git a/src/Numerics/LinearAlgebra/Complex32/Factorization/UserQR.cs b/src/Numerics/LinearAlgebra/Complex32/Factorization/UserQR.cs index f7b9ad0a..96902dad 100644 --- a/src/Numerics/LinearAlgebra/Complex32/Factorization/UserQR.cs +++ b/src/Numerics/LinearAlgebra/Complex32/Factorization/UserQR.cs @@ -30,7 +30,6 @@ using System; using System.Linq; using MathNet.Numerics.LinearAlgebra.Factorization; -using MathNet.Numerics.Properties; using MathNet.Numerics.Threading; namespace MathNet.Numerics.LinearAlgebra.Complex32.Factorization @@ -228,19 +227,19 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32.Factorization // The solution X should have the same number of columns as B if (input.ColumnCount != result.ColumnCount) { - throw new ArgumentException(Resources.ArgumentMatrixSameColumnDimension); + throw new ArgumentException("Matrix column dimensions must agree."); } // The dimension compatibility conditions for X = A\B require the two matrices A and B to have the same number of rows if (FullR.RowCount != input.RowCount) { - throw new ArgumentException(Resources.ArgumentMatrixSameRowDimension); + throw new ArgumentException("Matrix row dimensions must agree."); } // The solution X row dimension is equal to the column dimension of A if (FullR.ColumnCount != result.RowCount) { - throw new ArgumentException(Resources.ArgumentMatrixSameColumnDimension); + throw new ArgumentException("Matrix column dimensions must agree."); } var inputCopy = input.Clone(); @@ -303,7 +302,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32.Factorization // Check that b is a column vector with m entries if (FullR.RowCount != input.Count) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } // Check that x is a column vector with n entries diff --git a/src/Numerics/LinearAlgebra/Complex32/Factorization/UserSvd.cs b/src/Numerics/LinearAlgebra/Complex32/Factorization/UserSvd.cs index 9e672e32..75c01caa 100644 --- a/src/Numerics/LinearAlgebra/Complex32/Factorization/UserSvd.cs +++ b/src/Numerics/LinearAlgebra/Complex32/Factorization/UserSvd.cs @@ -28,7 +28,6 @@ // using System; -using MathNet.Numerics.Properties; namespace MathNet.Numerics.LinearAlgebra.Complex32.Factorization { @@ -804,25 +803,25 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32.Factorization { if (!VectorsComputed) { - throw new InvalidOperationException(Resources.SingularVectorsNotComputed); + throw new InvalidOperationException("The singular vectors were not computed."); } // The solution X should have the same number of columns as B if (input.ColumnCount != result.ColumnCount) { - throw new ArgumentException(Resources.ArgumentMatrixSameColumnDimension); + throw new ArgumentException("Matrix column dimensions must agree."); } // The dimension compatibility conditions for X = A\B require the two matrices A and B to have the same number of rows if (U.RowCount != input.RowCount) { - throw new ArgumentException(Resources.ArgumentMatrixSameRowDimension); + throw new ArgumentException("Matrix row dimensions must agree."); } // The solution X row dimension is equal to the column dimension of A if (VT.ColumnCount != result.RowCount) { - throw new ArgumentException(Resources.ArgumentMatrixSameColumnDimension); + throw new ArgumentException("Matrix column dimensions must agree."); } var mn = Math.Min(U.RowCount, VT.ColumnCount); @@ -870,14 +869,14 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32.Factorization { if (!VectorsComputed) { - throw new InvalidOperationException(Resources.SingularVectorsNotComputed); + throw new InvalidOperationException("The singular vectors were not computed."); } // Ax=b where A is an m x n matrix // Check that b is a column vector with m entries if (U.RowCount != input.Count) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } // Check that x is a column vector with n entries diff --git a/src/Numerics/LinearAlgebra/Complex32/Matrix.cs b/src/Numerics/LinearAlgebra/Complex32/Matrix.cs index 443e1471..ff2cd70b 100644 --- a/src/Numerics/LinearAlgebra/Complex32/Matrix.cs +++ b/src/Numerics/LinearAlgebra/Complex32/Matrix.cs @@ -31,7 +31,6 @@ using System; using MathNet.Numerics.LinearAlgebra.Complex32.Factorization; using MathNet.Numerics.LinearAlgebra.Factorization; using MathNet.Numerics.LinearAlgebra.Storage; -using MathNet.Numerics.Properties; namespace MathNet.Numerics.LinearAlgebra.Complex32 { @@ -551,7 +550,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32 { if (RowCount != ColumnCount) { - throw new ArgumentException(Resources.ArgumentMatrixSquare); + throw new ArgumentException("Matrix must be square."); } var sum = Complex32.Zero; @@ -661,7 +660,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32 { if (norm <= 0.0) { - throw new ArgumentOutOfRangeException(nameof(norm), Resources.ArgumentMustBePositive); + throw new ArgumentOutOfRangeException(nameof(norm), "Value must be positive."); } var ret = new double[RowCount]; @@ -693,7 +692,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32 { if (norm <= 0.0) { - throw new ArgumentOutOfRangeException(nameof(norm), Resources.ArgumentMustBePositive); + throw new ArgumentOutOfRangeException(nameof(norm), "Value must be positive."); } var ret = new double[ColumnCount]; diff --git a/src/Numerics/LinearAlgebra/Complex32/Solvers/BiCgStab.cs b/src/Numerics/LinearAlgebra/Complex32/Solvers/BiCgStab.cs index 0d8f75cd..f2106803 100644 --- a/src/Numerics/LinearAlgebra/Complex32/Solvers/BiCgStab.cs +++ b/src/Numerics/LinearAlgebra/Complex32/Solvers/BiCgStab.cs @@ -29,7 +29,6 @@ using System; using MathNet.Numerics.LinearAlgebra.Solvers; -using MathNet.Numerics.Properties; namespace MathNet.Numerics.LinearAlgebra.Complex32.Solvers { @@ -96,12 +95,12 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32.Solvers { if (matrix.RowCount != matrix.ColumnCount) { - throw new ArgumentException(Resources.ArgumentMatrixSquare, nameof(matrix)); + throw new ArgumentException("Matrix must be square.", nameof(matrix)); } if (result.Count != input.Count) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } if (input.Count != matrix.RowCount) diff --git a/src/Numerics/LinearAlgebra/Complex32/Solvers/CompositeSolver.cs b/src/Numerics/LinearAlgebra/Complex32/Solvers/CompositeSolver.cs index cfd1f34b..4c7b3f09 100644 --- a/src/Numerics/LinearAlgebra/Complex32/Solvers/CompositeSolver.cs +++ b/src/Numerics/LinearAlgebra/Complex32/Solvers/CompositeSolver.cs @@ -31,7 +31,6 @@ using System; using System.Collections.Generic; using System.Linq; using MathNet.Numerics.LinearAlgebra.Solvers; -using MathNet.Numerics.Properties; namespace MathNet.Numerics.LinearAlgebra.Complex32.Solvers { @@ -44,7 +43,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32.Solvers /// Solver based on:
/// Faster PDE-based simulations using robust composite linear solvers
/// S. Bhowmicka, P. Raghavan a,*, L. McInnes b, B. Norris
- /// Future Generation Computer Systems, Vol 20, 2004, pp 373–387
+ /// Future Generation Computer Systems, Vol 20, 2004, pp 373�387
/// /// /// Note that if an iterator is passed to this solver it will be used for all the sub-solvers. @@ -75,12 +74,12 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32.Solvers { if (matrix.RowCount != matrix.ColumnCount) { - throw new ArgumentException(Resources.ArgumentMatrixSquare, nameof(matrix)); + throw new ArgumentException("Matrix must be square.", nameof(matrix)); } if (result.Count != input.Count) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } if (iterator == null) diff --git a/src/Numerics/LinearAlgebra/Complex32/Solvers/DiagonalPreconditioner.cs b/src/Numerics/LinearAlgebra/Complex32/Solvers/DiagonalPreconditioner.cs index 4c1813ee..d92c3e28 100644 --- a/src/Numerics/LinearAlgebra/Complex32/Solvers/DiagonalPreconditioner.cs +++ b/src/Numerics/LinearAlgebra/Complex32/Solvers/DiagonalPreconditioner.cs @@ -29,7 +29,6 @@ using System; using MathNet.Numerics.LinearAlgebra.Solvers; -using MathNet.Numerics.Properties; namespace MathNet.Numerics.LinearAlgebra.Complex32.Solvers { @@ -72,7 +71,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32.Solvers { if (matrix.RowCount != matrix.ColumnCount) { - throw new ArgumentException(Resources.ArgumentMatrixSquare, nameof(matrix)); + throw new ArgumentException("Matrix must be square.", nameof(matrix)); } _inverseDiagonals = new Complex32[matrix.RowCount]; @@ -91,12 +90,12 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32.Solvers { if (_inverseDiagonals == null) { - throw new ArgumentException(Resources.ArgumentMatrixDoesNotExist); + throw new ArgumentException("The requested matrix does not exist."); } if ((lhs.Count != rhs.Count) || (lhs.Count != _inverseDiagonals.Length)) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength, nameof(rhs)); + throw new ArgumentException("All vectors must have the same dimensionality.", nameof(rhs)); } for (var i = 0; i < _inverseDiagonals.Length; i++) diff --git a/src/Numerics/LinearAlgebra/Complex32/Solvers/GpBiCg.cs b/src/Numerics/LinearAlgebra/Complex32/Solvers/GpBiCg.cs index 2cc8ada4..9fef00f2 100644 --- a/src/Numerics/LinearAlgebra/Complex32/Solvers/GpBiCg.cs +++ b/src/Numerics/LinearAlgebra/Complex32/Solvers/GpBiCg.cs @@ -29,7 +29,6 @@ using System; using MathNet.Numerics.LinearAlgebra.Solvers; -using MathNet.Numerics.Properties; namespace MathNet.Numerics.LinearAlgebra.Complex32.Solvers { @@ -159,12 +158,12 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32.Solvers { if (matrix.RowCount != matrix.ColumnCount) { - throw new ArgumentException(Resources.ArgumentMatrixSquare, nameof(matrix)); + throw new ArgumentException("Matrix must be square.", nameof(matrix)); } if (result.Count != input.Count) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } if (input.Count != matrix.RowCount) diff --git a/src/Numerics/LinearAlgebra/Complex32/Solvers/ILU0Preconditioner.cs b/src/Numerics/LinearAlgebra/Complex32/Solvers/ILU0Preconditioner.cs index c55e44b9..527764a5 100644 --- a/src/Numerics/LinearAlgebra/Complex32/Solvers/ILU0Preconditioner.cs +++ b/src/Numerics/LinearAlgebra/Complex32/Solvers/ILU0Preconditioner.cs @@ -29,7 +29,6 @@ using System; using MathNet.Numerics.LinearAlgebra.Solvers; -using MathNet.Numerics.Properties; namespace MathNet.Numerics.LinearAlgebra.Complex32.Solvers { @@ -110,7 +109,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32.Solvers if (matrix.RowCount != matrix.ColumnCount) { - throw new ArgumentException(Resources.ArgumentMatrixSquare, nameof(matrix)); + throw new ArgumentException("Matrix must be square.", nameof(matrix)); } _decompositionLU = SparseMatrix.OfMatrix(matrix); @@ -167,12 +166,12 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32.Solvers { if (_decompositionLU == null) { - throw new ArgumentException(Resources.ArgumentMatrixDoesNotExist); + throw new ArgumentException("The requested matrix does not exist."); } if ((lhs.Count != rhs.Count) || (lhs.Count != _decompositionLU.RowCount)) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } // Solve: diff --git a/src/Numerics/LinearAlgebra/Complex32/Solvers/ILUTPPreconditioner.cs b/src/Numerics/LinearAlgebra/Complex32/Solvers/ILUTPPreconditioner.cs index 713f7179..bfd86832 100644 --- a/src/Numerics/LinearAlgebra/Complex32/Solvers/ILUTPPreconditioner.cs +++ b/src/Numerics/LinearAlgebra/Complex32/Solvers/ILUTPPreconditioner.cs @@ -30,7 +30,6 @@ using System; using System.Collections.Generic; using MathNet.Numerics.LinearAlgebra.Solvers; -using MathNet.Numerics.Properties; namespace MathNet.Numerics.LinearAlgebra.Complex32.Solvers { @@ -300,7 +299,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32.Solvers if (matrix.RowCount != matrix.ColumnCount) { - throw new ArgumentException(Resources.ArgumentMatrixSquare, nameof(matrix)); + throw new ArgumentException("Matrix must be square.", nameof(matrix)); } var sparseMatrix = matrix as SparseMatrix ?? SparseMatrix.OfMatrix(matrix); @@ -618,12 +617,12 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32.Solvers { if (_upper == null) { - throw new ArgumentException(Resources.ArgumentMatrixDoesNotExist); + throw new ArgumentException("The requested matrix does not exist."); } if ((lhs.Count != rhs.Count) || (lhs.Count != _upper.RowCount)) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength, nameof(rhs)); + throw new ArgumentException("All vectors must have the same dimensionality.", nameof(rhs)); } // Solve equation here diff --git a/src/Numerics/LinearAlgebra/Complex32/Solvers/MILU0Preconditioner.cs b/src/Numerics/LinearAlgebra/Complex32/Solvers/MILU0Preconditioner.cs index 2a884496..07096e81 100644 --- a/src/Numerics/LinearAlgebra/Complex32/Solvers/MILU0Preconditioner.cs +++ b/src/Numerics/LinearAlgebra/Complex32/Solvers/MILU0Preconditioner.cs @@ -30,7 +30,6 @@ using System; using MathNet.Numerics.LinearAlgebra.Solvers; using MathNet.Numerics.LinearAlgebra.Storage; -using MathNet.Numerics.Properties; namespace MathNet.Numerics.LinearAlgebra.Complex32.Solvers { @@ -86,14 +85,14 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32.Solvers var csr = matrix.Storage as SparseCompressedRowMatrixStorage; if (csr == null) { - throw new ArgumentException(Resources.MatrixMustBeSparse, nameof(matrix)); + throw new ArgumentException("Matrix must be in sparse storage format", nameof(matrix)); } // Dimension of matrix int n = csr.RowCount; if (n != csr.ColumnCount) { - throw new ArgumentException(Resources.ArgumentMatrixSquare, nameof(matrix)); + throw new ArgumentException("Matrix must be square.", nameof(matrix)); } // Original matrix compressed sparse row storage. @@ -123,12 +122,12 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32.Solvers { if (_alu == null) { - throw new ArgumentException(Resources.ArgumentMatrixDoesNotExist); + throw new ArgumentException("The requested matrix does not exist."); } if ((result.Count != input.Count) || (result.Count != _diag.Length)) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } int n = _diag.Length; diff --git a/src/Numerics/LinearAlgebra/Complex32/Solvers/MlkBiCgStab.cs b/src/Numerics/LinearAlgebra/Complex32/Solvers/MlkBiCgStab.cs index 4046864c..e0b097f3 100644 --- a/src/Numerics/LinearAlgebra/Complex32/Solvers/MlkBiCgStab.cs +++ b/src/Numerics/LinearAlgebra/Complex32/Solvers/MlkBiCgStab.cs @@ -33,7 +33,6 @@ using System.Diagnostics; using System.Linq; using MathNet.Numerics.Distributions; using MathNet.Numerics.LinearAlgebra.Solvers; -using MathNet.Numerics.Properties; namespace MathNet.Numerics.LinearAlgebra.Complex32.Solvers { @@ -245,12 +244,12 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32.Solvers { if (matrix.RowCount != matrix.ColumnCount) { - throw new ArgumentException(Resources.ArgumentMatrixSquare, nameof(matrix)); + throw new ArgumentException("Matrix must be square.", nameof(matrix)); } if (result.Count != input.Count) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } if (input.Count != matrix.RowCount) diff --git a/src/Numerics/LinearAlgebra/Complex32/Solvers/TFQMR.cs b/src/Numerics/LinearAlgebra/Complex32/Solvers/TFQMR.cs index 42dd3c56..b6bccb5b 100644 --- a/src/Numerics/LinearAlgebra/Complex32/Solvers/TFQMR.cs +++ b/src/Numerics/LinearAlgebra/Complex32/Solvers/TFQMR.cs @@ -29,7 +29,6 @@ using System; using MathNet.Numerics.LinearAlgebra.Solvers; -using MathNet.Numerics.Properties; namespace MathNet.Numerics.LinearAlgebra.Complex32.Solvers { @@ -92,12 +91,12 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32.Solvers { if (matrix.RowCount != matrix.ColumnCount) { - throw new ArgumentException(Resources.ArgumentMatrixSquare, nameof(matrix)); + throw new ArgumentException("Matrix must be square.", nameof(matrix)); } if (result.Count != input.Count) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } if (input.Count != matrix.RowCount) diff --git a/src/Numerics/LinearAlgebra/Double/DenseMatrix.cs b/src/Numerics/LinearAlgebra/Double/DenseMatrix.cs index 24665233..1f123fe5 100644 --- a/src/Numerics/LinearAlgebra/Double/DenseMatrix.cs +++ b/src/Numerics/LinearAlgebra/Double/DenseMatrix.cs @@ -35,7 +35,6 @@ using MathNet.Numerics.Distributions; using MathNet.Numerics.LinearAlgebra.Double.Factorization; using MathNet.Numerics.LinearAlgebra.Factorization; using MathNet.Numerics.LinearAlgebra.Storage; -using MathNet.Numerics.Properties; using MathNet.Numerics.Providers.LinearAlgebra; using MathNet.Numerics.Threading; @@ -933,7 +932,7 @@ namespace MathNet.Numerics.LinearAlgebra.Double { if (_rowCount != _columnCount) { - throw new ArgumentException(Resources.ArgumentMatrixSquare); + throw new ArgumentException("Matrix must be square."); } var sum = 0.0; diff --git a/src/Numerics/LinearAlgebra/Double/DenseVector.cs b/src/Numerics/LinearAlgebra/Double/DenseVector.cs index 80ab7346..e7f42f0d 100644 --- a/src/Numerics/LinearAlgebra/Double/DenseVector.cs +++ b/src/Numerics/LinearAlgebra/Double/DenseVector.cs @@ -34,7 +34,6 @@ using System.Globalization; using System.Linq; using MathNet.Numerics.Distributions; using MathNet.Numerics.LinearAlgebra.Storage; -using MathNet.Numerics.Properties; using MathNet.Numerics.Providers.LinearAlgebra; using MathNet.Numerics.Threading; @@ -261,7 +260,7 @@ namespace MathNet.Numerics.LinearAlgebra.Double if (leftSide.Count != rightSide.Count) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength, nameof(rightSide)); + throw new ArgumentException("All vectors must have the same dimensionality.", nameof(rightSide)); } return (DenseVector)leftSide.Add(rightSide); diff --git a/src/Numerics/LinearAlgebra/Double/DiagonalMatrix.cs b/src/Numerics/LinearAlgebra/Double/DiagonalMatrix.cs index 3af9b702..4b9039e3 100644 --- a/src/Numerics/LinearAlgebra/Double/DiagonalMatrix.cs +++ b/src/Numerics/LinearAlgebra/Double/DiagonalMatrix.cs @@ -33,7 +33,6 @@ using System.Diagnostics; using System.Linq; using MathNet.Numerics.Distributions; using MathNet.Numerics.LinearAlgebra.Storage; -using MathNet.Numerics.Properties; using MathNet.Numerics.Providers.LinearAlgebra; using MathNet.Numerics.Threading; @@ -535,7 +534,7 @@ namespace MathNet.Numerics.LinearAlgebra.Double { if (RowCount != ColumnCount) { - throw new ArgumentException(Resources.ArgumentMatrixSquare); + throw new ArgumentException("Matrix must be square."); } return _data.Aggregate(1.0, (current, t) => current * t); @@ -565,7 +564,7 @@ namespace MathNet.Numerics.LinearAlgebra.Double { if (source.Length != _data.Length) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(source)); + throw new ArgumentException("The array arguments must have the same length.", nameof(source)); } Buffer.BlockCopy(source, 0, _data, 0, source.Length * Constants.SizeOfDouble); @@ -586,7 +585,7 @@ namespace MathNet.Numerics.LinearAlgebra.Double { if (_data.Length != denseSource.Values.Length) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength, nameof(source)); + throw new ArgumentException("All vectors must have the same dimensionality.", nameof(source)); } Buffer.BlockCopy(denseSource.Values, 0, _data, 0, denseSource.Values.Length * Constants.SizeOfDouble); @@ -648,7 +647,7 @@ namespace MathNet.Numerics.LinearAlgebra.Double { if (RowCount != ColumnCount) { - throw new ArgumentException(Resources.ArgumentMatrixSquare); + throw new ArgumentException("Matrix must be square."); } var inverse = (DiagonalMatrix)Clone(); @@ -660,7 +659,7 @@ namespace MathNet.Numerics.LinearAlgebra.Double } else { - throw new ArgumentException(Resources.ArgumentMatrixNotSingular); + throw new ArgumentException("Matrix must not be singular."); } } diff --git a/src/Numerics/LinearAlgebra/Double/Factorization/DenseCholesky.cs b/src/Numerics/LinearAlgebra/Double/Factorization/DenseCholesky.cs index d3a75e27..bf1d028a 100644 --- a/src/Numerics/LinearAlgebra/Double/Factorization/DenseCholesky.cs +++ b/src/Numerics/LinearAlgebra/Double/Factorization/DenseCholesky.cs @@ -28,7 +28,6 @@ // using System; -using MathNet.Numerics.Properties; using MathNet.Numerics.Providers.LinearAlgebra; namespace MathNet.Numerics.LinearAlgebra.Double.Factorization @@ -56,7 +55,7 @@ namespace MathNet.Numerics.LinearAlgebra.Double.Factorization { if (matrix.RowCount != matrix.ColumnCount) { - throw new ArgumentException(Resources.ArgumentMatrixSquare); + throw new ArgumentException("Matrix must be square."); } // Create a new matrix for the Cholesky factor, then perform factorization (while overwriting). @@ -79,12 +78,12 @@ namespace MathNet.Numerics.LinearAlgebra.Double.Factorization { if (result.RowCount != input.RowCount) { - throw new ArgumentException(Resources.ArgumentMatrixSameRowDimension); + throw new ArgumentException("Matrix row dimensions must agree."); } if (result.ColumnCount != input.ColumnCount) { - throw new ArgumentException(Resources.ArgumentMatrixSameColumnDimension); + throw new ArgumentException("Matrix column dimensions must agree."); } if (input.RowCount != Factor.RowCount) @@ -116,7 +115,7 @@ namespace MathNet.Numerics.LinearAlgebra.Double.Factorization { if (input.Count != result.Count) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } if (input.Count != Factor.RowCount) @@ -151,7 +150,7 @@ namespace MathNet.Numerics.LinearAlgebra.Double.Factorization { if (matrix.RowCount != matrix.ColumnCount) { - throw new ArgumentException(Resources.ArgumentMatrixSquare); + throw new ArgumentException("Matrix must be square."); } if (matrix.RowCount != Factor.RowCount || matrix.ColumnCount != Factor.ColumnCount) diff --git a/src/Numerics/LinearAlgebra/Double/Factorization/DenseEvd.cs b/src/Numerics/LinearAlgebra/Double/Factorization/DenseEvd.cs index b61da00c..eadac120 100644 --- a/src/Numerics/LinearAlgebra/Double/Factorization/DenseEvd.cs +++ b/src/Numerics/LinearAlgebra/Double/Factorization/DenseEvd.cs @@ -28,7 +28,6 @@ // using System; -using MathNet.Numerics.Properties; using MathNet.Numerics.Providers.LinearAlgebra; namespace MathNet.Numerics.LinearAlgebra.Double.Factorization @@ -64,7 +63,7 @@ namespace MathNet.Numerics.LinearAlgebra.Double.Factorization { if (matrix.RowCount != matrix.ColumnCount) { - throw new ArgumentException(Resources.ArgumentMatrixSquare); + throw new ArgumentException("Matrix must be square."); } var order = matrix.RowCount; @@ -109,19 +108,19 @@ namespace MathNet.Numerics.LinearAlgebra.Double.Factorization // The solution X should have the same number of columns as B if (input.ColumnCount != result.ColumnCount) { - throw new ArgumentException(Resources.ArgumentMatrixSameColumnDimension); + throw new ArgumentException("Matrix column dimensions must agree."); } // The dimension compatibility conditions for X = A\B require the two matrices A and B to have the same number of rows if (EigenValues.Count != input.RowCount) { - throw new ArgumentException(Resources.ArgumentMatrixSameRowDimension); + throw new ArgumentException("Matrix row dimensions must agree."); } // The solution X row dimension is equal to the column dimension of A if (EigenValues.Count != result.RowCount) { - throw new ArgumentException(Resources.ArgumentMatrixSameColumnDimension); + throw new ArgumentException("Matrix column dimensions must agree."); } if (IsSymmetric) @@ -161,7 +160,7 @@ namespace MathNet.Numerics.LinearAlgebra.Double.Factorization } else { - throw new ArgumentException(Resources.ArgumentMatrixSymmetric); + throw new ArgumentException("Matrix must be symmetric."); } } @@ -176,13 +175,13 @@ namespace MathNet.Numerics.LinearAlgebra.Double.Factorization // Check that b is a column vector with m entries if (EigenValues.Count != input.Count) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } // Check that x is a column vector with n entries if (EigenValues.Count != result.Count) { - throw new ArgumentException(Resources.ArgumentMatrixDimensions); + throw new ArgumentException("Matrix dimensions must agree."); } if (IsSymmetric) @@ -221,7 +220,7 @@ namespace MathNet.Numerics.LinearAlgebra.Double.Factorization } else { - throw new ArgumentException(Resources.ArgumentMatrixSymmetric); + throw new ArgumentException("Matrix must be symmetric."); } } } diff --git a/src/Numerics/LinearAlgebra/Double/Factorization/DenseGramSchmidt.cs b/src/Numerics/LinearAlgebra/Double/Factorization/DenseGramSchmidt.cs index 7adba9d9..6986d9f5 100644 --- a/src/Numerics/LinearAlgebra/Double/Factorization/DenseGramSchmidt.cs +++ b/src/Numerics/LinearAlgebra/Double/Factorization/DenseGramSchmidt.cs @@ -29,7 +29,6 @@ using System; using MathNet.Numerics.LinearAlgebra.Factorization; -using MathNet.Numerics.Properties; using MathNet.Numerics.Providers.LinearAlgebra; namespace MathNet.Numerics.LinearAlgebra.Double.Factorization @@ -90,7 +89,7 @@ namespace MathNet.Numerics.LinearAlgebra.Double.Factorization norm = Math.Sqrt(norm); if (norm == 0.0) { - throw new ArgumentException(Resources.ArgumentMatrixNotRankDeficient); + throw new ArgumentException("Matrix must not be rank deficient."); } r[(k * columnsQ) + k] = norm; @@ -130,19 +129,19 @@ namespace MathNet.Numerics.LinearAlgebra.Double.Factorization // The solution X should have the same number of columns as B if (input.ColumnCount != result.ColumnCount) { - throw new ArgumentException(Resources.ArgumentMatrixSameColumnDimension); + throw new ArgumentException("Matrix column dimensions must agree."); } // The dimension compatibility conditions for X = A\B require the two matrices A and B to have the same number of rows if (Q.RowCount != input.RowCount) { - throw new ArgumentException(Resources.ArgumentMatrixSameRowDimension); + throw new ArgumentException("Matrix row dimensions must agree."); } // The solution X row dimension is equal to the column dimension of A if (Q.ColumnCount != result.RowCount) { - throw new ArgumentException(Resources.ArgumentMatrixSameColumnDimension); + throw new ArgumentException("Matrix column dimensions must agree."); } if (input is DenseMatrix dinput && result is DenseMatrix dresult) @@ -166,7 +165,7 @@ namespace MathNet.Numerics.LinearAlgebra.Double.Factorization // Check that b is a column vector with m entries if (Q.RowCount != input.Count) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } // Check that x is a column vector with n entries diff --git a/src/Numerics/LinearAlgebra/Double/Factorization/DenseLU.cs b/src/Numerics/LinearAlgebra/Double/Factorization/DenseLU.cs index 9cbade23..694ada5b 100644 --- a/src/Numerics/LinearAlgebra/Double/Factorization/DenseLU.cs +++ b/src/Numerics/LinearAlgebra/Double/Factorization/DenseLU.cs @@ -28,7 +28,6 @@ // using System; -using MathNet.Numerics.Properties; using MathNet.Numerics.Providers.LinearAlgebra; namespace MathNet.Numerics.LinearAlgebra.Double.Factorization @@ -59,7 +58,7 @@ namespace MathNet.Numerics.LinearAlgebra.Double.Factorization if (matrix.RowCount != matrix.ColumnCount) { - throw new ArgumentException(Resources.ArgumentMatrixSquare); + throw new ArgumentException("Matrix must be square."); } // Create an array for the pivot indices. @@ -98,12 +97,12 @@ namespace MathNet.Numerics.LinearAlgebra.Double.Factorization // Check for proper dimensions. if (result.RowCount != input.RowCount) { - throw new ArgumentException(Resources.ArgumentMatrixSameRowDimension); + throw new ArgumentException("Matrix row dimensions must agree."); } if (result.ColumnCount != input.ColumnCount) { - throw new ArgumentException(Resources.ArgumentMatrixSameColumnDimension); + throw new ArgumentException("Matrix column dimensions must agree."); } if (input.RowCount != Factors.RowCount) @@ -147,7 +146,7 @@ namespace MathNet.Numerics.LinearAlgebra.Double.Factorization // Check for proper dimensions. if (input.Count != result.Count) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } if (input.Count != Factors.RowCount) diff --git a/src/Numerics/LinearAlgebra/Double/Factorization/DenseQR.cs b/src/Numerics/LinearAlgebra/Double/Factorization/DenseQR.cs index fec6f37a..83bf8f58 100644 --- a/src/Numerics/LinearAlgebra/Double/Factorization/DenseQR.cs +++ b/src/Numerics/LinearAlgebra/Double/Factorization/DenseQR.cs @@ -29,7 +29,6 @@ using System; using MathNet.Numerics.LinearAlgebra.Factorization; -using MathNet.Numerics.Properties; using MathNet.Numerics.Providers.LinearAlgebra; namespace MathNet.Numerics.LinearAlgebra.Double.Factorization @@ -101,19 +100,19 @@ namespace MathNet.Numerics.LinearAlgebra.Double.Factorization // The solution X should have the same number of columns as B if (input.ColumnCount != result.ColumnCount) { - throw new ArgumentException(Resources.ArgumentMatrixSameColumnDimension); + throw new ArgumentException("Matrix column dimensions must agree."); } // The dimension compatibility conditions for X = A\B require the two matrices A and B to have the same number of rows if (Q.RowCount != input.RowCount) { - throw new ArgumentException(Resources.ArgumentMatrixSameRowDimension); + throw new ArgumentException("Matrix row dimensions must agree."); } // The solution X row dimension is equal to the column dimension of A if (FullR.ColumnCount != result.RowCount) { - throw new ArgumentException(Resources.ArgumentMatrixSameColumnDimension); + throw new ArgumentException("Matrix column dimensions must agree."); } if (input is DenseMatrix dinput && result is DenseMatrix dresult) @@ -137,7 +136,7 @@ namespace MathNet.Numerics.LinearAlgebra.Double.Factorization // Check that b is a column vector with m entries if (Q.RowCount != input.Count) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } // Check that x is a column vector with n entries diff --git a/src/Numerics/LinearAlgebra/Double/Factorization/DenseSvd.cs b/src/Numerics/LinearAlgebra/Double/Factorization/DenseSvd.cs index 13539043..d1a50bf1 100644 --- a/src/Numerics/LinearAlgebra/Double/Factorization/DenseSvd.cs +++ b/src/Numerics/LinearAlgebra/Double/Factorization/DenseSvd.cs @@ -28,7 +28,6 @@ // using System; -using MathNet.Numerics.Properties; using MathNet.Numerics.Providers.LinearAlgebra; namespace MathNet.Numerics.LinearAlgebra.Double.Factorization @@ -82,25 +81,25 @@ namespace MathNet.Numerics.LinearAlgebra.Double.Factorization { if (!VectorsComputed) { - throw new InvalidOperationException(Resources.SingularVectorsNotComputed); + throw new InvalidOperationException("The singular vectors were not computed."); } // The solution X should have the same number of columns as B if (input.ColumnCount != result.ColumnCount) { - throw new ArgumentException(Resources.ArgumentMatrixSameColumnDimension); + throw new ArgumentException("Matrix column dimensions must agree."); } // The dimension compatibility conditions for X = A\B require the two matrices A and B to have the same number of rows if (U.RowCount != input.RowCount) { - throw new ArgumentException(Resources.ArgumentMatrixSameRowDimension); + throw new ArgumentException("Matrix row dimensions must agree."); } // The solution X row dimension is equal to the column dimension of A if (VT.ColumnCount != result.RowCount) { - throw new ArgumentException(Resources.ArgumentMatrixSameColumnDimension); + throw new ArgumentException("Matrix column dimensions must agree."); } if (input is DenseMatrix dinput && result is DenseMatrix dresult) @@ -122,14 +121,14 @@ namespace MathNet.Numerics.LinearAlgebra.Double.Factorization { if (!VectorsComputed) { - throw new InvalidOperationException(Resources.SingularVectorsNotComputed); + throw new InvalidOperationException("The singular vectors were not computed."); } // Ax=b where A is an m x n matrix // Check that b is a column vector with m entries if (U.RowCount != input.Count) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } // Check that x is a column vector with n entries diff --git a/src/Numerics/LinearAlgebra/Double/Factorization/GramSchmidt.cs b/src/Numerics/LinearAlgebra/Double/Factorization/GramSchmidt.cs index aa5f4d70..c5e14a8b 100644 --- a/src/Numerics/LinearAlgebra/Double/Factorization/GramSchmidt.cs +++ b/src/Numerics/LinearAlgebra/Double/Factorization/GramSchmidt.cs @@ -29,7 +29,6 @@ using System; using MathNet.Numerics.LinearAlgebra.Factorization; -using MathNet.Numerics.Properties; namespace MathNet.Numerics.LinearAlgebra.Double.Factorization { @@ -56,7 +55,7 @@ namespace MathNet.Numerics.LinearAlgebra.Double.Factorization { if (FullR.RowCount != FullR.ColumnCount) { - throw new ArgumentException(Resources.ArgumentMatrixSquare); + throw new ArgumentException("Matrix must be square."); } var det = 1.0; diff --git a/src/Numerics/LinearAlgebra/Double/Factorization/QR.cs b/src/Numerics/LinearAlgebra/Double/Factorization/QR.cs index daf5ffe9..681d9130 100644 --- a/src/Numerics/LinearAlgebra/Double/Factorization/QR.cs +++ b/src/Numerics/LinearAlgebra/Double/Factorization/QR.cs @@ -29,7 +29,6 @@ using System; using MathNet.Numerics.LinearAlgebra.Factorization; -using MathNet.Numerics.Properties; namespace MathNet.Numerics.LinearAlgebra.Double.Factorization { @@ -61,7 +60,7 @@ namespace MathNet.Numerics.LinearAlgebra.Double.Factorization { if (FullR.RowCount != FullR.ColumnCount) { - throw new ArgumentException(Resources.ArgumentMatrixSquare); + throw new ArgumentException("Matrix must be square."); } var det = 1.0; diff --git a/src/Numerics/LinearAlgebra/Double/Factorization/Svd.cs b/src/Numerics/LinearAlgebra/Double/Factorization/Svd.cs index aab6fd73..b2ea4941 100644 --- a/src/Numerics/LinearAlgebra/Double/Factorization/Svd.cs +++ b/src/Numerics/LinearAlgebra/Double/Factorization/Svd.cs @@ -30,7 +30,6 @@ using System; using System.Linq; using MathNet.Numerics.LinearAlgebra.Factorization; -using MathNet.Numerics.Properties; namespace MathNet.Numerics.LinearAlgebra.Double.Factorization { @@ -96,7 +95,7 @@ namespace MathNet.Numerics.LinearAlgebra.Double.Factorization { if (U.RowCount != VT.ColumnCount) { - throw new ArgumentException(Resources.ArgumentMatrixSquare); + throw new ArgumentException("Matrix must be square."); } var det = 1.0; diff --git a/src/Numerics/LinearAlgebra/Double/Factorization/UserCholesky.cs b/src/Numerics/LinearAlgebra/Double/Factorization/UserCholesky.cs index eed115b3..b5d1f829 100644 --- a/src/Numerics/LinearAlgebra/Double/Factorization/UserCholesky.cs +++ b/src/Numerics/LinearAlgebra/Double/Factorization/UserCholesky.cs @@ -28,7 +28,6 @@ // using System; -using MathNet.Numerics.Properties; using MathNet.Numerics.Threading; namespace MathNet.Numerics.LinearAlgebra.Double.Factorization @@ -55,7 +54,7 @@ namespace MathNet.Numerics.LinearAlgebra.Double.Factorization { if (factor.RowCount != factor.ColumnCount) { - throw new ArgumentException(Resources.ArgumentMatrixSquare); + throw new ArgumentException("Matrix must be square."); } var tmpColumn = new double[factor.RowCount]; @@ -85,7 +84,7 @@ namespace MathNet.Numerics.LinearAlgebra.Double.Factorization } else { - throw new ArgumentException(Resources.ArgumentMatrixPositiveDefinite); + throw new ArgumentException("Matrix must be positive definite."); } for (var i = ij + 1; i < factor.RowCount; i++) @@ -179,12 +178,12 @@ namespace MathNet.Numerics.LinearAlgebra.Double.Factorization { if (result.RowCount != input.RowCount) { - throw new ArgumentException(Resources.ArgumentMatrixSameRowDimension); + throw new ArgumentException("Matrix row dimensions must agree."); } if (result.ColumnCount != input.ColumnCount) { - throw new ArgumentException(Resources.ArgumentMatrixSameColumnDimension); + throw new ArgumentException("Matrix column dimensions must agree."); } if (input.RowCount != Factor.RowCount) @@ -233,7 +232,7 @@ namespace MathNet.Numerics.LinearAlgebra.Double.Factorization { if (input.Count != result.Count) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } if (input.Count != Factor.RowCount) diff --git a/src/Numerics/LinearAlgebra/Double/Factorization/UserEvd.cs b/src/Numerics/LinearAlgebra/Double/Factorization/UserEvd.cs index 9942b434..b23fa589 100644 --- a/src/Numerics/LinearAlgebra/Double/Factorization/UserEvd.cs +++ b/src/Numerics/LinearAlgebra/Double/Factorization/UserEvd.cs @@ -28,7 +28,6 @@ // using System; -using MathNet.Numerics.Properties; namespace MathNet.Numerics.LinearAlgebra.Double.Factorization { @@ -63,7 +62,7 @@ namespace MathNet.Numerics.LinearAlgebra.Double.Factorization { if (matrix.RowCount != matrix.ColumnCount) { - throw new ArgumentException(Resources.ArgumentMatrixSquare); + throw new ArgumentException("Matrix must be square."); } var order = matrix.RowCount; @@ -1093,19 +1092,19 @@ namespace MathNet.Numerics.LinearAlgebra.Double.Factorization // The solution X should have the same number of columns as B if (input.ColumnCount != result.ColumnCount) { - throw new ArgumentException(Resources.ArgumentMatrixSameColumnDimension); + throw new ArgumentException("Matrix column dimensions must agree."); } // The dimension compatibility conditions for X = A\B require the two matrices A and B to have the same number of rows if (EigenValues.Count != input.RowCount) { - throw new ArgumentException(Resources.ArgumentMatrixSameRowDimension); + throw new ArgumentException("Matrix row dimensions must agree."); } // The solution X row dimension is equal to the column dimension of A if (EigenValues.Count != result.RowCount) { - throw new ArgumentException(Resources.ArgumentMatrixSameColumnDimension); + throw new ArgumentException("Matrix column dimensions must agree."); } if (IsSymmetric) @@ -1145,7 +1144,7 @@ namespace MathNet.Numerics.LinearAlgebra.Double.Factorization } else { - throw new ArgumentException(Resources.ArgumentMatrixSymmetric); + throw new ArgumentException("Matrix must be symmetric."); } } @@ -1160,13 +1159,13 @@ namespace MathNet.Numerics.LinearAlgebra.Double.Factorization // Check that b is a column vector with m entries if (EigenValues.Count != input.Count) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } // Check that x is a column vector with n entries if (EigenValues.Count != result.Count) { - throw new ArgumentException(Resources.ArgumentMatrixDimensions); + throw new ArgumentException("Matrix dimensions must agree."); } if (IsSymmetric) @@ -1205,7 +1204,7 @@ namespace MathNet.Numerics.LinearAlgebra.Double.Factorization } else { - throw new ArgumentException(Resources.ArgumentMatrixSymmetric); + throw new ArgumentException("Matrix must be symmetric."); } } } diff --git a/src/Numerics/LinearAlgebra/Double/Factorization/UserGramSchmidt.cs b/src/Numerics/LinearAlgebra/Double/Factorization/UserGramSchmidt.cs index d4112dfe..d2250c6f 100644 --- a/src/Numerics/LinearAlgebra/Double/Factorization/UserGramSchmidt.cs +++ b/src/Numerics/LinearAlgebra/Double/Factorization/UserGramSchmidt.cs @@ -28,7 +28,6 @@ // using System; -using MathNet.Numerics.Properties; namespace MathNet.Numerics.LinearAlgebra.Double.Factorization { @@ -64,7 +63,7 @@ namespace MathNet.Numerics.LinearAlgebra.Double.Factorization var norm = q.Column(k).L2Norm(); if (norm == 0.0) { - throw new ArgumentException(Resources.ArgumentMatrixNotRankDeficient); + throw new ArgumentException("Matrix must not be rank deficient."); } r.At(k, k, norm); @@ -103,19 +102,19 @@ namespace MathNet.Numerics.LinearAlgebra.Double.Factorization // The solution X should have the same number of columns as B if (input.ColumnCount != result.ColumnCount) { - throw new ArgumentException(Resources.ArgumentMatrixSameColumnDimension); + throw new ArgumentException("Matrix column dimensions must agree."); } // The dimension compatibility conditions for X = A\B require the two matrices A and B to have the same number of rows if (Q.RowCount != input.RowCount) { - throw new ArgumentException(Resources.ArgumentMatrixSameRowDimension); + throw new ArgumentException("Matrix row dimensions must agree."); } // The solution X row dimension is equal to the column dimension of A if (Q.ColumnCount != result.RowCount) { - throw new ArgumentException(Resources.ArgumentMatrixSameColumnDimension); + throw new ArgumentException("Matrix column dimensions must agree."); } var inputCopy = input.Clone(); @@ -178,7 +177,7 @@ namespace MathNet.Numerics.LinearAlgebra.Double.Factorization // Check that b is a column vector with m entries if (Q.RowCount != input.Count) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } // Check that x is a column vector with n entries diff --git a/src/Numerics/LinearAlgebra/Double/Factorization/UserLU.cs b/src/Numerics/LinearAlgebra/Double/Factorization/UserLU.cs index 30034c06..1ec25c9f 100644 --- a/src/Numerics/LinearAlgebra/Double/Factorization/UserLU.cs +++ b/src/Numerics/LinearAlgebra/Double/Factorization/UserLU.cs @@ -28,7 +28,6 @@ // using System; -using MathNet.Numerics.Properties; namespace MathNet.Numerics.LinearAlgebra.Double.Factorization { @@ -58,7 +57,7 @@ namespace MathNet.Numerics.LinearAlgebra.Double.Factorization if (matrix.RowCount != matrix.ColumnCount) { - throw new ArgumentException(Resources.ArgumentMatrixSquare); + throw new ArgumentException("Matrix must be square."); } // Create an array for the pivot indices. @@ -156,12 +155,12 @@ namespace MathNet.Numerics.LinearAlgebra.Double.Factorization // Check for proper dimensions. if (result.RowCount != input.RowCount) { - throw new ArgumentException(Resources.ArgumentMatrixSameRowDimension); + throw new ArgumentException("Matrix row dimensions must agree."); } if (result.ColumnCount != input.ColumnCount) { - throw new ArgumentException(Resources.ArgumentMatrixSameColumnDimension); + throw new ArgumentException("Matrix column dimensions must agree."); } if (input.RowCount != Factors.RowCount) @@ -242,7 +241,7 @@ namespace MathNet.Numerics.LinearAlgebra.Double.Factorization // Check for proper dimensions. if (input.Count != result.Count) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } if (input.Count != Factors.RowCount) diff --git a/src/Numerics/LinearAlgebra/Double/Factorization/UserQR.cs b/src/Numerics/LinearAlgebra/Double/Factorization/UserQR.cs index 68315db6..0124893c 100644 --- a/src/Numerics/LinearAlgebra/Double/Factorization/UserQR.cs +++ b/src/Numerics/LinearAlgebra/Double/Factorization/UserQR.cs @@ -30,7 +30,6 @@ using System; using System.Linq; using MathNet.Numerics.LinearAlgebra.Factorization; -using MathNet.Numerics.Properties; using MathNet.Numerics.Threading; namespace MathNet.Numerics.LinearAlgebra.Double.Factorization @@ -227,19 +226,19 @@ namespace MathNet.Numerics.LinearAlgebra.Double.Factorization // The solution X should have the same number of columns as B if (input.ColumnCount != result.ColumnCount) { - throw new ArgumentException(Resources.ArgumentMatrixSameColumnDimension); + throw new ArgumentException("Matrix column dimensions must agree."); } // The dimension compatibility conditions for X = A\B require the two matrices A and B to have the same number of rows if (FullR.RowCount != input.RowCount) { - throw new ArgumentException(Resources.ArgumentMatrixSameRowDimension); + throw new ArgumentException("Matrix row dimensions must agree."); } // The solution X row dimension is equal to the column dimension of A if (FullR.ColumnCount != result.RowCount) { - throw new ArgumentException(Resources.ArgumentMatrixSameColumnDimension); + throw new ArgumentException("Matrix column dimensions must agree."); } var inputCopy = input.Clone(); @@ -302,7 +301,7 @@ namespace MathNet.Numerics.LinearAlgebra.Double.Factorization // Check that b is a column vector with m entries if (FullR.RowCount != input.Count) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } // Check that x is a column vector with n entries diff --git a/src/Numerics/LinearAlgebra/Double/Factorization/UserSvd.cs b/src/Numerics/LinearAlgebra/Double/Factorization/UserSvd.cs index 5aeb792b..dca8c0d1 100644 --- a/src/Numerics/LinearAlgebra/Double/Factorization/UserSvd.cs +++ b/src/Numerics/LinearAlgebra/Double/Factorization/UserSvd.cs @@ -28,7 +28,6 @@ // using System; -using MathNet.Numerics.Properties; namespace MathNet.Numerics.LinearAlgebra.Double.Factorization { @@ -787,25 +786,25 @@ namespace MathNet.Numerics.LinearAlgebra.Double.Factorization { if (!VectorsComputed) { - throw new InvalidOperationException(Resources.SingularVectorsNotComputed); + throw new InvalidOperationException("The singular vectors were not computed."); } // The solution X should have the same number of columns as B if (input.ColumnCount != result.ColumnCount) { - throw new ArgumentException(Resources.ArgumentMatrixSameColumnDimension); + throw new ArgumentException("Matrix column dimensions must agree."); } // The dimension compatibility conditions for X = A\B require the two matrices A and B to have the same number of rows if (U.RowCount != input.RowCount) { - throw new ArgumentException(Resources.ArgumentMatrixSameRowDimension); + throw new ArgumentException("Matrix row dimensions must agree."); } // The solution X row dimension is equal to the column dimension of A if (VT.ColumnCount != result.RowCount) { - throw new ArgumentException(Resources.ArgumentMatrixSameColumnDimension); + throw new ArgumentException("Matrix column dimensions must agree."); } var mn = Math.Min(U.RowCount, VT.ColumnCount); @@ -853,14 +852,14 @@ namespace MathNet.Numerics.LinearAlgebra.Double.Factorization { if (!VectorsComputed) { - throw new InvalidOperationException(Resources.SingularVectorsNotComputed); + throw new InvalidOperationException("The singular vectors were not computed."); } // Ax=b where A is an m x n matrix // Check that b is a column vector with m entries if (U.RowCount != input.Count) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } // Check that x is a column vector with n entries diff --git a/src/Numerics/LinearAlgebra/Double/Matrix.cs b/src/Numerics/LinearAlgebra/Double/Matrix.cs index a35950bf..7f5be88d 100644 --- a/src/Numerics/LinearAlgebra/Double/Matrix.cs +++ b/src/Numerics/LinearAlgebra/Double/Matrix.cs @@ -31,7 +31,6 @@ using System; using MathNet.Numerics.LinearAlgebra.Double.Factorization; using MathNet.Numerics.LinearAlgebra.Factorization; using MathNet.Numerics.LinearAlgebra.Storage; -using MathNet.Numerics.Properties; namespace MathNet.Numerics.LinearAlgebra.Double { @@ -521,7 +520,7 @@ namespace MathNet.Numerics.LinearAlgebra.Double { if (RowCount != ColumnCount) { - throw new ArgumentException(Resources.ArgumentMatrixSquare); + throw new ArgumentException("Matrix must be square."); } var sum = 0.0; @@ -631,7 +630,7 @@ namespace MathNet.Numerics.LinearAlgebra.Double { if (norm <= 0.0) { - throw new ArgumentOutOfRangeException(nameof(norm), Resources.ArgumentMustBePositive); + throw new ArgumentOutOfRangeException(nameof(norm), "Value must be positive."); } var ret = new double[RowCount]; @@ -663,7 +662,7 @@ namespace MathNet.Numerics.LinearAlgebra.Double { if (norm <= 0.0) { - throw new ArgumentOutOfRangeException(nameof(norm), Resources.ArgumentMustBePositive); + throw new ArgumentOutOfRangeException(nameof(norm), "Value must be positive."); } var ret = new double[ColumnCount]; diff --git a/src/Numerics/LinearAlgebra/Double/Solvers/BiCgStab.cs b/src/Numerics/LinearAlgebra/Double/Solvers/BiCgStab.cs index 222a05b0..b291b630 100644 --- a/src/Numerics/LinearAlgebra/Double/Solvers/BiCgStab.cs +++ b/src/Numerics/LinearAlgebra/Double/Solvers/BiCgStab.cs @@ -29,7 +29,6 @@ using System; using MathNet.Numerics.LinearAlgebra.Solvers; -using MathNet.Numerics.Properties; namespace MathNet.Numerics.LinearAlgebra.Double.Solvers { @@ -96,12 +95,12 @@ namespace MathNet.Numerics.LinearAlgebra.Double.Solvers { if (matrix.RowCount != matrix.ColumnCount) { - throw new ArgumentException(Resources.ArgumentMatrixSquare, nameof(matrix)); + throw new ArgumentException("Matrix must be square.", nameof(matrix)); } if (result.Count != input.Count) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } if (input.Count != matrix.RowCount) diff --git a/src/Numerics/LinearAlgebra/Double/Solvers/CompositeSolver.cs b/src/Numerics/LinearAlgebra/Double/Solvers/CompositeSolver.cs index 7b5c7f97..ef25bbf6 100644 --- a/src/Numerics/LinearAlgebra/Double/Solvers/CompositeSolver.cs +++ b/src/Numerics/LinearAlgebra/Double/Solvers/CompositeSolver.cs @@ -31,7 +31,6 @@ using System; using System.Collections.Generic; using System.Linq; using MathNet.Numerics.LinearAlgebra.Solvers; -using MathNet.Numerics.Properties; namespace MathNet.Numerics.LinearAlgebra.Double.Solvers { @@ -44,7 +43,7 @@ namespace MathNet.Numerics.LinearAlgebra.Double.Solvers /// Solver based on:
/// Faster PDE-based simulations using robust composite linear solvers
/// S. Bhowmicka, P. Raghavan a,*, L. McInnes b, B. Norris
- /// Future Generation Computer Systems, Vol 20, 2004, pp 373–387
+ /// Future Generation Computer Systems, Vol 20, 2004, pp 373�387
///
/// /// Note that if an iterator is passed to this solver it will be used for all the sub-solvers. @@ -75,12 +74,12 @@ namespace MathNet.Numerics.LinearAlgebra.Double.Solvers { if (matrix.RowCount != matrix.ColumnCount) { - throw new ArgumentException(Resources.ArgumentMatrixSquare, nameof(matrix)); + throw new ArgumentException("Matrix must be square.", nameof(matrix)); } if (result.Count != input.Count) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } if (iterator == null) diff --git a/src/Numerics/LinearAlgebra/Double/Solvers/DiagonalPreconditioner.cs b/src/Numerics/LinearAlgebra/Double/Solvers/DiagonalPreconditioner.cs index 440ec6bd..edddc4ad 100644 --- a/src/Numerics/LinearAlgebra/Double/Solvers/DiagonalPreconditioner.cs +++ b/src/Numerics/LinearAlgebra/Double/Solvers/DiagonalPreconditioner.cs @@ -29,7 +29,6 @@ using System; using MathNet.Numerics.LinearAlgebra.Solvers; -using MathNet.Numerics.Properties; namespace MathNet.Numerics.LinearAlgebra.Double.Solvers { @@ -70,7 +69,7 @@ namespace MathNet.Numerics.LinearAlgebra.Double.Solvers { if (matrix.RowCount != matrix.ColumnCount) { - throw new ArgumentException(Resources.ArgumentMatrixSquare, nameof(matrix)); + throw new ArgumentException("Matrix must be square.", nameof(matrix)); } _inverseDiagonals = new double[matrix.RowCount]; @@ -89,12 +88,12 @@ namespace MathNet.Numerics.LinearAlgebra.Double.Solvers { if (_inverseDiagonals == null) { - throw new ArgumentException(Resources.ArgumentMatrixDoesNotExist); + throw new ArgumentException("The requested matrix does not exist."); } if ((lhs.Count != rhs.Count) || (lhs.Count != _inverseDiagonals.Length)) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength, nameof(rhs)); + throw new ArgumentException("All vectors must have the same dimensionality.", nameof(rhs)); } for (var i = 0; i < _inverseDiagonals.Length; i++) diff --git a/src/Numerics/LinearAlgebra/Double/Solvers/GpBiCg.cs b/src/Numerics/LinearAlgebra/Double/Solvers/GpBiCg.cs index 824d11b6..e104594c 100644 --- a/src/Numerics/LinearAlgebra/Double/Solvers/GpBiCg.cs +++ b/src/Numerics/LinearAlgebra/Double/Solvers/GpBiCg.cs @@ -29,7 +29,6 @@ using System; using MathNet.Numerics.LinearAlgebra.Solvers; -using MathNet.Numerics.Properties; namespace MathNet.Numerics.LinearAlgebra.Double.Solvers { @@ -159,12 +158,12 @@ namespace MathNet.Numerics.LinearAlgebra.Double.Solvers { if (matrix.RowCount != matrix.ColumnCount) { - throw new ArgumentException(Resources.ArgumentMatrixSquare, nameof(matrix)); + throw new ArgumentException("Matrix must be square.", nameof(matrix)); } if (result.Count != input.Count) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } if (input.Count != matrix.RowCount) diff --git a/src/Numerics/LinearAlgebra/Double/Solvers/ILU0Preconditioner.cs b/src/Numerics/LinearAlgebra/Double/Solvers/ILU0Preconditioner.cs index 426080e3..aa9d55c2 100644 --- a/src/Numerics/LinearAlgebra/Double/Solvers/ILU0Preconditioner.cs +++ b/src/Numerics/LinearAlgebra/Double/Solvers/ILU0Preconditioner.cs @@ -29,7 +29,6 @@ using System; using MathNet.Numerics.LinearAlgebra.Solvers; -using MathNet.Numerics.Properties; namespace MathNet.Numerics.LinearAlgebra.Double.Solvers { @@ -108,7 +107,7 @@ namespace MathNet.Numerics.LinearAlgebra.Double.Solvers if (matrix.RowCount != matrix.ColumnCount) { - throw new ArgumentException(Resources.ArgumentMatrixSquare, nameof(matrix)); + throw new ArgumentException("Matrix must be square.", nameof(matrix)); } _decompositionLU = SparseMatrix.OfMatrix(matrix); @@ -165,12 +164,12 @@ namespace MathNet.Numerics.LinearAlgebra.Double.Solvers { if (_decompositionLU == null) { - throw new ArgumentException(Resources.ArgumentMatrixDoesNotExist); + throw new ArgumentException("The requested matrix does not exist."); } if ((lhs.Count != rhs.Count) || (lhs.Count != _decompositionLU.RowCount)) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } // Solve: diff --git a/src/Numerics/LinearAlgebra/Double/Solvers/ILUTPPreconditioner.cs b/src/Numerics/LinearAlgebra/Double/Solvers/ILUTPPreconditioner.cs index 40d3e53f..30d88a08 100644 --- a/src/Numerics/LinearAlgebra/Double/Solvers/ILUTPPreconditioner.cs +++ b/src/Numerics/LinearAlgebra/Double/Solvers/ILUTPPreconditioner.cs @@ -30,7 +30,6 @@ using System; using System.Collections.Generic; using MathNet.Numerics.LinearAlgebra.Solvers; -using MathNet.Numerics.Properties; namespace MathNet.Numerics.LinearAlgebra.Double.Solvers { @@ -298,7 +297,7 @@ namespace MathNet.Numerics.LinearAlgebra.Double.Solvers if (matrix.RowCount != matrix.ColumnCount) { - throw new ArgumentException(Resources.ArgumentMatrixSquare, nameof(matrix)); + throw new ArgumentException("Matrix must be square.", nameof(matrix)); } var sparseMatrix = matrix as SparseMatrix ?? SparseMatrix.OfMatrix(matrix); @@ -616,12 +615,12 @@ namespace MathNet.Numerics.LinearAlgebra.Double.Solvers { if (_upper == null) { - throw new ArgumentException(Resources.ArgumentMatrixDoesNotExist); + throw new ArgumentException("The requested matrix does not exist."); } if ((lhs.Count != rhs.Count) || (lhs.Count != _upper.RowCount)) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength, nameof(rhs)); + throw new ArgumentException("All vectors must have the same dimensionality.", nameof(rhs)); } // Solve equation here diff --git a/src/Numerics/LinearAlgebra/Double/Solvers/MILU0Preconditioner.cs b/src/Numerics/LinearAlgebra/Double/Solvers/MILU0Preconditioner.cs index 49202b03..8f9565a6 100644 --- a/src/Numerics/LinearAlgebra/Double/Solvers/MILU0Preconditioner.cs +++ b/src/Numerics/LinearAlgebra/Double/Solvers/MILU0Preconditioner.cs @@ -30,7 +30,6 @@ using System; using MathNet.Numerics.LinearAlgebra.Solvers; using MathNet.Numerics.LinearAlgebra.Storage; -using MathNet.Numerics.Properties; namespace MathNet.Numerics.LinearAlgebra.Double.Solvers { @@ -84,14 +83,14 @@ namespace MathNet.Numerics.LinearAlgebra.Double.Solvers var csr = matrix.Storage as SparseCompressedRowMatrixStorage; if (csr == null) { - throw new ArgumentException(Resources.MatrixMustBeSparse, nameof(matrix)); + throw new ArgumentException("Matrix must be in sparse storage format", nameof(matrix)); } // Dimension of matrix int n = csr.RowCount; if (n != csr.ColumnCount) { - throw new ArgumentException(Resources.ArgumentMatrixSquare, nameof(matrix)); + throw new ArgumentException("Matrix must be square.", nameof(matrix)); } // Original matrix compressed sparse row storage. @@ -121,12 +120,12 @@ namespace MathNet.Numerics.LinearAlgebra.Double.Solvers { if (_alu == null) { - throw new ArgumentException(Resources.ArgumentMatrixDoesNotExist); + throw new ArgumentException("The requested matrix does not exist."); } if ((result.Count != input.Count) || (result.Count != _diag.Length)) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } int n = _diag.Length; diff --git a/src/Numerics/LinearAlgebra/Double/Solvers/MlkBiCgStab.cs b/src/Numerics/LinearAlgebra/Double/Solvers/MlkBiCgStab.cs index 3e6dead2..4f202ad7 100644 --- a/src/Numerics/LinearAlgebra/Double/Solvers/MlkBiCgStab.cs +++ b/src/Numerics/LinearAlgebra/Double/Solvers/MlkBiCgStab.cs @@ -33,7 +33,6 @@ using System.Diagnostics; using System.Linq; using MathNet.Numerics.Distributions; using MathNet.Numerics.LinearAlgebra.Solvers; -using MathNet.Numerics.Properties; namespace MathNet.Numerics.LinearAlgebra.Double.Solvers { @@ -239,12 +238,12 @@ namespace MathNet.Numerics.LinearAlgebra.Double.Solvers { if (matrix.RowCount != matrix.ColumnCount) { - throw new ArgumentException(Resources.ArgumentMatrixSquare, nameof(matrix)); + throw new ArgumentException("Matrix must be square.", nameof(matrix)); } if (result.Count != input.Count) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } if (input.Count != matrix.RowCount) diff --git a/src/Numerics/LinearAlgebra/Double/Solvers/TFQMR.cs b/src/Numerics/LinearAlgebra/Double/Solvers/TFQMR.cs index cce8f81e..e0595e22 100644 --- a/src/Numerics/LinearAlgebra/Double/Solvers/TFQMR.cs +++ b/src/Numerics/LinearAlgebra/Double/Solvers/TFQMR.cs @@ -29,7 +29,6 @@ using System; using MathNet.Numerics.LinearAlgebra.Solvers; -using MathNet.Numerics.Properties; namespace MathNet.Numerics.LinearAlgebra.Double.Solvers { @@ -92,12 +91,12 @@ namespace MathNet.Numerics.LinearAlgebra.Double.Solvers { if (matrix.RowCount != matrix.ColumnCount) { - throw new ArgumentException(Resources.ArgumentMatrixSquare, nameof(matrix)); + throw new ArgumentException("Matrix must be square.", nameof(matrix)); } if (result.Count != input.Count) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } if (input.Count != matrix.RowCount) diff --git a/src/Numerics/LinearAlgebra/Factorization/Svd.cs b/src/Numerics/LinearAlgebra/Factorization/Svd.cs index 6e38f1e2..bff63540 100644 --- a/src/Numerics/LinearAlgebra/Factorization/Svd.cs +++ b/src/Numerics/LinearAlgebra/Factorization/Svd.cs @@ -28,7 +28,6 @@ // using System; -using MathNet.Numerics.Properties; namespace MathNet.Numerics.LinearAlgebra.Factorization { @@ -138,7 +137,7 @@ namespace MathNet.Numerics.LinearAlgebra.Factorization { if (!VectorsComputed) { - throw new InvalidOperationException(Resources.SingularVectorsNotComputed); + throw new InvalidOperationException("The singular vectors were not computed."); } var x = Matrix.Build.SameAs(U, VT.ColumnCount, input.ColumnCount, fullyMutable: true); @@ -162,7 +161,7 @@ namespace MathNet.Numerics.LinearAlgebra.Factorization { if (!VectorsComputed) { - throw new InvalidOperationException(Resources.SingularVectorsNotComputed); + throw new InvalidOperationException("The singular vectors were not computed."); } var x = Vector.Build.SameAs(U, VT.ColumnCount); diff --git a/src/Numerics/LinearAlgebra/Matrix.Arithmetic.cs b/src/Numerics/LinearAlgebra/Matrix.Arithmetic.cs index 0a588370..7845fe27 100644 --- a/src/Numerics/LinearAlgebra/Matrix.Arithmetic.cs +++ b/src/Numerics/LinearAlgebra/Matrix.Arithmetic.cs @@ -29,7 +29,6 @@ using System; using System.Linq; -using MathNet.Numerics.Properties; namespace MathNet.Numerics.LinearAlgebra { @@ -508,12 +507,12 @@ namespace MathNet.Numerics.LinearAlgebra { if (result.RowCount != RowCount) { - throw new ArgumentException(Resources.ArgumentMatrixSameRowDimension, nameof(result)); + throw new ArgumentException("Matrix row dimensions must agree.", nameof(result)); } if (result.ColumnCount != ColumnCount) { - throw new ArgumentException(Resources.ArgumentMatrixSameColumnDimension, nameof(result)); + throw new ArgumentException("Matrix column dimensions must agree.", nameof(result)); } if (scalar.Equals(One)) @@ -563,12 +562,12 @@ namespace MathNet.Numerics.LinearAlgebra { if (result.RowCount != RowCount) { - throw new ArgumentException(Resources.ArgumentMatrixSameRowDimension, nameof(result)); + throw new ArgumentException("Matrix row dimensions must agree.", nameof(result)); } if (result.ColumnCount != ColumnCount) { - throw new ArgumentException(Resources.ArgumentMatrixSameColumnDimension, nameof(result)); + throw new ArgumentException("Matrix column dimensions must agree.", nameof(result)); } if (scalar.Equals(One)) @@ -607,12 +606,12 @@ namespace MathNet.Numerics.LinearAlgebra { if (result.RowCount != RowCount) { - throw new ArgumentException(Resources.ArgumentMatrixSameRowDimension, nameof(result)); + throw new ArgumentException("Matrix row dimensions must agree.", nameof(result)); } if (result.ColumnCount != ColumnCount) { - throw new ArgumentException(Resources.ArgumentMatrixSameColumnDimension, nameof(result)); + throw new ArgumentException("Matrix column dimensions must agree.", nameof(result)); } DoDivideByThis(scalar, result); @@ -1118,7 +1117,7 @@ namespace MathNet.Numerics.LinearAlgebra } if (exponent < 0) { - throw new ArgumentException(Resources.ArgumentNotNegative); + throw new ArgumentException("Value must not be negative (zero is ok)."); } if (exponent == 0) { @@ -1149,8 +1148,8 @@ namespace MathNet.Numerics.LinearAlgebra /// The positive integer exponent to raise the matrix to. public Matrix Power(int exponent) { - if (RowCount != ColumnCount) throw new ArgumentException(Resources.ArgumentMatrixSquare); - if (exponent < 0) throw new ArgumentException(Resources.ArgumentNotNegative); + if (RowCount != ColumnCount) throw new ArgumentException("Matrix must be square."); + if (exponent < 0) throw new ArgumentException("Value must not be negative (zero is ok)."); if (exponent == 0) return Build.DiagonalIdentity(RowCount, ColumnCount); if (exponent == 1) return this; @@ -1972,7 +1971,7 @@ namespace MathNet.Numerics.LinearAlgebra { if (RowCount != ColumnCount) { - throw new ArgumentException(Resources.ArgumentMatrixSquare); + throw new ArgumentException("Matrix must be square."); } return LU().Determinant; @@ -2004,7 +2003,7 @@ namespace MathNet.Numerics.LinearAlgebra { if (RowCount != ColumnCount) { - throw new ArgumentException(Resources.ArgumentMatrixSquare); + throw new ArgumentException("Matrix must be square."); } return LU().Inverse(); @@ -2337,21 +2336,21 @@ namespace MathNet.Numerics.LinearAlgebra internal static Exception DimensionsDontMatch(Matrix left, Matrix right, Matrix result, string paramName = null) where TException : Exception { - var message = string.Format(Resources.ArgumentMatrixDimensions3, left.RowCount + "x" + left.ColumnCount, right.RowCount + "x" + right.ColumnCount, result.RowCount + "x" + result.ColumnCount); + var message = $"Matrix dimensions must agree: op1 is {left.RowCount}x{left.ColumnCount}, op2 is {right.RowCount}x{right.ColumnCount}, op3 is {result.RowCount}x{result.ColumnCount}."; return CreateException(message, paramName); } internal static Exception DimensionsDontMatch(Matrix left, Matrix right, string paramName = null) where TException : Exception { - var message = string.Format(Resources.ArgumentMatrixDimensions2, left.RowCount + "x" + left.ColumnCount, right.RowCount + "x" + right.ColumnCount); + var message = $"Matrix dimensions must agree: op1 is {left.RowCount}x{left.ColumnCount}, op2 is {right.RowCount}x{right.ColumnCount}."; return CreateException(message, paramName); } internal static Exception DimensionsDontMatch(Matrix matrix) where TException : Exception { - var message = string.Format(Resources.ArgumentMatrixDimensions1, matrix.RowCount + "x" + matrix.ColumnCount); + var message = $"Matrix dimensions must agree: {matrix.RowCount}x{matrix.ColumnCount}."; return CreateException(message); } diff --git a/src/Numerics/LinearAlgebra/Matrix.cs b/src/Numerics/LinearAlgebra/Matrix.cs index 64a847dd..2cb7091b 100644 --- a/src/Numerics/LinearAlgebra/Matrix.cs +++ b/src/Numerics/LinearAlgebra/Matrix.cs @@ -33,7 +33,6 @@ using System.Linq; using System.Runtime; using System.Runtime.CompilerServices; using MathNet.Numerics.LinearAlgebra.Storage; -using MathNet.Numerics.Properties; using MathNet.Numerics.Threading; namespace MathNet.Numerics.LinearAlgebra @@ -669,7 +668,7 @@ namespace MathNet.Numerics.LinearAlgebra if (column.Count != RowCount) { - throw new ArgumentException(Resources.ArgumentMatrixSameRowDimension, nameof(column)); + throw new ArgumentException("Matrix row dimensions must agree.", nameof(column)); } var result = Build.SameAs(this, RowCount, ColumnCount + 1, fullyMutable: true); @@ -785,7 +784,7 @@ namespace MathNet.Numerics.LinearAlgebra if (row.Count != ColumnCount) { - throw new ArgumentException(Resources.ArgumentMatrixSameRowDimension, nameof(row)); + throw new ArgumentException("Matrix row dimensions must agree.", nameof(row)); } var result = Build.SameAs(this, RowCount + 1, ColumnCount, fullyMutable: true); @@ -961,7 +960,7 @@ namespace MathNet.Numerics.LinearAlgebra if (source.Count != min) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength, nameof(source)); + throw new ArgumentException("All vectors must have the same dimensionality.", nameof(source)); } for (var i = 0; i < min; i++) @@ -991,7 +990,7 @@ namespace MathNet.Numerics.LinearAlgebra if (source.Length != min) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(source)); + throw new ArgumentException("The array arguments must have the same length.", nameof(source)); } for (var i = 0; i < min; i++) @@ -1038,7 +1037,7 @@ namespace MathNet.Numerics.LinearAlgebra { if (p.Dimension != RowCount) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(p)); + throw new ArgumentException("The array arguments must have the same length.", nameof(p)); } // Get a sequence of inversions from the permutation. @@ -1067,7 +1066,7 @@ namespace MathNet.Numerics.LinearAlgebra { if (p.Dimension != ColumnCount) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(p)); + throw new ArgumentException("The array arguments must have the same length.", nameof(p)); } // Get a sequence of inversions from the permutation. @@ -1104,7 +1103,7 @@ namespace MathNet.Numerics.LinearAlgebra if (right.RowCount != RowCount) { - throw new ArgumentException(Resources.ArgumentMatrixSameRowDimension); + throw new ArgumentException("Matrix row dimensions must agree."); } var result = Build.SameAs(this, right, RowCount, ColumnCount + right.ColumnCount, fullyMutable: true); @@ -1129,7 +1128,7 @@ namespace MathNet.Numerics.LinearAlgebra if (right.RowCount != RowCount) { - throw new ArgumentException(Resources.ArgumentMatrixSameRowDimension); + throw new ArgumentException("Matrix row dimensions must agree."); } if (result == null) @@ -1139,7 +1138,7 @@ namespace MathNet.Numerics.LinearAlgebra if (result.ColumnCount != (ColumnCount + right.ColumnCount) || result.RowCount != RowCount) { - throw new ArgumentException(Resources.ArgumentMatrixSameColumnDimension); + throw new ArgumentException("Matrix column dimensions must agree."); } Storage.CopySubMatrixToUnchecked(result.Storage, 0, 0, RowCount, 0, 0, ColumnCount, ExistingData.Clear); @@ -1164,7 +1163,7 @@ namespace MathNet.Numerics.LinearAlgebra if (lower.ColumnCount != ColumnCount) { - throw new ArgumentException(Resources.ArgumentMatrixSameColumnDimension, nameof(lower)); + throw new ArgumentException("Matrix column dimensions must agree.", nameof(lower)); } var result = Build.SameAs(this, lower, RowCount + lower.RowCount, ColumnCount, fullyMutable: true); @@ -1191,7 +1190,7 @@ namespace MathNet.Numerics.LinearAlgebra if (lower.ColumnCount != ColumnCount) { - throw new ArgumentException(Resources.ArgumentMatrixSameColumnDimension, nameof(lower)); + throw new ArgumentException("Matrix column dimensions must agree.", nameof(lower)); } if (result == null) diff --git a/src/Numerics/LinearAlgebra/Single/DenseMatrix.cs b/src/Numerics/LinearAlgebra/Single/DenseMatrix.cs index f17c1ed8..397b2cd5 100644 --- a/src/Numerics/LinearAlgebra/Single/DenseMatrix.cs +++ b/src/Numerics/LinearAlgebra/Single/DenseMatrix.cs @@ -35,7 +35,6 @@ using MathNet.Numerics.Distributions; using MathNet.Numerics.LinearAlgebra.Factorization; using MathNet.Numerics.LinearAlgebra.Single.Factorization; using MathNet.Numerics.LinearAlgebra.Storage; -using MathNet.Numerics.Properties; using MathNet.Numerics.Providers.LinearAlgebra; using MathNet.Numerics.Threading; @@ -933,7 +932,7 @@ namespace MathNet.Numerics.LinearAlgebra.Single { if (_rowCount != _columnCount) { - throw new ArgumentException(Resources.ArgumentMatrixSquare); + throw new ArgumentException("Matrix must be square."); } var sum = 0.0f; diff --git a/src/Numerics/LinearAlgebra/Single/DiagonalMatrix.cs b/src/Numerics/LinearAlgebra/Single/DiagonalMatrix.cs index 0deaabd1..11da79ed 100644 --- a/src/Numerics/LinearAlgebra/Single/DiagonalMatrix.cs +++ b/src/Numerics/LinearAlgebra/Single/DiagonalMatrix.cs @@ -33,7 +33,6 @@ using System.Diagnostics; using System.Linq; using MathNet.Numerics.Distributions; using MathNet.Numerics.LinearAlgebra.Storage; -using MathNet.Numerics.Properties; using MathNet.Numerics.Providers.LinearAlgebra; using MathNet.Numerics.Threading; @@ -535,7 +534,7 @@ namespace MathNet.Numerics.LinearAlgebra.Single { if (RowCount != ColumnCount) { - throw new ArgumentException(Resources.ArgumentMatrixSquare); + throw new ArgumentException("Matrix must be square."); } return _data.Aggregate(1.0f, (current, t) => current * t); @@ -565,7 +564,7 @@ namespace MathNet.Numerics.LinearAlgebra.Single { if (source.Length != _data.Length) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(source)); + throw new ArgumentException("The array arguments must have the same length.", nameof(source)); } Buffer.BlockCopy(source, 0, _data, 0, source.Length * Constants.SizeOfFloat); @@ -586,7 +585,7 @@ namespace MathNet.Numerics.LinearAlgebra.Single { if (_data.Length != denseSource.Values.Length) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength, nameof(source)); + throw new ArgumentException("All vectors must have the same dimensionality.", nameof(source)); } Buffer.BlockCopy(denseSource.Values, 0, _data, 0, denseSource.Values.Length * Constants.SizeOfFloat); @@ -648,7 +647,7 @@ namespace MathNet.Numerics.LinearAlgebra.Single { if (RowCount != ColumnCount) { - throw new ArgumentException(Resources.ArgumentMatrixSquare); + throw new ArgumentException("Matrix must be square."); } var inverse = (DiagonalMatrix)Clone(); @@ -660,7 +659,7 @@ namespace MathNet.Numerics.LinearAlgebra.Single } else { - throw new ArgumentException(Resources.ArgumentMatrixNotSingular); + throw new ArgumentException("Matrix must not be singular."); } } diff --git a/src/Numerics/LinearAlgebra/Single/Factorization/DenseCholesky.cs b/src/Numerics/LinearAlgebra/Single/Factorization/DenseCholesky.cs index 5ead5410..d83feb2d 100644 --- a/src/Numerics/LinearAlgebra/Single/Factorization/DenseCholesky.cs +++ b/src/Numerics/LinearAlgebra/Single/Factorization/DenseCholesky.cs @@ -28,7 +28,6 @@ // using System; -using MathNet.Numerics.Properties; using MathNet.Numerics.Providers.LinearAlgebra; namespace MathNet.Numerics.LinearAlgebra.Single.Factorization @@ -56,7 +55,7 @@ namespace MathNet.Numerics.LinearAlgebra.Single.Factorization { if (matrix.RowCount != matrix.ColumnCount) { - throw new ArgumentException(Resources.ArgumentMatrixSquare); + throw new ArgumentException("Matrix must be square."); } // Create a new matrix for the Cholesky factor, then perform factorization (while overwriting). @@ -79,12 +78,12 @@ namespace MathNet.Numerics.LinearAlgebra.Single.Factorization { if (result.RowCount != input.RowCount) { - throw new ArgumentException(Resources.ArgumentMatrixSameRowDimension); + throw new ArgumentException("Matrix row dimensions must agree."); } if (result.ColumnCount != input.ColumnCount) { - throw new ArgumentException(Resources.ArgumentMatrixSameColumnDimension); + throw new ArgumentException("Matrix column dimensions must agree."); } if (input.RowCount != Factor.RowCount) @@ -116,7 +115,7 @@ namespace MathNet.Numerics.LinearAlgebra.Single.Factorization { if (input.Count != result.Count) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } if (input.Count != Factor.RowCount) @@ -151,7 +150,7 @@ namespace MathNet.Numerics.LinearAlgebra.Single.Factorization { if (matrix.RowCount != matrix.ColumnCount) { - throw new ArgumentException(Resources.ArgumentMatrixSquare); + throw new ArgumentException("Matrix must be square."); } if (matrix.RowCount != Factor.RowCount || matrix.ColumnCount != Factor.ColumnCount) diff --git a/src/Numerics/LinearAlgebra/Single/Factorization/DenseEvd.cs b/src/Numerics/LinearAlgebra/Single/Factorization/DenseEvd.cs index 2dda05a9..f74cc939 100644 --- a/src/Numerics/LinearAlgebra/Single/Factorization/DenseEvd.cs +++ b/src/Numerics/LinearAlgebra/Single/Factorization/DenseEvd.cs @@ -28,7 +28,6 @@ // using System; -using MathNet.Numerics.Properties; using MathNet.Numerics.Providers.LinearAlgebra; namespace MathNet.Numerics.LinearAlgebra.Single.Factorization @@ -64,7 +63,7 @@ namespace MathNet.Numerics.LinearAlgebra.Single.Factorization { if (matrix.RowCount != matrix.ColumnCount) { - throw new ArgumentException(Resources.ArgumentMatrixSquare); + throw new ArgumentException("Matrix must be square."); } var order = matrix.RowCount; @@ -109,19 +108,19 @@ namespace MathNet.Numerics.LinearAlgebra.Single.Factorization // The solution X should have the same number of columns as B if (input.ColumnCount != result.ColumnCount) { - throw new ArgumentException(Resources.ArgumentMatrixSameColumnDimension); + throw new ArgumentException("Matrix column dimensions must agree."); } // The dimension compatibility conditions for X = A\B require the two matrices A and B to have the same number of rows if (EigenValues.Count != input.RowCount) { - throw new ArgumentException(Resources.ArgumentMatrixSameRowDimension); + throw new ArgumentException("Matrix row dimensions must agree."); } // The solution X row dimension is equal to the column dimension of A if (EigenValues.Count != result.RowCount) { - throw new ArgumentException(Resources.ArgumentMatrixSameColumnDimension); + throw new ArgumentException("Matrix column dimensions must agree."); } if (IsSymmetric) @@ -161,7 +160,7 @@ namespace MathNet.Numerics.LinearAlgebra.Single.Factorization } else { - throw new ArgumentException(Resources.ArgumentMatrixSymmetric); + throw new ArgumentException("Matrix must be symmetric."); } } @@ -176,13 +175,13 @@ namespace MathNet.Numerics.LinearAlgebra.Single.Factorization // Check that b is a column vector with m entries if (EigenValues.Count != input.Count) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } // Check that x is a column vector with n entries if (EigenValues.Count != result.Count) { - throw new ArgumentException(Resources.ArgumentMatrixDimensions); + throw new ArgumentException("Matrix dimensions must agree."); } if (IsSymmetric) @@ -221,7 +220,7 @@ namespace MathNet.Numerics.LinearAlgebra.Single.Factorization } else { - throw new ArgumentException(Resources.ArgumentMatrixSymmetric); + throw new ArgumentException("Matrix must be symmetric."); } } } diff --git a/src/Numerics/LinearAlgebra/Single/Factorization/DenseGramSchmidt.cs b/src/Numerics/LinearAlgebra/Single/Factorization/DenseGramSchmidt.cs index b6fe7a7c..c206c6e3 100644 --- a/src/Numerics/LinearAlgebra/Single/Factorization/DenseGramSchmidt.cs +++ b/src/Numerics/LinearAlgebra/Single/Factorization/DenseGramSchmidt.cs @@ -29,7 +29,6 @@ using System; using MathNet.Numerics.LinearAlgebra.Factorization; -using MathNet.Numerics.Properties; using MathNet.Numerics.Providers.LinearAlgebra; namespace MathNet.Numerics.LinearAlgebra.Single.Factorization @@ -90,7 +89,7 @@ namespace MathNet.Numerics.LinearAlgebra.Single.Factorization norm = (float)Math.Sqrt(norm); if (norm == 0.0) { - throw new ArgumentException(Resources.ArgumentMatrixNotRankDeficient); + throw new ArgumentException("Matrix must not be rank deficient."); } r[(k * columnsQ) + k] = norm; @@ -130,19 +129,19 @@ namespace MathNet.Numerics.LinearAlgebra.Single.Factorization // The solution X should have the same number of columns as B if (input.ColumnCount != result.ColumnCount) { - throw new ArgumentException(Resources.ArgumentMatrixSameColumnDimension); + throw new ArgumentException("Matrix column dimensions must agree."); } // The dimension compatibility conditions for X = A\B require the two matrices A and B to have the same number of rows if (Q.RowCount != input.RowCount) { - throw new ArgumentException(Resources.ArgumentMatrixSameRowDimension); + throw new ArgumentException("Matrix row dimensions must agree."); } // The solution X row dimension is equal to the column dimension of A if (Q.ColumnCount != result.RowCount) { - throw new ArgumentException(Resources.ArgumentMatrixSameColumnDimension); + throw new ArgumentException("Matrix column dimensions must agree."); } if (input is DenseMatrix dinput && result is DenseMatrix dresult) @@ -166,7 +165,7 @@ namespace MathNet.Numerics.LinearAlgebra.Single.Factorization // Check that b is a column vector with m entries if (Q.RowCount != input.Count) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } // Check that x is a column vector with n entries diff --git a/src/Numerics/LinearAlgebra/Single/Factorization/DenseLU.cs b/src/Numerics/LinearAlgebra/Single/Factorization/DenseLU.cs index c3e24945..4826f1d4 100644 --- a/src/Numerics/LinearAlgebra/Single/Factorization/DenseLU.cs +++ b/src/Numerics/LinearAlgebra/Single/Factorization/DenseLU.cs @@ -28,7 +28,6 @@ // using System; -using MathNet.Numerics.Properties; using MathNet.Numerics.Providers.LinearAlgebra; namespace MathNet.Numerics.LinearAlgebra.Single.Factorization @@ -59,7 +58,7 @@ namespace MathNet.Numerics.LinearAlgebra.Single.Factorization if (matrix.RowCount != matrix.ColumnCount) { - throw new ArgumentException(Resources.ArgumentMatrixSquare); + throw new ArgumentException("Matrix must be square."); } // Create an array for the pivot indices. @@ -98,12 +97,12 @@ namespace MathNet.Numerics.LinearAlgebra.Single.Factorization // Check for proper dimensions. if (result.RowCount != input.RowCount) { - throw new ArgumentException(Resources.ArgumentMatrixSameRowDimension); + throw new ArgumentException("Matrix row dimensions must agree."); } if (result.ColumnCount != input.ColumnCount) { - throw new ArgumentException(Resources.ArgumentMatrixSameColumnDimension); + throw new ArgumentException("Matrix column dimensions must agree."); } if (input.RowCount != Factors.RowCount) @@ -147,7 +146,7 @@ namespace MathNet.Numerics.LinearAlgebra.Single.Factorization // Check for proper dimensions. if (input.Count != result.Count) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } if (input.Count != Factors.RowCount) diff --git a/src/Numerics/LinearAlgebra/Single/Factorization/DenseQR.cs b/src/Numerics/LinearAlgebra/Single/Factorization/DenseQR.cs index 8250e9b1..f99f2f27 100644 --- a/src/Numerics/LinearAlgebra/Single/Factorization/DenseQR.cs +++ b/src/Numerics/LinearAlgebra/Single/Factorization/DenseQR.cs @@ -29,7 +29,6 @@ using System; using MathNet.Numerics.LinearAlgebra.Factorization; -using MathNet.Numerics.Properties; using MathNet.Numerics.Providers.LinearAlgebra; namespace MathNet.Numerics.LinearAlgebra.Single.Factorization @@ -101,19 +100,19 @@ namespace MathNet.Numerics.LinearAlgebra.Single.Factorization // The solution X should have the same number of columns as B if (input.ColumnCount != result.ColumnCount) { - throw new ArgumentException(Resources.ArgumentMatrixSameColumnDimension); + throw new ArgumentException("Matrix column dimensions must agree."); } // The dimension compatibility conditions for X = A\B require the two matrices A and B to have the same number of rows if (Q.RowCount != input.RowCount) { - throw new ArgumentException(Resources.ArgumentMatrixSameRowDimension); + throw new ArgumentException("Matrix row dimensions must agree."); } // The solution X row dimension is equal to the column dimension of A if (FullR.ColumnCount != result.RowCount) { - throw new ArgumentException(Resources.ArgumentMatrixSameColumnDimension); + throw new ArgumentException("Matrix column dimensions must agree."); } if (input is DenseMatrix dinput && result is DenseMatrix dresult) @@ -137,7 +136,7 @@ namespace MathNet.Numerics.LinearAlgebra.Single.Factorization // Check that b is a column vector with m entries if (Q.RowCount != input.Count) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } // Check that x is a column vector with n entries diff --git a/src/Numerics/LinearAlgebra/Single/Factorization/DenseSvd.cs b/src/Numerics/LinearAlgebra/Single/Factorization/DenseSvd.cs index 24ca5177..05fa6d46 100644 --- a/src/Numerics/LinearAlgebra/Single/Factorization/DenseSvd.cs +++ b/src/Numerics/LinearAlgebra/Single/Factorization/DenseSvd.cs @@ -28,7 +28,6 @@ // using System; -using MathNet.Numerics.Properties; using MathNet.Numerics.Providers.LinearAlgebra; namespace MathNet.Numerics.LinearAlgebra.Single.Factorization @@ -83,25 +82,25 @@ namespace MathNet.Numerics.LinearAlgebra.Single.Factorization { if (!VectorsComputed) { - throw new InvalidOperationException(Resources.SingularVectorsNotComputed); + throw new InvalidOperationException("The singular vectors were not computed."); } // The solution X should have the same number of columns as B if (input.ColumnCount != result.ColumnCount) { - throw new ArgumentException(Resources.ArgumentMatrixSameColumnDimension); + throw new ArgumentException("Matrix column dimensions must agree."); } // The dimension compatibility conditions for X = A\B require the two matrices A and B to have the same number of rows if (U.RowCount != input.RowCount) { - throw new ArgumentException(Resources.ArgumentMatrixSameRowDimension); + throw new ArgumentException("Matrix row dimensions must agree."); } // The solution X row dimension is equal to the column dimension of A if (VT.ColumnCount != result.RowCount) { - throw new ArgumentException(Resources.ArgumentMatrixSameColumnDimension); + throw new ArgumentException("Matrix column dimensions must agree."); } if (input is DenseMatrix dinput && result is DenseMatrix dresult) @@ -123,14 +122,14 @@ namespace MathNet.Numerics.LinearAlgebra.Single.Factorization { if (!VectorsComputed) { - throw new InvalidOperationException(Resources.SingularVectorsNotComputed); + throw new InvalidOperationException("The singular vectors were not computed."); } // Ax=b where A is an m x n matrix // Check that b is a column vector with m entries if (U.RowCount != input.Count) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } // Check that x is a column vector with n entries diff --git a/src/Numerics/LinearAlgebra/Single/Factorization/GramSchmidt.cs b/src/Numerics/LinearAlgebra/Single/Factorization/GramSchmidt.cs index 9f83d1a9..8251d84a 100644 --- a/src/Numerics/LinearAlgebra/Single/Factorization/GramSchmidt.cs +++ b/src/Numerics/LinearAlgebra/Single/Factorization/GramSchmidt.cs @@ -29,7 +29,6 @@ using System; using MathNet.Numerics.LinearAlgebra.Factorization; -using MathNet.Numerics.Properties; namespace MathNet.Numerics.LinearAlgebra.Single.Factorization { @@ -56,7 +55,7 @@ namespace MathNet.Numerics.LinearAlgebra.Single.Factorization { if (FullR.RowCount != FullR.ColumnCount) { - throw new ArgumentException(Resources.ArgumentMatrixSquare); + throw new ArgumentException("Matrix must be square."); } var det = 1.0; diff --git a/src/Numerics/LinearAlgebra/Single/Factorization/QR.cs b/src/Numerics/LinearAlgebra/Single/Factorization/QR.cs index d587f1a1..e6ceed7a 100644 --- a/src/Numerics/LinearAlgebra/Single/Factorization/QR.cs +++ b/src/Numerics/LinearAlgebra/Single/Factorization/QR.cs @@ -29,7 +29,6 @@ using System; using MathNet.Numerics.LinearAlgebra.Factorization; -using MathNet.Numerics.Properties; namespace MathNet.Numerics.LinearAlgebra.Single.Factorization { @@ -61,7 +60,7 @@ namespace MathNet.Numerics.LinearAlgebra.Single.Factorization { if (FullR.RowCount != FullR.ColumnCount) { - throw new ArgumentException(Resources.ArgumentMatrixSquare); + throw new ArgumentException("Matrix must be square."); } var det = 1.0; diff --git a/src/Numerics/LinearAlgebra/Single/Factorization/Svd.cs b/src/Numerics/LinearAlgebra/Single/Factorization/Svd.cs index da14c79e..f11017d0 100644 --- a/src/Numerics/LinearAlgebra/Single/Factorization/Svd.cs +++ b/src/Numerics/LinearAlgebra/Single/Factorization/Svd.cs @@ -30,7 +30,6 @@ using System; using System.Linq; using MathNet.Numerics.LinearAlgebra.Factorization; -using MathNet.Numerics.Properties; namespace MathNet.Numerics.LinearAlgebra.Single.Factorization { @@ -96,7 +95,7 @@ namespace MathNet.Numerics.LinearAlgebra.Single.Factorization { if (U.RowCount != VT.ColumnCount) { - throw new ArgumentException(Resources.ArgumentMatrixSquare); + throw new ArgumentException("Matrix must be square."); } var det = 1.0; diff --git a/src/Numerics/LinearAlgebra/Single/Factorization/UserCholesky.cs b/src/Numerics/LinearAlgebra/Single/Factorization/UserCholesky.cs index c83219b9..1c934fe1 100644 --- a/src/Numerics/LinearAlgebra/Single/Factorization/UserCholesky.cs +++ b/src/Numerics/LinearAlgebra/Single/Factorization/UserCholesky.cs @@ -28,7 +28,6 @@ // using System; -using MathNet.Numerics.Properties; using MathNet.Numerics.Threading; namespace MathNet.Numerics.LinearAlgebra.Single.Factorization @@ -55,7 +54,7 @@ namespace MathNet.Numerics.LinearAlgebra.Single.Factorization { if (factor.RowCount != factor.ColumnCount) { - throw new ArgumentException(Resources.ArgumentMatrixSquare); + throw new ArgumentException("Matrix must be square."); } var tmpColumn = new float[factor.RowCount]; @@ -85,7 +84,7 @@ namespace MathNet.Numerics.LinearAlgebra.Single.Factorization } else { - throw new ArgumentException(Resources.ArgumentMatrixPositiveDefinite); + throw new ArgumentException("Matrix must be positive definite."); } for (var i = ij + 1; i < factor.RowCount; i++) @@ -179,12 +178,12 @@ namespace MathNet.Numerics.LinearAlgebra.Single.Factorization { if (result.RowCount != input.RowCount) { - throw new ArgumentException(Resources.ArgumentMatrixSameRowDimension); + throw new ArgumentException("Matrix row dimensions must agree."); } if (result.ColumnCount != input.ColumnCount) { - throw new ArgumentException(Resources.ArgumentMatrixSameColumnDimension); + throw new ArgumentException("Matrix column dimensions must agree."); } if (input.RowCount != Factor.RowCount) @@ -233,7 +232,7 @@ namespace MathNet.Numerics.LinearAlgebra.Single.Factorization { if (input.Count != result.Count) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } if (input.Count != Factor.RowCount) diff --git a/src/Numerics/LinearAlgebra/Single/Factorization/UserEvd.cs b/src/Numerics/LinearAlgebra/Single/Factorization/UserEvd.cs index b65235fa..6a803c2b 100644 --- a/src/Numerics/LinearAlgebra/Single/Factorization/UserEvd.cs +++ b/src/Numerics/LinearAlgebra/Single/Factorization/UserEvd.cs @@ -28,7 +28,6 @@ // using System; -using MathNet.Numerics.Properties; namespace MathNet.Numerics.LinearAlgebra.Single.Factorization { @@ -64,7 +63,7 @@ namespace MathNet.Numerics.LinearAlgebra.Single.Factorization { if (matrix.RowCount != matrix.ColumnCount) { - throw new ArgumentException(Resources.ArgumentMatrixSquare); + throw new ArgumentException("Matrix must be square."); } var order = matrix.RowCount; @@ -1094,19 +1093,19 @@ namespace MathNet.Numerics.LinearAlgebra.Single.Factorization // The solution X should have the same number of columns as B if (input.ColumnCount != result.ColumnCount) { - throw new ArgumentException(Resources.ArgumentMatrixSameColumnDimension); + throw new ArgumentException("Matrix column dimensions must agree."); } // The dimension compatibility conditions for X = A\B require the two matrices A and B to have the same number of rows if (EigenValues.Count != input.RowCount) { - throw new ArgumentException(Resources.ArgumentMatrixSameRowDimension); + throw new ArgumentException("Matrix row dimensions must agree."); } // The solution X row dimension is equal to the column dimension of A if (EigenValues.Count != result.RowCount) { - throw new ArgumentException(Resources.ArgumentMatrixSameColumnDimension); + throw new ArgumentException("Matrix column dimensions must agree."); } if (IsSymmetric) @@ -1146,7 +1145,7 @@ namespace MathNet.Numerics.LinearAlgebra.Single.Factorization } else { - throw new ArgumentException(Resources.ArgumentMatrixSymmetric); + throw new ArgumentException("Matrix must be symmetric."); } } @@ -1161,13 +1160,13 @@ namespace MathNet.Numerics.LinearAlgebra.Single.Factorization // Check that b is a column vector with m entries if (EigenValues.Count != input.Count) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } // Check that x is a column vector with n entries if (EigenValues.Count != result.Count) { - throw new ArgumentException(Resources.ArgumentMatrixDimensions); + throw new ArgumentException("Matrix dimensions must agree."); } if (IsSymmetric) @@ -1206,7 +1205,7 @@ namespace MathNet.Numerics.LinearAlgebra.Single.Factorization } else { - throw new ArgumentException(Resources.ArgumentMatrixSymmetric); + throw new ArgumentException("Matrix must be symmetric."); } } } diff --git a/src/Numerics/LinearAlgebra/Single/Factorization/UserGramSchmidt.cs b/src/Numerics/LinearAlgebra/Single/Factorization/UserGramSchmidt.cs index e9ec4d1a..ac701540 100644 --- a/src/Numerics/LinearAlgebra/Single/Factorization/UserGramSchmidt.cs +++ b/src/Numerics/LinearAlgebra/Single/Factorization/UserGramSchmidt.cs @@ -28,7 +28,6 @@ // using System; -using MathNet.Numerics.Properties; namespace MathNet.Numerics.LinearAlgebra.Single.Factorization { @@ -64,7 +63,7 @@ namespace MathNet.Numerics.LinearAlgebra.Single.Factorization var norm = (float) q.Column(k).L2Norm(); if (norm == 0f) { - throw new ArgumentException(Resources.ArgumentMatrixNotRankDeficient); + throw new ArgumentException("Matrix must not be rank deficient."); } r.At(k, k, norm); @@ -103,19 +102,19 @@ namespace MathNet.Numerics.LinearAlgebra.Single.Factorization // The solution X should have the same number of columns as B if (input.ColumnCount != result.ColumnCount) { - throw new ArgumentException(Resources.ArgumentMatrixSameColumnDimension); + throw new ArgumentException("Matrix column dimensions must agree."); } // The dimension compatibility conditions for X = A\B require the two matrices A and B to have the same number of rows if (Q.RowCount != input.RowCount) { - throw new ArgumentException(Resources.ArgumentMatrixSameRowDimension); + throw new ArgumentException("Matrix row dimensions must agree."); } // The solution X row dimension is equal to the column dimension of A if (Q.ColumnCount != result.RowCount) { - throw new ArgumentException(Resources.ArgumentMatrixSameColumnDimension); + throw new ArgumentException("Matrix column dimensions must agree."); } var inputCopy = input.Clone(); @@ -178,7 +177,7 @@ namespace MathNet.Numerics.LinearAlgebra.Single.Factorization // Check that b is a column vector with m entries if (Q.RowCount != input.Count) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } // Check that x is a column vector with n entries diff --git a/src/Numerics/LinearAlgebra/Single/Factorization/UserLU.cs b/src/Numerics/LinearAlgebra/Single/Factorization/UserLU.cs index 3dae03e6..5872dfad 100644 --- a/src/Numerics/LinearAlgebra/Single/Factorization/UserLU.cs +++ b/src/Numerics/LinearAlgebra/Single/Factorization/UserLU.cs @@ -28,7 +28,6 @@ // using System; -using MathNet.Numerics.Properties; namespace MathNet.Numerics.LinearAlgebra.Single.Factorization { @@ -58,7 +57,7 @@ namespace MathNet.Numerics.LinearAlgebra.Single.Factorization if (matrix.RowCount != matrix.ColumnCount) { - throw new ArgumentException(Resources.ArgumentMatrixSquare); + throw new ArgumentException("Matrix must be square."); } // Create an array for the pivot indices. @@ -156,12 +155,12 @@ namespace MathNet.Numerics.LinearAlgebra.Single.Factorization // Check for proper dimensions. if (result.RowCount != input.RowCount) { - throw new ArgumentException(Resources.ArgumentMatrixSameRowDimension); + throw new ArgumentException("Matrix row dimensions must agree."); } if (result.ColumnCount != input.ColumnCount) { - throw new ArgumentException(Resources.ArgumentMatrixSameColumnDimension); + throw new ArgumentException("Matrix column dimensions must agree."); } if (input.RowCount != Factors.RowCount) @@ -242,7 +241,7 @@ namespace MathNet.Numerics.LinearAlgebra.Single.Factorization // Check for proper dimensions. if (input.Count != result.Count) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } if (input.Count != Factors.RowCount) diff --git a/src/Numerics/LinearAlgebra/Single/Factorization/UserQR.cs b/src/Numerics/LinearAlgebra/Single/Factorization/UserQR.cs index faa7e06d..95850126 100644 --- a/src/Numerics/LinearAlgebra/Single/Factorization/UserQR.cs +++ b/src/Numerics/LinearAlgebra/Single/Factorization/UserQR.cs @@ -30,7 +30,6 @@ using System; using System.Linq; using MathNet.Numerics.LinearAlgebra.Factorization; -using MathNet.Numerics.Properties; using MathNet.Numerics.Threading; namespace MathNet.Numerics.LinearAlgebra.Single.Factorization @@ -227,19 +226,19 @@ namespace MathNet.Numerics.LinearAlgebra.Single.Factorization // The solution X should have the same number of columns as B if (input.ColumnCount != result.ColumnCount) { - throw new ArgumentException(Resources.ArgumentMatrixSameColumnDimension); + throw new ArgumentException("Matrix column dimensions must agree."); } // The dimension compatibility conditions for X = A\B require the two matrices A and B to have the same number of rows if (FullR.RowCount != input.RowCount) { - throw new ArgumentException(Resources.ArgumentMatrixSameRowDimension); + throw new ArgumentException("Matrix row dimensions must agree."); } // The solution X row dimension is equal to the column dimension of A if (FullR.ColumnCount != result.RowCount) { - throw new ArgumentException(Resources.ArgumentMatrixSameColumnDimension); + throw new ArgumentException("Matrix column dimensions must agree."); } var inputCopy = input.Clone(); @@ -302,7 +301,7 @@ namespace MathNet.Numerics.LinearAlgebra.Single.Factorization // Check that b is a column vector with m entries if (FullR.RowCount != input.Count) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } // Check that x is a column vector with n entries diff --git a/src/Numerics/LinearAlgebra/Single/Factorization/UserSvd.cs b/src/Numerics/LinearAlgebra/Single/Factorization/UserSvd.cs index b618a083..6a4c30da 100644 --- a/src/Numerics/LinearAlgebra/Single/Factorization/UserSvd.cs +++ b/src/Numerics/LinearAlgebra/Single/Factorization/UserSvd.cs @@ -28,7 +28,6 @@ // using System; -using MathNet.Numerics.Properties; namespace MathNet.Numerics.LinearAlgebra.Single.Factorization { @@ -787,25 +786,25 @@ namespace MathNet.Numerics.LinearAlgebra.Single.Factorization { if (!VectorsComputed) { - throw new InvalidOperationException(Resources.SingularVectorsNotComputed); + throw new InvalidOperationException("The singular vectors were not computed."); } // The solution X should have the same number of columns as B if (input.ColumnCount != result.ColumnCount) { - throw new ArgumentException(Resources.ArgumentMatrixSameColumnDimension); + throw new ArgumentException("Matrix column dimensions must agree."); } // The dimension compatibility conditions for X = A\B require the two matrices A and B to have the same number of rows if (U.RowCount != input.RowCount) { - throw new ArgumentException(Resources.ArgumentMatrixSameRowDimension); + throw new ArgumentException("Matrix row dimensions must agree."); } // The solution X row dimension is equal to the column dimension of A if (VT.ColumnCount != result.RowCount) { - throw new ArgumentException(Resources.ArgumentMatrixSameColumnDimension); + throw new ArgumentException("Matrix column dimensions must agree."); } var mn = Math.Min(U.RowCount, VT.ColumnCount); @@ -853,14 +852,14 @@ namespace MathNet.Numerics.LinearAlgebra.Single.Factorization { if (!VectorsComputed) { - throw new InvalidOperationException(Resources.SingularVectorsNotComputed); + throw new InvalidOperationException("The singular vectors were not computed."); } // Ax=b where A is an m x n matrix // Check that b is a column vector with m entries if (U.RowCount != input.Count) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } // Check that x is a column vector with n entries diff --git a/src/Numerics/LinearAlgebra/Single/Matrix.cs b/src/Numerics/LinearAlgebra/Single/Matrix.cs index 4538ba9b..48987587 100644 --- a/src/Numerics/LinearAlgebra/Single/Matrix.cs +++ b/src/Numerics/LinearAlgebra/Single/Matrix.cs @@ -31,7 +31,6 @@ using System; using MathNet.Numerics.LinearAlgebra.Factorization; using MathNet.Numerics.LinearAlgebra.Single.Factorization; using MathNet.Numerics.LinearAlgebra.Storage; -using MathNet.Numerics.Properties; namespace MathNet.Numerics.LinearAlgebra.Single { @@ -522,7 +521,7 @@ namespace MathNet.Numerics.LinearAlgebra.Single { if (RowCount != ColumnCount) { - throw new ArgumentException(Resources.ArgumentMatrixSquare); + throw new ArgumentException("Matrix must be square."); } var sum = 0.0f; @@ -632,7 +631,7 @@ namespace MathNet.Numerics.LinearAlgebra.Single { if (norm <= 0.0) { - throw new ArgumentOutOfRangeException(nameof(norm), Resources.ArgumentMustBePositive); + throw new ArgumentOutOfRangeException(nameof(norm), "Value must be positive."); } var ret = new double[RowCount]; @@ -664,7 +663,7 @@ namespace MathNet.Numerics.LinearAlgebra.Single { if (norm <= 0.0) { - throw new ArgumentOutOfRangeException(nameof(norm), Resources.ArgumentMustBePositive); + throw new ArgumentOutOfRangeException(nameof(norm), "Value must be positive."); } var ret = new double[ColumnCount]; diff --git a/src/Numerics/LinearAlgebra/Single/Solvers/BiCgStab.cs b/src/Numerics/LinearAlgebra/Single/Solvers/BiCgStab.cs index a7591be3..ce018354 100644 --- a/src/Numerics/LinearAlgebra/Single/Solvers/BiCgStab.cs +++ b/src/Numerics/LinearAlgebra/Single/Solvers/BiCgStab.cs @@ -29,7 +29,6 @@ using System; using MathNet.Numerics.LinearAlgebra.Solvers; -using MathNet.Numerics.Properties; namespace MathNet.Numerics.LinearAlgebra.Single.Solvers { @@ -96,12 +95,12 @@ namespace MathNet.Numerics.LinearAlgebra.Single.Solvers { if (matrix.RowCount != matrix.ColumnCount) { - throw new ArgumentException(Resources.ArgumentMatrixSquare, nameof(matrix)); + throw new ArgumentException("Matrix must be square.", nameof(matrix)); } if (result.Count != input.Count) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } if (input.Count != matrix.RowCount) diff --git a/src/Numerics/LinearAlgebra/Single/Solvers/CompositeSolver.cs b/src/Numerics/LinearAlgebra/Single/Solvers/CompositeSolver.cs index 322786c6..adb1fe25 100644 --- a/src/Numerics/LinearAlgebra/Single/Solvers/CompositeSolver.cs +++ b/src/Numerics/LinearAlgebra/Single/Solvers/CompositeSolver.cs @@ -31,7 +31,6 @@ using System; using System.Collections.Generic; using System.Linq; using MathNet.Numerics.LinearAlgebra.Solvers; -using MathNet.Numerics.Properties; namespace MathNet.Numerics.LinearAlgebra.Single.Solvers { @@ -44,7 +43,7 @@ namespace MathNet.Numerics.LinearAlgebra.Single.Solvers /// Solver based on:
/// Faster PDE-based simulations using robust composite linear solvers
/// S. Bhowmicka, P. Raghavan a,*, L. McInnes b, B. Norris
- /// Future Generation Computer Systems, Vol 20, 2004, pp 373–387
+ /// Future Generation Computer Systems, Vol 20, 2004, pp 373�387
///
/// /// Note that if an iterator is passed to this solver it will be used for all the sub-solvers. @@ -75,12 +74,12 @@ namespace MathNet.Numerics.LinearAlgebra.Single.Solvers { if (matrix.RowCount != matrix.ColumnCount) { - throw new ArgumentException(Resources.ArgumentMatrixSquare, nameof(matrix)); + throw new ArgumentException("Matrix must be square.", nameof(matrix)); } if (result.Count != input.Count) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } if (iterator == null) diff --git a/src/Numerics/LinearAlgebra/Single/Solvers/DiagonalPreconditioner.cs b/src/Numerics/LinearAlgebra/Single/Solvers/DiagonalPreconditioner.cs index 5087ca03..59948509 100644 --- a/src/Numerics/LinearAlgebra/Single/Solvers/DiagonalPreconditioner.cs +++ b/src/Numerics/LinearAlgebra/Single/Solvers/DiagonalPreconditioner.cs @@ -29,7 +29,6 @@ using System; using MathNet.Numerics.LinearAlgebra.Solvers; -using MathNet.Numerics.Properties; namespace MathNet.Numerics.LinearAlgebra.Single.Solvers { @@ -70,7 +69,7 @@ namespace MathNet.Numerics.LinearAlgebra.Single.Solvers { if (matrix.RowCount != matrix.ColumnCount) { - throw new ArgumentException(Resources.ArgumentMatrixSquare, nameof(matrix)); + throw new ArgumentException("Matrix must be square.", nameof(matrix)); } _inverseDiagonals = new float[matrix.RowCount]; @@ -89,12 +88,12 @@ namespace MathNet.Numerics.LinearAlgebra.Single.Solvers { if (_inverseDiagonals == null) { - throw new ArgumentException(Resources.ArgumentMatrixDoesNotExist); + throw new ArgumentException("The requested matrix does not exist."); } if ((lhs.Count != rhs.Count) || (lhs.Count != _inverseDiagonals.Length)) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength, nameof(rhs)); + throw new ArgumentException("All vectors must have the same dimensionality.", nameof(rhs)); } for (var i = 0; i < _inverseDiagonals.Length; i++) diff --git a/src/Numerics/LinearAlgebra/Single/Solvers/GpBiCg.cs b/src/Numerics/LinearAlgebra/Single/Solvers/GpBiCg.cs index 20864c30..1fb7af1e 100644 --- a/src/Numerics/LinearAlgebra/Single/Solvers/GpBiCg.cs +++ b/src/Numerics/LinearAlgebra/Single/Solvers/GpBiCg.cs @@ -29,7 +29,6 @@ using System; using MathNet.Numerics.LinearAlgebra.Solvers; -using MathNet.Numerics.Properties; namespace MathNet.Numerics.LinearAlgebra.Single.Solvers { @@ -159,12 +158,12 @@ namespace MathNet.Numerics.LinearAlgebra.Single.Solvers { if (matrix.RowCount != matrix.ColumnCount) { - throw new ArgumentException(Resources.ArgumentMatrixSquare, nameof(matrix)); + throw new ArgumentException("Matrix must be square.", nameof(matrix)); } if (result.Count != input.Count) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } if (input.Count != matrix.RowCount) diff --git a/src/Numerics/LinearAlgebra/Single/Solvers/ILU0Preconditioner.cs b/src/Numerics/LinearAlgebra/Single/Solvers/ILU0Preconditioner.cs index 992cc4c1..200b1fba 100644 --- a/src/Numerics/LinearAlgebra/Single/Solvers/ILU0Preconditioner.cs +++ b/src/Numerics/LinearAlgebra/Single/Solvers/ILU0Preconditioner.cs @@ -29,7 +29,6 @@ using System; using MathNet.Numerics.LinearAlgebra.Solvers; -using MathNet.Numerics.Properties; namespace MathNet.Numerics.LinearAlgebra.Single.Solvers { @@ -108,7 +107,7 @@ namespace MathNet.Numerics.LinearAlgebra.Single.Solvers if (matrix.RowCount != matrix.ColumnCount) { - throw new ArgumentException(Resources.ArgumentMatrixSquare, nameof(matrix)); + throw new ArgumentException("Matrix must be square.", nameof(matrix)); } _decompositionLU = SparseMatrix.OfMatrix(matrix); @@ -165,12 +164,12 @@ namespace MathNet.Numerics.LinearAlgebra.Single.Solvers { if (_decompositionLU == null) { - throw new ArgumentException(Resources.ArgumentMatrixDoesNotExist); + throw new ArgumentException("The requested matrix does not exist."); } if ((lhs.Count != rhs.Count) || (lhs.Count != _decompositionLU.RowCount)) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } // Solve: diff --git a/src/Numerics/LinearAlgebra/Single/Solvers/ILUTPPreconditioner.cs b/src/Numerics/LinearAlgebra/Single/Solvers/ILUTPPreconditioner.cs index fc4b403e..60a45c4f 100644 --- a/src/Numerics/LinearAlgebra/Single/Solvers/ILUTPPreconditioner.cs +++ b/src/Numerics/LinearAlgebra/Single/Solvers/ILUTPPreconditioner.cs @@ -30,7 +30,6 @@ using System; using System.Collections.Generic; using MathNet.Numerics.LinearAlgebra.Solvers; -using MathNet.Numerics.Properties; namespace MathNet.Numerics.LinearAlgebra.Single.Solvers { @@ -298,7 +297,7 @@ namespace MathNet.Numerics.LinearAlgebra.Single.Solvers if (matrix.RowCount != matrix.ColumnCount) { - throw new ArgumentException(Resources.ArgumentMatrixSquare, nameof(matrix)); + throw new ArgumentException("Matrix must be square.", nameof(matrix)); } SparseMatrix sparseMatrix = matrix as SparseMatrix ?? SparseMatrix.OfMatrix(matrix); @@ -616,12 +615,12 @@ namespace MathNet.Numerics.LinearAlgebra.Single.Solvers { if (_upper == null) { - throw new ArgumentException(Resources.ArgumentMatrixDoesNotExist); + throw new ArgumentException("The requested matrix does not exist."); } if ((lhs.Count != rhs.Count) || (lhs.Count != _upper.RowCount)) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength, nameof(rhs)); + throw new ArgumentException("All vectors must have the same dimensionality.", nameof(rhs)); } // Solve equation here diff --git a/src/Numerics/LinearAlgebra/Single/Solvers/MILU0Preconditioner.cs b/src/Numerics/LinearAlgebra/Single/Solvers/MILU0Preconditioner.cs index 768494e1..253e1dd2 100644 --- a/src/Numerics/LinearAlgebra/Single/Solvers/MILU0Preconditioner.cs +++ b/src/Numerics/LinearAlgebra/Single/Solvers/MILU0Preconditioner.cs @@ -30,7 +30,6 @@ using System; using MathNet.Numerics.LinearAlgebra.Solvers; using MathNet.Numerics.LinearAlgebra.Storage; -using MathNet.Numerics.Properties; namespace MathNet.Numerics.LinearAlgebra.Single.Solvers { @@ -84,14 +83,14 @@ namespace MathNet.Numerics.LinearAlgebra.Single.Solvers var csr = matrix.Storage as SparseCompressedRowMatrixStorage; if (csr == null) { - throw new ArgumentException(Resources.MatrixMustBeSparse, nameof(matrix)); + throw new ArgumentException("Matrix must be in sparse storage format", nameof(matrix)); } // Dimension of matrix int n = csr.RowCount; if (n != csr.ColumnCount) { - throw new ArgumentException(Resources.ArgumentMatrixSquare, nameof(matrix)); + throw new ArgumentException("Matrix must be square.", nameof(matrix)); } // Original matrix compressed sparse row storage. @@ -121,12 +120,12 @@ namespace MathNet.Numerics.LinearAlgebra.Single.Solvers { if (_alu == null) { - throw new ArgumentException(Resources.ArgumentMatrixDoesNotExist); + throw new ArgumentException("The requested matrix does not exist."); } if ((result.Count != input.Count) || (result.Count != _diag.Length)) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } int n = _diag.Length; diff --git a/src/Numerics/LinearAlgebra/Single/Solvers/MlkBiCgStab.cs b/src/Numerics/LinearAlgebra/Single/Solvers/MlkBiCgStab.cs index 2c89b1bc..0e74992a 100644 --- a/src/Numerics/LinearAlgebra/Single/Solvers/MlkBiCgStab.cs +++ b/src/Numerics/LinearAlgebra/Single/Solvers/MlkBiCgStab.cs @@ -32,7 +32,6 @@ using System.Collections.Generic; using System.Diagnostics; using MathNet.Numerics.Distributions; using MathNet.Numerics.LinearAlgebra.Solvers; -using MathNet.Numerics.Properties; namespace MathNet.Numerics.LinearAlgebra.Single.Solvers { @@ -242,12 +241,12 @@ namespace MathNet.Numerics.LinearAlgebra.Single.Solvers { if (matrix.RowCount != matrix.ColumnCount) { - throw new ArgumentException(Resources.ArgumentMatrixSquare, nameof(matrix)); + throw new ArgumentException("Matrix must be square.", nameof(matrix)); } if (result.Count != input.Count) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } if (input.Count != matrix.RowCount) diff --git a/src/Numerics/LinearAlgebra/Single/Solvers/TFQMR.cs b/src/Numerics/LinearAlgebra/Single/Solvers/TFQMR.cs index c44a73f1..b0852468 100644 --- a/src/Numerics/LinearAlgebra/Single/Solvers/TFQMR.cs +++ b/src/Numerics/LinearAlgebra/Single/Solvers/TFQMR.cs @@ -29,7 +29,6 @@ using System; using MathNet.Numerics.LinearAlgebra.Solvers; -using MathNet.Numerics.Properties; namespace MathNet.Numerics.LinearAlgebra.Single.Solvers { @@ -92,12 +91,12 @@ namespace MathNet.Numerics.LinearAlgebra.Single.Solvers { if (matrix.RowCount != matrix.ColumnCount) { - throw new ArgumentException(Resources.ArgumentMatrixSquare, nameof(matrix)); + throw new ArgumentException("Matrix must be square.", nameof(matrix)); } if (result.Count != input.Count) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } if (input.Count != matrix.RowCount) diff --git a/src/Numerics/LinearAlgebra/Solvers/FailureStopCriterion.cs b/src/Numerics/LinearAlgebra/Solvers/FailureStopCriterion.cs index ef626fcc..b01bf1e0 100644 --- a/src/Numerics/LinearAlgebra/Solvers/FailureStopCriterion.cs +++ b/src/Numerics/LinearAlgebra/Solvers/FailureStopCriterion.cs @@ -29,7 +29,6 @@ using System; using System.Diagnostics; -using MathNet.Numerics.Properties; namespace MathNet.Numerics.LinearAlgebra.Solvers { @@ -70,7 +69,7 @@ namespace MathNet.Numerics.LinearAlgebra.Solvers if (solutionVector.Count != residualVector.Count) { - throw new ArgumentException(Resources.ArgumentArraysSameLength); + throw new ArgumentException("The array arguments must have the same length."); } if (_lastIteration >= iterationNumber) diff --git a/src/Numerics/LinearAlgebra/Solvers/Iterator.cs b/src/Numerics/LinearAlgebra/Solvers/Iterator.cs index 6f4c4c7c..0294a0fd 100644 --- a/src/Numerics/LinearAlgebra/Solvers/Iterator.cs +++ b/src/Numerics/LinearAlgebra/Solvers/Iterator.cs @@ -30,7 +30,6 @@ using System; using System.Collections.Generic; using System.Linq; -using MathNet.Numerics.Properties; namespace MathNet.Numerics.LinearAlgebra.Solvers { @@ -104,7 +103,7 @@ namespace MathNet.Numerics.LinearAlgebra.Solvers { if (_stopCriteria.Count == 0) { - throw new ArgumentException(Resources.StopCriterionMissing); + throw new ArgumentException("There is no stop criterion in the collection."); } if (iterationNumber < 0) diff --git a/src/Numerics/LinearAlgebra/Solvers/ResidualStopCriterion.cs b/src/Numerics/LinearAlgebra/Solvers/ResidualStopCriterion.cs index 9abf0f68..f0aaf37a 100644 --- a/src/Numerics/LinearAlgebra/Solvers/ResidualStopCriterion.cs +++ b/src/Numerics/LinearAlgebra/Solvers/ResidualStopCriterion.cs @@ -29,7 +29,6 @@ using System; using System.Diagnostics; -using MathNet.Numerics.Properties; namespace MathNet.Numerics.LinearAlgebra.Solvers { @@ -157,12 +156,12 @@ namespace MathNet.Numerics.LinearAlgebra.Solvers if (solutionVector.Count != sourceVector.Count) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength, nameof(sourceVector)); + throw new ArgumentException("All vectors must have the same dimensionality.", nameof(sourceVector)); } if (solutionVector.Count != residualVector.Count) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength, nameof(residualVector)); + throw new ArgumentException("All vectors must have the same dimensionality.", nameof(residualVector)); } diff --git a/src/Numerics/LinearAlgebra/Solvers/UnitPreconditioner.cs b/src/Numerics/LinearAlgebra/Solvers/UnitPreconditioner.cs index e21847a1..58fb9677 100644 --- a/src/Numerics/LinearAlgebra/Solvers/UnitPreconditioner.cs +++ b/src/Numerics/LinearAlgebra/Solvers/UnitPreconditioner.cs @@ -28,7 +28,6 @@ // using System; -using MathNet.Numerics.Properties; namespace MathNet.Numerics.LinearAlgebra.Solvers { @@ -56,7 +55,7 @@ namespace MathNet.Numerics.LinearAlgebra.Solvers { if (matrix.RowCount != matrix.ColumnCount) { - throw new ArgumentException(Resources.ArgumentMatrixSquare, nameof(matrix)); + throw new ArgumentException("Matrix must be square.", nameof(matrix)); } _size = matrix.RowCount; @@ -82,7 +81,7 @@ namespace MathNet.Numerics.LinearAlgebra.Solvers { if ((lhs.Count != rhs.Count) || (lhs.Count != _size)) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } rhs.CopyTo(lhs); diff --git a/src/Numerics/LinearAlgebra/Storage/DenseColumnMajorMatrixStorage.cs b/src/Numerics/LinearAlgebra/Storage/DenseColumnMajorMatrixStorage.cs index 1fe7108c..026d757a 100644 --- a/src/Numerics/LinearAlgebra/Storage/DenseColumnMajorMatrixStorage.cs +++ b/src/Numerics/LinearAlgebra/Storage/DenseColumnMajorMatrixStorage.cs @@ -31,7 +31,6 @@ using System; using System.Collections.Generic; using System.Linq; using System.Runtime.Serialization; -using MathNet.Numerics.Properties; using MathNet.Numerics.Threading; namespace MathNet.Numerics.LinearAlgebra.Storage @@ -62,7 +61,7 @@ namespace MathNet.Numerics.LinearAlgebra.Storage if (data.Length != rows*columns) { - throw new ArgumentOutOfRangeException(nameof(data), string.Format(Resources.ArgumentArrayWrongLength, rows*columns)); + throw new ArgumentOutOfRangeException(nameof(data), $"The given array has the wrong length. Should be {rows * columns}."); } Data = data; @@ -226,7 +225,7 @@ namespace MathNet.Numerics.LinearAlgebra.Storage { if (data.Length <= 0) { - throw new ArgumentOutOfRangeException(nameof(data), Resources.MatrixCanNotBeEmpty); + throw new ArgumentOutOfRangeException(nameof(data), "Matrices can not be empty and must have at least one row and column."); } int columns = data.Length; @@ -243,7 +242,7 @@ namespace MathNet.Numerics.LinearAlgebra.Storage { if (data.Length <= 0) { - throw new ArgumentOutOfRangeException(nameof(data), Resources.MatrixCanNotBeEmpty); + throw new ArgumentOutOfRangeException(nameof(data), "Matrices can not be empty and must have at least one row and column."); } int rows = data.Length; @@ -285,7 +284,7 @@ namespace MathNet.Numerics.LinearAlgebra.Storage { if (data.Length <= 0) { - throw new ArgumentOutOfRangeException(nameof(data), Resources.MatrixCanNotBeEmpty); + throw new ArgumentOutOfRangeException(nameof(data), "Matrices can not be empty and must have at least one row and column."); } int columns = data.Length; @@ -315,7 +314,7 @@ namespace MathNet.Numerics.LinearAlgebra.Storage { if (data.Length <= 0) { - throw new ArgumentOutOfRangeException(nameof(data), Resources.MatrixCanNotBeEmpty); + throw new ArgumentOutOfRangeException(nameof(data), "Matrices can not be empty and must have at least one row and column."); } int rows = data.Length; @@ -364,7 +363,7 @@ namespace MathNet.Numerics.LinearAlgebra.Storage { for (int column = 0; column < columns; column++) { - if (!columnIterator.MoveNext()) throw new ArgumentOutOfRangeException(nameof(data), string.Format(Resources.ArgumentArrayWrongLength, columns)); + if (!columnIterator.MoveNext()) throw new ArgumentOutOfRangeException(nameof(data), $"The given array has the wrong length. Should be {columns}."); if (columnIterator.Current is T[] arrayColumn) { Array.Copy(arrayColumn, 0, array, column*rows, rows); @@ -376,14 +375,14 @@ namespace MathNet.Numerics.LinearAlgebra.Storage var end = (column + 1)*rows; for (int index = column*rows; index < end; index++) { - if (!rowIterator.MoveNext()) throw new ArgumentOutOfRangeException(nameof(data), string.Format(Resources.ArgumentArrayWrongLength, rows)); + if (!rowIterator.MoveNext()) throw new ArgumentOutOfRangeException(nameof(data), $"The given array has the wrong length. Should be {rows}."); array[index] = rowIterator.Current; } - if (rowIterator.MoveNext()) throw new ArgumentOutOfRangeException(nameof(data), string.Format(Resources.ArgumentArrayWrongLength, rows)); + if (rowIterator.MoveNext()) throw new ArgumentOutOfRangeException(nameof(data), $"The given array has the wrong length. Should be {rows}."); } } } - if (columnIterator.MoveNext()) throw new ArgumentOutOfRangeException(nameof(data), string.Format(Resources.ArgumentArrayWrongLength, columns)); + if (columnIterator.MoveNext()) throw new ArgumentOutOfRangeException(nameof(data), $"The given array has the wrong length. Should be {columns}."); } return new DenseColumnMajorMatrixStorage(rows, columns, array); } @@ -395,18 +394,18 @@ namespace MathNet.Numerics.LinearAlgebra.Storage { for (int row = 0; row < rows; row++) { - if (!rowIterator.MoveNext()) throw new ArgumentOutOfRangeException(nameof(data), string.Format(Resources.ArgumentArrayWrongLength, rows)); + if (!rowIterator.MoveNext()) throw new ArgumentOutOfRangeException(nameof(data), $"The given array has the wrong length. Should be {rows}."); using (var columnIterator = rowIterator.Current.GetEnumerator()) { for (int index = row; index < array.Length; index += rows) { - if (!columnIterator.MoveNext()) throw new ArgumentOutOfRangeException(nameof(data), string.Format(Resources.ArgumentArrayWrongLength, columns)); + if (!columnIterator.MoveNext()) throw new ArgumentOutOfRangeException(nameof(data), $"The given array has the wrong length. Should be {columns}."); array[index] = columnIterator.Current; } - if (columnIterator.MoveNext()) throw new ArgumentOutOfRangeException(nameof(data), string.Format(Resources.ArgumentArrayWrongLength, columns)); + if (columnIterator.MoveNext()) throw new ArgumentOutOfRangeException(nameof(data), $"The given array has the wrong length. Should be {columns}."); } } - if (rowIterator.MoveNext()) throw new ArgumentOutOfRangeException(nameof(data), string.Format(Resources.ArgumentArrayWrongLength, rows)); + if (rowIterator.MoveNext()) throw new ArgumentOutOfRangeException(nameof(data), $"The given array has the wrong length. Should be {rows}."); } return new DenseColumnMajorMatrixStorage(rows, columns, array); } diff --git a/src/Numerics/LinearAlgebra/Storage/DenseVectorStorage.cs b/src/Numerics/LinearAlgebra/Storage/DenseVectorStorage.cs index eb4156ca..6fe53ce8 100644 --- a/src/Numerics/LinearAlgebra/Storage/DenseVectorStorage.cs +++ b/src/Numerics/LinearAlgebra/Storage/DenseVectorStorage.cs @@ -31,7 +31,6 @@ using System; using System.Collections.Generic; using System.Linq; using System.Runtime.Serialization; -using MathNet.Numerics.Properties; using MathNet.Numerics.Threading; namespace MathNet.Numerics.LinearAlgebra.Storage @@ -62,7 +61,7 @@ namespace MathNet.Numerics.LinearAlgebra.Storage if (data.Length != length) { - throw new ArgumentOutOfRangeException(nameof(data), string.Format(Resources.ArgumentArrayWrongLength, length)); + throw new ArgumentOutOfRangeException(nameof(data), $"The given array has the wrong length. Should be {length}."); } Data = data; @@ -114,7 +113,7 @@ namespace MathNet.Numerics.LinearAlgebra.Storage { if (length < 0) { - throw new ArgumentOutOfRangeException(nameof(length), Resources.ArgumentNotNegative); + throw new ArgumentOutOfRangeException(nameof(length), "Value must not be negative (zero is ok)."); } var data = new T[length]; @@ -132,7 +131,7 @@ namespace MathNet.Numerics.LinearAlgebra.Storage { if (length < 0) { - throw new ArgumentOutOfRangeException(nameof(length), Resources.ArgumentNotNegative); + throw new ArgumentOutOfRangeException(nameof(length), "Value must not be negative (zero is ok)."); } var data = new T[length]; diff --git a/src/Numerics/LinearAlgebra/Storage/DiagonalMatrixStorage.cs b/src/Numerics/LinearAlgebra/Storage/DiagonalMatrixStorage.cs index b4e75806..c907f23b 100644 --- a/src/Numerics/LinearAlgebra/Storage/DiagonalMatrixStorage.cs +++ b/src/Numerics/LinearAlgebra/Storage/DiagonalMatrixStorage.cs @@ -31,7 +31,6 @@ using System; using System.Collections.Generic; using System.Linq; using System.Runtime.Serialization; -using MathNet.Numerics.Properties; using MathNet.Numerics.Threading; namespace MathNet.Numerics.LinearAlgebra.Storage @@ -62,7 +61,7 @@ namespace MathNet.Numerics.LinearAlgebra.Storage if (data.Length != Math.Min(rows, columns)) { - throw new ArgumentOutOfRangeException(nameof(data), string.Format(Resources.ArgumentArrayWrongLength, Math.Min(rows, columns))); + throw new ArgumentOutOfRangeException(nameof(data), $"The given array has the wrong length. Should be {Math.Min(rows, columns)}."); } Data = data; diff --git a/src/Numerics/LinearAlgebra/Storage/MatrixStorage.Validation.cs b/src/Numerics/LinearAlgebra/Storage/MatrixStorage.Validation.cs index 6cbe4939..4f02e126 100644 --- a/src/Numerics/LinearAlgebra/Storage/MatrixStorage.Validation.cs +++ b/src/Numerics/LinearAlgebra/Storage/MatrixStorage.Validation.cs @@ -28,7 +28,6 @@ // using System; -using MathNet.Numerics.Properties; namespace MathNet.Numerics.LinearAlgebra.Storage { @@ -56,12 +55,12 @@ namespace MathNet.Numerics.LinearAlgebra.Storage { if (rowCount < 1) { - throw new ArgumentOutOfRangeException(nameof(rowCount), Resources.ArgumentMustBePositive); + throw new ArgumentOutOfRangeException(nameof(rowCount), "Value must be positive."); } if (columnCount < 1) { - throw new ArgumentOutOfRangeException(nameof(columnCount), Resources.ArgumentMustBePositive); + throw new ArgumentOutOfRangeException(nameof(columnCount), "Value must be positive."); } // Verify Source @@ -125,7 +124,7 @@ namespace MathNet.Numerics.LinearAlgebra.Storage if (ColumnCount != target.Length) { - throw new ArgumentException(Resources.ArgumentMatrixSameRowDimension, nameof(target)); + throw new ArgumentException("Matrix row dimensions must agree.", nameof(target)); } } @@ -139,7 +138,7 @@ namespace MathNet.Numerics.LinearAlgebra.Storage if (RowCount != target.Length) { - throw new ArgumentException(Resources.ArgumentMatrixSameColumnDimension, nameof(target)); + throw new ArgumentException("Matrix column dimensions must agree.", nameof(target)); } } @@ -149,7 +148,7 @@ namespace MathNet.Numerics.LinearAlgebra.Storage { if (columnCount < 1) { - throw new ArgumentOutOfRangeException(nameof(columnCount), Resources.ArgumentMustBePositive); + throw new ArgumentOutOfRangeException(nameof(columnCount), "Value must be positive."); } // Verify Source @@ -188,7 +187,7 @@ namespace MathNet.Numerics.LinearAlgebra.Storage { if (rowCount < 1) { - throw new ArgumentOutOfRangeException(nameof(rowCount), Resources.ArgumentMustBePositive); + throw new ArgumentOutOfRangeException(nameof(rowCount), "Value must be positive."); } // Verify Source diff --git a/src/Numerics/LinearAlgebra/Storage/MatrixStorage.cs b/src/Numerics/LinearAlgebra/Storage/MatrixStorage.cs index 7f9618c5..7d07c53e 100644 --- a/src/Numerics/LinearAlgebra/Storage/MatrixStorage.cs +++ b/src/Numerics/LinearAlgebra/Storage/MatrixStorage.cs @@ -30,7 +30,6 @@ using System; using System.Collections.Generic; using System.Runtime.Serialization; -using MathNet.Numerics.Properties; namespace MathNet.Numerics.LinearAlgebra.Storage { @@ -53,12 +52,12 @@ namespace MathNet.Numerics.LinearAlgebra.Storage { if (rowCount < 0) { - throw new ArgumentOutOfRangeException(nameof(rowCount), Resources.MatrixRowsMustBePositive); + throw new ArgumentOutOfRangeException(nameof(rowCount), "The number of rows of a matrix must be positive."); } if (columnCount < 0) { - throw new ArgumentOutOfRangeException(nameof(columnCount), Resources.MatrixColumnsMustBePositive); + throw new ArgumentOutOfRangeException(nameof(columnCount), "The number of columns of a matrix must be positive."); } RowCount = rowCount; @@ -323,7 +322,7 @@ namespace MathNet.Numerics.LinearAlgebra.Storage if (RowCount != target.RowCount || ColumnCount != target.ColumnCount) { - var message = string.Format(Resources.ArgumentMatrixDimensions2, RowCount + "x" + ColumnCount, target.RowCount + "x" + target.ColumnCount); + var message = $"Matrix dimensions must agree: op1 is {RowCount}x{ColumnCount}, op2 is {target.RowCount}x{target.ColumnCount}."; throw new ArgumentException(message, nameof(target)); } @@ -474,7 +473,7 @@ namespace MathNet.Numerics.LinearAlgebra.Storage if (RowCount != target.ColumnCount || ColumnCount != target.RowCount) { - var message = string.Format(Resources.ArgumentMatrixDimensions2, RowCount + "x" + ColumnCount, target.RowCount + "x" + target.ColumnCount); + var message = $"Matrix dimensions must agree: op1 is {RowCount}x{ColumnCount}, op2 is {target.RowCount}x{target.ColumnCount}."; throw new ArgumentException(message, nameof(target)); } @@ -691,7 +690,7 @@ namespace MathNet.Numerics.LinearAlgebra.Storage if (RowCount != other.RowCount || ColumnCount != other.ColumnCount) { - var message = string.Format(Resources.ArgumentMatrixDimensions2, RowCount + "x" + ColumnCount, other.RowCount + "x" + other.ColumnCount); + var message = $"Matrix dimensions must agree: op1 is {RowCount}x{ColumnCount}, op2 is {other.RowCount}x{other.ColumnCount}."; throw new ArgumentException(message, nameof(other)); } @@ -750,7 +749,7 @@ namespace MathNet.Numerics.LinearAlgebra.Storage if (RowCount != target.RowCount || ColumnCount != target.ColumnCount) { - var message = string.Format(Resources.ArgumentMatrixDimensions2, RowCount + "x" + ColumnCount, target.RowCount + "x" + target.ColumnCount); + var message = $"Matrix dimensions must agree: op1 is {RowCount}x{ColumnCount}, op2 is {target.RowCount}x{target.ColumnCount}."; throw new ArgumentException(message, nameof(target)); } @@ -779,7 +778,7 @@ namespace MathNet.Numerics.LinearAlgebra.Storage if (RowCount != target.RowCount || ColumnCount != target.ColumnCount) { - var message = string.Format(Resources.ArgumentMatrixDimensions2, RowCount + "x" + ColumnCount, target.RowCount + "x" + target.ColumnCount); + var message = $"Matrix dimensions must agree: op1 is {RowCount}x{ColumnCount}, op2 is {target.RowCount}x{target.ColumnCount}."; throw new ArgumentException(message, nameof(target)); } @@ -855,13 +854,13 @@ namespace MathNet.Numerics.LinearAlgebra.Storage if (RowCount != target.RowCount || ColumnCount != target.ColumnCount) { - var message = string.Format(Resources.ArgumentMatrixDimensions2, RowCount + "x" + ColumnCount, target.RowCount + "x" + target.ColumnCount); + var message = $"Matrix dimensions must agree: op1 is {RowCount}x{ColumnCount}, op2 is {target.RowCount}x{target.ColumnCount}."; throw new ArgumentException(message, nameof(target)); } if (RowCount != other.RowCount || ColumnCount != other.ColumnCount) { - var message = string.Format(Resources.ArgumentMatrixDimensions2, RowCount + "x" + ColumnCount, other.RowCount + "x" + other.ColumnCount); + var message = $"Matrix dimensions must agree: op1 is {RowCount}x{ColumnCount}, op2 is {other.RowCount}x{other.ColumnCount}."; throw new ArgumentException(message, nameof(other)); } @@ -890,7 +889,7 @@ namespace MathNet.Numerics.LinearAlgebra.Storage } if (target.Length != RowCount) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength, nameof(target)); + throw new ArgumentException("All vectors must have the same dimensionality.", nameof(target)); } if (state == null) @@ -899,7 +898,7 @@ namespace MathNet.Numerics.LinearAlgebra.Storage } if (state.Length != RowCount) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength, nameof(state)); + throw new ArgumentException("All vectors must have the same dimensionality.", nameof(state)); } FoldByRowUnchecked(target, f, finalize, state, zeros); @@ -928,7 +927,7 @@ namespace MathNet.Numerics.LinearAlgebra.Storage } if (target.Length != ColumnCount) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength, nameof(target)); + throw new ArgumentException("All vectors must have the same dimensionality.", nameof(target)); } if (state == null) @@ -937,7 +936,7 @@ namespace MathNet.Numerics.LinearAlgebra.Storage } if (state.Length != ColumnCount) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength, nameof(state)); + throw new ArgumentException("All vectors must have the same dimensionality.", nameof(state)); } FoldByColumnUnchecked(target, f, finalize, state, zeros); @@ -967,7 +966,7 @@ namespace MathNet.Numerics.LinearAlgebra.Storage if (RowCount != other.RowCount || ColumnCount != other.ColumnCount) { - var message = string.Format(Resources.ArgumentMatrixDimensions2, RowCount + "x" + ColumnCount, other.RowCount + "x" + other.ColumnCount); + var message = $"Matrix dimensions must agree: op1 is {RowCount}x{ColumnCount}, op2 is {other.RowCount}x{other.ColumnCount}."; throw new ArgumentException(message, nameof(other)); } diff --git a/src/Numerics/LinearAlgebra/Storage/SparseCompressedRowMatrixStorage.cs b/src/Numerics/LinearAlgebra/Storage/SparseCompressedRowMatrixStorage.cs index d65d7968..5067dfd2 100644 --- a/src/Numerics/LinearAlgebra/Storage/SparseCompressedRowMatrixStorage.cs +++ b/src/Numerics/LinearAlgebra/Storage/SparseCompressedRowMatrixStorage.cs @@ -31,7 +31,6 @@ using System; using System.Collections.Generic; using System.Linq; using System.Runtime.Serialization; -using MathNet.Numerics.Properties; namespace MathNet.Numerics.LinearAlgebra.Storage { @@ -161,7 +160,7 @@ namespace MathNet.Numerics.LinearAlgebra.Storage var size = Math.Min(Values.Length + GrowthSize(), (long)RowCount*ColumnCount); if (size > int.MaxValue) { - throw new NotSupportedException(Resources.TooManyElements); + throw new NotSupportedException("We only support sparse matrix with less than int.MaxValue elements."); } Array.Resize(ref Values, (int)size); @@ -513,7 +512,7 @@ namespace MathNet.Numerics.LinearAlgebra.Storage { if (data.Length <= 0) { - throw new ArgumentOutOfRangeException(nameof(data), Resources.MatrixCanNotBeEmpty); + throw new ArgumentOutOfRangeException(nameof(data), "Matrices can not be empty and must have at least one row and column."); } var storage = new SparseCompressedRowMatrixStorage(data.Length, data[0].Length); @@ -545,7 +544,7 @@ namespace MathNet.Numerics.LinearAlgebra.Storage { if (data.Length <= 0) { - throw new ArgumentOutOfRangeException(nameof(data), Resources.MatrixCanNotBeEmpty); + throw new ArgumentOutOfRangeException(nameof(data), "Matrices can not be empty and must have at least one row and column."); } var storage = new SparseCompressedRowMatrixStorage(data[0].Length, data.Length); @@ -577,7 +576,7 @@ namespace MathNet.Numerics.LinearAlgebra.Storage { if (data.Length <= 0) { - throw new ArgumentOutOfRangeException(nameof(data), Resources.MatrixCanNotBeEmpty); + throw new ArgumentOutOfRangeException(nameof(data), "Matrices can not be empty and must have at least one row and column."); } var storage = new SparseCompressedRowMatrixStorage(data.Length, data[0].Length); @@ -611,7 +610,7 @@ namespace MathNet.Numerics.LinearAlgebra.Storage { if (data.Length <= 0) { - throw new ArgumentOutOfRangeException(nameof(data), Resources.MatrixCanNotBeEmpty); + throw new ArgumentOutOfRangeException(nameof(data), "Matrices can not be empty and must have at least one row and column."); } var storage = new SparseCompressedRowMatrixStorage(data[0].Length, data.Length); @@ -691,23 +690,23 @@ namespace MathNet.Numerics.LinearAlgebra.Storage { for (int row = 0; row < rows; row++) { - if (!rowIterator.MoveNext()) throw new ArgumentOutOfRangeException(nameof(data), string.Format(Resources.ArgumentArrayWrongLength, rows)); + if (!rowIterator.MoveNext()) throw new ArgumentOutOfRangeException(nameof(data), $"The given array has the wrong length. Should be {rows}."); rowPointers[row] = values.Count; using (var columnIterator = rowIterator.Current.GetEnumerator()) { for (int col = 0; col < columns; col++) { - if (!columnIterator.MoveNext()) throw new ArgumentOutOfRangeException(nameof(data), string.Format(Resources.ArgumentArrayWrongLength, columns)); + if (!columnIterator.MoveNext()) throw new ArgumentOutOfRangeException(nameof(data), $"The given array has the wrong length. Should be {columns}."); if (!Zero.Equals(columnIterator.Current)) { values.Add(columnIterator.Current); columnIndices.Add(col); } } - if (columnIterator.MoveNext()) throw new ArgumentOutOfRangeException(nameof(data), string.Format(Resources.ArgumentArrayWrongLength, columns)); + if (columnIterator.MoveNext()) throw new ArgumentOutOfRangeException(nameof(data), $"The given array has the wrong length. Should be {columns}."); } } - if (rowIterator.MoveNext()) throw new ArgumentOutOfRangeException(nameof(data), string.Format(Resources.ArgumentArrayWrongLength, rows)); + if (rowIterator.MoveNext()) throw new ArgumentOutOfRangeException(nameof(data), $"The given array has the wrong length. Should be {rows}."); } rowPointers[rows] = values.Count; @@ -723,12 +722,12 @@ namespace MathNet.Numerics.LinearAlgebra.Storage { for (int column = 0; column < columns; column++) { - if (!columnIterator.MoveNext()) throw new ArgumentOutOfRangeException(nameof(data), string.Format(Resources.ArgumentArrayWrongLength, columns)); + if (!columnIterator.MoveNext()) throw new ArgumentOutOfRangeException(nameof(data), $"The given array has the wrong length. Should be {columns}."); using (var rowIterator = columnIterator.Current.GetEnumerator()) { for (int row = 0; row < rows; row++) { - if (!rowIterator.MoveNext()) throw new ArgumentOutOfRangeException(nameof(data), string.Format(Resources.ArgumentArrayWrongLength, rows)); + if (!rowIterator.MoveNext()) throw new ArgumentOutOfRangeException(nameof(data), $"The given array has the wrong length. Should be {rows}."); if (!Zero.Equals(rowIterator.Current)) { var trow = trows[row] ?? (trows[row] = new List>()); @@ -801,7 +800,7 @@ namespace MathNet.Numerics.LinearAlgebra.Storage { if (rows*columns != data.Count) { - throw new ArgumentException(Resources.ArgumentMatrixDimensions); + throw new ArgumentException("Matrix dimensions must agree."); } var storage = new SparseCompressedRowMatrixStorage(rows, columns); diff --git a/src/Numerics/LinearAlgebra/Storage/SparseVectorStorage.cs b/src/Numerics/LinearAlgebra/Storage/SparseVectorStorage.cs index 0638a8a6..9aa1a375 100644 --- a/src/Numerics/LinearAlgebra/Storage/SparseVectorStorage.cs +++ b/src/Numerics/LinearAlgebra/Storage/SparseVectorStorage.cs @@ -32,7 +32,6 @@ using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Runtime.Serialization; -using MathNet.Numerics.Properties; using MathNet.Numerics.Threading; namespace MathNet.Numerics.LinearAlgebra.Storage @@ -315,7 +314,7 @@ namespace MathNet.Numerics.LinearAlgebra.Storage if (length < 0) { - throw new ArgumentOutOfRangeException(nameof(length), Resources.ArgumentNotNegative); + throw new ArgumentOutOfRangeException(nameof(length), "Value must not be negative (zero is ok)."); } var indices = new int[length]; @@ -338,7 +337,7 @@ namespace MathNet.Numerics.LinearAlgebra.Storage { if (length < 0) { - throw new ArgumentOutOfRangeException(nameof(length), Resources.ArgumentNotNegative); + throw new ArgumentOutOfRangeException(nameof(length), "Value must not be negative (zero is ok)."); } var indices = new List(); @@ -454,7 +453,7 @@ namespace MathNet.Numerics.LinearAlgebra.Storage if (Length != target.Length) { - var message = string.Format(Resources.ArgumentMatrixDimensions2, Length, target.Length); + var message = $"Matrix dimensions must agree: op1 is {Length}, op2 is {target.Length}."; throw new ArgumentException(message, nameof(target)); } diff --git a/src/Numerics/LinearAlgebra/Storage/VectorStorage.Validation.cs b/src/Numerics/LinearAlgebra/Storage/VectorStorage.Validation.cs index ff4e5f4a..1623d2c5 100644 --- a/src/Numerics/LinearAlgebra/Storage/VectorStorage.Validation.cs +++ b/src/Numerics/LinearAlgebra/Storage/VectorStorage.Validation.cs @@ -28,7 +28,6 @@ // using System; -using MathNet.Numerics.Properties; namespace MathNet.Numerics.LinearAlgebra.Storage { @@ -48,7 +47,7 @@ namespace MathNet.Numerics.LinearAlgebra.Storage { if (count < 1) { - throw new ArgumentOutOfRangeException(nameof(count), Resources.ArgumentMustBePositive); + throw new ArgumentOutOfRangeException(nameof(count), "Value must be positive."); } // Verify Source @@ -89,7 +88,7 @@ namespace MathNet.Numerics.LinearAlgebra.Storage if (target.ColumnCount != Length) { - throw new ArgumentException(Resources.ArgumentMatrixSameRowDimension, nameof(target)); + throw new ArgumentException("Matrix row dimensions must agree.", nameof(target)); } } @@ -102,7 +101,7 @@ namespace MathNet.Numerics.LinearAlgebra.Storage if (target.RowCount != Length) { - throw new ArgumentException(Resources.ArgumentMatrixSameColumnDimension, nameof(target)); + throw new ArgumentException("Matrix column dimensions must agree.", nameof(target)); } } @@ -111,7 +110,7 @@ namespace MathNet.Numerics.LinearAlgebra.Storage { if (columnCount < 1) { - throw new ArgumentOutOfRangeException(nameof(columnCount), Resources.ArgumentMustBePositive); + throw new ArgumentOutOfRangeException(nameof(columnCount), "Value must be positive."); } // Verify Source @@ -149,7 +148,7 @@ namespace MathNet.Numerics.LinearAlgebra.Storage { if (rowCount < 1) { - throw new ArgumentOutOfRangeException(nameof(rowCount), Resources.ArgumentMustBePositive); + throw new ArgumentOutOfRangeException(nameof(rowCount), "Value must be positive."); } // Verify Source diff --git a/src/Numerics/LinearAlgebra/Storage/VectorStorage.cs b/src/Numerics/LinearAlgebra/Storage/VectorStorage.cs index 8fe8af83..48c3f81a 100644 --- a/src/Numerics/LinearAlgebra/Storage/VectorStorage.cs +++ b/src/Numerics/LinearAlgebra/Storage/VectorStorage.cs @@ -30,7 +30,6 @@ using System; using System.Collections.Generic; using System.Runtime.Serialization; -using MathNet.Numerics.Properties; namespace MathNet.Numerics.LinearAlgebra.Storage { @@ -50,7 +49,7 @@ namespace MathNet.Numerics.LinearAlgebra.Storage { if (length < 0) { - throw new ArgumentOutOfRangeException(nameof(length), Resources.ArgumentNotNegative); + throw new ArgumentOutOfRangeException(nameof(length), "Value must not be negative (zero is ok)."); } Length = length; @@ -206,7 +205,7 @@ namespace MathNet.Numerics.LinearAlgebra.Storage if (Length != target.Length) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength, nameof(target)); + throw new ArgumentException("All vectors must have the same dimensionality.", nameof(target)); } CopyToUnchecked(target, existingData); @@ -231,7 +230,7 @@ namespace MathNet.Numerics.LinearAlgebra.Storage if (Length != target.ColumnCount) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength, nameof(target)); + throw new ArgumentException("All vectors must have the same dimensionality.", nameof(target)); } ValidateRowRange(target, rowIndex); @@ -257,7 +256,7 @@ namespace MathNet.Numerics.LinearAlgebra.Storage if (Length != target.RowCount) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength, nameof(target)); + throw new ArgumentException("All vectors must have the same dimensionality.", nameof(target)); } ValidateColumnRange(target, columnIndex); @@ -458,7 +457,7 @@ namespace MathNet.Numerics.LinearAlgebra.Storage if (Length != other.Length) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength, nameof(other)); + throw new ArgumentException("All vectors must have the same dimensionality.", nameof(other)); } return Find2Unchecked(other, predicate, zeros); @@ -507,7 +506,7 @@ namespace MathNet.Numerics.LinearAlgebra.Storage if (Length != target.Length) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength, nameof(target)); + throw new ArgumentException("All vectors must have the same dimensionality.", nameof(target)); } MapToUnchecked(target, f, zeros, existingData); @@ -532,7 +531,7 @@ namespace MathNet.Numerics.LinearAlgebra.Storage if (Length != target.Length) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength, nameof(target)); + throw new ArgumentException("All vectors must have the same dimensionality.", nameof(target)); } MapIndexedToUnchecked(target, f, zeros, existingData); @@ -561,12 +560,12 @@ namespace MathNet.Numerics.LinearAlgebra.Storage if (Length != target.Length) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength, nameof(target)); + throw new ArgumentException("All vectors must have the same dimensionality.", nameof(target)); } if (Length != other.Length) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength, nameof(other)); + throw new ArgumentException("All vectors must have the same dimensionality.", nameof(other)); } Map2ToUnchecked(target, other, f, zeros, existingData); @@ -592,7 +591,7 @@ namespace MathNet.Numerics.LinearAlgebra.Storage if (Length != other.Length) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength, nameof(other)); + throw new ArgumentException("All vectors must have the same dimensionality.", nameof(other)); } return Fold2Unchecked(other, f, state, zeros); diff --git a/src/Numerics/LinearAlgebra/Vector.Arithmetic.cs b/src/Numerics/LinearAlgebra/Vector.Arithmetic.cs index 54e1cf58..2ba646f2 100644 --- a/src/Numerics/LinearAlgebra/Vector.Arithmetic.cs +++ b/src/Numerics/LinearAlgebra/Vector.Arithmetic.cs @@ -28,7 +28,6 @@ // using System; -using MathNet.Numerics.Properties; namespace MathNet.Numerics.LinearAlgebra { @@ -287,7 +286,7 @@ namespace MathNet.Numerics.LinearAlgebra { if (Count != result.Count) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength, nameof(result)); + throw new ArgumentException("All vectors must have the same dimensionality.", nameof(result)); } if (scalar.Equals(Zero)) @@ -309,7 +308,7 @@ namespace MathNet.Numerics.LinearAlgebra { if (Count != other.Count) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength, nameof(other)); + throw new ArgumentException("All vectors must have the same dimensionality.", nameof(other)); } var result = Build.SameAs(this, other); @@ -328,7 +327,7 @@ namespace MathNet.Numerics.LinearAlgebra { if (Count != result.Count) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength, nameof(result)); + throw new ArgumentException("All vectors must have the same dimensionality.", nameof(result)); } DoAdd(other, result); @@ -361,7 +360,7 @@ namespace MathNet.Numerics.LinearAlgebra { if (Count != result.Count) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength, nameof(result)); + throw new ArgumentException("All vectors must have the same dimensionality.", nameof(result)); } if (scalar.Equals(Zero)) @@ -395,7 +394,7 @@ namespace MathNet.Numerics.LinearAlgebra { if (Count != result.Count) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength, nameof(result)); + throw new ArgumentException("All vectors must have the same dimensionality.", nameof(result)); } DoSubtractFrom(scalar, result); @@ -421,7 +420,7 @@ namespace MathNet.Numerics.LinearAlgebra { if (Count != result.Count) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength, nameof(result)); + throw new ArgumentException("All vectors must have the same dimensionality.", nameof(result)); } DoNegate(result); @@ -437,7 +436,7 @@ namespace MathNet.Numerics.LinearAlgebra { if (Count != other.Count) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength, nameof(other)); + throw new ArgumentException("All vectors must have the same dimensionality.", nameof(other)); } var result = Build.SameAs(this, other); @@ -456,7 +455,7 @@ namespace MathNet.Numerics.LinearAlgebra { if (Count != result.Count) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength, nameof(result)); + throw new ArgumentException("All vectors must have the same dimensionality.", nameof(result)); } DoSubtract(other, result); @@ -481,7 +480,7 @@ namespace MathNet.Numerics.LinearAlgebra { if (Count != result.Count) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength, nameof(result)); + throw new ArgumentException("All vectors must have the same dimensionality.", nameof(result)); } DoConjugate(result); @@ -519,7 +518,7 @@ namespace MathNet.Numerics.LinearAlgebra { if (Count != result.Count) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength, nameof(result)); + throw new ArgumentException("All vectors must have the same dimensionality.", nameof(result)); } if (scalar.Equals(One)) @@ -546,7 +545,7 @@ namespace MathNet.Numerics.LinearAlgebra /// public T DotProduct(Vector other) { - if (Count != other.Count) throw new ArgumentException(Resources.ArgumentVectorsSameLength, nameof(other)); + if (Count != other.Count) throw new ArgumentException("All vectors must have the same dimensionality.", nameof(other)); return DoDotProduct(other); } @@ -561,7 +560,7 @@ namespace MathNet.Numerics.LinearAlgebra /// public T ConjugateDotProduct(Vector other) { - if (Count != other.Count) throw new ArgumentException(Resources.ArgumentVectorsSameLength, nameof(other)); + if (Count != other.Count) throw new ArgumentException("All vectors must have the same dimensionality.", nameof(other)); return DoConjugateDotProduct(other); } @@ -593,7 +592,7 @@ namespace MathNet.Numerics.LinearAlgebra { if (Count != result.Count) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength, nameof(result)); + throw new ArgumentException("All vectors must have the same dimensionality.", nameof(result)); } if (scalar.Equals(One)) @@ -627,7 +626,7 @@ namespace MathNet.Numerics.LinearAlgebra { if (Count != result.Count) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength, nameof(result)); + throw new ArgumentException("All vectors must have the same dimensionality.", nameof(result)); } DoDivideByThis(scalar, result); @@ -656,7 +655,7 @@ namespace MathNet.Numerics.LinearAlgebra { if (Count != result.Count) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength, nameof(result)); + throw new ArgumentException("All vectors must have the same dimensionality.", nameof(result)); } DoModulus(divisor, result); @@ -685,7 +684,7 @@ namespace MathNet.Numerics.LinearAlgebra { if (Count != result.Count) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength, nameof(result)); + throw new ArgumentException("All vectors must have the same dimensionality.", nameof(result)); } DoModulusByThis(dividend, result); @@ -714,7 +713,7 @@ namespace MathNet.Numerics.LinearAlgebra { if (Count != result.Count) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength, nameof(result)); + throw new ArgumentException("All vectors must have the same dimensionality.", nameof(result)); } DoRemainder(divisor, result); @@ -743,7 +742,7 @@ namespace MathNet.Numerics.LinearAlgebra { if (Count != result.Count) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength, nameof(result)); + throw new ArgumentException("All vectors must have the same dimensionality.", nameof(result)); } DoRemainderByThis(dividend, result); @@ -759,7 +758,7 @@ namespace MathNet.Numerics.LinearAlgebra { if (Count != other.Count) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength, nameof(other)); + throw new ArgumentException("All vectors must have the same dimensionality.", nameof(other)); } var result = Build.SameAs(this, other); @@ -778,12 +777,12 @@ namespace MathNet.Numerics.LinearAlgebra { if (Count != other.Count) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength, nameof(other)); + throw new ArgumentException("All vectors must have the same dimensionality.", nameof(other)); } if (Count != result.Count) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength, nameof(result)); + throw new ArgumentException("All vectors must have the same dimensionality.", nameof(result)); } DoPointwiseMultiply(other, result); @@ -799,7 +798,7 @@ namespace MathNet.Numerics.LinearAlgebra { if (Count != divisor.Count) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength, nameof(divisor)); + throw new ArgumentException("All vectors must have the same dimensionality.", nameof(divisor)); } var result = Build.SameAs(this, divisor); @@ -818,12 +817,12 @@ namespace MathNet.Numerics.LinearAlgebra { if (Count != divisor.Count) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength, nameof(divisor)); + throw new ArgumentException("All vectors must have the same dimensionality.", nameof(divisor)); } if (Count != result.Count) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength, nameof(result)); + throw new ArgumentException("All vectors must have the same dimensionality.", nameof(result)); } DoPointwiseDivide(divisor, result); @@ -850,7 +849,7 @@ namespace MathNet.Numerics.LinearAlgebra { if (Count != result.Count) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength, nameof(result)); + throw new ArgumentException("All vectors must have the same dimensionality.", nameof(result)); } DoPointwisePower(exponent, result); @@ -864,7 +863,7 @@ namespace MathNet.Numerics.LinearAlgebra { if (Count != exponent.Count) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength, nameof(exponent)); + throw new ArgumentException("All vectors must have the same dimensionality.", nameof(exponent)); } var result = Build.SameAs(this); @@ -882,12 +881,12 @@ namespace MathNet.Numerics.LinearAlgebra { if (Count != exponent.Count) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength, nameof(exponent)); + throw new ArgumentException("All vectors must have the same dimensionality.", nameof(exponent)); } if (Count != result.Count) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength, nameof(result)); + throw new ArgumentException("All vectors must have the same dimensionality.", nameof(result)); } DoPointwisePower(exponent, result); @@ -903,7 +902,7 @@ namespace MathNet.Numerics.LinearAlgebra { if (Count != divisor.Count) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength, nameof(divisor)); + throw new ArgumentException("All vectors must have the same dimensionality.", nameof(divisor)); } var result = Build.SameAs(this, divisor); @@ -923,12 +922,12 @@ namespace MathNet.Numerics.LinearAlgebra { if (Count != divisor.Count) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength, nameof(divisor)); + throw new ArgumentException("All vectors must have the same dimensionality.", nameof(divisor)); } if (Count != result.Count) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength, nameof(result)); + throw new ArgumentException("All vectors must have the same dimensionality.", nameof(result)); } DoPointwiseModulus(divisor, result); @@ -943,7 +942,7 @@ namespace MathNet.Numerics.LinearAlgebra { if (Count != divisor.Count) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength, nameof(divisor)); + throw new ArgumentException("All vectors must have the same dimensionality.", nameof(divisor)); } var result = Build.SameAs(this, divisor); @@ -963,12 +962,12 @@ namespace MathNet.Numerics.LinearAlgebra { if (Count != divisor.Count) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength, nameof(divisor)); + throw new ArgumentException("All vectors must have the same dimensionality.", nameof(divisor)); } if (Count != result.Count) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength, nameof(result)); + throw new ArgumentException("All vectors must have the same dimensionality.", nameof(result)); } DoPointwiseRemainder(divisor, result); @@ -1000,7 +999,7 @@ namespace MathNet.Numerics.LinearAlgebra { if (Count != result.Count) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength, nameof(result)); + throw new ArgumentException("All vectors must have the same dimensionality.", nameof(result)); } f(result); @@ -1034,7 +1033,7 @@ namespace MathNet.Numerics.LinearAlgebra { if (Count != result.Count) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength, nameof(result)); + throw new ArgumentException("All vectors must have the same dimensionality.", nameof(result)); } f(x, result); } @@ -1053,7 +1052,7 @@ namespace MathNet.Numerics.LinearAlgebra { if (Count != other.Count) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength, nameof(other)); + throw new ArgumentException("All vectors must have the same dimensionality.", nameof(other)); } var result = Build.SameAs(this, other); @@ -1073,12 +1072,12 @@ namespace MathNet.Numerics.LinearAlgebra { if (Count != other.Count) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength, nameof(other)); + throw new ArgumentException("All vectors must have the same dimensionality.", nameof(other)); } if (Count != result.Count) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength, nameof(result)); + throw new ArgumentException("All vectors must have the same dimensionality.", nameof(result)); } f(other, result); } @@ -1434,7 +1433,7 @@ namespace MathNet.Numerics.LinearAlgebra { if (Count != result.RowCount || other.Count != result.ColumnCount) { - throw new ArgumentException(Resources.ArgumentMatrixDimensions, nameof(result)); + throw new ArgumentException("Matrix dimensions must agree.", nameof(result)); } DoOuterProduct(other, result); @@ -1466,7 +1465,7 @@ namespace MathNet.Numerics.LinearAlgebra { if (Count != result.Count) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength, nameof(result)); + throw new ArgumentException("All vectors must have the same dimensionality.", nameof(result)); } DoPointwiseMinimum(scalar, result); @@ -1493,7 +1492,7 @@ namespace MathNet.Numerics.LinearAlgebra { if (Count != result.Count) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength, nameof(result)); + throw new ArgumentException("All vectors must have the same dimensionality.", nameof(result)); } DoPointwiseMaximum(scalar, result); @@ -1520,7 +1519,7 @@ namespace MathNet.Numerics.LinearAlgebra { if (Count != result.Count) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength, nameof(result)); + throw new ArgumentException("All vectors must have the same dimensionality.", nameof(result)); } DoPointwiseAbsoluteMinimum(scalar, result); @@ -1547,7 +1546,7 @@ namespace MathNet.Numerics.LinearAlgebra { if (Count != result.Count) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength, nameof(result)); + throw new ArgumentException("All vectors must have the same dimensionality.", nameof(result)); } DoPointwiseAbsoluteMaximum(scalar, result); @@ -1574,7 +1573,7 @@ namespace MathNet.Numerics.LinearAlgebra { if (Count != result.Count) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength, nameof(result)); + throw new ArgumentException("All vectors must have the same dimensionality.", nameof(result)); } DoPointwiseMinimum(other, result); @@ -1601,7 +1600,7 @@ namespace MathNet.Numerics.LinearAlgebra { if (Count != result.Count) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength, nameof(result)); + throw new ArgumentException("All vectors must have the same dimensionality.", nameof(result)); } DoPointwiseMaximum(other, result); @@ -1628,7 +1627,7 @@ namespace MathNet.Numerics.LinearAlgebra { if (Count != result.Count) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength, nameof(result)); + throw new ArgumentException("All vectors must have the same dimensionality.", nameof(result)); } DoPointwiseAbsoluteMinimum(other, result); @@ -1655,7 +1654,7 @@ namespace MathNet.Numerics.LinearAlgebra { if (Count != result.Count) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength, nameof(result)); + throw new ArgumentException("All vectors must have the same dimensionality.", nameof(result)); } DoPointwiseAbsoluteMaximum(other, result); diff --git a/src/Numerics/LinearAlgebra/Vector.BCL.cs b/src/Numerics/LinearAlgebra/Vector.BCL.cs index 464ea553..8d87f475 100644 --- a/src/Numerics/LinearAlgebra/Vector.BCL.cs +++ b/src/Numerics/LinearAlgebra/Vector.BCL.cs @@ -34,7 +34,6 @@ using System.Diagnostics; using System.Linq; using System.Text; using MathNet.Numerics.LinearAlgebra.Storage; -using MathNet.Numerics.Properties; namespace MathNet.Numerics.LinearAlgebra { @@ -206,7 +205,7 @@ namespace MathNet.Numerics.LinearAlgebra } if (array.Rank != 1) { - throw new ArgumentException(Resources.ArgumentSingleDimensionArray, nameof(array)); + throw new ArgumentException("Array must have exactly one dimension (and not be null).", nameof(array)); } Storage.CopySubVectorTo(new DenseVectorStorage(array.Length, (T[]) array), 0, index, Count); diff --git a/src/Numerics/LinearAlgebra/Vector.cs b/src/Numerics/LinearAlgebra/Vector.cs index c4d32987..d021a89a 100644 --- a/src/Numerics/LinearAlgebra/Vector.cs +++ b/src/Numerics/LinearAlgebra/Vector.cs @@ -33,7 +33,6 @@ using System.Collections.Generic; using System.Runtime; using System.Runtime.CompilerServices; using MathNet.Numerics.LinearAlgebra.Storage; -using MathNet.Numerics.Properties; namespace MathNet.Numerics.LinearAlgebra { @@ -129,7 +128,7 @@ namespace MathNet.Numerics.LinearAlgebra { if (count < 1) { - throw new ArgumentOutOfRangeException(nameof(count), Resources.ArgumentMustBePositive); + throw new ArgumentOutOfRangeException(nameof(count), "Value must be positive."); } if (index + count > Count || index < 0) diff --git a/src/Numerics/LinearRegression/MultipleRegression.cs b/src/Numerics/LinearRegression/MultipleRegression.cs index 0c77c5c1..98a0d304 100644 --- a/src/Numerics/LinearRegression/MultipleRegression.cs +++ b/src/Numerics/LinearRegression/MultipleRegression.cs @@ -30,7 +30,6 @@ using System; using System.Collections.Generic; using MathNet.Numerics.LinearAlgebra; -using MathNet.Numerics.Properties; namespace MathNet.Numerics.LinearRegression { @@ -137,12 +136,12 @@ namespace MathNet.Numerics.LinearRegression { if (x.RowCount != y.Count) { - throw new ArgumentException(string.Format(Resources.SampleVectorsSameLength, x.RowCount, y.Count)); + throw new ArgumentException($"All sample vectors must have the same length. However, vectors with disagreeing length {x.RowCount} and {y.Count} have been provided. A sample with index i is given by the value at index i of each provided vector."); } if (x.ColumnCount > y.Count) { - throw new ArgumentException(string.Format(Resources.RegressionNotEnoughSamples, x.ColumnCount, y.Count)); + throw new ArgumentException($"A regression of the requested order requires at least {x.ColumnCount} samples. Only {y.Count} samples have been provided."); } return x.TransposeThisAndMultiply(x).Cholesky().Solve(x.TransposeThisAndMultiply(y)); @@ -159,12 +158,12 @@ namespace MathNet.Numerics.LinearRegression { if (x.RowCount != y.RowCount) { - throw new ArgumentException(string.Format(Resources.SampleVectorsSameLength, x.RowCount, y.RowCount)); + throw new ArgumentException($"All sample vectors must have the same length. However, vectors with disagreeing length {x.RowCount} and {y.RowCount} have been provided. A sample with index i is given by the value at index i of each provided vector."); } if (x.ColumnCount > y.RowCount) { - throw new ArgumentException(string.Format(Resources.RegressionNotEnoughSamples, x.ColumnCount, y.RowCount)); + throw new ArgumentException($"A regression of the requested order requires at least {x.ColumnCount} samples. Only {y.RowCount} samples have been provided."); } return x.TransposeThisAndMultiply(x).Cholesky().Solve(x.TransposeThisAndMultiply(y)); @@ -188,12 +187,12 @@ namespace MathNet.Numerics.LinearRegression if (predictor.RowCount != y.Length) { - throw new ArgumentException(string.Format(Resources.SampleVectorsSameLength, predictor.RowCount, y.Length)); + throw new ArgumentException($"All sample vectors must have the same length. However, vectors with disagreeing length {predictor.RowCount} and {y.Length} have been provided. A sample with index i is given by the value at index i of each provided vector."); } if (predictor.ColumnCount > y.Length) { - throw new ArgumentException(string.Format(Resources.RegressionNotEnoughSamples, predictor.ColumnCount, y.Length)); + throw new ArgumentException($"A regression of the requested order requires at least {predictor.ColumnCount} samples. Only {y.Length} samples have been provided."); } var response = Vector.Build.Dense(y); @@ -224,12 +223,12 @@ namespace MathNet.Numerics.LinearRegression { if (x.RowCount != y.Count) { - throw new ArgumentException(string.Format(Resources.SampleVectorsSameLength, x.RowCount, y.Count)); + throw new ArgumentException($"All sample vectors must have the same length. However, vectors with disagreeing length {x.RowCount} and {y.Count} have been provided. A sample with index i is given by the value at index i of each provided vector."); } if (x.ColumnCount > y.Count) { - throw new ArgumentException(string.Format(Resources.RegressionNotEnoughSamples, x.ColumnCount, y.Count)); + throw new ArgumentException($"A regression of the requested order requires at least {x.ColumnCount} samples. Only {y.Count} samples have been provided."); } return x.QR().Solve(y); @@ -246,12 +245,12 @@ namespace MathNet.Numerics.LinearRegression { if (x.RowCount != y.RowCount) { - throw new ArgumentException(string.Format(Resources.SampleVectorsSameLength, x.RowCount, y.RowCount)); + throw new ArgumentException($"All sample vectors must have the same length. However, vectors with disagreeing length {x.RowCount} and {y.RowCount} have been provided. A sample with index i is given by the value at index i of each provided vector."); } if (x.ColumnCount > y.RowCount) { - throw new ArgumentException(string.Format(Resources.RegressionNotEnoughSamples, x.ColumnCount, y.RowCount)); + throw new ArgumentException($"A regression of the requested order requires at least {x.ColumnCount} samples. Only {y.RowCount} samples have been provided."); } return x.QR().Solve(y); @@ -275,12 +274,12 @@ namespace MathNet.Numerics.LinearRegression if (predictor.RowCount != y.Length) { - throw new ArgumentException(string.Format(Resources.SampleVectorsSameLength, predictor.RowCount, y.Length)); + throw new ArgumentException($"All sample vectors must have the same length. However, vectors with disagreeing length {predictor.RowCount} and {y.Length} have been provided. A sample with index i is given by the value at index i of each provided vector."); } if (predictor.ColumnCount > y.Length) { - throw new ArgumentException(string.Format(Resources.RegressionNotEnoughSamples, predictor.ColumnCount, y.Length)); + throw new ArgumentException($"A regression of the requested order requires at least {predictor.ColumnCount} samples. Only {y.Length} samples have been provided."); } return predictor.QR().Solve(Vector.Build.Dense(y)).ToArray(); @@ -310,12 +309,12 @@ namespace MathNet.Numerics.LinearRegression { if (x.RowCount != y.Count) { - throw new ArgumentException(string.Format(Resources.SampleVectorsSameLength, x.RowCount, y.Count)); + throw new ArgumentException($"All sample vectors must have the same length. However, vectors with disagreeing length {x.RowCount} and {y.Count} have been provided. A sample with index i is given by the value at index i of each provided vector."); } if (x.ColumnCount > y.Count) { - throw new ArgumentException(string.Format(Resources.RegressionNotEnoughSamples, x.ColumnCount, y.Count)); + throw new ArgumentException($"A regression of the requested order requires at least {x.ColumnCount} samples. Only {y.Count} samples have been provided."); } return x.Svd().Solve(y); @@ -332,12 +331,12 @@ namespace MathNet.Numerics.LinearRegression { if (x.RowCount != y.RowCount) { - throw new ArgumentException(string.Format(Resources.SampleVectorsSameLength, x.RowCount, y.RowCount)); + throw new ArgumentException($"All sample vectors must have the same length. However, vectors with disagreeing length {x.RowCount} and {y.RowCount} have been provided. A sample with index i is given by the value at index i of each provided vector."); } if (x.ColumnCount > y.RowCount) { - throw new ArgumentException(string.Format(Resources.RegressionNotEnoughSamples, x.ColumnCount, y.RowCount)); + throw new ArgumentException($"A regression of the requested order requires at least {x.ColumnCount} samples. Only {y.RowCount} samples have been provided."); } return x.Svd().Solve(y); @@ -361,12 +360,12 @@ namespace MathNet.Numerics.LinearRegression if (predictor.RowCount != y.Length) { - throw new ArgumentException(string.Format(Resources.SampleVectorsSameLength, predictor.RowCount, y.Length)); + throw new ArgumentException($"All sample vectors must have the same length. However, vectors with disagreeing length {predictor.RowCount} and {y.Length} have been provided. A sample with index i is given by the value at index i of each provided vector."); } if (predictor.ColumnCount > y.Length) { - throw new ArgumentException(string.Format(Resources.RegressionNotEnoughSamples, predictor.ColumnCount, y.Length)); + throw new ArgumentException($"A regression of the requested order requires at least {predictor.ColumnCount} samples. Only {y.Length} samples have been provided."); } return predictor.Svd().Solve(Vector.Build.Dense(y)).ToArray(); diff --git a/src/Numerics/LinearRegression/SimpleRegression.cs b/src/Numerics/LinearRegression/SimpleRegression.cs index 16c72e48..c9e25b46 100644 --- a/src/Numerics/LinearRegression/SimpleRegression.cs +++ b/src/Numerics/LinearRegression/SimpleRegression.cs @@ -29,7 +29,6 @@ using System; using System.Collections.Generic; -using MathNet.Numerics.Properties; namespace MathNet.Numerics.LinearRegression { @@ -46,12 +45,12 @@ namespace MathNet.Numerics.LinearRegression { if (x.Length != y.Length) { - throw new ArgumentException(string.Format(Resources.SampleVectorsSameLength, x.Length, y.Length)); + throw new ArgumentException($"All sample vectors must have the same length. However, vectors with disagreeing length {x.Length} and {y.Length} have been provided. A sample with index i is given by the value at index i of each provided vector."); } if (x.Length <= 1) { - throw new ArgumentException(string.Format(Resources.RegressionNotEnoughSamples, 2, x.Length)); + throw new ArgumentException($"A regression of the requested order requires at least {2} samples. Only {x.Length} samples have been provided."); } // First Pass: Mean (Less robust but faster than ArrayStatistics.Mean) @@ -103,12 +102,12 @@ namespace MathNet.Numerics.LinearRegression { if (x.Length != y.Length) { - throw new ArgumentException(string.Format(Resources.SampleVectorsSameLength, x.Length, y.Length)); + throw new ArgumentException($"All sample vectors must have the same length. However, vectors with disagreeing length {x.Length} and {y.Length} have been provided. A sample with index i is given by the value at index i of each provided vector."); } if (x.Length <= 1) { - throw new ArgumentException(string.Format(Resources.RegressionNotEnoughSamples, 2, x.Length)); + throw new ArgumentException($"A regression of the requested order requires at least {2} samples. Only {x.Length} samples have been provided."); } double mxy = 0.0; diff --git a/src/Numerics/Permutation.cs b/src/Numerics/Permutation.cs index 331c61f4..de778365 100644 --- a/src/Numerics/Permutation.cs +++ b/src/Numerics/Permutation.cs @@ -27,11 +27,10 @@ // OTHER DEALINGS IN THE SOFTWARE. // +using System; + namespace MathNet.Numerics { - using System; - using Properties; - /// /// Class to represent a permutation for a subset of the natural numbers. /// @@ -58,7 +57,7 @@ namespace MathNet.Numerics { if (!CheckForProperPermutation(indices)) { - throw new ArgumentException(Resources.PermutationAsIntArrayInvalid, nameof(indices)); + throw new ArgumentException("The integer array does not represent a valid permutation.", nameof(indices)); } _indices = (int[])indices.Clone(); diff --git a/src/Numerics/Properties/Resources.Designer.cs b/src/Numerics/Properties/Resources.Designer.cs deleted file mode 100644 index 6556a755..00000000 --- a/src/Numerics/Properties/Resources.Designer.cs +++ /dev/null @@ -1,1074 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -using System.Reflection; - -namespace MathNet.Numerics.Properties -{ - /// - /// A strongly-typed resource class, for looking up localized strings, etc. - /// - // This class was auto-generated by the StronglyTypedResourceBuilder - // class via a tool like ResGen or Visual Studio. - // To add or remove a member, edit your .ResX file then rerun ResGen - // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - public class Resources { - - private static global::System.Resources.ResourceManager resourceMan; - - private static global::System.Globalization.CultureInfo resourceCulture; - - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal Resources() { - } - - /// - /// Returns the cached ResourceManager instance used by this class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - public static global::System.Resources.ResourceManager ResourceManager { - get { -#if NETSTANDARD1_3 - if (object.ReferenceEquals(resourceMan, null)) - { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("MathNet.Numerics.Properties.Resources", typeof(Resources).GetTypeInfo().Assembly); - resourceMan = temp; - } -#else - if (object.ReferenceEquals(resourceMan, null)) - { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("MathNet.Numerics.Properties.Resources", typeof(Resources).Assembly); - resourceMan = temp; - } -#endif - return resourceMan; - } - } - - /// - /// Overrides the current thread's CurrentUICulture property for all - /// resource lookups using this strongly typed resource class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - public static global::System.Globalization.CultureInfo Culture { - get { - return resourceCulture; - } - set { - resourceCulture = value; - } - } - - /// - /// Looks up a localized string similar to The accuracy couldn't be reached with the specified number of iterations.. - /// - public static string AccuracyNotReached { - get { - return ResourceManager.GetString("AccuracyNotReached", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to The array arguments must have the same length.. - /// - public static string ArgumentArraysSameLength { - get { - return ResourceManager.GetString("ArgumentArraysSameLength", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to The given array has the wrong length. Should be {0}.. - /// - public static string ArgumentArrayWrongLength { - get { - return ResourceManager.GetString("ArgumentArrayWrongLength", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to The argument must be between 0 and 1.. - /// - public static string ArgumentBetween0And1 { - get { - return ResourceManager.GetString("ArgumentBetween0And1", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Value cannot be in the range -1 < x < 1.. - /// - public static string ArgumentCannotBeBetweenOneAndNegativeOne { - get { - return ResourceManager.GetString("ArgumentCannotBeBetweenOneAndNegativeOne", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Value must be even.. - /// - public static string ArgumentEven { - get { - return ResourceManager.GetString("ArgumentEven", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to The histogram does not contain the value.. - /// - public static string ArgumentHistogramContainsNot { - get { - return ResourceManager.GetString("ArgumentHistogramContainsNot", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Value is expected to be between {0} and {1} (including {0} and {1}).. - /// - public static string ArgumentInIntervalXYInclusive { - get { - return ResourceManager.GetString("ArgumentInIntervalXYInclusive", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to At least one item of {0} is a null reference (Nothing in Visual Basic).. - /// - public static string ArgumentItemNull { - get { - return ResourceManager.GetString("ArgumentItemNull", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Value must be greater than or equal to one.. - /// - public static string ArgumentLessThanOne { - get { - return ResourceManager.GetString("ArgumentLessThanOne", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Matrix dimensions must agree.. - /// - public static string ArgumentMatrixDimensions { - get { - return ResourceManager.GetString("ArgumentMatrixDimensions", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Matrix dimensions must agree: {0}.. - /// - public static string ArgumentMatrixDimensions1 { - get { - return ResourceManager.GetString("ArgumentMatrixDimensions1", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Matrix dimensions must agree: op1 is {0}, op2 is {1}.. - /// - public static string ArgumentMatrixDimensions2 { - get { - return ResourceManager.GetString("ArgumentMatrixDimensions2", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Matrix dimensions must agree: op1 is {0}, op2 is {1}, op3 is {2}.. - /// - public static string ArgumentMatrixDimensions3 { - get { - return ResourceManager.GetString("ArgumentMatrixDimensions3", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to The requested matrix does not exist.. - /// - public static string ArgumentMatrixDoesNotExist { - get { - return ResourceManager.GetString("ArgumentMatrixDoesNotExist", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to The matrix indices must not be out of range of the given matrix.. - /// - public static string ArgumentMatrixIndexOutOfRange { - get { - return ResourceManager.GetString("ArgumentMatrixIndexOutOfRange", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Matrix must not be rank deficient.. - /// - public static string ArgumentMatrixNotRankDeficient { - get { - return ResourceManager.GetString("ArgumentMatrixNotRankDeficient", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Matrix must not be singular.. - /// - public static string ArgumentMatrixNotSingular { - get { - return ResourceManager.GetString("ArgumentMatrixNotSingular", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Matrix must be positive definite.. - /// - public static string ArgumentMatrixPositiveDefinite { - get { - return ResourceManager.GetString("ArgumentMatrixPositiveDefinite", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Matrix column dimensions must agree.. - /// - public static string ArgumentMatrixSameColumnDimension { - get { - return ResourceManager.GetString("ArgumentMatrixSameColumnDimension", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Matrix row dimensions must agree.. - /// - public static string ArgumentMatrixSameRowDimension { - get { - return ResourceManager.GetString("ArgumentMatrixSameRowDimension", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Matrix must have exactly one column.. - /// - public static string ArgumentMatrixSingleColumn { - get { - return ResourceManager.GetString("ArgumentMatrixSingleColumn", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Matrix must have exactly one column and row, thus have only one cell.. - /// - public static string ArgumentMatrixSingleColumnRow { - get { - return ResourceManager.GetString("ArgumentMatrixSingleColumnRow", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Matrix must have exactly one row.. - /// - public static string ArgumentMatrixSingleRow { - get { - return ResourceManager.GetString("ArgumentMatrixSingleRow", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Matrix must be square.. - /// - public static string ArgumentMatrixSquare { - get { - return ResourceManager.GetString("ArgumentMatrixSquare", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Matrix must be symmetric.. - /// - public static string ArgumentMatrixSymmetric { - get { - return ResourceManager.GetString("ArgumentMatrixSymmetric", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Matrix must be symmetric positive definite.. - /// - public static string ArgumentMatrixSymmetricPositiveDefinite { - get { - return ResourceManager.GetString("ArgumentMatrixSymmetricPositiveDefinite", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to In the specified range, the exclusive maximum must be greater than the inclusive minimum.. - /// - public static string ArgumentMaxExclusiveMustBeLargerThanMinInclusive { - get { - return ResourceManager.GetString("ArgumentMaxExclusiveMustBeLargerThanMinInclusive", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to In the specified range, the minimum is greater than maximum.. - /// - public static string ArgumentMinValueGreaterThanMaxValue { - get { - return ResourceManager.GetString("ArgumentMinValueGreaterThanMaxValue", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Value must be positive.. - /// - public static string ArgumentMustBePositive { - get { - return ResourceManager.GetString("ArgumentMustBePositive", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Value must neither be infinite nor NaN.. - /// - public static string ArgumentNotInfinityNaN { - get { - return ResourceManager.GetString("ArgumentNotInfinityNaN", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Value must not be negative (zero is ok).. - /// - public static string ArgumentNotNegative { - get { - return ResourceManager.GetString("ArgumentNotNegative", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to {0} is a null reference (Nothing in Visual Basic).. - /// - public static string ArgumentNull { - get { - return ResourceManager.GetString("ArgumentNull", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Value must be odd.. - /// - public static string ArgumentOdd { - get { - return ResourceManager.GetString("ArgumentOdd", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to {0} must be greater than {1}.. - /// - public static string ArgumentOutOfRangeGreater { - get { - return ResourceManager.GetString("ArgumentOutOfRangeGreater", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to {0} must be greater than or equal to {1}.. - /// - public static string ArgumentOutOfRangeGreaterEqual { - get { - return ResourceManager.GetString("ArgumentOutOfRangeGreaterEqual", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to {0} must be smaller than {1}.. - /// - public static string ArgumentOutOfRangeSmaller { - get { - return ResourceManager.GetString("ArgumentOutOfRangeSmaller", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to {0} must be smaller than or equal to {1}.. - /// - public static string ArgumentOutOfRangeSmallerEqual { - get { - return ResourceManager.GetString("ArgumentOutOfRangeSmallerEqual", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to The chosen parameter set is invalid (probably some value is out of range).. - /// - public static string ArgumentParameterSetInvalid { - get { - return ResourceManager.GetString("ArgumentParameterSetInvalid", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to The given expression does not represent a complex number.. - /// - public static string ArgumentParseComplexNumber { - get { - return ResourceManager.GetString("ArgumentParseComplexNumber", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Value must be positive (and not zero).. - /// - public static string ArgumentPositive { - get { - return ResourceManager.GetString("ArgumentPositive", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Size must be a Power of Two.. - /// - public static string ArgumentPowerOfTwo { - get { - return ResourceManager.GetString("ArgumentPowerOfTwo", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Size must be a Power of Two in every dimension.. - /// - public static string ArgumentPowerOfTwoEveryDimension { - get { - return ResourceManager.GetString("ArgumentPowerOfTwoEveryDimension", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to The range between {0} and {1} must be less than or equal to {2}.. - /// - public static string ArgumentRangeLessEqual { - get { - return ResourceManager.GetString("ArgumentRangeLessEqual", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Arguments must be different objects.. - /// - public static string ArgumentReferenceDifferent { - get { - return ResourceManager.GetString("ArgumentReferenceDifferent", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Array must have exactly one dimension (and not be null).. - /// - public static string ArgumentSingleDimensionArray { - get { - return ResourceManager.GetString("ArgumentSingleDimensionArray", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Value is too large.. - /// - public static string ArgumentTooLarge { - get { - return ResourceManager.GetString("ArgumentTooLarge", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Value is too large for the current iteration limit.. - /// - public static string ArgumentTooLargeForIterationLimit { - get { - return ResourceManager.GetString("ArgumentTooLargeForIterationLimit", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Type mismatch.. - /// - public static string ArgumentTypeMismatch { - get { - return ResourceManager.GetString("ArgumentTypeMismatch", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to The upper bound must be strictly larger than the lower bound.. - /// - public static string ArgumentUpperBoundMustBeLargerThanLowerBound { - get { - return ResourceManager.GetString("ArgumentUpperBoundMustBeLargerThanLowerBound", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to The upper bound must be at least as large as the lower bound.. - /// - public static string ArgumentUpperBoundMustBeLargerThanOrEqualToLowerBound { - get { - return ResourceManager.GetString("ArgumentUpperBoundMustBeLargerThanOrEqualToLowerBound", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Array length must be a multiple of {0}.. - /// - public static string ArgumentVectorLengthsMultipleOf { - get { - return ResourceManager.GetString("ArgumentVectorLengthsMultipleOf", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to All vectors must have the same dimensionality.. - /// - public static string ArgumentVectorsSameLength { - get { - return ResourceManager.GetString("ArgumentVectorsSameLength", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to The vector must have 3 dimensions.. - /// - public static string ArgumentVectorThreeDimensional { - get { - return ResourceManager.GetString("ArgumentVectorThreeDimensional", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to The given array is too small. It must be at least {0} long.. - /// - public static string ArrayTooSmall { - get { - return ResourceManager.GetString("ArrayTooSmall", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Big endian files are not supported.. - /// - public static string BigEndianNotSupported { - get { - return ResourceManager.GetString("BigEndianNotSupported", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to The supplied collection is empty.. - /// - public static string CollectionEmpty { - get { - return ResourceManager.GetString("CollectionEmpty", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Complex matrices are not supported.. - /// - public static string ComplexMatricesNotSupported { - get { - return ResourceManager.GetString("ComplexMatricesNotSupported", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to An algorithm failed to converge.. - /// - public static string ConvergenceFailed { - get { - return ResourceManager.GetString("ConvergenceFailed", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to The sample size must be larger than the given degrees of freedom.. - /// - public static string DegreesOfFreedomMustBeLessThanSampleSize { - get { - return ResourceManager.GetString("DegreesOfFreedomMustBeLessThanSampleSize", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to This feature is not implemented yet (but is planned).. - /// - public static string FeaturePlannedButNotImplementedYet { - get { - return ResourceManager.GetString("FeaturePlannedButNotImplementedYet", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to The given file doesn't exist.. - /// - public static string FileDoesNotExist { - get { - return ResourceManager.GetString("FileDoesNotExist", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Sample points should be sorted in strictly ascending order. - /// - public static string Interpolation_Initialize_SamplePointsNotStrictlyAscendingOrder { - get { - return ResourceManager.GetString("Interpolation_Initialize_SamplePointsNotStrictlyAscendingOrder", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to All sample points should be unique.. - /// - public static string Interpolation_Initialize_SamplePointsNotUnique { - get { - return ResourceManager.GetString("Interpolation_Initialize_SamplePointsNotUnique", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Invalid parameterization for the distribution.. - /// - public static string InvalidDistributionParameters { - get { - return ResourceManager.GetString("InvalidDistributionParameters", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Invalid Left Boundary Condition.. - /// - public static string InvalidLeftBoundaryCondition { - get { - return ResourceManager.GetString("InvalidLeftBoundaryCondition", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to The operation could not be performed because the accumulator is empty.. - /// - public static string InvalidOperationAccumulatorEmpty { - get { - return ResourceManager.GetString("InvalidOperationAccumulatorEmpty", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to The operation could not be performed because the histogram is empty.. - /// - public static string InvalidOperationHistogramEmpty { - get { - return ResourceManager.GetString("InvalidOperationHistogramEmpty", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Not enough points in the distribution.. - /// - public static string InvalidOperationHistogramNotEnoughPoints { - get { - return ResourceManager.GetString("InvalidOperationHistogramNotEnoughPoints", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to No Samples Provided. Preparation Required.. - /// - public static string InvalidOperationNoSamplesProvided { - get { - return ResourceManager.GetString("InvalidOperationNoSamplesProvided", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to An invalid parameter was passed to a native method.. - /// - public static string InvalidParameter { - get { - return ResourceManager.GetString("InvalidParameter", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to An invalid parameter was passed to a native method, parameter number : {0}. - /// - public static string InvalidParameterWithNumber { - get { - return ResourceManager.GetString("InvalidParameterWithNumber", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Invalid Right Boundary Condition.. - /// - public static string InvalidRightBoundaryCondition { - get { - return ResourceManager.GetString("InvalidRightBoundaryCondition", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Lag must be positive. - /// - public static string LagMustBePositive { - get { - return ResourceManager.GetString("LagMustBePositive", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Lag must be smaller than the sample size. - /// - public static string LagMustBeSmallerThanTheSampleSize { - get { - return ResourceManager.GetString("LagMustBeSmallerThanTheSampleSize", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to ddd MMM dd HH:mm:ss yyyy. - /// - public static string MatlabDateHeaderFormat { - get { - return ResourceManager.GetString("MatlabDateHeaderFormat", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Matrices can not be empty and must have at least one row and column.. - /// - public static string MatrixCanNotBeEmpty { - get { - return ResourceManager.GetString("MatrixCanNotBeEmpty", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to The number of columns of a matrix must be positive.. - /// - public static string MatrixColumnsMustBePositive { - get { - return ResourceManager.GetString("MatrixColumnsMustBePositive", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Matrix must be in sparse storage format. - /// - public static string MatrixMustBeSparse { - get { - return ResourceManager.GetString("MatrixMustBeSparse", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to The number of rows of a matrix must be positive.. - /// - public static string MatrixRowsMustBePositive { - get { - return ResourceManager.GetString("MatrixRowsMustBePositive", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to The number of rows or columns of a matrix must be positive.. - /// - public static string MatrixRowsOrColumnsMustBePositive { - get { - return ResourceManager.GetString("MatrixRowsOrColumnsMustBePositive", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Unable to allocate native memory.. - /// - public static string MemoryAllocation { - get { - return ResourceManager.GetString("MemoryAllocation", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Only 1 and 2 dimensional arrays are supported.. - /// - public static string MoreThan2D { - get { - return ResourceManager.GetString("MoreThan2D", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Data must contain at least {0} values.. - /// - public static string MustContainAtLeast { - get { - return ResourceManager.GetString("MustContainAtLeast", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Name cannot contain a space. name: {0}. - /// - public static string NameCannotContainASpace { - get { - return ResourceManager.GetString("NameCannotContainASpace", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to {0} is not a supported type.. - /// - public static string NotSupportedType { - get { - return ResourceManager.GetString("NotSupportedType", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Algorithm experience a numerical break down - ///. - /// - public static string NumericalBreakdown { - get { - return ResourceManager.GetString("NumericalBreakdown", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to: Numerical estimation of the statistic has failed. - /// - public static string NumericalEstimationFailed - { - get - { - return ResourceManager.GetString("NumericalEstimationFailed", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to The two arguments can't be compared (maybe they are part of a partial ordering?). - /// - public static string PartialOrderException { - get { - return ResourceManager.GetString("PartialOrderException", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to The integer array does not represent a valid permutation.. - /// - public static string PermutationAsIntArrayInvalid { - get { - return ResourceManager.GetString("PermutationAsIntArrayInvalid", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to The sampler's proposal distribution is not upper bounding the target density.. - /// - public static string ProposalDistributionNoUpperBound { - get { - return ResourceManager.GetString("ProposalDistributionNoUpperBound", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to A regression of the requested order requires at least {0} samples. Only {1} samples have been provided. . - /// - public static string RegressionNotEnoughSamples { - get { - return ResourceManager.GetString("RegressionNotEnoughSamples", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to The algorithm has failed, exceeded the number of iterations allowed or there is no root within the provided bounds.. - /// - public static string RootFindingFailed { - get { - return ResourceManager.GetString("RootFindingFailed", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to The algorithm has failed, exceeded the number of iterations allowed or there is no root within the provided bounds. Consider to use RobustNewtonRaphson instead.. - /// - public static string RootFindingFailedRecommendRobustNewtonRaphson { - get { - return ResourceManager.GetString("RootFindingFailedRecommendRobustNewtonRaphson", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to The lower and upper bounds must bracket a single root.. - /// - public static string RootMustBeBracketedByBounds { - get { - return ResourceManager.GetString("RootMustBeBracketedByBounds", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to The algorithm ended without root in the range.. - /// - public static string RootNotFound { - get { - return ResourceManager.GetString("RootNotFound", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to The number of rows must greater than or equal to the number of columns.. - /// - public static string RowsLessThanColumns { - get { - return ResourceManager.GetString("RowsLessThanColumns", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to All sample vectors must have the same length. However, vectors with disagreeing length {0} and {1} have been provided. A sample with index i is given by the value at index i of each provided vector.. - /// - public static string SampleVectorsSameLength { - get { - return ResourceManager.GetString("SampleVectorsSameLength", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to U is singular, and the inversion could not be completed.. - /// - public static string SingularUMatrix { - get { - return ResourceManager.GetString("SingularUMatrix", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to U is singular, and the inversion could not be completed. The {0}-th diagonal element of the factor U is zero.. - /// - public static string SingularUMatrixWithElement { - get { - return ResourceManager.GetString("SingularUMatrixWithElement", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to The singular vectors were not computed.. - /// - public static string SingularVectorsNotComputed { - get { - return ResourceManager.GetString("SingularVectorsNotComputed", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to This special case is not supported yet (but is planned).. - /// - public static string SpecialCasePlannedButNotImplementedYet { - get { - return ResourceManager.GetString("SpecialCasePlannedButNotImplementedYet", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to The given stop criterion already exist in the collection.. - /// - public static string StopCriterionDuplicate { - get { - return ResourceManager.GetString("StopCriterionDuplicate", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to There is no stop criterion in the collection.. - /// - public static string StopCriterionMissing { - get { - return ResourceManager.GetString("StopCriterionMissing", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to String parameter cannot be empty or null.. - /// - public static string StringNullOrEmpty { - get { - return ResourceManager.GetString("StringNullOrEmpty", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to We only support sparse matrix with less than int.MaxValue elements.. - /// - public static string TooManyElements { - get { - return ResourceManager.GetString("TooManyElements", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to The moment of the distribution is undefined.. - /// - public static string UndefinedMoment { - get { - return ResourceManager.GetString("UndefinedMoment", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to A user defined provider has not been specified.. - /// - public static string UserDefinedProviderNotSpecified { - get { - return ResourceManager.GetString("UserDefinedProviderNotSpecified", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to User work buffers are not supported by this provider.. - /// - public static string UserWorkBufferNotSupported { - get { - return ResourceManager.GetString("UserWorkBufferNotSupported", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Vectors can not be empty and must have at least one element.. - /// - public static string VectorCanNotBeEmpty { - get { - return ResourceManager.GetString("VectorCanNotBeEmpty", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to The given work array is too small. Check work[0] for the corret size.. - /// - public static string WorkArrayTooSmall { - get { - return ResourceManager.GetString("WorkArrayTooSmall", resourceCulture); - } - } - } -} diff --git a/src/Numerics/Properties/Resources.resx b/src/Numerics/Properties/Resources.resx deleted file mode 100644 index 6f8c7f4f..00000000 --- a/src/Numerics/Properties/Resources.resx +++ /dev/null @@ -1,454 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - The histogram does not contain the value. - - - Value is expected to be between {0} and {1} (including {0} and {1}). - - - The matrix indices must not be out of range of the given matrix. - - - Matrix must not be rank deficient. - - - Matrix must not be singular. - - - Matrix column dimensions must agree. - - - Matrix dimensions must agree. - - - Matrix dimensions must agree: {0}. - - - Matrix dimensions must agree: op1 is {0}, op2 is {1}. - - - Matrix dimensions must agree: op1 is {0}, op2 is {1}, op3 is {2}. - - - Matrix row dimensions must agree. - - - Matrix must have exactly one column. - - - Matrix must have exactly one column and row, thus have only one cell. - - - Matrix must have exactly one row. - - - Matrix must be square. - - - Matrix must be symmetric. - - - Matrix must be symmetric positive definite. - - - Value must neither be infinite nor NaN. - - - Value must not be negative (zero is ok). - - - {0} is a null reference (Nothing in Visual Basic). - - - {0} must be greater than {1}. - - - {0} must be greater than or equal to {1}. - - - {0} must be smaller than {1}. - - - {0} must be smaller than or equal to {1}. - - - The chosen parameter set is invalid (probably some value is out of range). - - - The given expression does not represent a complex number. - - - Value must be positive (and not zero). - - - Size must be a Power of Two. - - - Size must be a Power of Two in every dimension. - - - The range between {0} and {1} must be less than or equal to {2}. - - - Array must have exactly one dimension (and not be null). - - - Value is too large. - - - Value is too large for the current iteration limit. - - - Type mismatch. - - - Array length must be a multiple of {0}. - - - All vectors must have the same dimensionality. - - - The vector must have 3 dimensions. - - - This feature is not implemented yet (but is planned). - - - Invalid Left Boundary Condition. - - - The operation could not be performed because the accumulator is empty. - - - The operation could not be performed because the histogram is empty. - - - Not enough points in the distribution. - - - No Samples Provided. Preparation Required. - - - Invalid Right Boundary Condition. - - - This special case is not supported yet (but is planned). - - - Invalid parameterization for the distribution. - - - Value must be even. - - - Value must be odd. - - - At least one item of {0} is a null reference (Nothing in Visual Basic). - - - The supplied collection is empty. - - - Value cannot be in the range -1 < x < 1. - - - Value must be greater than or equal to one. - - - Value must be positive. - - - A user defined provider has not been specified. - - - In the specified range, the minimum is greater than maximum. - - - In the specified range, the exclusive maximum must be greater than the inclusive minimum. - - - The upper bound must be at least as large as the lower bound. - - - The two arguments can't be compared (maybe they are part of a partial ordering?) - - - The number of columns of a matrix must be positive. - - - The number of rows of a matrix must be positive. - - - The number of rows or columns of a matrix must be positive. - - - The argument must be between 0 and 1. - - - The sampler's proposal distribution is not upper bounding the target density. - - - Matrix must be positive definite. - - - The array arguments must have the same length. - - - The moment of the distribution is undefined. - - - Arguments must be different objects. - - - The integer array does not represent a valid permutation. - - - An algorithm failed to converge. - - - The singular vectors were not computed. - - - The given work array is too small. Check work[0] for the corret size. - - - String parameter cannot be empty or null. - - - The requested matrix does not exist. - - - Big endian files are not supported. - - - Complex matrices are not supported. - - - The given file doesn't exist. - - - Only 1 and 2 dimensional arrays are supported. - - - {0} is not a supported type. - - - The given stop criterion already exist in the collection. - - - There is no stop criterion in the collection. - - - Name cannot contain a space. name: {0} - - - ddd MMM dd HH:mm:ss yyyy - - - Data must contain at least {0} values. - - - The given array is too small. It must be at least {0} long. - - - The given array has the wrong length. Should be {0}. - - - The number of rows must greater than or equal to the number of columns. - - - We only support sparse matrix with less than int.MaxValue elements. - - - Sample points should be sorted in strictly ascending order - - - All sample points should be unique. - - - The accuracy couldn't be reached with the specified number of iterations. - - - The algorithm ended without root in the range. - - - The lower and upper bounds must bracket a single root. - - - The algorithm has failed, exceeded the number of iterations allowed or there is no root within the provided bounds. - - - The algorithm has failed, exceeded the number of iterations allowed or there is no root within the provided bounds. Consider to use RobustNewtonRaphson instead. - - - Algorithm experience a numerical break down - - - - Lag must be positive - - - Lag must be smaller than the sample size - - - Matrix must be in sparse storage format - - - The upper bound must be strictly larger than the lower bound. - - - Matrices can not be empty and must have at least one row and column. - - - Vectors can not be empty and must have at least one element. - - - User work buffers are not supported by this provider. - - - An invalid parameter was passed to a native method. - - - An invalid parameter was passed to a native method, parameter number : {0} - - - Unable to allocate native memory. - - - U is singular, and the inversion could not be completed. - - - U is singular, and the inversion could not be completed. The {0}-th diagonal element of the factor U is zero. - - - A regression of the requested order requires at least {0} samples. Only {1} samples have been provided. - - - All sample vectors must have the same length. However, vectors with disagreeing length {0} and {1} have been provided. A sample with index i is given by the value at index i of each provided vector. - - - The sample size must be larger than the given degrees of freedom. - - - Numerical estimation of the statistic has failed. The used solver did not succeed in finding a root. - - \ No newline at end of file diff --git a/src/Numerics/Providers/LinearAlgebra/Acml/AcmlLinearAlgebraProvider.Complex.cs b/src/Numerics/Providers/LinearAlgebra/Acml/AcmlLinearAlgebraProvider.Complex.cs index 7f6401ed..ca94ec59 100644 --- a/src/Numerics/Providers/LinearAlgebra/Acml/AcmlLinearAlgebraProvider.Complex.cs +++ b/src/Numerics/Providers/LinearAlgebra/Acml/AcmlLinearAlgebraProvider.Complex.cs @@ -26,7 +26,6 @@ #if NATIVEACML using MathNet.Numerics.LinearAlgebra.Factorization; -using MathNet.Numerics.Properties; using System; using System.Security; using Complex = System.Numerics.Complex; @@ -60,7 +59,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Acml if (x.Length != y.Length) { - throw new ArgumentException(Resources.ArgumentArraysSameLength); + throw new ArgumentException("The array arguments must have the same length."); } return SafeNativeMethods.z_dot_product(x.Length, x, y); @@ -89,7 +88,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Acml if (y.Length != x.Length) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } if (!ReferenceEquals(y, result)) @@ -189,12 +188,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Acml if (c.Length != m*n) { - throw new ArgumentException(Resources.ArgumentMatrixDimensions); + throw new ArgumentException("Matrix dimensions must agree."); } if (k != l) { - throw new ArgumentException(Resources.ArgumentMatrixDimensions); + throw new ArgumentException("Matrix dimensions must agree."); } SafeNativeMethods.z_matrix_multiply(transposeA, transposeB, m, n, k, alpha, a, b, beta, c); @@ -224,12 +223,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Acml if (data.Length != order*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(data)); + throw new ArgumentException("The array arguments must have the same length.", nameof(data)); } if (ipiv.Length != order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(ipiv)); + throw new ArgumentException("The array arguments must have the same length.", nameof(ipiv)); } SafeNativeMethods.z_lu_factor(order, data, ipiv); @@ -251,7 +250,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Acml if (a.Length != order*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(a)); + throw new ArgumentException("The array arguments must have the same length.", nameof(a)); } var work = new Complex[order]; @@ -280,12 +279,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Acml if (a.Length != order*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(a)); + throw new ArgumentException("The array arguments must have the same length.", nameof(a)); } if (ipiv.Length != order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(ipiv)); + throw new ArgumentException("The array arguments must have the same length.", nameof(ipiv)); } var work = new Complex[order]; @@ -311,7 +310,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Acml if (a.Length != order*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(a)); + throw new ArgumentException("The array arguments must have the same length.", nameof(a)); } if (work == null) @@ -352,12 +351,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Acml if (a.Length != order*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(a)); + throw new ArgumentException("The array arguments must have the same length.", nameof(a)); } if (ipiv.Length != order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(ipiv)); + throw new ArgumentException("The array arguments must have the same length.", nameof(ipiv)); } if (work == null) @@ -391,17 +390,17 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Acml if (a.Length != order*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(a)); + throw new ArgumentException("The array arguments must have the same length.", nameof(a)); } if (b.Length != columnsOfB*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (ReferenceEquals(a, b)) { - throw new ArgumentException(Resources.ArgumentReferenceDifferent); + throw new ArgumentException("Arguments must be different objects."); } SafeNativeMethods.z_lu_solve(order, columnsOfB, a, b); @@ -431,22 +430,22 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Acml if (a.Length != order*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(a)); + throw new ArgumentException("The array arguments must have the same length.", nameof(a)); } if (ipiv.Length != order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(ipiv)); + throw new ArgumentException("The array arguments must have the same length.", nameof(ipiv)); } if (b.Length != columnsOfB*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (ReferenceEquals(a, b)) { - throw new ArgumentException(Resources.ArgumentReferenceDifferent); + throw new ArgumentException("Arguments must be different objects."); } SafeNativeMethods.z_lu_solve_factored(order, columnsOfB, a, ipiv, b); @@ -469,19 +468,19 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Acml if (order < 1) { - throw new ArgumentException(Resources.ArgumentMustBePositive, nameof(order)); + throw new ArgumentException("Value must be positive.", nameof(order)); } if (a.Length != order*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(a)); + throw new ArgumentException("The array arguments must have the same length.", nameof(a)); } var info = SafeNativeMethods.z_cholesky_factor(order, a); if (info > 0) { - throw new ArgumentException(Resources.ArgumentMatrixPositiveDefinite); + throw new ArgumentException("Matrix must be positive definite."); } } @@ -509,12 +508,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Acml if (b.Length != orderA*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (ReferenceEquals(a, b)) { - throw new ArgumentException(Resources.ArgumentReferenceDifferent); + throw new ArgumentException("Arguments must be different objects."); } SafeNativeMethods.z_cholesky_solve(orderA, columnsB, a, b); @@ -543,12 +542,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Acml if (b.Length != orderA*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (ReferenceEquals(a, b)) { - throw new ArgumentException(Resources.ArgumentReferenceDifferent); + throw new ArgumentException("Arguments must be different objects."); } SafeNativeMethods.z_cholesky_solve_factored(orderA, columnsB, a, b); @@ -684,17 +683,17 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Acml if (a.Length != rows*columns) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(a)); + throw new ArgumentException("The array arguments must have the same length.", nameof(a)); } if (b.Length != rows*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (x.Length != columns*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(x)); + throw new ArgumentException("The array arguments must have the same length.", nameof(x)); } if (rows < columns) @@ -743,17 +742,17 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Acml if (a.Length != rows*columns) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(a)); + throw new ArgumentException("The array arguments must have the same length.", nameof(a)); } if (b.Length != rows*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (x.Length != columns*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(x)); + throw new ArgumentException("The array arguments must have the same length.", nameof(x)); } if (rows < columns) @@ -808,22 +807,22 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Acml if (r.Length != rowsR*columnsR) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(r)); + throw new ArgumentException("The array arguments must have the same length.", nameof(r)); } if (q.Length != rowsR*rowsR) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(q)); + throw new ArgumentException("The array arguments must have the same length.", nameof(q)); } if (b.Length != rowsR*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (x.Length != columnsR*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(x)); + throw new ArgumentException("The array arguments must have the same length.", nameof(x)); } if (rowsR < columnsR) @@ -881,22 +880,22 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Acml if (r.Length != rowsR*columnsR) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(r)); + throw new ArgumentException("The array arguments must have the same length.", nameof(r)); } if (q.Length != rowsR*rowsR) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(q)); + throw new ArgumentException("The array arguments must have the same length.", nameof(q)); } if (b.Length != rowsR*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (x.Length != columnsR*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(x)); + throw new ArgumentException("The array arguments must have the same length.", nameof(x)); } if (rowsR < columnsR) @@ -951,17 +950,17 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Acml if (u.Length != rowsA*rowsA) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(u)); + throw new ArgumentException("The array arguments must have the same length.", nameof(u)); } if (vt.Length != columnsA*columnsA) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(vt)); + throw new ArgumentException("The array arguments must have the same length.", nameof(vt)); } if (s.Length != Math.Min(rowsA, columnsA)) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(s)); + throw new ArgumentException("The array arguments must have the same length.", nameof(s)); } var work = new Complex[(2*Math.Min(rowsA, columnsA)) + Math.Max(rowsA, columnsA)]; @@ -996,12 +995,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Acml if (b.Length != rowsA*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (x.Length != columnsA*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } var work = new Complex[(2*Math.Min(rowsA, columnsA)) + Math.Max(rowsA, columnsA)]; @@ -1061,17 +1060,17 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Acml if (u.Length != rowsA*rowsA) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(u)); + throw new ArgumentException("The array arguments must have the same length.", nameof(u)); } if (vt.Length != columnsA*columnsA) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(vt)); + throw new ArgumentException("The array arguments must have the same length.", nameof(vt)); } if (s.Length != Math.Min(rowsA, columnsA)) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(s)); + throw new ArgumentException("The array arguments must have the same length.", nameof(s)); } if (work.Length == 0) diff --git a/src/Numerics/Providers/LinearAlgebra/Acml/AcmlLinearAlgebraProvider.Complex32.cs b/src/Numerics/Providers/LinearAlgebra/Acml/AcmlLinearAlgebraProvider.Complex32.cs index fabad113..6fb0f9f6 100644 --- a/src/Numerics/Providers/LinearAlgebra/Acml/AcmlLinearAlgebraProvider.Complex32.cs +++ b/src/Numerics/Providers/LinearAlgebra/Acml/AcmlLinearAlgebraProvider.Complex32.cs @@ -30,7 +30,6 @@ #if NATIVEACML using MathNet.Numerics.LinearAlgebra.Factorization; -using MathNet.Numerics.Properties; using System; using System.Security; @@ -63,7 +62,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Acml if (x.Length != y.Length) { - throw new ArgumentException(Resources.ArgumentArraysSameLength); + throw new ArgumentException("The array arguments must have the same length."); } return SafeNativeMethods.c_dot_product(x.Length, x, y); @@ -92,7 +91,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Acml if (y.Length != x.Length) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } if (!ReferenceEquals(y, result)) @@ -192,12 +191,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Acml if (c.Length != m*n) { - throw new ArgumentException(Resources.ArgumentMatrixDimensions); + throw new ArgumentException("Matrix dimensions must agree."); } if (k != l) { - throw new ArgumentException(Resources.ArgumentMatrixDimensions); + throw new ArgumentException("Matrix dimensions must agree."); } SafeNativeMethods.c_matrix_multiply(transposeA, transposeB, m, n, k, alpha, a, b, beta, c); @@ -227,12 +226,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Acml if (data.Length != order*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(data)); + throw new ArgumentException("The array arguments must have the same length.", nameof(data)); } if (ipiv.Length != order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(ipiv)); + throw new ArgumentException("The array arguments must have the same length.", nameof(ipiv)); } SafeNativeMethods.c_lu_factor(order, data, ipiv); @@ -254,7 +253,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Acml if (a.Length != order*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(a)); + throw new ArgumentException("The array arguments must have the same length.", nameof(a)); } var work = new Complex32[order]; @@ -283,12 +282,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Acml if (a.Length != order*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(a)); + throw new ArgumentException("The array arguments must have the same length.", nameof(a)); } if (ipiv.Length != order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(ipiv)); + throw new ArgumentException("The array arguments must have the same length.", nameof(ipiv)); } var work = new Complex32[order]; @@ -314,7 +313,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Acml if (a.Length != order*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(a)); + throw new ArgumentException("The array arguments must have the same length.", nameof(a)); } if (work == null) @@ -355,12 +354,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Acml if (a.Length != order*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(a)); + throw new ArgumentException("The array arguments must have the same length.", nameof(a)); } if (ipiv.Length != order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(ipiv)); + throw new ArgumentException("The array arguments must have the same length.", nameof(ipiv)); } if (work == null) @@ -394,17 +393,17 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Acml if (a.Length != order*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(a)); + throw new ArgumentException("The array arguments must have the same length.", nameof(a)); } if (b.Length != columnsOfB*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (ReferenceEquals(a, b)) { - throw new ArgumentException(Resources.ArgumentReferenceDifferent); + throw new ArgumentException("Arguments must be different objects."); } SafeNativeMethods.c_lu_solve(order, columnsOfB, a, b); @@ -434,22 +433,22 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Acml if (a.Length != order*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(a)); + throw new ArgumentException("The array arguments must have the same length.", nameof(a)); } if (ipiv.Length != order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(ipiv)); + throw new ArgumentException("The array arguments must have the same length.", nameof(ipiv)); } if (b.Length != columnsOfB*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (ReferenceEquals(a, b)) { - throw new ArgumentException(Resources.ArgumentReferenceDifferent); + throw new ArgumentException("Arguments must be different objects."); } SafeNativeMethods.c_lu_solve_factored(order, columnsOfB, a, ipiv, b); @@ -472,19 +471,19 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Acml if (order < 1) { - throw new ArgumentException(Resources.ArgumentMustBePositive, nameof(order)); + throw new ArgumentException("Value must be positive.", nameof(order)); } if (a.Length != order*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(a)); + throw new ArgumentException("The array arguments must have the same length.", nameof(a)); } var info = SafeNativeMethods.c_cholesky_factor(order, a); if (info > 0) { - throw new ArgumentException(Resources.ArgumentMatrixPositiveDefinite); + throw new ArgumentException("Matrix must be positive definite."); } } @@ -512,12 +511,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Acml if (b.Length != orderA*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (ReferenceEquals(a, b)) { - throw new ArgumentException(Resources.ArgumentReferenceDifferent); + throw new ArgumentException("Arguments must be different objects."); } SafeNativeMethods.c_cholesky_solve(orderA, columnsB, a, b); @@ -546,12 +545,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Acml if (b.Length != orderA*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (ReferenceEquals(a, b)) { - throw new ArgumentException(Resources.ArgumentReferenceDifferent); + throw new ArgumentException("Arguments must be different objects."); } SafeNativeMethods.c_cholesky_solve_factored(orderA, columnsB, a, b); @@ -687,17 +686,17 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Acml if (a.Length != rows*columns) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(a)); + throw new ArgumentException("The array arguments must have the same length.", nameof(a)); } if (b.Length != rows*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (x.Length != columns*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(x)); + throw new ArgumentException("The array arguments must have the same length.", nameof(x)); } if (rows < columns) @@ -746,17 +745,17 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Acml if (a.Length != rows*columns) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(a)); + throw new ArgumentException("The array arguments must have the same length.", nameof(a)); } if (b.Length != rows*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (x.Length != columns*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(x)); + throw new ArgumentException("The array arguments must have the same length.", nameof(x)); } if (rows < columns) @@ -811,22 +810,22 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Acml if (r.Length != rowsR*columnsR) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(r)); + throw new ArgumentException("The array arguments must have the same length.", nameof(r)); } if (q.Length != rowsR*rowsR) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(q)); + throw new ArgumentException("The array arguments must have the same length.", nameof(q)); } if (b.Length != rowsR*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (x.Length != columnsR*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(x)); + throw new ArgumentException("The array arguments must have the same length.", nameof(x)); } if (rowsR < columnsR) @@ -884,22 +883,22 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Acml if (r.Length != rowsR*columnsR) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(r)); + throw new ArgumentException("The array arguments must have the same length.", nameof(r)); } if (q.Length != rowsR*rowsR) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(q)); + throw new ArgumentException("The array arguments must have the same length.", nameof(q)); } if (b.Length != rowsR*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (x.Length != columnsR*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(x)); + throw new ArgumentException("The array arguments must have the same length.", nameof(x)); } if (rowsR < columnsR) @@ -954,17 +953,17 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Acml if (u.Length != rowsA*rowsA) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(u)); + throw new ArgumentException("The array arguments must have the same length.", nameof(u)); } if (vt.Length != columnsA*columnsA) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(vt)); + throw new ArgumentException("The array arguments must have the same length.", nameof(vt)); } if (s.Length != Math.Min(rowsA, columnsA)) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(s)); + throw new ArgumentException("The array arguments must have the same length.", nameof(s)); } var work = new Complex32[(2*Math.Min(rowsA, columnsA)) + Math.Max(rowsA, columnsA)]; @@ -999,12 +998,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Acml if (b.Length != rowsA*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (x.Length != columnsA*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } var work = new Complex32[(2*Math.Min(rowsA, columnsA)) + Math.Max(rowsA, columnsA)]; @@ -1064,17 +1063,17 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Acml if (u.Length != rowsA*rowsA) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(u)); + throw new ArgumentException("The array arguments must have the same length.", nameof(u)); } if (vt.Length != columnsA*columnsA) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(vt)); + throw new ArgumentException("The array arguments must have the same length.", nameof(vt)); } if (s.Length != Math.Min(rowsA, columnsA)) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(s)); + throw new ArgumentException("The array arguments must have the same length.", nameof(s)); } if (work.Length == 0) diff --git a/src/Numerics/Providers/LinearAlgebra/Acml/AcmlLinearAlgebraProvider.Double.cs b/src/Numerics/Providers/LinearAlgebra/Acml/AcmlLinearAlgebraProvider.Double.cs index 088400e2..b3e157cd 100644 --- a/src/Numerics/Providers/LinearAlgebra/Acml/AcmlLinearAlgebraProvider.Double.cs +++ b/src/Numerics/Providers/LinearAlgebra/Acml/AcmlLinearAlgebraProvider.Double.cs @@ -30,7 +30,6 @@ #if NATIVEACML using MathNet.Numerics.LinearAlgebra.Factorization; -using MathNet.Numerics.Properties; using System; using System.Security; @@ -63,7 +62,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Acml if (x.Length != y.Length) { - throw new ArgumentException(Resources.ArgumentArraysSameLength); + throw new ArgumentException("The array arguments must have the same length."); } return SafeNativeMethods.d_dot_product(x.Length, x, y); @@ -92,7 +91,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Acml if (y.Length != x.Length) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } if (!ReferenceEquals(y, result)) @@ -192,12 +191,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Acml if (c.Length != m*n) { - throw new ArgumentException(Resources.ArgumentMatrixDimensions); + throw new ArgumentException("Matrix dimensions must agree."); } if (k != l) { - throw new ArgumentException(Resources.ArgumentMatrixDimensions); + throw new ArgumentException("Matrix dimensions must agree."); } SafeNativeMethods.d_matrix_multiply(transposeA, transposeB, m, n, k, alpha, a, b, beta, c); @@ -227,12 +226,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Acml if (data.Length != order*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(data)); + throw new ArgumentException("The array arguments must have the same length.", nameof(data)); } if (ipiv.Length != order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(ipiv)); + throw new ArgumentException("The array arguments must have the same length.", nameof(ipiv)); } SafeNativeMethods.d_lu_factor(order, data, ipiv); @@ -254,7 +253,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Acml if (a.Length != order*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(a)); + throw new ArgumentException("The array arguments must have the same length.", nameof(a)); } var work = new double[order]; @@ -283,12 +282,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Acml if (a.Length != order*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(a)); + throw new ArgumentException("The array arguments must have the same length.", nameof(a)); } if (ipiv.Length != order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(ipiv)); + throw new ArgumentException("The array arguments must have the same length.", nameof(ipiv)); } var work = new double[order]; @@ -314,7 +313,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Acml if (a.Length != order*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(a)); + throw new ArgumentException("The array arguments must have the same length.", nameof(a)); } if (work == null) @@ -355,12 +354,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Acml if (a.Length != order*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(a)); + throw new ArgumentException("The array arguments must have the same length.", nameof(a)); } if (ipiv.Length != order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(ipiv)); + throw new ArgumentException("The array arguments must have the same length.", nameof(ipiv)); } if (work == null) @@ -394,17 +393,17 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Acml if (a.Length != order*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(a)); + throw new ArgumentException("The array arguments must have the same length.", nameof(a)); } if (b.Length != columnsOfB*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (ReferenceEquals(a, b)) { - throw new ArgumentException(Resources.ArgumentReferenceDifferent); + throw new ArgumentException("Arguments must be different objects."); } SafeNativeMethods.d_lu_solve(order, columnsOfB, a, b); @@ -434,22 +433,22 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Acml if (a.Length != order*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(a)); + throw new ArgumentException("The array arguments must have the same length.", nameof(a)); } if (ipiv.Length != order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(ipiv)); + throw new ArgumentException("The array arguments must have the same length.", nameof(ipiv)); } if (b.Length != columnsOfB*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (ReferenceEquals(a, b)) { - throw new ArgumentException(Resources.ArgumentReferenceDifferent); + throw new ArgumentException("Arguments must be different objects."); } SafeNativeMethods.d_lu_solve_factored(order, columnsOfB, a, ipiv, b); @@ -472,19 +471,19 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Acml if (order < 1) { - throw new ArgumentException(Resources.ArgumentMustBePositive, nameof(order)); + throw new ArgumentException("Value must be positive.", nameof(order)); } if (a.Length != order*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(a)); + throw new ArgumentException("The array arguments must have the same length.", nameof(a)); } var info = SafeNativeMethods.d_cholesky_factor(order, a); if (info > 0) { - throw new ArgumentException(Resources.ArgumentMatrixPositiveDefinite); + throw new ArgumentException("Matrix must be positive definite."); } } @@ -512,12 +511,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Acml if (b.Length != orderA*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (ReferenceEquals(a, b)) { - throw new ArgumentException(Resources.ArgumentReferenceDifferent); + throw new ArgumentException("Arguments must be different objects."); } SafeNativeMethods.d_cholesky_solve(orderA, columnsB, a, b); @@ -546,12 +545,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Acml if (b.Length != orderA*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (ReferenceEquals(a, b)) { - throw new ArgumentException(Resources.ArgumentReferenceDifferent); + throw new ArgumentException("Arguments must be different objects."); } SafeNativeMethods.d_cholesky_solve_factored(orderA, columnsB, a, b); @@ -687,17 +686,17 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Acml if (a.Length != rows*columns) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(a)); + throw new ArgumentException("The array arguments must have the same length.", nameof(a)); } if (b.Length != rows*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (x.Length != columns*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(x)); + throw new ArgumentException("The array arguments must have the same length.", nameof(x)); } if (rows < columns) @@ -746,17 +745,17 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Acml if (a.Length != rows*columns) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(a)); + throw new ArgumentException("The array arguments must have the same length.", nameof(a)); } if (b.Length != rows*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (x.Length != columns*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(x)); + throw new ArgumentException("The array arguments must have the same length.", nameof(x)); } if (rows < columns) @@ -811,22 +810,22 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Acml if (r.Length != rowsR*columnsR) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(r)); + throw new ArgumentException("The array arguments must have the same length.", nameof(r)); } if (q.Length != rowsR*rowsR) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(q)); + throw new ArgumentException("The array arguments must have the same length.", nameof(q)); } if (b.Length != rowsR*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (x.Length != columnsR*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(x)); + throw new ArgumentException("The array arguments must have the same length.", nameof(x)); } if (rowsR < columnsR) @@ -884,22 +883,22 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Acml if (r.Length != rowsR*columnsR) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(r)); + throw new ArgumentException("The array arguments must have the same length.", nameof(r)); } if (q.Length != rowsR*rowsR) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(q)); + throw new ArgumentException("The array arguments must have the same length.", nameof(q)); } if (b.Length != rowsR*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (x.Length != columnsR*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(x)); + throw new ArgumentException("The array arguments must have the same length.", nameof(x)); } if (rowsR < columnsR) @@ -954,17 +953,17 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Acml if (u.Length != rowsA*rowsA) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(u)); + throw new ArgumentException("The array arguments must have the same length.", nameof(u)); } if (vt.Length != columnsA*columnsA) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(vt)); + throw new ArgumentException("The array arguments must have the same length.", nameof(vt)); } if (s.Length != Math.Min(rowsA, columnsA)) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(s)); + throw new ArgumentException("The array arguments must have the same length.", nameof(s)); } var work = new double[Math.Max((3*Math.Min(rowsA, columnsA)) + Math.Max(rowsA, columnsA), 5*Math.Min(rowsA, columnsA))]; @@ -999,12 +998,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Acml if (b.Length != rowsA*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (x.Length != columnsA*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } var work = new double[Math.Max((3*Math.Min(rowsA, columnsA)) + Math.Max(rowsA, columnsA), 5*Math.Min(rowsA, columnsA))]; @@ -1064,17 +1063,17 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Acml if (u.Length != rowsA*rowsA) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(u)); + throw new ArgumentException("The array arguments must have the same length.", nameof(u)); } if (vt.Length != columnsA*columnsA) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(vt)); + throw new ArgumentException("The array arguments must have the same length.", nameof(vt)); } if (s.Length != Math.Min(rowsA, columnsA)) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(s)); + throw new ArgumentException("The array arguments must have the same length.", nameof(s)); } if (work.Length == 0) diff --git a/src/Numerics/Providers/LinearAlgebra/Acml/AcmlLinearAlgebraProvider.Single.cs b/src/Numerics/Providers/LinearAlgebra/Acml/AcmlLinearAlgebraProvider.Single.cs index 4089da29..707b03c3 100644 --- a/src/Numerics/Providers/LinearAlgebra/Acml/AcmlLinearAlgebraProvider.Single.cs +++ b/src/Numerics/Providers/LinearAlgebra/Acml/AcmlLinearAlgebraProvider.Single.cs @@ -30,7 +30,6 @@ #if NATIVEACML using MathNet.Numerics.LinearAlgebra.Factorization; -using MathNet.Numerics.Properties; using System; using System.Security; @@ -63,7 +62,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Acml if (x.Length != y.Length) { - throw new ArgumentException(Resources.ArgumentArraysSameLength); + throw new ArgumentException("The array arguments must have the same length."); } return SafeNativeMethods.s_dot_product(x.Length, x, y); @@ -92,7 +91,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Acml if (y.Length != x.Length) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } if (!ReferenceEquals(y, result)) @@ -192,12 +191,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Acml if (c.Length != m*n) { - throw new ArgumentException(Resources.ArgumentMatrixDimensions); + throw new ArgumentException("Matrix dimensions must agree."); } if (k != l) { - throw new ArgumentException(Resources.ArgumentMatrixDimensions); + throw new ArgumentException("Matrix dimensions must agree."); } SafeNativeMethods.s_matrix_multiply(transposeA, transposeB, m, n, k, alpha, a, b, beta, c); @@ -227,12 +226,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Acml if (data.Length != order*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(data)); + throw new ArgumentException("The array arguments must have the same length.", nameof(data)); } if (ipiv.Length != order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(ipiv)); + throw new ArgumentException("The array arguments must have the same length.", nameof(ipiv)); } SafeNativeMethods.s_lu_factor(order, data, ipiv); @@ -254,7 +253,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Acml if (a.Length != order*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(a)); + throw new ArgumentException("The array arguments must have the same length.", nameof(a)); } var work = new float[order]; @@ -283,12 +282,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Acml if (a.Length != order*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(a)); + throw new ArgumentException("The array arguments must have the same length.", nameof(a)); } if (ipiv.Length != order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(ipiv)); + throw new ArgumentException("The array arguments must have the same length.", nameof(ipiv)); } var work = new float[order]; @@ -314,7 +313,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Acml if (a.Length != order*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(a)); + throw new ArgumentException("The array arguments must have the same length.", nameof(a)); } if (work == null) @@ -355,12 +354,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Acml if (a.Length != order*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(a)); + throw new ArgumentException("The array arguments must have the same length.", nameof(a)); } if (ipiv.Length != order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(ipiv)); + throw new ArgumentException("The array arguments must have the same length.", nameof(ipiv)); } if (work == null) @@ -394,17 +393,17 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Acml if (a.Length != order*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(a)); + throw new ArgumentException("The array arguments must have the same length.", nameof(a)); } if (b.Length != columnsOfB*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (ReferenceEquals(a, b)) { - throw new ArgumentException(Resources.ArgumentReferenceDifferent); + throw new ArgumentException("Arguments must be different objects."); } SafeNativeMethods.s_lu_solve(order, columnsOfB, a, b); @@ -434,22 +433,22 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Acml if (a.Length != order*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(a)); + throw new ArgumentException("The array arguments must have the same length.", nameof(a)); } if (ipiv.Length != order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(ipiv)); + throw new ArgumentException("The array arguments must have the same length.", nameof(ipiv)); } if (b.Length != columnsOfB*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (ReferenceEquals(a, b)) { - throw new ArgumentException(Resources.ArgumentReferenceDifferent); + throw new ArgumentException("Arguments must be different objects."); } SafeNativeMethods.s_lu_solve_factored(order, columnsOfB, a, ipiv, b); @@ -472,19 +471,19 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Acml if (order < 1) { - throw new ArgumentException(Resources.ArgumentMustBePositive, nameof(order)); + throw new ArgumentException("Value must be positive.", nameof(order)); } if (a.Length != order*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(a)); + throw new ArgumentException("The array arguments must have the same length.", nameof(a)); } var info = SafeNativeMethods.s_cholesky_factor(order, a); if (info > 0) { - throw new ArgumentException(Resources.ArgumentMatrixPositiveDefinite); + throw new ArgumentException("Matrix must be positive definite."); } } @@ -512,12 +511,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Acml if (b.Length != orderA*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (ReferenceEquals(a, b)) { - throw new ArgumentException(Resources.ArgumentReferenceDifferent); + throw new ArgumentException("Arguments must be different objects."); } SafeNativeMethods.s_cholesky_solve(orderA, columnsB, a, b); @@ -546,12 +545,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Acml if (b.Length != orderA*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (ReferenceEquals(a, b)) { - throw new ArgumentException(Resources.ArgumentReferenceDifferent); + throw new ArgumentException("Arguments must be different objects."); } SafeNativeMethods.s_cholesky_solve_factored(orderA, columnsB, a, b); @@ -687,17 +686,17 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Acml if (a.Length != rows*columns) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(a)); + throw new ArgumentException("The array arguments must have the same length.", nameof(a)); } if (b.Length != rows*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (x.Length != columns*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(x)); + throw new ArgumentException("The array arguments must have the same length.", nameof(x)); } if (rows < columns) @@ -746,17 +745,17 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Acml if (a.Length != rows*columns) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(a)); + throw new ArgumentException("The array arguments must have the same length.", nameof(a)); } if (b.Length != rows*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (x.Length != columns*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(x)); + throw new ArgumentException("The array arguments must have the same length.", nameof(x)); } if (rows < columns) @@ -811,22 +810,22 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Acml if (r.Length != rowsR*columnsR) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(r)); + throw new ArgumentException("The array arguments must have the same length.", nameof(r)); } if (q.Length != rowsR*rowsR) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(q)); + throw new ArgumentException("The array arguments must have the same length.", nameof(q)); } if (b.Length != rowsR*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (x.Length != columnsR*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(x)); + throw new ArgumentException("The array arguments must have the same length.", nameof(x)); } if (rowsR < columnsR) @@ -884,22 +883,22 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Acml if (r.Length != rowsR*columnsR) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(r)); + throw new ArgumentException("The array arguments must have the same length.", nameof(r)); } if (q.Length != rowsR*rowsR) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(q)); + throw new ArgumentException("The array arguments must have the same length.", nameof(q)); } if (b.Length != rowsR*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (x.Length != columnsR*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(x)); + throw new ArgumentException("The array arguments must have the same length.", nameof(x)); } if (rowsR < columnsR) @@ -954,17 +953,17 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Acml if (u.Length != rowsA*rowsA) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(u)); + throw new ArgumentException("The array arguments must have the same length.", nameof(u)); } if (vt.Length != columnsA*columnsA) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(vt)); + throw new ArgumentException("The array arguments must have the same length.", nameof(vt)); } if (s.Length != Math.Min(rowsA, columnsA)) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(s)); + throw new ArgumentException("The array arguments must have the same length.", nameof(s)); } var work = new float[Math.Max(((3*Math.Min(rowsA, columnsA)) + Math.Max(rowsA, columnsA)), 5*Math.Min(rowsA, columnsA))]; @@ -999,12 +998,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Acml if (b.Length != rowsA*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (x.Length != columnsA*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } var work = new float[Math.Max(((3*Math.Min(rowsA, columnsA)) + Math.Max(rowsA, columnsA)), 5*Math.Min(rowsA, columnsA))]; @@ -1064,17 +1063,17 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Acml if (u.Length != rowsA*rowsA) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(u)); + throw new ArgumentException("The array arguments must have the same length.", nameof(u)); } if (vt.Length != columnsA*columnsA) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(vt)); + throw new ArgumentException("The array arguments must have the same length.", nameof(vt)); } if (s.Length != Math.Min(rowsA, columnsA)) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(s)); + throw new ArgumentException("The array arguments must have the same length.", nameof(s)); } if (work.Length == 0) diff --git a/src/Numerics/Providers/LinearAlgebra/Cuda/CudaLinearAlgebraProvider.Complex.cs b/src/Numerics/Providers/LinearAlgebra/Cuda/CudaLinearAlgebraProvider.Complex.cs index 55698a7e..abc8c70a 100644 --- a/src/Numerics/Providers/LinearAlgebra/Cuda/CudaLinearAlgebraProvider.Complex.cs +++ b/src/Numerics/Providers/LinearAlgebra/Cuda/CudaLinearAlgebraProvider.Complex.cs @@ -31,7 +31,6 @@ using System; using System.Security; -using MathNet.Numerics.Properties; using MathNet.Numerics.Providers.Common.Cuda; using Complex = System.Numerics.Complex; @@ -64,7 +63,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Cuda if (x.Length != y.Length) { - throw new ArgumentException(Resources.ArgumentArraysSameLength); + throw new ArgumentException("The array arguments must have the same length."); } return SafeNativeMethods.z_dot_product(_blasHandle, x.Length, x, y); @@ -93,7 +92,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Cuda if (y.Length != x.Length) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } if (!ReferenceEquals(y, result)) @@ -193,12 +192,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Cuda if (c.Length != m*n) { - throw new ArgumentException(Resources.ArgumentMatrixDimensions); + throw new ArgumentException("Matrix dimensions must agree."); } if (k != l) { - throw new ArgumentException(Resources.ArgumentMatrixDimensions); + throw new ArgumentException("Matrix dimensions must agree."); } SafeNativeMethods.z_matrix_multiply(_blasHandle, transposeA.ToCUDA(), transposeB.ToCUDA(), m, n, k, alpha, a, b, beta, c); @@ -228,12 +227,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Cuda if (data.Length != order*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(data)); + throw new ArgumentException("The array arguments must have the same length.", nameof(data)); } if (ipiv.Length != order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(ipiv)); + throw new ArgumentException("The array arguments must have the same length.", nameof(ipiv)); } Solver(SafeNativeMethods.z_lu_factor(_solverHandle, order, data, ipiv)); @@ -255,7 +254,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Cuda if (a.Length != order*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(a)); + throw new ArgumentException("The array arguments must have the same length.", nameof(a)); } Solver(SafeNativeMethods.z_lu_inverse(_solverHandle, _blasHandle, order, a)); @@ -283,12 +282,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Cuda if (a.Length != order*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(a)); + throw new ArgumentException("The array arguments must have the same length.", nameof(a)); } if (ipiv.Length != order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(ipiv)); + throw new ArgumentException("The array arguments must have the same length.", nameof(ipiv)); } BLAS(SafeNativeMethods.z_lu_inverse_factored(_blasHandle, order, a, ipiv)); @@ -312,17 +311,17 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Cuda if (a.Length != order*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(a)); + throw new ArgumentException("The array arguments must have the same length.", nameof(a)); } if (b.Length != columnsOfB*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (ReferenceEquals(a, b)) { - throw new ArgumentException(Resources.ArgumentReferenceDifferent); + throw new ArgumentException("Arguments must be different objects."); } Solver(SafeNativeMethods.z_lu_solve(_solverHandle, order, columnsOfB, a, b)); @@ -352,22 +351,22 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Cuda if (a.Length != order*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(a)); + throw new ArgumentException("The array arguments must have the same length.", nameof(a)); } if (ipiv.Length != order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(ipiv)); + throw new ArgumentException("The array arguments must have the same length.", nameof(ipiv)); } if (b.Length != columnsOfB*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (ReferenceEquals(a, b)) { - throw new ArgumentException(Resources.ArgumentReferenceDifferent); + throw new ArgumentException("Arguments must be different objects."); } Solver(SafeNativeMethods.z_lu_solve_factored(_solverHandle, order, columnsOfB, a, ipiv, b)); @@ -390,12 +389,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Cuda if (order < 1) { - throw new ArgumentException(Resources.ArgumentMustBePositive, nameof(order)); + throw new ArgumentException("Value must be positive.", nameof(order)); } if (a.Length != order*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(a)); + throw new ArgumentException("The array arguments must have the same length.", nameof(a)); } Solver(SafeNativeMethods.z_cholesky_factor(_solverHandle, order, a)); @@ -425,12 +424,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Cuda if (b.Length != orderA*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (ReferenceEquals(a, b)) { - throw new ArgumentException(Resources.ArgumentReferenceDifferent); + throw new ArgumentException("Arguments must be different objects."); } Solver(SafeNativeMethods.z_cholesky_solve(_solverHandle, orderA, columnsB, a, b)); @@ -459,12 +458,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Cuda if (b.Length != orderA*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (ReferenceEquals(a, b)) { - throw new ArgumentException(Resources.ArgumentReferenceDifferent); + throw new ArgumentException("Arguments must be different objects."); } Solver(SafeNativeMethods.z_cholesky_solve_factored(_solverHandle, orderA, columnsB, a, b)); @@ -498,12 +497,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Cuda if (b.Length != rowsA*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (x.Length != columnsA*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } var s = new Complex[Math.Min(rowsA, columnsA)]; @@ -554,17 +553,17 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Cuda if (u.Length != rowsA*rowsA) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(u)); + throw new ArgumentException("The array arguments must have the same length.", nameof(u)); } if (vt.Length != columnsA*columnsA) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(vt)); + throw new ArgumentException("The array arguments must have the same length.", nameof(vt)); } if (s.Length != Math.Min(rowsA, columnsA)) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(s)); + throw new ArgumentException("The array arguments must have the same length.", nameof(s)); } if (columnsA > rowsA || !computeVectors) // see remarks http://docs.nvidia.com/cuda/cusolver/index.html#cuds-lt-t-gt-gesvd diff --git a/src/Numerics/Providers/LinearAlgebra/Cuda/CudaLinearAlgebraProvider.Complex32.cs b/src/Numerics/Providers/LinearAlgebra/Cuda/CudaLinearAlgebraProvider.Complex32.cs index 1ff2002b..da1b0dcd 100644 --- a/src/Numerics/Providers/LinearAlgebra/Cuda/CudaLinearAlgebraProvider.Complex32.cs +++ b/src/Numerics/Providers/LinearAlgebra/Cuda/CudaLinearAlgebraProvider.Complex32.cs @@ -31,7 +31,6 @@ using System; using System.Security; -using MathNet.Numerics.Properties; using MathNet.Numerics.Providers.Common.Cuda; namespace MathNet.Numerics.Providers.LinearAlgebra.Cuda @@ -63,7 +62,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Cuda if (x.Length != y.Length) { - throw new ArgumentException(Resources.ArgumentArraysSameLength); + throw new ArgumentException("The array arguments must have the same length."); } return SafeNativeMethods.c_dot_product(_blasHandle, x.Length, x, y); @@ -92,7 +91,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Cuda if (y.Length != x.Length) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } if (!ReferenceEquals(y, result)) @@ -192,12 +191,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Cuda if (c.Length != m*n) { - throw new ArgumentException(Resources.ArgumentMatrixDimensions); + throw new ArgumentException("Matrix dimensions must agree."); } if (k != l) { - throw new ArgumentException(Resources.ArgumentMatrixDimensions); + throw new ArgumentException("Matrix dimensions must agree."); } SafeNativeMethods.c_matrix_multiply(_blasHandle, transposeA.ToCUDA(), transposeB.ToCUDA(), m, n, k, alpha, a, b, beta, c); @@ -227,12 +226,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Cuda if (data.Length != order*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(data)); + throw new ArgumentException("The array arguments must have the same length.", nameof(data)); } if (ipiv.Length != order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(ipiv)); + throw new ArgumentException("The array arguments must have the same length.", nameof(ipiv)); } Solver(SafeNativeMethods.c_lu_factor(_solverHandle, order, data, ipiv)); @@ -254,7 +253,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Cuda if (a.Length != order*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(a)); + throw new ArgumentException("The array arguments must have the same length.", nameof(a)); } Solver(SafeNativeMethods.c_lu_inverse(_solverHandle, _blasHandle, order, a)); @@ -282,12 +281,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Cuda if (a.Length != order*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(a)); + throw new ArgumentException("The array arguments must have the same length.", nameof(a)); } if (ipiv.Length != order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(ipiv)); + throw new ArgumentException("The array arguments must have the same length.", nameof(ipiv)); } BLAS(SafeNativeMethods.c_lu_inverse_factored(_blasHandle, order, a, ipiv)); @@ -311,17 +310,17 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Cuda if (a.Length != order*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(a)); + throw new ArgumentException("The array arguments must have the same length.", nameof(a)); } if (b.Length != columnsOfB*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (ReferenceEquals(a, b)) { - throw new ArgumentException(Resources.ArgumentReferenceDifferent); + throw new ArgumentException("Arguments must be different objects."); } Solver(SafeNativeMethods.c_lu_solve(_solverHandle, order, columnsOfB, a, b)); @@ -351,22 +350,22 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Cuda if (a.Length != order*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(a)); + throw new ArgumentException("The array arguments must have the same length.", nameof(a)); } if (ipiv.Length != order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(ipiv)); + throw new ArgumentException("The array arguments must have the same length.", nameof(ipiv)); } if (b.Length != columnsOfB*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (ReferenceEquals(a, b)) { - throw new ArgumentException(Resources.ArgumentReferenceDifferent); + throw new ArgumentException("Arguments must be different objects."); } Solver(SafeNativeMethods.c_lu_solve_factored(_solverHandle, order, columnsOfB, a, ipiv, b)); @@ -389,12 +388,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Cuda if (order < 1) { - throw new ArgumentException(Resources.ArgumentMustBePositive, nameof(order)); + throw new ArgumentException("Value must be positive.", nameof(order)); } if (a.Length != order*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(a)); + throw new ArgumentException("The array arguments must have the same length.", nameof(a)); } Solver(SafeNativeMethods.c_cholesky_factor(_solverHandle, order, a)); @@ -424,12 +423,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Cuda if (b.Length != orderA*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (ReferenceEquals(a, b)) { - throw new ArgumentException(Resources.ArgumentReferenceDifferent); + throw new ArgumentException("Arguments must be different objects."); } Solver(SafeNativeMethods.c_cholesky_solve(_solverHandle, orderA, columnsB, a, b)); @@ -458,12 +457,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Cuda if (b.Length != orderA*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (ReferenceEquals(a, b)) { - throw new ArgumentException(Resources.ArgumentReferenceDifferent); + throw new ArgumentException("Arguments must be different objects."); } Solver(SafeNativeMethods.c_cholesky_solve_factored(_solverHandle, orderA, columnsB, a, b)); @@ -497,12 +496,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Cuda if (b.Length != rowsA*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (x.Length != columnsA*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } var s = new Complex32[Math.Min(rowsA, columnsA)]; @@ -553,17 +552,17 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Cuda if (u.Length != rowsA*rowsA) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(u)); + throw new ArgumentException("The array arguments must have the same length.", nameof(u)); } if (vt.Length != columnsA*columnsA) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(vt)); + throw new ArgumentException("The array arguments must have the same length.", nameof(vt)); } if (s.Length != Math.Min(rowsA, columnsA)) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(s)); + throw new ArgumentException("The array arguments must have the same length.", nameof(s)); } if (columnsA > rowsA || !computeVectors) // see remarks http://docs.nvidia.com/cuda/cusolver/index.html#cuds-lt-t-gt-gesvd diff --git a/src/Numerics/Providers/LinearAlgebra/Cuda/CudaLinearAlgebraProvider.Double.cs b/src/Numerics/Providers/LinearAlgebra/Cuda/CudaLinearAlgebraProvider.Double.cs index e4beaca3..904b2f6a 100644 --- a/src/Numerics/Providers/LinearAlgebra/Cuda/CudaLinearAlgebraProvider.Double.cs +++ b/src/Numerics/Providers/LinearAlgebra/Cuda/CudaLinearAlgebraProvider.Double.cs @@ -31,7 +31,6 @@ using System; using System.Security; -using MathNet.Numerics.Properties; using MathNet.Numerics.Providers.Common.Cuda; namespace MathNet.Numerics.Providers.LinearAlgebra.Cuda @@ -63,7 +62,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Cuda if (x.Length != y.Length) { - throw new ArgumentException(Resources.ArgumentArraysSameLength); + throw new ArgumentException("The array arguments must have the same length."); } return SafeNativeMethods.d_dot_product(_blasHandle, x.Length, x, y); @@ -92,7 +91,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Cuda if (y.Length != x.Length) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } if (!ReferenceEquals(y, result)) @@ -192,12 +191,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Cuda if (c.Length != m*n) { - throw new ArgumentException(Resources.ArgumentMatrixDimensions); + throw new ArgumentException("Matrix dimensions must agree."); } if (k != l) { - throw new ArgumentException(Resources.ArgumentMatrixDimensions); + throw new ArgumentException("Matrix dimensions must agree."); } SafeNativeMethods.d_matrix_multiply(_blasHandle, transposeA.ToCUDA(), transposeB.ToCUDA(), m, n, k, alpha, a, b, beta, c); @@ -227,12 +226,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Cuda if (data.Length != order*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(data)); + throw new ArgumentException("The array arguments must have the same length.", nameof(data)); } if (ipiv.Length != order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(ipiv)); + throw new ArgumentException("The array arguments must have the same length.", nameof(ipiv)); } Solver(SafeNativeMethods.d_lu_factor(_solverHandle, order, data, ipiv)); @@ -254,7 +253,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Cuda if (a.Length != order*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(a)); + throw new ArgumentException("The array arguments must have the same length.", nameof(a)); } Solver(SafeNativeMethods.d_lu_inverse(_solverHandle, _blasHandle, order, a)); @@ -282,12 +281,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Cuda if (a.Length != order*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(a)); + throw new ArgumentException("The array arguments must have the same length.", nameof(a)); } if (ipiv.Length != order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(ipiv)); + throw new ArgumentException("The array arguments must have the same length.", nameof(ipiv)); } BLAS(SafeNativeMethods.d_lu_inverse_factored(_blasHandle, order, a, ipiv)); @@ -311,17 +310,17 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Cuda if (a.Length != order*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(a)); + throw new ArgumentException("The array arguments must have the same length.", nameof(a)); } if (b.Length != columnsOfB*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (ReferenceEquals(a, b)) { - throw new ArgumentException(Resources.ArgumentReferenceDifferent); + throw new ArgumentException("Arguments must be different objects."); } Solver(SafeNativeMethods.d_lu_solve(_solverHandle, order, columnsOfB, a, b)); @@ -351,22 +350,22 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Cuda if (a.Length != order*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(a)); + throw new ArgumentException("The array arguments must have the same length.", nameof(a)); } if (ipiv.Length != order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(ipiv)); + throw new ArgumentException("The array arguments must have the same length.", nameof(ipiv)); } if (b.Length != columnsOfB*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (ReferenceEquals(a, b)) { - throw new ArgumentException(Resources.ArgumentReferenceDifferent); + throw new ArgumentException("Arguments must be different objects."); } Solver(SafeNativeMethods.d_lu_solve_factored(_solverHandle, order, columnsOfB, a, ipiv, b)); @@ -389,12 +388,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Cuda if (order < 1) { - throw new ArgumentException(Resources.ArgumentMustBePositive, nameof(order)); + throw new ArgumentException("Value must be positive.", nameof(order)); } if (a.Length != order*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(a)); + throw new ArgumentException("The array arguments must have the same length.", nameof(a)); } Solver(SafeNativeMethods.d_cholesky_factor(_solverHandle, order, a)); @@ -424,12 +423,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Cuda if (b.Length != orderA*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (ReferenceEquals(a, b)) { - throw new ArgumentException(Resources.ArgumentReferenceDifferent); + throw new ArgumentException("Arguments must be different objects."); } Solver(SafeNativeMethods.d_cholesky_solve(_solverHandle, orderA, columnsB, a, b)); @@ -458,12 +457,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Cuda if (b.Length != orderA*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (ReferenceEquals(a, b)) { - throw new ArgumentException(Resources.ArgumentReferenceDifferent); + throw new ArgumentException("Arguments must be different objects."); } Solver(SafeNativeMethods.d_cholesky_solve_factored(_solverHandle, orderA, columnsB, a, b)); @@ -497,12 +496,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Cuda if (b.Length != rowsA*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (x.Length != columnsA*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } var s = new double[Math.Min(rowsA, columnsA)]; @@ -553,17 +552,17 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Cuda if (u.Length != rowsA*rowsA) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(u)); + throw new ArgumentException("The array arguments must have the same length.", nameof(u)); } if (vt.Length != columnsA*columnsA) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(vt)); + throw new ArgumentException("The array arguments must have the same length.", nameof(vt)); } if (s.Length != Math.Min(rowsA, columnsA)) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(s)); + throw new ArgumentException("The array arguments must have the same length.", nameof(s)); } if (columnsA > rowsA || !computeVectors) // see remarks http://docs.nvidia.com/cuda/cusolver/index.html#cuds-lt-t-gt-gesvd diff --git a/src/Numerics/Providers/LinearAlgebra/Cuda/CudaLinearAlgebraProvider.Single.cs b/src/Numerics/Providers/LinearAlgebra/Cuda/CudaLinearAlgebraProvider.Single.cs index 33fbb98d..3f3d69a3 100644 --- a/src/Numerics/Providers/LinearAlgebra/Cuda/CudaLinearAlgebraProvider.Single.cs +++ b/src/Numerics/Providers/LinearAlgebra/Cuda/CudaLinearAlgebraProvider.Single.cs @@ -31,7 +31,6 @@ using System; using System.Security; -using MathNet.Numerics.Properties; using MathNet.Numerics.Providers.Common.Cuda; namespace MathNet.Numerics.Providers.LinearAlgebra.Cuda @@ -63,7 +62,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Cuda if (x.Length != y.Length) { - throw new ArgumentException(Resources.ArgumentArraysSameLength); + throw new ArgumentException("The array arguments must have the same length."); } return SafeNativeMethods.s_dot_product(_blasHandle, x.Length, x, y); @@ -92,7 +91,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Cuda if (y.Length != x.Length) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } if (!ReferenceEquals(y, result)) @@ -192,12 +191,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Cuda if (c.Length != m*n) { - throw new ArgumentException(Resources.ArgumentMatrixDimensions); + throw new ArgumentException("Matrix dimensions must agree."); } if (k != l) { - throw new ArgumentException(Resources.ArgumentMatrixDimensions); + throw new ArgumentException("Matrix dimensions must agree."); } SafeNativeMethods.s_matrix_multiply(_blasHandle, transposeA.ToCUDA(), transposeB.ToCUDA(), m, n, k, alpha, a, b, beta, c); @@ -227,12 +226,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Cuda if (data.Length != order*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(data)); + throw new ArgumentException("The array arguments must have the same length.", nameof(data)); } if (ipiv.Length != order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(ipiv)); + throw new ArgumentException("The array arguments must have the same length.", nameof(ipiv)); } Solver(SafeNativeMethods.s_lu_factor(_solverHandle, order, data, ipiv)); @@ -254,7 +253,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Cuda if (a.Length != order*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(a)); + throw new ArgumentException("The array arguments must have the same length.", nameof(a)); } Solver(SafeNativeMethods.s_lu_inverse(_solverHandle, _blasHandle, order, a)); @@ -282,12 +281,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Cuda if (a.Length != order*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(a)); + throw new ArgumentException("The array arguments must have the same length.", nameof(a)); } if (ipiv.Length != order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(ipiv)); + throw new ArgumentException("The array arguments must have the same length.", nameof(ipiv)); } BLAS(SafeNativeMethods.s_lu_inverse_factored(_blasHandle, order, a, ipiv)); @@ -311,17 +310,17 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Cuda if (a.Length != order*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(a)); + throw new ArgumentException("The array arguments must have the same length.", nameof(a)); } if (b.Length != columnsOfB*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (ReferenceEquals(a, b)) { - throw new ArgumentException(Resources.ArgumentReferenceDifferent); + throw new ArgumentException("Arguments must be different objects."); } Solver(SafeNativeMethods.s_lu_solve(_solverHandle, order, columnsOfB, a, b)); @@ -351,22 +350,22 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Cuda if (a.Length != order*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(a)); + throw new ArgumentException("The array arguments must have the same length.", nameof(a)); } if (ipiv.Length != order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(ipiv)); + throw new ArgumentException("The array arguments must have the same length.", nameof(ipiv)); } if (b.Length != columnsOfB*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (ReferenceEquals(a, b)) { - throw new ArgumentException(Resources.ArgumentReferenceDifferent); + throw new ArgumentException("Arguments must be different objects."); } Solver(SafeNativeMethods.s_lu_solve_factored(_solverHandle, order, columnsOfB, a, ipiv, b)); @@ -389,12 +388,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Cuda if (order < 1) { - throw new ArgumentException(Resources.ArgumentMustBePositive, nameof(order)); + throw new ArgumentException("Value must be positive.", nameof(order)); } if (a.Length != order*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(a)); + throw new ArgumentException("The array arguments must have the same length.", nameof(a)); } Solver(SafeNativeMethods.s_cholesky_factor(_solverHandle, order, a)); @@ -424,12 +423,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Cuda if (b.Length != orderA*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (ReferenceEquals(a, b)) { - throw new ArgumentException(Resources.ArgumentReferenceDifferent); + throw new ArgumentException("Arguments must be different objects."); } Solver(SafeNativeMethods.s_cholesky_solve(_solverHandle, orderA, columnsB, a, b)); @@ -458,12 +457,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Cuda if (b.Length != orderA*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (ReferenceEquals(a, b)) { - throw new ArgumentException(Resources.ArgumentReferenceDifferent); + throw new ArgumentException("Arguments must be different objects."); } Solver(SafeNativeMethods.s_cholesky_solve_factored(_solverHandle, orderA, columnsB, a, b)); @@ -497,12 +496,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Cuda if (b.Length != rowsA*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (x.Length != columnsA*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } var s = new float[Math.Min(rowsA, columnsA)]; @@ -553,17 +552,17 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Cuda if (u.Length != rowsA*rowsA) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(u)); + throw new ArgumentException("The array arguments must have the same length.", nameof(u)); } if (vt.Length != columnsA*columnsA) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(vt)); + throw new ArgumentException("The array arguments must have the same length.", nameof(vt)); } if (s.Length != Math.Min(rowsA, columnsA)) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(s)); + throw new ArgumentException("The array arguments must have the same length.", nameof(s)); } if (columnsA > rowsA || !computeVectors) // see remarks http://docs.nvidia.com/cuda/cusolver/index.html#cuds-lt-t-gt-gesvd diff --git a/src/Numerics/Providers/LinearAlgebra/Managed/ManagedLinearAlgebraProvider.Complex.cs b/src/Numerics/Providers/LinearAlgebra/Managed/ManagedLinearAlgebraProvider.Complex.cs index 16043450..77e114d3 100644 --- a/src/Numerics/Providers/LinearAlgebra/Managed/ManagedLinearAlgebraProvider.Complex.cs +++ b/src/Numerics/Providers/LinearAlgebra/Managed/ManagedLinearAlgebraProvider.Complex.cs @@ -28,7 +28,6 @@ // using System; -using MathNet.Numerics.Properties; using MathNet.Numerics.Threading; using Complex = System.Numerics.Complex; using QRMethod = MathNet.Numerics.LinearAlgebra.Factorization.QRMethod; @@ -63,7 +62,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Managed if (y.Length != x.Length) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } if (alpha.IsZero()) @@ -156,7 +155,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Managed if (y.Length != x.Length) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } Complex dot = Complex.Zero; @@ -197,7 +196,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Managed if (y.Length != x.Length || y.Length != result.Length) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } for (int i = 0; i < result.Length; i++) @@ -235,7 +234,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Managed if (y.Length != x.Length || y.Length != result.Length) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } for (int i = 0; i < result.Length; i++) @@ -273,7 +272,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Managed if (y.Length != x.Length || y.Length != result.Length) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } for (int i = 0; i < result.Length; i++) @@ -311,7 +310,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Managed if (y.Length != x.Length || y.Length != result.Length) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } CommonParallel.For(0, y.Length, 4096, (a, b) => @@ -352,7 +351,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Managed if (y.Length != x.Length || y.Length != result.Length) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } CommonParallel.For(0, y.Length, 4096, (a, b) => @@ -694,12 +693,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Managed if (data.Length != order*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(data)); + throw new ArgumentException("The array arguments must have the same length.", nameof(data)); } if (ipiv.Length != order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(ipiv)); + throw new ArgumentException("The array arguments must have the same length.", nameof(ipiv)); } // Initialize the pivot matrix to the identity permutation. @@ -787,7 +786,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Managed if (a.Length != order*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(a)); + throw new ArgumentException("The array arguments must have the same length.", nameof(a)); } var ipiv = new int[order]; @@ -816,12 +815,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Managed if (a.Length != order*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(a)); + throw new ArgumentException("The array arguments must have the same length.", nameof(a)); } if (ipiv.Length != order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(ipiv)); + throw new ArgumentException("The array arguments must have the same length.", nameof(ipiv)); } var inverse = new Complex[a.Length]; @@ -856,17 +855,17 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Managed if (a.Length != order*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(a)); + throw new ArgumentException("The array arguments must have the same length.", nameof(a)); } if (b.Length != order*columnsOfB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (ReferenceEquals(a, b)) { - throw new ArgumentException(Resources.ArgumentReferenceDifferent); + throw new ArgumentException("Arguments must be different objects."); } var ipiv = new int[order]; @@ -904,22 +903,22 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Managed if (a.Length != order*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(a)); + throw new ArgumentException("The array arguments must have the same length.", nameof(a)); } if (ipiv.Length != order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(ipiv)); + throw new ArgumentException("The array arguments must have the same length.", nameof(ipiv)); } if (b.Length != order*columnsOfB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (ReferenceEquals(a, b)) { - throw new ArgumentException(Resources.ArgumentReferenceDifferent); + throw new ArgumentException("Arguments must be different objects."); } // Compute the column vector P*B @@ -1018,7 +1017,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Managed } else { - throw new ArgumentException(Resources.ArgumentMatrixPositiveDefinite); + throw new ArgumentException("Matrix must be positive definite."); } for (var i = ij + 1; i < order; i++) @@ -1085,12 +1084,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Managed if (b.Length != orderA*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (ReferenceEquals(a, b)) { - throw new ArgumentException(Resources.ArgumentReferenceDifferent); + throw new ArgumentException("Arguments must be different objects."); } var clone = new Complex[a.Length]; @@ -1121,12 +1120,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Managed if (b.Length != orderA*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (ReferenceEquals(a, b)) { - throw new ArgumentException(Resources.ArgumentReferenceDifferent); + throw new ArgumentException("Arguments must be different objects."); } CommonParallel.For(0, columnsB, (u, v) => @@ -1202,17 +1201,17 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Managed if (r.Length != rowsR*columnsR) { - throw new ArgumentException(string.Format(Resources.ArgumentArrayWrongLength, "rowsR * columnsR"), nameof(r)); + throw new ArgumentException("The given array has the wrong length. Should be rowsR * columnsR.", nameof(r)); } if (tau.Length < Math.Min(rowsR, columnsR)) { - throw new ArgumentException(string.Format(Resources.ArrayTooSmall, "min(m,n)"), nameof(tau)); + throw new ArgumentException("The given array is too small. It must be at least min(m,n) long.", nameof(tau)); } if (q.Length != rowsR*rowsR) { - throw new ArgumentException(string.Format(Resources.ArgumentArrayWrongLength, "rowsR * rowsR"), nameof(q)); + throw new ArgumentException("The given array has the wrong length. Should be rowsR * rowsR.", nameof(q)); } var work = columnsR > rowsR ? new Complex[rowsR*rowsR] : new Complex[rowsR*columnsR]; @@ -1264,17 +1263,17 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Managed if (a.Length != rowsA*columnsA) { - throw new ArgumentException(string.Format(Resources.ArgumentArrayWrongLength, "rowsR * columnsR"), nameof(a)); + throw new ArgumentException("The given array has the wrong length. Should be rowsR * columnsR.", nameof(a)); } if (tau.Length < Math.Min(rowsA, columnsA)) { - throw new ArgumentException(string.Format(Resources.ArrayTooSmall, "min(m,n)"), nameof(tau)); + throw new ArgumentException("The given array is too small. It must be at least min(m,n) long.", nameof(tau)); } if (r.Length != columnsA*columnsA) { - throw new ArgumentException(string.Format(Resources.ArgumentArrayWrongLength, "columnsA * columnsA"), nameof(r)); + throw new ArgumentException("The given array has the wrong length. Should be columnsA * columnsA.", nameof(r)); } var work = new Complex[rowsA*columnsA]; @@ -1457,22 +1456,22 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Managed if (a.Length != rows*columns) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(a)); + throw new ArgumentException("The array arguments must have the same length.", nameof(a)); } if (b.Length != rows*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (rows < columns) { - throw new ArgumentException(Resources.RowsLessThanColumns); + throw new ArgumentException("The number of rows must greater than or equal to the number of columns."); } if (x.Length != columns*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(x)); + throw new ArgumentException("The array arguments must have the same length.", nameof(x)); } var work = new Complex[rows * columns]; @@ -1532,7 +1531,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Managed if (rowsA < columnsA) { - throw new ArgumentException(Resources.RowsLessThanColumns); + throw new ArgumentException("The number of rows must greater than or equal to the number of columns."); } int rowsQ, columnsQ, rowsR, columnsR; @@ -1549,22 +1548,22 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Managed if (r.Length != rowsR*columnsR) { - throw new ArgumentException(string.Format(Resources.ArgumentArrayWrongLength, rowsR*columnsR), nameof(r)); + throw new ArgumentException($"The given array has the wrong length. Should be {rowsR * columnsR}.", nameof(r)); } if (q.Length != rowsQ*columnsQ) { - throw new ArgumentException(string.Format(Resources.ArgumentArrayWrongLength, rowsQ*columnsQ), nameof(q)); + throw new ArgumentException($"The given array has the wrong length. Should be {rowsQ * columnsQ}.", nameof(q)); } if (b.Length != rowsA*columnsB) { - throw new ArgumentException(string.Format(Resources.ArgumentArrayWrongLength, rowsA*columnsB), nameof(b)); + throw new ArgumentException($"The given array has the wrong length. Should be {rowsA * columnsB}.", nameof(b)); } if (x.Length != columnsA*columnsB) { - throw new ArgumentException(string.Format(Resources.ArgumentArrayWrongLength, columnsA*columnsB), nameof(x)); + throw new ArgumentException($"The given array has the wrong length. Should be {columnsA * columnsB}.", nameof(x)); } var sol = new Complex[b.Length]; @@ -1658,17 +1657,17 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Managed if (u.Length != rowsA*rowsA) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(u)); + throw new ArgumentException("The array arguments must have the same length.", nameof(u)); } if (vt.Length != columnsA*columnsA) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(vt)); + throw new ArgumentException("The array arguments must have the same length.", nameof(vt)); } if (s.Length != Math.Min(rowsA, columnsA)) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(s)); + throw new ArgumentException("The array arguments must have the same length.", nameof(s)); } var work = new Complex[rowsA]; @@ -2314,12 +2313,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Managed if (b.Length != rowsA*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (x.Length != columnsA*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } var s = new Complex[Math.Min(rowsA, columnsA)]; @@ -2372,27 +2371,27 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Managed if (u.Length != rowsA*rowsA) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(u)); + throw new ArgumentException("The array arguments must have the same length.", nameof(u)); } if (vt.Length != columnsA*columnsA) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(vt)); + throw new ArgumentException("The array arguments must have the same length.", nameof(vt)); } if (s.Length != Math.Min(rowsA, columnsA)) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(s)); + throw new ArgumentException("The array arguments must have the same length.", nameof(s)); } if (b.Length != rowsA*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (x.Length != columnsA*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } var mn = Math.Min(rowsA, columnsA); @@ -2447,7 +2446,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Managed if (matrix.Length != order*order) { - throw new ArgumentException(String.Format(Resources.ArgumentArrayWrongLength, order*order), nameof(matrix)); + throw new ArgumentException($"The given array has the wrong length. Should be {order * order}.", nameof(matrix)); } if (matrixEv == null) @@ -2457,7 +2456,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Managed if (matrixEv.Length != order*order) { - throw new ArgumentException(String.Format(Resources.ArgumentArrayWrongLength, order*order), nameof(matrixEv)); + throw new ArgumentException($"The given array has the wrong length. Should be {order * order}.", nameof(matrixEv)); } if (vectorEv == null) @@ -2467,7 +2466,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Managed if (vectorEv.Length != order) { - throw new ArgumentException(String.Format(Resources.ArgumentArrayWrongLength, order), nameof(vectorEv)); + throw new ArgumentException($"The given array has the wrong length. Should be {order}.", nameof(vectorEv)); } if (matrixD == null) @@ -2477,7 +2476,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Managed if (matrixD.Length != order*order) { - throw new ArgumentException(String.Format(Resources.ArgumentArrayWrongLength, order*order), nameof(matrixD)); + throw new ArgumentException($"The given array has the wrong length. Should be {order * order}.", nameof(matrixD)); } var matrixCopy = new Complex[matrix.Length]; Array.Copy(matrix, 0, matrixCopy, 0, matrix.Length); diff --git a/src/Numerics/Providers/LinearAlgebra/Managed/ManagedLinearAlgebraProvider.Complex32.cs b/src/Numerics/Providers/LinearAlgebra/Managed/ManagedLinearAlgebraProvider.Complex32.cs index e952a900..32a6e33d 100644 --- a/src/Numerics/Providers/LinearAlgebra/Managed/ManagedLinearAlgebraProvider.Complex32.cs +++ b/src/Numerics/Providers/LinearAlgebra/Managed/ManagedLinearAlgebraProvider.Complex32.cs @@ -28,7 +28,6 @@ // using System; -using MathNet.Numerics.Properties; using MathNet.Numerics.Threading; using Complex = System.Numerics.Complex; using QRMethod = MathNet.Numerics.LinearAlgebra.Factorization.QRMethod; @@ -63,7 +62,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Managed if (y.Length != x.Length) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } if (alpha.IsZero()) @@ -157,7 +156,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Managed if (y.Length != x.Length) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } Complex32 d = new Complex32(0.0F, 0.0F); @@ -198,7 +197,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Managed if (y.Length != x.Length || y.Length != result.Length) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } for (int i = 0; i < result.Length; i++) @@ -236,7 +235,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Managed if (y.Length != x.Length || y.Length != result.Length) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } for (int i = 0; i < result.Length; i++) @@ -274,7 +273,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Managed if (y.Length != x.Length || y.Length != result.Length) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } for (int i = 0; i < result.Length; i++) @@ -312,7 +311,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Managed if (y.Length != x.Length || y.Length != result.Length) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } CommonParallel.For(0, y.Length, 4096, (a, b) => @@ -353,7 +352,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Managed if (y.Length != x.Length || y.Length != result.Length) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } CommonParallel.For(0, y.Length, 4096, (a, b) => @@ -694,12 +693,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Managed if (data.Length != order*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(data)); + throw new ArgumentException("The array arguments must have the same length.", nameof(data)); } if (ipiv.Length != order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(ipiv)); + throw new ArgumentException("The array arguments must have the same length.", nameof(ipiv)); } // Initialize the pivot matrix to the identity permutation. @@ -787,7 +786,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Managed if (a.Length != order*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(a)); + throw new ArgumentException("The array arguments must have the same length.", nameof(a)); } var ipiv = new int[order]; @@ -816,12 +815,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Managed if (a.Length != order*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(a)); + throw new ArgumentException("The array arguments must have the same length.", nameof(a)); } if (ipiv.Length != order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(ipiv)); + throw new ArgumentException("The array arguments must have the same length.", nameof(ipiv)); } var inverse = new Complex32[a.Length]; @@ -856,17 +855,17 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Managed if (a.Length != order*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(a)); + throw new ArgumentException("The array arguments must have the same length.", nameof(a)); } if (b.Length != order*columnsOfB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (ReferenceEquals(a, b)) { - throw new ArgumentException(Resources.ArgumentReferenceDifferent); + throw new ArgumentException("Arguments must be different objects."); } var ipiv = new int[order]; @@ -904,22 +903,22 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Managed if (a.Length != order*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(a)); + throw new ArgumentException("The array arguments must have the same length.", nameof(a)); } if (ipiv.Length != order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(ipiv)); + throw new ArgumentException("The array arguments must have the same length.", nameof(ipiv)); } if (b.Length != order*columnsOfB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (ReferenceEquals(a, b)) { - throw new ArgumentException(Resources.ArgumentReferenceDifferent); + throw new ArgumentException("Arguments must be different objects."); } // Compute the column vector P*B @@ -1018,7 +1017,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Managed } else { - throw new ArgumentException(Resources.ArgumentMatrixPositiveDefinite); + throw new ArgumentException("Matrix must be positive definite."); } for (var i = ij + 1; i < order; i++) @@ -1085,12 +1084,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Managed if (b.Length != orderA*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (ReferenceEquals(a, b)) { - throw new ArgumentException(Resources.ArgumentReferenceDifferent); + throw new ArgumentException("Arguments must be different objects."); } var clone = new Complex32[a.Length]; @@ -1121,12 +1120,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Managed if (b.Length != orderA*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (ReferenceEquals(a, b)) { - throw new ArgumentException(Resources.ArgumentReferenceDifferent); + throw new ArgumentException("Arguments must be different objects."); } CommonParallel.For(0, columnsB, (u, v) => @@ -1202,17 +1201,17 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Managed if (r.Length != rowsR*columnsR) { - throw new ArgumentException(string.Format(Resources.ArgumentArrayWrongLength, "rowsR * columnsR"), nameof(r)); + throw new ArgumentException("The given array has the wrong length. Should be rowsR * columnsR.", nameof(r)); } if (tau.Length < Math.Min(rowsR, columnsR)) { - throw new ArgumentException(string.Format(Resources.ArrayTooSmall, "min(m,n)"), nameof(tau)); + throw new ArgumentException("The given array is too small. It must be at least min(m,n) long.", nameof(tau)); } if (q.Length != rowsR*rowsR) { - throw new ArgumentException(string.Format(Resources.ArgumentArrayWrongLength, "rowsR * rowsR"), nameof(q)); + throw new ArgumentException("The given array has the wrong length. Should be rowsR * rowsR.", nameof(q)); } var work = columnsR > rowsR ? new Complex32[rowsR*rowsR] : new Complex32[rowsR*columnsR]; @@ -1264,17 +1263,17 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Managed if (a.Length != rowsA*columnsA) { - throw new ArgumentException(string.Format(Resources.ArgumentArrayWrongLength, "rowsR * columnsR"), nameof(a)); + throw new ArgumentException("The given array has the wrong length. Should be rowsR * columnsR.", nameof(a)); } if (tau.Length < Math.Min(rowsA, columnsA)) { - throw new ArgumentException(string.Format(Resources.ArrayTooSmall, "min(m,n)"), nameof(tau)); + throw new ArgumentException("The given array is too small. It must be at least min(m,n) long.", nameof(tau)); } if (r.Length != columnsA*columnsA) { - throw new ArgumentException(string.Format(Resources.ArgumentArrayWrongLength, "columnsA * columnsA"), nameof(r)); + throw new ArgumentException("The given array has the wrong length. Should be columnsA * columnsA.", nameof(r)); } var work = new Complex32[rowsA*columnsA]; @@ -1455,22 +1454,22 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Managed if (a.Length != rows*columns) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(a)); + throw new ArgumentException("The array arguments must have the same length.", nameof(a)); } if (b.Length != rows*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (x.Length != columns*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(x)); + throw new ArgumentException("The array arguments must have the same length.", nameof(x)); } if (rows < columns) { - throw new ArgumentException(Resources.RowsLessThanColumns); + throw new ArgumentException("The number of rows must greater than or equal to the number of columns."); } var work = new Complex32[rows * columns]; @@ -1530,7 +1529,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Managed if (rowsA < columnsA) { - throw new ArgumentException(Resources.RowsLessThanColumns); + throw new ArgumentException("The number of rows must greater than or equal to the number of columns."); } int rowsQ, columnsQ, rowsR, columnsR; @@ -1547,22 +1546,22 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Managed if (r.Length != rowsR*columnsR) { - throw new ArgumentException(string.Format(Resources.ArgumentArrayWrongLength, rowsR*columnsR), nameof(r)); + throw new ArgumentException($"The given array has the wrong length. Should be {rowsR * columnsR}.", nameof(r)); } if (q.Length != rowsQ*columnsQ) { - throw new ArgumentException(string.Format(Resources.ArgumentArrayWrongLength, rowsQ*columnsQ), nameof(q)); + throw new ArgumentException($"The given array has the wrong length. Should be {rowsQ * columnsQ}.", nameof(q)); } if (b.Length != rowsA*columnsB) { - throw new ArgumentException(string.Format(Resources.ArgumentArrayWrongLength, rowsA*columnsB), nameof(b)); + throw new ArgumentException($"The given array has the wrong length. Should be {rowsA * columnsB}.", nameof(b)); } if (x.Length != columnsA*columnsB) { - throw new ArgumentException(string.Format(Resources.ArgumentArrayWrongLength, columnsA*columnsB), nameof(x)); + throw new ArgumentException($"The given array has the wrong length. Should be {columnsA * columnsB}.", nameof(x)); } var sol = new Complex32[b.Length]; @@ -1656,17 +1655,17 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Managed if (u.Length != rowsA*rowsA) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(u)); + throw new ArgumentException("The array arguments must have the same length.", nameof(u)); } if (vt.Length != columnsA*columnsA) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(vt)); + throw new ArgumentException("The array arguments must have the same length.", nameof(vt)); } if (s.Length != Math.Min(rowsA, columnsA)) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(s)); + throw new ArgumentException("The array arguments must have the same length.", nameof(s)); } var work = new Complex32[rowsA]; @@ -2312,12 +2311,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Managed if (b.Length != rowsA*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (x.Length != columnsA*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } var s = new Complex32[Math.Min(rowsA, columnsA)]; @@ -2370,27 +2369,27 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Managed if (u.Length != rowsA*rowsA) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(u)); + throw new ArgumentException("The array arguments must have the same length.", nameof(u)); } if (vt.Length != columnsA*columnsA) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(vt)); + throw new ArgumentException("The array arguments must have the same length.", nameof(vt)); } if (s.Length != Math.Min(rowsA, columnsA)) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(s)); + throw new ArgumentException("The array arguments must have the same length.", nameof(s)); } if (b.Length != rowsA*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (x.Length != columnsA*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } var mn = Math.Min(rowsA, columnsA); @@ -2445,7 +2444,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Managed if (matrix.Length != order*order) { - throw new ArgumentException(String.Format(Resources.ArgumentArrayWrongLength, order*order), nameof(matrix)); + throw new ArgumentException($"The given array has the wrong length. Should be {order * order}.", nameof(matrix)); } if (matrixEv == null) @@ -2455,7 +2454,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Managed if (matrixEv.Length != order*order) { - throw new ArgumentException(String.Format(Resources.ArgumentArrayWrongLength, order*order), nameof(matrixEv)); + throw new ArgumentException($"The given array has the wrong length. Should be {order * order}.", nameof(matrixEv)); } if (vectorEv == null) @@ -2465,7 +2464,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Managed if (vectorEv.Length != order) { - throw new ArgumentException(String.Format(Resources.ArgumentArrayWrongLength, order), nameof(vectorEv)); + throw new ArgumentException($"The given array has the wrong length. Should be {order}.", nameof(vectorEv)); } if (matrixD == null) @@ -2475,7 +2474,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Managed if (matrixD.Length != order*order) { - throw new ArgumentException(String.Format(Resources.ArgumentArrayWrongLength, order*order), nameof(matrixD)); + throw new ArgumentException($"The given array has the wrong length. Should be {order * order}.", nameof(matrixD)); } var matrixCopy = new Complex32[matrix.Length]; diff --git a/src/Numerics/Providers/LinearAlgebra/Managed/ManagedLinearAlgebraProvider.Double.cs b/src/Numerics/Providers/LinearAlgebra/Managed/ManagedLinearAlgebraProvider.Double.cs index 8b57082e..636f4da9 100644 --- a/src/Numerics/Providers/LinearAlgebra/Managed/ManagedLinearAlgebraProvider.Double.cs +++ b/src/Numerics/Providers/LinearAlgebra/Managed/ManagedLinearAlgebraProvider.Double.cs @@ -28,7 +28,6 @@ // using System; -using MathNet.Numerics.Properties; using MathNet.Numerics.Threading; using Complex = System.Numerics.Complex; using QRMethod = MathNet.Numerics.LinearAlgebra.Factorization.QRMethod; @@ -63,7 +62,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Managed if (y.Length != x.Length) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } if (alpha == 0.0) @@ -156,7 +155,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Managed if (y.Length != x.Length) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } double sum = 0.0; @@ -197,7 +196,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Managed if (y.Length != x.Length || y.Length != result.Length) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } for (int i = 0; i < result.Length; i++) @@ -235,7 +234,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Managed if (y.Length != x.Length || y.Length != result.Length) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } for (int i = 0; i < result.Length; i++) @@ -273,7 +272,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Managed if (y.Length != x.Length || y.Length != result.Length) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } for (int i = 0; i < result.Length; i++) @@ -311,7 +310,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Managed if (y.Length != x.Length || y.Length != result.Length) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } CommonParallel.For(0, y.Length, 4096, (a, b) => @@ -352,7 +351,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Managed if (y.Length != x.Length || y.Length != result.Length) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } CommonParallel.For(0, y.Length, 4096, (a, b) => @@ -694,12 +693,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Managed if (data.Length != order*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(data)); + throw new ArgumentException("The array arguments must have the same length.", nameof(data)); } if (ipiv.Length != order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(ipiv)); + throw new ArgumentException("The array arguments must have the same length.", nameof(ipiv)); } // Initialize the pivot matrix to the identity permutation. @@ -787,7 +786,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Managed if (a.Length != order*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(a)); + throw new ArgumentException("The array arguments must have the same length.", nameof(a)); } var ipiv = new int[order]; @@ -816,12 +815,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Managed if (a.Length != order*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(a)); + throw new ArgumentException("The array arguments must have the same length.", nameof(a)); } if (ipiv.Length != order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(ipiv)); + throw new ArgumentException("The array arguments must have the same length.", nameof(ipiv)); } var inverse = new double[a.Length]; @@ -856,17 +855,17 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Managed if (a.Length != order*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(a)); + throw new ArgumentException("The array arguments must have the same length.", nameof(a)); } if (b.Length != order*columnsOfB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (ReferenceEquals(a, b)) { - throw new ArgumentException(Resources.ArgumentReferenceDifferent); + throw new ArgumentException("Arguments must be different objects."); } var ipiv = new int[order]; @@ -904,22 +903,22 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Managed if (a.Length != order*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(a)); + throw new ArgumentException("The array arguments must have the same length.", nameof(a)); } if (ipiv.Length != order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(ipiv)); + throw new ArgumentException("The array arguments must have the same length.", nameof(ipiv)); } if (b.Length != order*columnsOfB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (ReferenceEquals(a, b)) { - throw new ArgumentException(Resources.ArgumentReferenceDifferent); + throw new ArgumentException("Arguments must be different objects."); } // Compute the column vector P*B @@ -1018,7 +1017,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Managed } else { - throw new ArgumentException(Resources.ArgumentMatrixPositiveDefinite); + throw new ArgumentException("Matrix must be positive definite."); } for (int i = ij + 1; i < order; i++) @@ -1085,12 +1084,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Managed if (b.Length != orderA*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (ReferenceEquals(a, b)) { - throw new ArgumentException(Resources.ArgumentReferenceDifferent); + throw new ArgumentException("Arguments must be different objects."); } var clone = new double[a.Length]; @@ -1121,12 +1120,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Managed if (b.Length != orderA*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (ReferenceEquals(a, b)) { - throw new ArgumentException(Resources.ArgumentReferenceDifferent); + throw new ArgumentException("Arguments must be different objects."); } CommonParallel.For(0, columnsB, (u, v) => @@ -1202,17 +1201,17 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Managed if (r.Length != rowsR*columnsR) { - throw new ArgumentException(string.Format(Resources.ArgumentArrayWrongLength, "rowsR * columnsR"), nameof(r)); + throw new ArgumentException("The given array has the wrong length. Should be rowsR * columnsR.", nameof(r)); } if (tau.Length < Math.Min(rowsR, columnsR)) { - throw new ArgumentException(string.Format(Resources.ArrayTooSmall, "min(m,n)"), nameof(tau)); + throw new ArgumentException("The given array is too small. It must be at least min(m,n) long.", nameof(tau)); } if (q.Length != rowsR*rowsR) { - throw new ArgumentException(string.Format(Resources.ArgumentArrayWrongLength, "rowsR * rowsR"), nameof(q)); + throw new ArgumentException("The given array has the wrong length. Should be rowsR * rowsR.", nameof(q)); } CommonParallel.For(0, rowsR, (a, b) => @@ -1263,17 +1262,17 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Managed if (a.Length != rowsA*columnsA) { - throw new ArgumentException(string.Format(Resources.ArgumentArrayWrongLength, "rowsR * columnsR"), nameof(a)); + throw new ArgumentException("The given array has the wrong length. Should be rowsR * columnsR.", nameof(a)); } if (tau.Length < Math.Min(rowsA, columnsA)) { - throw new ArgumentException(string.Format(Resources.ArrayTooSmall, "min(m,n)"), nameof(tau)); + throw new ArgumentException("The given array is too small. It must be at least min(m,n) long.", nameof(tau)); } if (r.Length != columnsA*columnsA) { - throw new ArgumentException(string.Format(Resources.ArgumentArrayWrongLength, "columnsA * columnsA"), nameof(r)); + throw new ArgumentException("The given array has the wrong length. Should be columnsA * columnsA.", nameof(r)); } var work = new double[rowsA*columnsA]; @@ -1454,22 +1453,22 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Managed if (a.Length != rows*columns) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(a)); + throw new ArgumentException("The array arguments must have the same length.", nameof(a)); } if (b.Length != rows*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (x.Length != columns*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(x)); + throw new ArgumentException("The array arguments must have the same length.", nameof(x)); } if (rows < columns) { - throw new ArgumentException(Resources.RowsLessThanColumns); + throw new ArgumentException("The number of rows must greater than or equal to the number of columns."); } var work = new double[rows * columns]; @@ -1529,7 +1528,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Managed if (rowsA < columnsA) { - throw new ArgumentException(Resources.RowsLessThanColumns); + throw new ArgumentException("The number of rows must greater than or equal to the number of columns."); } int rowsQ, columnsQ, rowsR, columnsR; @@ -1546,22 +1545,22 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Managed if (r.Length != rowsR*columnsR) { - throw new ArgumentException(string.Format(Resources.ArgumentArrayWrongLength, rowsR*columnsR), nameof(r)); + throw new ArgumentException($"The given array has the wrong length. Should be {rowsR * columnsR}.", nameof(r)); } if (q.Length != rowsQ*columnsQ) { - throw new ArgumentException(string.Format(Resources.ArgumentArrayWrongLength, rowsQ*columnsQ), nameof(q)); + throw new ArgumentException($"The given array has the wrong length. Should be {rowsQ * columnsQ}.", nameof(q)); } if (b.Length != rowsA*columnsB) { - throw new ArgumentException(string.Format(Resources.ArgumentArrayWrongLength, rowsA*columnsB), nameof(b)); + throw new ArgumentException($"The given array has the wrong length. Should be {rowsA * columnsB}.", nameof(b)); } if (x.Length != columnsA*columnsB) { - throw new ArgumentException(string.Format(Resources.ArgumentArrayWrongLength, columnsA*columnsB), nameof(x)); + throw new ArgumentException($"The given array has the wrong length. Should be {columnsA * columnsB}.", nameof(x)); } var sol = new double[b.Length]; @@ -1655,17 +1654,17 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Managed if (u.Length != rowsA*rowsA) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(u)); + throw new ArgumentException("The array arguments must have the same length.", nameof(u)); } if (vt.Length != columnsA*columnsA) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(vt)); + throw new ArgumentException("The array arguments must have the same length.", nameof(vt)); } if (s.Length != Math.Min(rowsA, columnsA)) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(s)); + throw new ArgumentException("The array arguments must have the same length.", nameof(s)); } var work = new double[rowsA]; @@ -2372,12 +2371,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Managed if (b.Length != rowsA*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (x.Length != columnsA*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } var s = new double[Math.Min(rowsA, columnsA)]; var u = new double[rowsA*rowsA]; @@ -2429,27 +2428,27 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Managed if (u.Length != rowsA*rowsA) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(u)); + throw new ArgumentException("The array arguments must have the same length.", nameof(u)); } if (vt.Length != columnsA*columnsA) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(vt)); + throw new ArgumentException("The array arguments must have the same length.", nameof(vt)); } if (s.Length != Math.Min(rowsA, columnsA)) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(s)); + throw new ArgumentException("The array arguments must have the same length.", nameof(s)); } if (b.Length != rowsA*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (x.Length != columnsA*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } var mn = Math.Min(rowsA, columnsA); @@ -2504,7 +2503,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Managed if (matrix.Length != order*order) { - throw new ArgumentException(String.Format(Resources.ArgumentArrayWrongLength, order*order), nameof(matrix)); + throw new ArgumentException($"The given array has the wrong length. Should be {order * order}.", nameof(matrix)); } if (matrixEv == null) @@ -2514,7 +2513,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Managed if (matrixEv.Length != order*order) { - throw new ArgumentException(String.Format(Resources.ArgumentArrayWrongLength, order*order), nameof(matrixEv)); + throw new ArgumentException($"The given array has the wrong length. Should be {order * order}.", nameof(matrixEv)); } if (vectorEv == null) @@ -2524,7 +2523,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Managed if (vectorEv.Length != order) { - throw new ArgumentException(String.Format(Resources.ArgumentArrayWrongLength, order), nameof(vectorEv)); + throw new ArgumentException($"The given array has the wrong length. Should be {order}.", nameof(vectorEv)); } if (matrixD == null) @@ -2534,7 +2533,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Managed if (matrixD.Length != order*order) { - throw new ArgumentException(String.Format(Resources.ArgumentArrayWrongLength, order*order), nameof(matrixD)); + throw new ArgumentException($"The given array has the wrong length. Should be {order * order}.", nameof(matrixD)); } var d = new double[order]; diff --git a/src/Numerics/Providers/LinearAlgebra/Managed/ManagedLinearAlgebraProvider.Single.cs b/src/Numerics/Providers/LinearAlgebra/Managed/ManagedLinearAlgebraProvider.Single.cs index d4785091..548b6aeb 100644 --- a/src/Numerics/Providers/LinearAlgebra/Managed/ManagedLinearAlgebraProvider.Single.cs +++ b/src/Numerics/Providers/LinearAlgebra/Managed/ManagedLinearAlgebraProvider.Single.cs @@ -28,7 +28,6 @@ // using System; -using MathNet.Numerics.Properties; using MathNet.Numerics.Threading; using Complex = System.Numerics.Complex; using QRMethod = MathNet.Numerics.LinearAlgebra.Factorization.QRMethod; @@ -63,7 +62,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Managed if (y.Length != x.Length) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } if (alpha == 0.0) @@ -156,7 +155,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Managed if (y.Length != x.Length) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } float sum = 0.0f; @@ -197,7 +196,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Managed if (y.Length != x.Length || y.Length != result.Length) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } for (int i = 0; i < result.Length; i++) @@ -235,7 +234,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Managed if (y.Length != x.Length || y.Length != result.Length) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } for (int i = 0; i < result.Length; i++) @@ -273,7 +272,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Managed if (y.Length != x.Length || y.Length != result.Length) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } for (int i = 0; i < result.Length; i++) @@ -311,7 +310,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Managed if (y.Length != x.Length || y.Length != result.Length) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } CommonParallel.For(0, y.Length, 4096, (a, b) => @@ -352,7 +351,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Managed if (y.Length != x.Length || y.Length != result.Length) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } CommonParallel.For(0, y.Length, 4096, (a, b) => @@ -694,12 +693,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Managed if (data.Length != order*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(data)); + throw new ArgumentException("The array arguments must have the same length.", nameof(data)); } if (ipiv.Length != order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(ipiv)); + throw new ArgumentException("The array arguments must have the same length.", nameof(ipiv)); } // Initialize the pivot matrix to the identity permutation. @@ -787,7 +786,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Managed if (a.Length != order*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(a)); + throw new ArgumentException("The array arguments must have the same length.", nameof(a)); } var ipiv = new int[order]; @@ -816,12 +815,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Managed if (a.Length != order*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(a)); + throw new ArgumentException("The array arguments must have the same length.", nameof(a)); } if (ipiv.Length != order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(ipiv)); + throw new ArgumentException("The array arguments must have the same length.", nameof(ipiv)); } var inverse = new float[a.Length]; @@ -856,17 +855,17 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Managed if (a.Length != order*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(a)); + throw new ArgumentException("The array arguments must have the same length.", nameof(a)); } if (b.Length != order*columnsOfB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (ReferenceEquals(a, b)) { - throw new ArgumentException(Resources.ArgumentReferenceDifferent); + throw new ArgumentException("Arguments must be different objects."); } var ipiv = new int[order]; @@ -904,22 +903,22 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Managed if (a.Length != order*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(a)); + throw new ArgumentException("The array arguments must have the same length.", nameof(a)); } if (ipiv.Length != order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(ipiv)); + throw new ArgumentException("The array arguments must have the same length.", nameof(ipiv)); } if (b.Length != order*columnsOfB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (ReferenceEquals(a, b)) { - throw new ArgumentException(Resources.ArgumentReferenceDifferent); + throw new ArgumentException("Arguments must be different objects."); } // Compute the column vector P*B @@ -1018,7 +1017,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Managed } else { - throw new ArgumentException(Resources.ArgumentMatrixPositiveDefinite); + throw new ArgumentException("Matrix must be positive definite."); } for (int i = ij + 1; i < order; i++) @@ -1085,12 +1084,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Managed if (b.Length != orderA*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (ReferenceEquals(a, b)) { - throw new ArgumentException(Resources.ArgumentReferenceDifferent); + throw new ArgumentException("Arguments must be different objects."); } var clone = new float[a.Length]; @@ -1121,12 +1120,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Managed if (b.Length != orderA*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (ReferenceEquals(a, b)) { - throw new ArgumentException(Resources.ArgumentReferenceDifferent); + throw new ArgumentException("Arguments must be different objects."); } CommonParallel.For(0, columnsB, (u, v) => @@ -1202,17 +1201,17 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Managed if (r.Length != rowsR*columnsR) { - throw new ArgumentException(string.Format(Resources.ArgumentArrayWrongLength, "rowsR * columnsR"), nameof(r)); + throw new ArgumentException("The given array has the wrong length. Should be rowsR * columnsR.", nameof(r)); } if (tau.Length < Math.Min(rowsR, columnsR)) { - throw new ArgumentException(string.Format(Resources.ArrayTooSmall, "min(m,n)"), nameof(tau)); + throw new ArgumentException("The given array is too small. It must be at least min(m,n) long.", nameof(tau)); } if (q.Length != rowsR*rowsR) { - throw new ArgumentException(string.Format(Resources.ArgumentArrayWrongLength, "rowsR * rowsR"), nameof(q)); + throw new ArgumentException("The given array has the wrong length. Should be rowsR * rowsR.", nameof(q)); } var work = columnsR > rowsR ? new float[rowsR*rowsR] : new float[rowsR*columnsR]; @@ -1264,17 +1263,17 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Managed if (a.Length != rowsA*columnsA) { - throw new ArgumentException(string.Format(Resources.ArgumentArrayWrongLength, "rowsR * columnsR"), nameof(a)); + throw new ArgumentException("The given array has the wrong length. Should be rowsR * columnsR.", nameof(a)); } if (tau.Length < Math.Min(rowsA, columnsA)) { - throw new ArgumentException(string.Format(Resources.ArrayTooSmall, "min(m,n)"), nameof(tau)); + throw new ArgumentException("The given array is too small. It must be at least min(m,n) long.", nameof(tau)); } if (r.Length != columnsA*columnsA) { - throw new ArgumentException(string.Format(Resources.ArgumentArrayWrongLength, "columnsA * columnsA"), nameof(r)); + throw new ArgumentException("The given array has the wrong length. Should be columnsA * columnsA.", nameof(r)); } var work = new float[rowsA*columnsA]; @@ -1457,22 +1456,22 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Managed if (a.Length != rows*columns) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(a)); + throw new ArgumentException("The array arguments must have the same length.", nameof(a)); } if (b.Length != rows*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (x.Length != columns*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(x)); + throw new ArgumentException("The array arguments must have the same length.", nameof(x)); } if (rows < columns) { - throw new ArgumentException(Resources.RowsLessThanColumns); + throw new ArgumentException("The number of rows must greater than or equal to the number of columns."); } var work = new float[rows * columns]; @@ -1532,7 +1531,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Managed if (rowsA < columnsA) { - throw new ArgumentException(Resources.RowsLessThanColumns); + throw new ArgumentException("The number of rows must greater than or equal to the number of columns."); } int rowsQ, columnsQ, rowsR, columnsR; @@ -1549,22 +1548,22 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Managed if (r.Length != rowsR*columnsR) { - throw new ArgumentException(string.Format(Resources.ArgumentArrayWrongLength, rowsR*columnsR), nameof(r)); + throw new ArgumentException($"The given array has the wrong length. Should be {rowsR * columnsR}.", nameof(r)); } if (q.Length != rowsQ*columnsQ) { - throw new ArgumentException(string.Format(Resources.ArgumentArrayWrongLength, rowsQ*columnsQ), nameof(q)); + throw new ArgumentException($"The given array has the wrong length. Should be {rowsQ * columnsQ}.", nameof(q)); } if (b.Length != rowsA*columnsB) { - throw new ArgumentException(string.Format(Resources.ArgumentArrayWrongLength, rowsA*columnsB), nameof(b)); + throw new ArgumentException($"The given array has the wrong length. Should be {rowsA * columnsB}.", nameof(b)); } if (x.Length != columnsA*columnsB) { - throw new ArgumentException(string.Format(Resources.ArgumentArrayWrongLength, columnsA*columnsB), nameof(x)); + throw new ArgumentException($"The given array has the wrong length. Should be {columnsA * columnsB}.", nameof(x)); } var sol = new float[b.Length]; @@ -1658,17 +1657,17 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Managed if (u.Length != rowsA*rowsA) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(u)); + throw new ArgumentException("The array arguments must have the same length.", nameof(u)); } if (vt.Length != columnsA*columnsA) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(vt)); + throw new ArgumentException("The array arguments must have the same length.", nameof(vt)); } if (s.Length != Math.Min(rowsA, columnsA)) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(s)); + throw new ArgumentException("The array arguments must have the same length.", nameof(s)); } var work = new float[rowsA]; @@ -2377,12 +2376,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Managed if (b.Length != rowsA*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (x.Length != columnsA*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } var s = new float[Math.Min(rowsA, columnsA)]; @@ -2435,27 +2434,27 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Managed if (u.Length != rowsA*rowsA) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(u)); + throw new ArgumentException("The array arguments must have the same length.", nameof(u)); } if (vt.Length != columnsA*columnsA) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(vt)); + throw new ArgumentException("The array arguments must have the same length.", nameof(vt)); } if (s.Length != Math.Min(rowsA, columnsA)) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(s)); + throw new ArgumentException("The array arguments must have the same length.", nameof(s)); } if (b.Length != rowsA*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (x.Length != columnsA*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } var mn = Math.Min(rowsA, columnsA); @@ -2510,7 +2509,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Managed if (matrix.Length != order*order) { - throw new ArgumentException(String.Format(Resources.ArgumentArrayWrongLength, order*order), nameof(matrix)); + throw new ArgumentException($"The given array has the wrong length. Should be {order * order}.", nameof(matrix)); } if (matrixEv == null) @@ -2520,7 +2519,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Managed if (matrixEv.Length != order*order) { - throw new ArgumentException(String.Format(Resources.ArgumentArrayWrongLength, order*order), nameof(matrixEv)); + throw new ArgumentException($"The given array has the wrong length. Should be {order * order}.", nameof(matrixEv)); } if (vectorEv == null) @@ -2530,7 +2529,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Managed if (vectorEv.Length != order) { - throw new ArgumentException(String.Format(Resources.ArgumentArrayWrongLength, order), nameof(vectorEv)); + throw new ArgumentException($"The given array has the wrong length. Should be {order}.", nameof(vectorEv)); } if (matrixD == null) @@ -2540,7 +2539,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Managed if (matrixD.Length != order*order) { - throw new ArgumentException(String.Format(Resources.ArgumentArrayWrongLength, order*order), nameof(matrixD)); + throw new ArgumentException($"The given array has the wrong length. Should be {order * order}.", nameof(matrixD)); } var d = new float[order]; diff --git a/src/Numerics/Providers/LinearAlgebra/ManagedReference/ManagedReferenceLinearAlgebraProvider.Complex.cs b/src/Numerics/Providers/LinearAlgebra/ManagedReference/ManagedReferenceLinearAlgebraProvider.Complex.cs index d5380a6a..f6896986 100644 --- a/src/Numerics/Providers/LinearAlgebra/ManagedReference/ManagedReferenceLinearAlgebraProvider.Complex.cs +++ b/src/Numerics/Providers/LinearAlgebra/ManagedReference/ManagedReferenceLinearAlgebraProvider.Complex.cs @@ -28,7 +28,6 @@ // using System; -using MathNet.Numerics.Properties; using MathNet.Numerics.Threading; using Complex = System.Numerics.Complex; using QRMethod = MathNet.Numerics.LinearAlgebra.Factorization.QRMethod; @@ -62,7 +61,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.ManagedReference if (y.Length != x.Length) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } if (alpha.IsZero()) @@ -167,7 +166,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.ManagedReference if (y.Length != x.Length) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } var dot = Complex.Zero; @@ -208,7 +207,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.ManagedReference if (y.Length != x.Length || y.Length != result.Length) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } CommonParallel.For(0, y.Length, 4096, (a, b) => @@ -249,7 +248,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.ManagedReference if (y.Length != x.Length || y.Length != result.Length) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } CommonParallel.For(0, y.Length, 4096, (a, b) => @@ -290,7 +289,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.ManagedReference if (y.Length != x.Length || y.Length != result.Length) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } CommonParallel.For(0, y.Length, 4096, (a, b) => @@ -331,7 +330,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.ManagedReference if (y.Length != x.Length || y.Length != result.Length) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } CommonParallel.For(0, y.Length, 4096, (a, b) => @@ -372,7 +371,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.ManagedReference if (y.Length != x.Length || y.Length != result.Length) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } CommonParallel.For(0, y.Length, 4096, (a, b) => @@ -948,12 +947,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.ManagedReference if (data.Length != order*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(data)); + throw new ArgumentException("The array arguments must have the same length.", nameof(data)); } if (ipiv.Length != order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(ipiv)); + throw new ArgumentException("The array arguments must have the same length.", nameof(ipiv)); } // Initialize the pivot matrix to the identity permutation. @@ -1041,7 +1040,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.ManagedReference if (a.Length != order*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(a)); + throw new ArgumentException("The array arguments must have the same length.", nameof(a)); } var ipiv = new int[order]; @@ -1070,12 +1069,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.ManagedReference if (a.Length != order*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(a)); + throw new ArgumentException("The array arguments must have the same length.", nameof(a)); } if (ipiv.Length != order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(ipiv)); + throw new ArgumentException("The array arguments must have the same length.", nameof(ipiv)); } var inverse = new Complex[a.Length]; @@ -1110,17 +1109,17 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.ManagedReference if (a.Length != order*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(a)); + throw new ArgumentException("The array arguments must have the same length.", nameof(a)); } if (b.Length != order*columnsOfB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (ReferenceEquals(a, b)) { - throw new ArgumentException(Resources.ArgumentReferenceDifferent); + throw new ArgumentException("Arguments must be different objects."); } var ipiv = new int[order]; @@ -1158,22 +1157,22 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.ManagedReference if (a.Length != order*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(a)); + throw new ArgumentException("The array arguments must have the same length.", nameof(a)); } if (ipiv.Length != order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(ipiv)); + throw new ArgumentException("The array arguments must have the same length.", nameof(ipiv)); } if (b.Length != order*columnsOfB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (ReferenceEquals(a, b)) { - throw new ArgumentException(Resources.ArgumentReferenceDifferent); + throw new ArgumentException("Arguments must be different objects."); } // Compute the column vector P*B @@ -1272,7 +1271,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.ManagedReference } else { - throw new ArgumentException(Resources.ArgumentMatrixPositiveDefinite); + throw new ArgumentException("Matrix must be positive definite."); } for (var i = ij + 1; i < order; i++) @@ -1339,12 +1338,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.ManagedReference if (b.Length != orderA*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (ReferenceEquals(a, b)) { - throw new ArgumentException(Resources.ArgumentReferenceDifferent); + throw new ArgumentException("Arguments must be different objects."); } var clone = new Complex[a.Length]; @@ -1375,12 +1374,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.ManagedReference if (b.Length != orderA*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (ReferenceEquals(a, b)) { - throw new ArgumentException(Resources.ArgumentReferenceDifferent); + throw new ArgumentException("Arguments must be different objects."); } CommonParallel.For(0, columnsB, (u, v) => @@ -1456,17 +1455,17 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.ManagedReference if (r.Length != rowsR*columnsR) { - throw new ArgumentException(string.Format(Resources.ArgumentArrayWrongLength, "rowsR * columnsR"), nameof(r)); + throw new ArgumentException("The given array has the wrong length. Should be rowsR * columnsR.", nameof(r)); } if (tau.Length < Math.Min(rowsR, columnsR)) { - throw new ArgumentException(string.Format(Resources.ArrayTooSmall, "min(m,n)"), nameof(tau)); + throw new ArgumentException("The given array is too small. It must be at least min(m,n) long.", nameof(tau)); } if (q.Length != rowsR*rowsR) { - throw new ArgumentException(string.Format(Resources.ArgumentArrayWrongLength, "rowsR * rowsR"), nameof(q)); + throw new ArgumentException("The given array has the wrong length. Should be rowsR * rowsR.", nameof(q)); } var work = columnsR > rowsR ? new Complex[rowsR*rowsR] : new Complex[rowsR*columnsR]; @@ -1518,17 +1517,17 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.ManagedReference if (a.Length != rowsA*columnsA) { - throw new ArgumentException(string.Format(Resources.ArgumentArrayWrongLength, "rowsR * columnsR"), nameof(a)); + throw new ArgumentException("The given array has the wrong length. Should be rowsR * columnsR.", nameof(a)); } if (tau.Length < Math.Min(rowsA, columnsA)) { - throw new ArgumentException(string.Format(Resources.ArrayTooSmall, "min(m,n)"), nameof(tau)); + throw new ArgumentException("The given array is too small. It must be at least min(m,n) long.", nameof(tau)); } if (r.Length != columnsA*columnsA) { - throw new ArgumentException(string.Format(Resources.ArgumentArrayWrongLength, "columnsA * columnsA"), nameof(r)); + throw new ArgumentException("The given array has the wrong length. Should be columnsA * columnsA.", nameof(r)); } var work = new Complex[rowsA*columnsA]; @@ -1711,22 +1710,22 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.ManagedReference if (a.Length != rows*columns) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(a)); + throw new ArgumentException("The array arguments must have the same length.", nameof(a)); } if (b.Length != rows*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (rows < columns) { - throw new ArgumentException(Resources.RowsLessThanColumns); + throw new ArgumentException("The number of rows must greater than or equal to the number of columns."); } if (x.Length != columns*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(x)); + throw new ArgumentException("The array arguments must have the same length.", nameof(x)); } var work = new Complex[rows * columns]; @@ -1786,7 +1785,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.ManagedReference if (rowsA < columnsA) { - throw new ArgumentException(Resources.RowsLessThanColumns); + throw new ArgumentException("The number of rows must greater than or equal to the number of columns."); } int rowsQ, columnsQ, rowsR, columnsR; @@ -1803,22 +1802,22 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.ManagedReference if (r.Length != rowsR*columnsR) { - throw new ArgumentException(string.Format(Resources.ArgumentArrayWrongLength, rowsR*columnsR), nameof(r)); + throw new ArgumentException($"The given array has the wrong length. Should be {rowsR * columnsR}.", nameof(r)); } if (q.Length != rowsQ*columnsQ) { - throw new ArgumentException(string.Format(Resources.ArgumentArrayWrongLength, rowsQ*columnsQ), nameof(q)); + throw new ArgumentException($"The given array has the wrong length. Should be {rowsQ * columnsQ}.", nameof(q)); } if (b.Length != rowsA*columnsB) { - throw new ArgumentException(string.Format(Resources.ArgumentArrayWrongLength, rowsA*columnsB), nameof(b)); + throw new ArgumentException($"The given array has the wrong length. Should be {rowsA * columnsB}.", nameof(b)); } if (x.Length != columnsA*columnsB) { - throw new ArgumentException(string.Format(Resources.ArgumentArrayWrongLength, columnsA*columnsB), nameof(x)); + throw new ArgumentException($"The given array has the wrong length. Should be {columnsA * columnsB}.", nameof(x)); } var sol = new Complex[b.Length]; @@ -1912,17 +1911,17 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.ManagedReference if (u.Length != rowsA*rowsA) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(u)); + throw new ArgumentException("The array arguments must have the same length.", nameof(u)); } if (vt.Length != columnsA*columnsA) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(vt)); + throw new ArgumentException("The array arguments must have the same length.", nameof(vt)); } if (s.Length != Math.Min(rowsA, columnsA)) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(s)); + throw new ArgumentException("The array arguments must have the same length.", nameof(s)); } var work = new Complex[rowsA]; @@ -2568,12 +2567,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.ManagedReference if (b.Length != rowsA*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (x.Length != columnsA*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } var s = new Complex[Math.Min(rowsA, columnsA)]; @@ -2626,27 +2625,27 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.ManagedReference if (u.Length != rowsA*rowsA) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(u)); + throw new ArgumentException("The array arguments must have the same length.", nameof(u)); } if (vt.Length != columnsA*columnsA) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(vt)); + throw new ArgumentException("The array arguments must have the same length.", nameof(vt)); } if (s.Length != Math.Min(rowsA, columnsA)) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(s)); + throw new ArgumentException("The array arguments must have the same length.", nameof(s)); } if (b.Length != rowsA*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (x.Length != columnsA*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } var mn = Math.Min(rowsA, columnsA); @@ -2701,7 +2700,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.ManagedReference if (matrix.Length != order*order) { - throw new ArgumentException(String.Format(Resources.ArgumentArrayWrongLength, order*order), nameof(matrix)); + throw new ArgumentException($"The given array has the wrong length. Should be {order * order}.", nameof(matrix)); } if (matrixEv == null) @@ -2711,7 +2710,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.ManagedReference if (matrixEv.Length != order*order) { - throw new ArgumentException(String.Format(Resources.ArgumentArrayWrongLength, order*order), nameof(matrixEv)); + throw new ArgumentException($"The given array has the wrong length. Should be {order * order}.", nameof(matrixEv)); } if (vectorEv == null) @@ -2721,7 +2720,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.ManagedReference if (vectorEv.Length != order) { - throw new ArgumentException(String.Format(Resources.ArgumentArrayWrongLength, order), nameof(vectorEv)); + throw new ArgumentException($"The given array has the wrong length. Should be {order}.", nameof(vectorEv)); } if (matrixD == null) @@ -2731,7 +2730,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.ManagedReference if (matrixD.Length != order*order) { - throw new ArgumentException(String.Format(Resources.ArgumentArrayWrongLength, order*order), nameof(matrixD)); + throw new ArgumentException($"The given array has the wrong length. Should be {order * order}.", nameof(matrixD)); } var matrixCopy = new Complex[matrix.Length]; Array.Copy(matrix, 0, matrixCopy, 0, matrix.Length); diff --git a/src/Numerics/Providers/LinearAlgebra/ManagedReference/ManagedReferenceLinearAlgebraProvider.Complex32.cs b/src/Numerics/Providers/LinearAlgebra/ManagedReference/ManagedReferenceLinearAlgebraProvider.Complex32.cs index ca19ab35..50938907 100644 --- a/src/Numerics/Providers/LinearAlgebra/ManagedReference/ManagedReferenceLinearAlgebraProvider.Complex32.cs +++ b/src/Numerics/Providers/LinearAlgebra/ManagedReference/ManagedReferenceLinearAlgebraProvider.Complex32.cs @@ -28,7 +28,6 @@ // using System; -using MathNet.Numerics.Properties; using MathNet.Numerics.Threading; using Complex = System.Numerics.Complex; using QRMethod = MathNet.Numerics.LinearAlgebra.Factorization.QRMethod; @@ -62,7 +61,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.ManagedReference if (y.Length != x.Length) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } if (alpha.IsZero()) @@ -168,7 +167,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.ManagedReference if (y.Length != x.Length) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } var d = new Complex32(0.0F, 0.0F); @@ -210,7 +209,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.ManagedReference if (y.Length != x.Length || y.Length != result.Length) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } CommonParallel.For(0, y.Length, 4096, (a, b) => @@ -251,7 +250,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.ManagedReference if (y.Length != x.Length || y.Length != result.Length) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } CommonParallel.For(0, y.Length, 4096, (a, b) => @@ -292,7 +291,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.ManagedReference if (y.Length != x.Length || y.Length != result.Length) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } CommonParallel.For(0, y.Length, 4096, (a, b) => @@ -333,7 +332,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.ManagedReference if (y.Length != x.Length || y.Length != result.Length) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } CommonParallel.For(0, y.Length, 4096, (a, b) => @@ -374,7 +373,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.ManagedReference if (y.Length != x.Length || y.Length != result.Length) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } CommonParallel.For(0, y.Length, 4096, (a, b) => @@ -949,12 +948,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.ManagedReference if (data.Length != order*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(data)); + throw new ArgumentException("The array arguments must have the same length.", nameof(data)); } if (ipiv.Length != order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(ipiv)); + throw new ArgumentException("The array arguments must have the same length.", nameof(ipiv)); } // Initialize the pivot matrix to the identity permutation. @@ -1042,7 +1041,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.ManagedReference if (a.Length != order*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(a)); + throw new ArgumentException("The array arguments must have the same length.", nameof(a)); } var ipiv = new int[order]; @@ -1071,12 +1070,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.ManagedReference if (a.Length != order*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(a)); + throw new ArgumentException("The array arguments must have the same length.", nameof(a)); } if (ipiv.Length != order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(ipiv)); + throw new ArgumentException("The array arguments must have the same length.", nameof(ipiv)); } var inverse = new Complex32[a.Length]; @@ -1111,17 +1110,17 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.ManagedReference if (a.Length != order*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(a)); + throw new ArgumentException("The array arguments must have the same length.", nameof(a)); } if (b.Length != order*columnsOfB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (ReferenceEquals(a, b)) { - throw new ArgumentException(Resources.ArgumentReferenceDifferent); + throw new ArgumentException("Arguments must be different objects."); } var ipiv = new int[order]; @@ -1159,22 +1158,22 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.ManagedReference if (a.Length != order*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(a)); + throw new ArgumentException("The array arguments must have the same length.", nameof(a)); } if (ipiv.Length != order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(ipiv)); + throw new ArgumentException("The array arguments must have the same length.", nameof(ipiv)); } if (b.Length != order*columnsOfB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (ReferenceEquals(a, b)) { - throw new ArgumentException(Resources.ArgumentReferenceDifferent); + throw new ArgumentException("Arguments must be different objects."); } // Compute the column vector P*B @@ -1273,7 +1272,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.ManagedReference } else { - throw new ArgumentException(Resources.ArgumentMatrixPositiveDefinite); + throw new ArgumentException("Matrix must be positive definite."); } for (var i = ij + 1; i < order; i++) @@ -1340,12 +1339,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.ManagedReference if (b.Length != orderA*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (ReferenceEquals(a, b)) { - throw new ArgumentException(Resources.ArgumentReferenceDifferent); + throw new ArgumentException("Arguments must be different objects."); } var clone = new Complex32[a.Length]; @@ -1376,12 +1375,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.ManagedReference if (b.Length != orderA*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (ReferenceEquals(a, b)) { - throw new ArgumentException(Resources.ArgumentReferenceDifferent); + throw new ArgumentException("Arguments must be different objects."); } CommonParallel.For(0, columnsB, (u, v) => @@ -1457,17 +1456,17 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.ManagedReference if (r.Length != rowsR*columnsR) { - throw new ArgumentException(string.Format(Resources.ArgumentArrayWrongLength, "rowsR * columnsR"), nameof(r)); + throw new ArgumentException("The given array has the wrong length. Should be rowsR * columnsR.", nameof(r)); } if (tau.Length < Math.Min(rowsR, columnsR)) { - throw new ArgumentException(string.Format(Resources.ArrayTooSmall, "min(m,n)"), nameof(tau)); + throw new ArgumentException("The given array is too small. It must be at least min(m,n) long.", nameof(tau)); } if (q.Length != rowsR*rowsR) { - throw new ArgumentException(string.Format(Resources.ArgumentArrayWrongLength, "rowsR * rowsR"), nameof(q)); + throw new ArgumentException("The given array has the wrong length. Should be rowsR * rowsR.", nameof(q)); } var work = columnsR > rowsR ? new Complex32[rowsR*rowsR] : new Complex32[rowsR*columnsR]; @@ -1519,17 +1518,17 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.ManagedReference if (a.Length != rowsA*columnsA) { - throw new ArgumentException(string.Format(Resources.ArgumentArrayWrongLength, "rowsR * columnsR"), nameof(a)); + throw new ArgumentException("The given array has the wrong length. Should be rowsR * columnsR.", nameof(a)); } if (tau.Length < Math.Min(rowsA, columnsA)) { - throw new ArgumentException(string.Format(Resources.ArrayTooSmall, "min(m,n)"), nameof(tau)); + throw new ArgumentException("The given array is too small. It must be at least min(m,n) long.", nameof(tau)); } if (r.Length != columnsA*columnsA) { - throw new ArgumentException(string.Format(Resources.ArgumentArrayWrongLength, "columnsA * columnsA"), nameof(r)); + throw new ArgumentException("The given array has the wrong length. Should be columnsA * columnsA.", nameof(r)); } var work = new Complex32[rowsA*columnsA]; @@ -1710,22 +1709,22 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.ManagedReference if (a.Length != rows*columns) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(a)); + throw new ArgumentException("The array arguments must have the same length.", nameof(a)); } if (b.Length != rows*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (x.Length != columns*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(x)); + throw new ArgumentException("The array arguments must have the same length.", nameof(x)); } if (rows < columns) { - throw new ArgumentException(Resources.RowsLessThanColumns); + throw new ArgumentException("The number of rows must greater than or equal to the number of columns."); } var work = new Complex32[rows * columns]; @@ -1785,7 +1784,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.ManagedReference if (rowsA < columnsA) { - throw new ArgumentException(Resources.RowsLessThanColumns); + throw new ArgumentException("The number of rows must greater than or equal to the number of columns."); } int rowsQ, columnsQ, rowsR, columnsR; @@ -1802,22 +1801,22 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.ManagedReference if (r.Length != rowsR*columnsR) { - throw new ArgumentException(string.Format(Resources.ArgumentArrayWrongLength, rowsR*columnsR), nameof(r)); + throw new ArgumentException($"The given array has the wrong length. Should be {rowsR * columnsR}.", nameof(r)); } if (q.Length != rowsQ*columnsQ) { - throw new ArgumentException(string.Format(Resources.ArgumentArrayWrongLength, rowsQ*columnsQ), nameof(q)); + throw new ArgumentException($"The given array has the wrong length. Should be {rowsQ * columnsQ}.", nameof(q)); } if (b.Length != rowsA*columnsB) { - throw new ArgumentException(string.Format(Resources.ArgumentArrayWrongLength, rowsA*columnsB), nameof(b)); + throw new ArgumentException($"The given array has the wrong length. Should be {rowsA * columnsB}.", nameof(b)); } if (x.Length != columnsA*columnsB) { - throw new ArgumentException(string.Format(Resources.ArgumentArrayWrongLength, columnsA*columnsB), nameof(x)); + throw new ArgumentException($"The given array has the wrong length. Should be {columnsA * columnsB}.", nameof(x)); } var sol = new Complex32[b.Length]; @@ -1911,17 +1910,17 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.ManagedReference if (u.Length != rowsA*rowsA) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(u)); + throw new ArgumentException("The array arguments must have the same length.", nameof(u)); } if (vt.Length != columnsA*columnsA) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(vt)); + throw new ArgumentException("The array arguments must have the same length.", nameof(vt)); } if (s.Length != Math.Min(rowsA, columnsA)) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(s)); + throw new ArgumentException("The array arguments must have the same length.", nameof(s)); } var work = new Complex32[rowsA]; @@ -2567,12 +2566,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.ManagedReference if (b.Length != rowsA*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (x.Length != columnsA*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } var s = new Complex32[Math.Min(rowsA, columnsA)]; @@ -2625,27 +2624,27 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.ManagedReference if (u.Length != rowsA*rowsA) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(u)); + throw new ArgumentException("The array arguments must have the same length.", nameof(u)); } if (vt.Length != columnsA*columnsA) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(vt)); + throw new ArgumentException("The array arguments must have the same length.", nameof(vt)); } if (s.Length != Math.Min(rowsA, columnsA)) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(s)); + throw new ArgumentException("The array arguments must have the same length.", nameof(s)); } if (b.Length != rowsA*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (x.Length != columnsA*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } var mn = Math.Min(rowsA, columnsA); @@ -2700,7 +2699,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.ManagedReference if (matrix.Length != order*order) { - throw new ArgumentException(String.Format(Resources.ArgumentArrayWrongLength, order*order), nameof(matrix)); + throw new ArgumentException($"The given array has the wrong length. Should be {order * order}.", nameof(matrix)); } if (matrixEv == null) @@ -2710,7 +2709,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.ManagedReference if (matrixEv.Length != order*order) { - throw new ArgumentException(String.Format(Resources.ArgumentArrayWrongLength, order*order), nameof(matrixEv)); + throw new ArgumentException($"The given array has the wrong length. Should be {order * order}.", nameof(matrixEv)); } if (vectorEv == null) @@ -2720,7 +2719,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.ManagedReference if (vectorEv.Length != order) { - throw new ArgumentException(String.Format(Resources.ArgumentArrayWrongLength, order), nameof(vectorEv)); + throw new ArgumentException($"The given array has the wrong length. Should be {order}.", nameof(vectorEv)); } if (matrixD == null) @@ -2730,7 +2729,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.ManagedReference if (matrixD.Length != order*order) { - throw new ArgumentException(String.Format(Resources.ArgumentArrayWrongLength, order*order), nameof(matrixD)); + throw new ArgumentException($"The given array has the wrong length. Should be {order * order}.", nameof(matrixD)); } var matrixCopy = new Complex32[matrix.Length]; diff --git a/src/Numerics/Providers/LinearAlgebra/ManagedReference/ManagedReferenceLinearAlgebraProvider.Double.cs b/src/Numerics/Providers/LinearAlgebra/ManagedReference/ManagedReferenceLinearAlgebraProvider.Double.cs index a7969245..115b6ee4 100644 --- a/src/Numerics/Providers/LinearAlgebra/ManagedReference/ManagedReferenceLinearAlgebraProvider.Double.cs +++ b/src/Numerics/Providers/LinearAlgebra/ManagedReference/ManagedReferenceLinearAlgebraProvider.Double.cs @@ -28,7 +28,6 @@ // using System; -using MathNet.Numerics.Properties; using MathNet.Numerics.Threading; using Complex = System.Numerics.Complex; using QRMethod = MathNet.Numerics.LinearAlgebra.Factorization.QRMethod; @@ -62,7 +61,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.ManagedReference if (y.Length != x.Length) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } if (alpha == 0.0) @@ -164,7 +163,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.ManagedReference if (y.Length != x.Length) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } var sum = 0.0; @@ -206,7 +205,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.ManagedReference if (y.Length != x.Length || y.Length != result.Length) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } CommonParallel.For(0, y.Length, 4096, (a, b) => @@ -247,7 +246,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.ManagedReference if (y.Length != x.Length || y.Length != result.Length) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } CommonParallel.For(0, y.Length, 4096, (a, b) => @@ -288,7 +287,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.ManagedReference if (y.Length != x.Length || y.Length != result.Length) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } CommonParallel.For(0, y.Length, 4096, (a, b) => @@ -329,7 +328,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.ManagedReference if (y.Length != x.Length || y.Length != result.Length) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } CommonParallel.For(0, y.Length, 4096, (a, b) => @@ -370,7 +369,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.ManagedReference if (y.Length != x.Length || y.Length != result.Length) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } CommonParallel.For(0, y.Length, 4096, (a, b) => @@ -837,12 +836,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.ManagedReference if (data.Length != order*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(data)); + throw new ArgumentException("The array arguments must have the same length.", nameof(data)); } if (ipiv.Length != order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(ipiv)); + throw new ArgumentException("The array arguments must have the same length.", nameof(ipiv)); } // Initialize the pivot matrix to the identity permutation. @@ -930,7 +929,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.ManagedReference if (a.Length != order*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(a)); + throw new ArgumentException("The array arguments must have the same length.", nameof(a)); } var ipiv = new int[order]; @@ -959,12 +958,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.ManagedReference if (a.Length != order*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(a)); + throw new ArgumentException("The array arguments must have the same length.", nameof(a)); } if (ipiv.Length != order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(ipiv)); + throw new ArgumentException("The array arguments must have the same length.", nameof(ipiv)); } var inverse = new double[a.Length]; @@ -999,17 +998,17 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.ManagedReference if (a.Length != order*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(a)); + throw new ArgumentException("The array arguments must have the same length.", nameof(a)); } if (b.Length != order*columnsOfB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (ReferenceEquals(a, b)) { - throw new ArgumentException(Resources.ArgumentReferenceDifferent); + throw new ArgumentException("Arguments must be different objects."); } var ipiv = new int[order]; @@ -1047,22 +1046,22 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.ManagedReference if (a.Length != order*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(a)); + throw new ArgumentException("The array arguments must have the same length.", nameof(a)); } if (ipiv.Length != order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(ipiv)); + throw new ArgumentException("The array arguments must have the same length.", nameof(ipiv)); } if (b.Length != order*columnsOfB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (ReferenceEquals(a, b)) { - throw new ArgumentException(Resources.ArgumentReferenceDifferent); + throw new ArgumentException("Arguments must be different objects."); } // Compute the column vector P*B @@ -1161,7 +1160,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.ManagedReference } else { - throw new ArgumentException(Resources.ArgumentMatrixPositiveDefinite); + throw new ArgumentException("Matrix must be positive definite."); } for (int i = ij + 1; i < order; i++) @@ -1228,12 +1227,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.ManagedReference if (b.Length != orderA*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (ReferenceEquals(a, b)) { - throw new ArgumentException(Resources.ArgumentReferenceDifferent); + throw new ArgumentException("Arguments must be different objects."); } var clone = new double[a.Length]; @@ -1264,12 +1263,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.ManagedReference if (b.Length != orderA*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (ReferenceEquals(a, b)) { - throw new ArgumentException(Resources.ArgumentReferenceDifferent); + throw new ArgumentException("Arguments must be different objects."); } CommonParallel.For(0, columnsB, (u, v) => @@ -1345,17 +1344,17 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.ManagedReference if (r.Length != rowsR*columnsR) { - throw new ArgumentException(string.Format(Resources.ArgumentArrayWrongLength, "rowsR * columnsR"), nameof(r)); + throw new ArgumentException("The given array has the wrong length. Should be rowsR * columnsR.", nameof(r)); } if (tau.Length < Math.Min(rowsR, columnsR)) { - throw new ArgumentException(string.Format(Resources.ArrayTooSmall, "min(m,n)"), nameof(tau)); + throw new ArgumentException("The given array is too small. It must be at least min(m,n) long.", nameof(tau)); } if (q.Length != rowsR*rowsR) { - throw new ArgumentException(string.Format(Resources.ArgumentArrayWrongLength, "rowsR * rowsR"), nameof(q)); + throw new ArgumentException("The given array has the wrong length. Should be rowsR * rowsR.", nameof(q)); } CommonParallel.For(0, rowsR, (a, b) => @@ -1406,17 +1405,17 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.ManagedReference if (a.Length != rowsA*columnsA) { - throw new ArgumentException(string.Format(Resources.ArgumentArrayWrongLength, "rowsR * columnsR"), nameof(a)); + throw new ArgumentException("The given array has the wrong length. Should be rowsR * columnsR.", nameof(a)); } if (tau.Length < Math.Min(rowsA, columnsA)) { - throw new ArgumentException(string.Format(Resources.ArrayTooSmall, "min(m,n)"), nameof(tau)); + throw new ArgumentException("The given array is too small. It must be at least min(m,n) long.", nameof(tau)); } if (r.Length != columnsA*columnsA) { - throw new ArgumentException(string.Format(Resources.ArgumentArrayWrongLength, "columnsA * columnsA"), nameof(r)); + throw new ArgumentException("The given array has the wrong length. Should be columnsA * columnsA.", nameof(r)); } var work = new double[rowsA*columnsA]; @@ -1597,22 +1596,22 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.ManagedReference if (a.Length != rows*columns) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(a)); + throw new ArgumentException("The array arguments must have the same length.", nameof(a)); } if (b.Length != rows*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (x.Length != columns*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(x)); + throw new ArgumentException("The array arguments must have the same length.", nameof(x)); } if (rows < columns) { - throw new ArgumentException(Resources.RowsLessThanColumns); + throw new ArgumentException("The number of rows must greater than or equal to the number of columns."); } var work = new double[rows * columns]; @@ -1672,7 +1671,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.ManagedReference if (rowsA < columnsA) { - throw new ArgumentException(Resources.RowsLessThanColumns); + throw new ArgumentException("The number of rows must greater than or equal to the number of columns."); } int rowsQ, columnsQ, rowsR, columnsR; @@ -1689,22 +1688,22 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.ManagedReference if (r.Length != rowsR*columnsR) { - throw new ArgumentException(string.Format(Resources.ArgumentArrayWrongLength, rowsR*columnsR), nameof(r)); + throw new ArgumentException($"The given array has the wrong length. Should be {rowsR * columnsR}.", nameof(r)); } if (q.Length != rowsQ*columnsQ) { - throw new ArgumentException(string.Format(Resources.ArgumentArrayWrongLength, rowsQ*columnsQ), nameof(q)); + throw new ArgumentException($"The given array has the wrong length. Should be {rowsQ * columnsQ}.", nameof(q)); } if (b.Length != rowsA*columnsB) { - throw new ArgumentException(string.Format(Resources.ArgumentArrayWrongLength, rowsA*columnsB), nameof(b)); + throw new ArgumentException($"The given array has the wrong length. Should be {rowsA * columnsB}.", nameof(b)); } if (x.Length != columnsA*columnsB) { - throw new ArgumentException(string.Format(Resources.ArgumentArrayWrongLength, columnsA*columnsB), nameof(x)); + throw new ArgumentException($"The given array has the wrong length. Should be {columnsA * columnsB}.", nameof(x)); } var sol = new double[b.Length]; @@ -1798,17 +1797,17 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.ManagedReference if (u.Length != rowsA*rowsA) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(u)); + throw new ArgumentException("The array arguments must have the same length.", nameof(u)); } if (vt.Length != columnsA*columnsA) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(vt)); + throw new ArgumentException("The array arguments must have the same length.", nameof(vt)); } if (s.Length != Math.Min(rowsA, columnsA)) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(s)); + throw new ArgumentException("The array arguments must have the same length.", nameof(s)); } var work = new double[rowsA]; @@ -2515,12 +2514,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.ManagedReference if (b.Length != rowsA*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (x.Length != columnsA*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } var s = new double[Math.Min(rowsA, columnsA)]; var u = new double[rowsA*rowsA]; @@ -2572,27 +2571,27 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.ManagedReference if (u.Length != rowsA*rowsA) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(u)); + throw new ArgumentException("The array arguments must have the same length.", nameof(u)); } if (vt.Length != columnsA*columnsA) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(vt)); + throw new ArgumentException("The array arguments must have the same length.", nameof(vt)); } if (s.Length != Math.Min(rowsA, columnsA)) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(s)); + throw new ArgumentException("The array arguments must have the same length.", nameof(s)); } if (b.Length != rowsA*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (x.Length != columnsA*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } var mn = Math.Min(rowsA, columnsA); @@ -2647,7 +2646,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.ManagedReference if (matrix.Length != order*order) { - throw new ArgumentException(String.Format(Resources.ArgumentArrayWrongLength, order*order), nameof(matrix)); + throw new ArgumentException($"The given array has the wrong length. Should be {order * order}.", nameof(matrix)); } if (matrixEv == null) @@ -2657,7 +2656,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.ManagedReference if (matrixEv.Length != order*order) { - throw new ArgumentException(String.Format(Resources.ArgumentArrayWrongLength, order*order), nameof(matrixEv)); + throw new ArgumentException($"The given array has the wrong length. Should be {order * order}.", nameof(matrixEv)); } if (vectorEv == null) @@ -2667,7 +2666,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.ManagedReference if (vectorEv.Length != order) { - throw new ArgumentException(String.Format(Resources.ArgumentArrayWrongLength, order), nameof(vectorEv)); + throw new ArgumentException($"The given array has the wrong length. Should be {order}.", nameof(vectorEv)); } if (matrixD == null) @@ -2677,7 +2676,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.ManagedReference if (matrixD.Length != order*order) { - throw new ArgumentException(String.Format(Resources.ArgumentArrayWrongLength, order*order), nameof(matrixD)); + throw new ArgumentException($"The given array has the wrong length. Should be {order * order}.", nameof(matrixD)); } var d = new double[order]; diff --git a/src/Numerics/Providers/LinearAlgebra/ManagedReference/ManagedReferenceLinearAlgebraProvider.Single.cs b/src/Numerics/Providers/LinearAlgebra/ManagedReference/ManagedReferenceLinearAlgebraProvider.Single.cs index c21e7520..6a1a6a41 100644 --- a/src/Numerics/Providers/LinearAlgebra/ManagedReference/ManagedReferenceLinearAlgebraProvider.Single.cs +++ b/src/Numerics/Providers/LinearAlgebra/ManagedReference/ManagedReferenceLinearAlgebraProvider.Single.cs @@ -28,7 +28,6 @@ // using System; -using MathNet.Numerics.Properties; using MathNet.Numerics.Threading; using Complex = System.Numerics.Complex; using QRMethod = MathNet.Numerics.LinearAlgebra.Factorization.QRMethod; @@ -62,7 +61,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.ManagedReference if (y.Length != x.Length) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } if (alpha == 0.0) @@ -164,7 +163,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.ManagedReference if (y.Length != x.Length) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } var sum = 0.0f; @@ -206,7 +205,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.ManagedReference if (y.Length != x.Length || y.Length != result.Length) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } CommonParallel.For(0, y.Length, 4096, (a, b) => @@ -247,7 +246,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.ManagedReference if (y.Length != x.Length || y.Length != result.Length) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } CommonParallel.For(0, y.Length, 4096, (a, b) => @@ -288,7 +287,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.ManagedReference if (y.Length != x.Length || y.Length != result.Length) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } CommonParallel.For(0, y.Length, 4096, (a, b) => @@ -329,7 +328,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.ManagedReference if (y.Length != x.Length || y.Length != result.Length) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } CommonParallel.For(0, y.Length, 4096, (a, b) => @@ -370,7 +369,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.ManagedReference if (y.Length != x.Length || y.Length != result.Length) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } CommonParallel.For(0, y.Length, 4096, (a, b) => @@ -837,12 +836,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.ManagedReference if (data.Length != order*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(data)); + throw new ArgumentException("The array arguments must have the same length.", nameof(data)); } if (ipiv.Length != order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(ipiv)); + throw new ArgumentException("The array arguments must have the same length.", nameof(ipiv)); } // Initialize the pivot matrix to the identity permutation. @@ -930,7 +929,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.ManagedReference if (a.Length != order*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(a)); + throw new ArgumentException("The array arguments must have the same length.", nameof(a)); } var ipiv = new int[order]; @@ -959,12 +958,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.ManagedReference if (a.Length != order*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(a)); + throw new ArgumentException("The array arguments must have the same length.", nameof(a)); } if (ipiv.Length != order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(ipiv)); + throw new ArgumentException("The array arguments must have the same length.", nameof(ipiv)); } var inverse = new float[a.Length]; @@ -999,17 +998,17 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.ManagedReference if (a.Length != order*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(a)); + throw new ArgumentException("The array arguments must have the same length.", nameof(a)); } if (b.Length != order*columnsOfB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (ReferenceEquals(a, b)) { - throw new ArgumentException(Resources.ArgumentReferenceDifferent); + throw new ArgumentException("Arguments must be different objects."); } var ipiv = new int[order]; @@ -1047,22 +1046,22 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.ManagedReference if (a.Length != order*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(a)); + throw new ArgumentException("The array arguments must have the same length.", nameof(a)); } if (ipiv.Length != order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(ipiv)); + throw new ArgumentException("The array arguments must have the same length.", nameof(ipiv)); } if (b.Length != order*columnsOfB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (ReferenceEquals(a, b)) { - throw new ArgumentException(Resources.ArgumentReferenceDifferent); + throw new ArgumentException("Arguments must be different objects."); } // Compute the column vector P*B @@ -1161,7 +1160,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.ManagedReference } else { - throw new ArgumentException(Resources.ArgumentMatrixPositiveDefinite); + throw new ArgumentException("Matrix must be positive definite."); } for (int i = ij + 1; i < order; i++) @@ -1228,12 +1227,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.ManagedReference if (b.Length != orderA*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (ReferenceEquals(a, b)) { - throw new ArgumentException(Resources.ArgumentReferenceDifferent); + throw new ArgumentException("Arguments must be different objects."); } var clone = new float[a.Length]; @@ -1264,12 +1263,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.ManagedReference if (b.Length != orderA*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (ReferenceEquals(a, b)) { - throw new ArgumentException(Resources.ArgumentReferenceDifferent); + throw new ArgumentException("Arguments must be different objects."); } CommonParallel.For(0, columnsB, (u, v) => @@ -1345,17 +1344,17 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.ManagedReference if (r.Length != rowsR*columnsR) { - throw new ArgumentException(string.Format(Resources.ArgumentArrayWrongLength, "rowsR * columnsR"), nameof(r)); + throw new ArgumentException("The given array has the wrong length. Should be rowsR * columnsR.", nameof(r)); } if (tau.Length < Math.Min(rowsR, columnsR)) { - throw new ArgumentException(string.Format(Resources.ArrayTooSmall, "min(m,n)"), nameof(tau)); + throw new ArgumentException("The given array is too small. It must be at least min(m,n) long.", nameof(tau)); } if (q.Length != rowsR*rowsR) { - throw new ArgumentException(string.Format(Resources.ArgumentArrayWrongLength, "rowsR * rowsR"), nameof(q)); + throw new ArgumentException("The given array has the wrong length. Should be rowsR * rowsR.", nameof(q)); } var work = columnsR > rowsR ? new float[rowsR*rowsR] : new float[rowsR*columnsR]; @@ -1407,17 +1406,17 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.ManagedReference if (a.Length != rowsA*columnsA) { - throw new ArgumentException(string.Format(Resources.ArgumentArrayWrongLength, "rowsR * columnsR"), nameof(a)); + throw new ArgumentException("The given array has the wrong length. Should be rowsR * columnsR.", nameof(a)); } if (tau.Length < Math.Min(rowsA, columnsA)) { - throw new ArgumentException(string.Format(Resources.ArrayTooSmall, "min(m,n)"), nameof(tau)); + throw new ArgumentException("The given array is too small. It must be at least min(m,n) long.", nameof(tau)); } if (r.Length != columnsA*columnsA) { - throw new ArgumentException(string.Format(Resources.ArgumentArrayWrongLength, "columnsA * columnsA"), nameof(r)); + throw new ArgumentException("The given array has the wrong length. Should be columnsA * columnsA.", nameof(r)); } var work = new float[rowsA*columnsA]; @@ -1600,22 +1599,22 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.ManagedReference if (a.Length != rows*columns) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(a)); + throw new ArgumentException("The array arguments must have the same length.", nameof(a)); } if (b.Length != rows*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (x.Length != columns*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(x)); + throw new ArgumentException("The array arguments must have the same length.", nameof(x)); } if (rows < columns) { - throw new ArgumentException(Resources.RowsLessThanColumns); + throw new ArgumentException("The number of rows must greater than or equal to the number of columns."); } var work = new float[rows * columns]; @@ -1675,7 +1674,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.ManagedReference if (rowsA < columnsA) { - throw new ArgumentException(Resources.RowsLessThanColumns); + throw new ArgumentException("The number of rows must greater than or equal to the number of columns."); } int rowsQ, columnsQ, rowsR, columnsR; @@ -1692,22 +1691,22 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.ManagedReference if (r.Length != rowsR*columnsR) { - throw new ArgumentException(string.Format(Resources.ArgumentArrayWrongLength, rowsR*columnsR), nameof(r)); + throw new ArgumentException($"The given array has the wrong length. Should be {rowsR * columnsR}.", nameof(r)); } if (q.Length != rowsQ*columnsQ) { - throw new ArgumentException(string.Format(Resources.ArgumentArrayWrongLength, rowsQ*columnsQ), nameof(q)); + throw new ArgumentException($"The given array has the wrong length. Should be {rowsQ * columnsQ}.", nameof(q)); } if (b.Length != rowsA*columnsB) { - throw new ArgumentException(string.Format(Resources.ArgumentArrayWrongLength, rowsA*columnsB), nameof(b)); + throw new ArgumentException($"The given array has the wrong length. Should be {rowsA * columnsB}.", nameof(b)); } if (x.Length != columnsA*columnsB) { - throw new ArgumentException(string.Format(Resources.ArgumentArrayWrongLength, columnsA*columnsB), nameof(x)); + throw new ArgumentException($"The given array has the wrong length. Should be {columnsA * columnsB}.", nameof(x)); } var sol = new float[b.Length]; @@ -1801,17 +1800,17 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.ManagedReference if (u.Length != rowsA*rowsA) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(u)); + throw new ArgumentException("The array arguments must have the same length.", nameof(u)); } if (vt.Length != columnsA*columnsA) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(vt)); + throw new ArgumentException("The array arguments must have the same length.", nameof(vt)); } if (s.Length != Math.Min(rowsA, columnsA)) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(s)); + throw new ArgumentException("The array arguments must have the same length.", nameof(s)); } var work = new float[rowsA]; @@ -2520,12 +2519,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.ManagedReference if (b.Length != rowsA*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (x.Length != columnsA*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } var s = new float[Math.Min(rowsA, columnsA)]; @@ -2578,27 +2577,27 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.ManagedReference if (u.Length != rowsA*rowsA) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(u)); + throw new ArgumentException("The array arguments must have the same length.", nameof(u)); } if (vt.Length != columnsA*columnsA) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(vt)); + throw new ArgumentException("The array arguments must have the same length.", nameof(vt)); } if (s.Length != Math.Min(rowsA, columnsA)) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(s)); + throw new ArgumentException("The array arguments must have the same length.", nameof(s)); } if (b.Length != rowsA*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (x.Length != columnsA*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } var mn = Math.Min(rowsA, columnsA); @@ -2653,7 +2652,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.ManagedReference if (matrix.Length != order*order) { - throw new ArgumentException(String.Format(Resources.ArgumentArrayWrongLength, order*order), nameof(matrix)); + throw new ArgumentException($"The given array has the wrong length. Should be {order * order}.", nameof(matrix)); } if (matrixEv == null) @@ -2663,7 +2662,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.ManagedReference if (matrixEv.Length != order*order) { - throw new ArgumentException(String.Format(Resources.ArgumentArrayWrongLength, order*order), nameof(matrixEv)); + throw new ArgumentException($"The given array has the wrong length. Should be {order * order}.", nameof(matrixEv)); } if (vectorEv == null) @@ -2673,7 +2672,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.ManagedReference if (vectorEv.Length != order) { - throw new ArgumentException(String.Format(Resources.ArgumentArrayWrongLength, order), nameof(vectorEv)); + throw new ArgumentException($"The given array has the wrong length. Should be {order}.", nameof(vectorEv)); } if (matrixD == null) @@ -2683,7 +2682,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.ManagedReference if (matrixD.Length != order*order) { - throw new ArgumentException(String.Format(Resources.ArgumentArrayWrongLength, order*order), nameof(matrixD)); + throw new ArgumentException($"The given array has the wrong length. Should be {order * order}.", nameof(matrixD)); } var d = new float[order]; diff --git a/src/Numerics/Providers/LinearAlgebra/Mkl/MklLinearAlgebraProvider.Complex.cs b/src/Numerics/Providers/LinearAlgebra/Mkl/MklLinearAlgebraProvider.Complex.cs index d2084da2..a632ab64 100644 --- a/src/Numerics/Providers/LinearAlgebra/Mkl/MklLinearAlgebraProvider.Complex.cs +++ b/src/Numerics/Providers/LinearAlgebra/Mkl/MklLinearAlgebraProvider.Complex.cs @@ -32,7 +32,6 @@ using System; using System.Security; using MathNet.Numerics.LinearAlgebra.Factorization; -using MathNet.Numerics.Properties; using MathNet.Numerics.Providers.Common.Mkl; using Complex = System.Numerics.Complex; @@ -63,17 +62,17 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Mkl if (rows <= 0) { - throw new ArgumentException(Resources.ArgumentMustBePositive, nameof(rows)); + throw new ArgumentException("Value must be positive.", nameof(rows)); } if (columns <= 0) { - throw new ArgumentException(Resources.ArgumentMustBePositive, nameof(columns)); + throw new ArgumentException("Value must be positive.", nameof(columns)); } if (matrix.Length < rows * columns) { - throw new ArgumentException(string.Format(Resources.ArrayTooSmall, rows * columns), nameof(matrix)); + throw new ArgumentException($"The given array is too small. It must be at least {rows * columns} long.", nameof(matrix)); } return SafeNativeMethods.z_matrix_norm((byte)norm, rows, columns, matrix); @@ -101,7 +100,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Mkl if (x.Length != y.Length) { - throw new ArgumentException(Resources.ArgumentArraysSameLength); + throw new ArgumentException("The array arguments must have the same length."); } return SafeNativeMethods.z_dot_product(x.Length, x, y); @@ -130,7 +129,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Mkl if (y.Length != x.Length) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } if (!ReferenceEquals(y, result)) @@ -230,12 +229,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Mkl if (c.Length != m*n) { - throw new ArgumentException(Resources.ArgumentMatrixDimensions); + throw new ArgumentException("Matrix dimensions must agree."); } if (k != l) { - throw new ArgumentException(Resources.ArgumentMatrixDimensions); + throw new ArgumentException("Matrix dimensions must agree."); } SafeNativeMethods.z_matrix_multiply(transposeA, transposeB, m, n, k, alpha, a, b, beta, c); @@ -265,12 +264,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Mkl if (data.Length != order*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(data)); + throw new ArgumentException("The array arguments must have the same length.", nameof(data)); } if (ipiv.Length != order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(ipiv)); + throw new ArgumentException("The array arguments must have the same length.", nameof(ipiv)); } var info = SafeNativeMethods.z_lu_factor(order, data, ipiv); @@ -297,7 +296,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Mkl if (a.Length != order*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(a)); + throw new ArgumentException("The array arguments must have the same length.", nameof(a)); } var info = SafeNativeMethods.z_lu_inverse(order, a); @@ -340,12 +339,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Mkl if (a.Length != order*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(a)); + throw new ArgumentException("The array arguments must have the same length.", nameof(a)); } if (ipiv.Length != order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(ipiv)); + throw new ArgumentException("The array arguments must have the same length.", nameof(ipiv)); } var info = SafeNativeMethods.z_lu_inverse_factored(order, a, ipiv); @@ -379,17 +378,17 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Mkl if (a.Length != order*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(a)); + throw new ArgumentException("The array arguments must have the same length.", nameof(a)); } if (b.Length != columnsOfB*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (ReferenceEquals(a, b)) { - throw new ArgumentException(Resources.ArgumentReferenceDifferent); + throw new ArgumentException("Arguments must be different objects."); } var info = SafeNativeMethods.z_lu_solve(order, columnsOfB, a, b); @@ -429,22 +428,22 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Mkl if (a.Length != order*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(a)); + throw new ArgumentException("The array arguments must have the same length.", nameof(a)); } if (ipiv.Length != order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(ipiv)); + throw new ArgumentException("The array arguments must have the same length.", nameof(ipiv)); } if (b.Length != columnsOfB*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (ReferenceEquals(a, b)) { - throw new ArgumentException(Resources.ArgumentReferenceDifferent); + throw new ArgumentException("Arguments must be different objects."); } var info = SafeNativeMethods.z_lu_solve_factored(order, columnsOfB, a, ipiv, b); @@ -477,12 +476,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Mkl if (order < 1) { - throw new ArgumentException(Resources.ArgumentMustBePositive, nameof(order)); + throw new ArgumentException("Value must be positive.", nameof(order)); } if (a.Length != order*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(a)); + throw new ArgumentException("The array arguments must have the same length.", nameof(a)); } var info = SafeNativeMethods.z_cholesky_factor(order, a); @@ -494,7 +493,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Mkl if (info > 0) { - throw new ArgumentException(Resources.ArgumentMatrixPositiveDefinite); + throw new ArgumentException("Matrix must be positive definite."); } } @@ -522,12 +521,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Mkl if (b.Length != orderA*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (ReferenceEquals(a, b)) { - throw new ArgumentException(Resources.ArgumentReferenceDifferent); + throw new ArgumentException("Arguments must be different objects."); } var info = SafeNativeMethods.z_cholesky_solve(orderA, columnsB, a, b); @@ -566,12 +565,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Mkl if (b.Length != orderA*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (ReferenceEquals(a, b)) { - throw new ArgumentException(Resources.ArgumentReferenceDifferent); + throw new ArgumentException("Arguments must be different objects."); } var info = SafeNativeMethods.z_cholesky_solve_factored(orderA, columnsB, a, b); @@ -609,17 +608,17 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Mkl if (r.Length != rowsR*columnsR) { - throw new ArgumentException(string.Format(Resources.ArgumentArrayWrongLength, "rowsR * columnsR"), nameof(r)); + throw new ArgumentException("The given array has the wrong length. Should be rowsR * columnsR.", nameof(r)); } if (tau.Length < Math.Min(rowsR, columnsR)) { - throw new ArgumentException(string.Format(Resources.ArrayTooSmall, "min(m,n)"), nameof(tau)); + throw new ArgumentException("The given array is too small. It must be at least min(m,n) long.", nameof(tau)); } if (q.Length != rowsR*rowsR) { - throw new ArgumentException(string.Format(Resources.ArgumentArrayWrongLength, "rowsR * rowsR"), nameof(q)); + throw new ArgumentException("The given array has the wrong length. Should be rowsR * rowsR.", nameof(q)); } var info = SafeNativeMethods.z_qr_factor(rowsR, columnsR, r, tau, q); @@ -657,17 +656,17 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Mkl if (q.Length != rowsA * columnsA) { - throw new ArgumentException(string.Format(Resources.ArgumentArrayWrongLength, "rowsR * columnsR"), nameof(q)); + throw new ArgumentException("The given array has the wrong length. Should be rowsR * columnsR.", nameof(q)); } if (tau.Length < Math.Min(rowsA, columnsA)) { - throw new ArgumentException(string.Format(Resources.ArrayTooSmall, "min(m,n)"), nameof(tau)); + throw new ArgumentException("The given array is too small. It must be at least min(m,n) long.", nameof(tau)); } if (r.Length != columnsA * columnsA) { - throw new ArgumentException(string.Format(Resources.ArgumentArrayWrongLength, "columnsA * columnsA"), nameof(r)); + throw new ArgumentException("The given array has the wrong length. Should be columnsA * columnsA.", nameof(r)); } var info = SafeNativeMethods.z_qr_thin_factor(rowsA, columnsA, q, tau, r); @@ -709,22 +708,22 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Mkl if (a.Length != rows * columns) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(a)); + throw new ArgumentException("The array arguments must have the same length.", nameof(a)); } if (b.Length != rows * columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (x.Length != columns * columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(x)); + throw new ArgumentException("The array arguments must have the same length.", nameof(x)); } if (rows < columns) { - throw new ArgumentException(Resources.RowsLessThanColumns); + throw new ArgumentException("The number of rows must greater than or equal to the number of columns."); } var info = SafeNativeMethods.z_qr_solve(rows, columns, columnsB, a, b, x); @@ -741,7 +740,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Mkl if (info > 0) { - throw new ArgumentException(Resources.ArgumentMatrixNotRankDeficient, nameof(a)); + throw new ArgumentException("Matrix must not be rank deficient.", nameof(a)); } } @@ -796,22 +795,22 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Mkl if (r.Length != rowsR * columnsR) { - throw new ArgumentException(string.Format(Resources.ArgumentArrayWrongLength, rowsR * columnsR), nameof(r)); + throw new ArgumentException($"The given array has the wrong length. Should be {rowsR * columnsR}.", nameof(r)); } if (q.Length != rowsQ * columnsQ) { - throw new ArgumentException(string.Format(Resources.ArgumentArrayWrongLength, rowsQ * columnsQ), nameof(q)); + throw new ArgumentException($"The given array has the wrong length. Should be {rowsQ * columnsQ}.", nameof(q)); } if (b.Length != rowsA * columnsB) { - throw new ArgumentException(string.Format(Resources.ArgumentArrayWrongLength, rowsA * columnsB), nameof(b)); + throw new ArgumentException($"The given array has the wrong length. Should be {rowsA * columnsB}.", nameof(b)); } if (x.Length != columnsA * columnsB) { - throw new ArgumentException(string.Format(Resources.ArgumentArrayWrongLength, columnsA * columnsB), nameof(x)); + throw new ArgumentException($"The given array has the wrong length. Should be {columnsA * columnsB}.", nameof(x)); } if (method == QRMethod.Full) @@ -864,12 +863,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Mkl if (b.Length != rowsA*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (x.Length != columnsA*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } var s = new Complex[Math.Min(rowsA, columnsA)]; @@ -920,17 +919,17 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Mkl if (u.Length != rowsA*rowsA) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(u)); + throw new ArgumentException("The array arguments must have the same length.", nameof(u)); } if (vt.Length != columnsA*columnsA) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(vt)); + throw new ArgumentException("The array arguments must have the same length.", nameof(vt)); } if (s.Length != Math.Min(rowsA, columnsA)) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(s)); + throw new ArgumentException("The array arguments must have the same length.", nameof(s)); } var info = SafeNativeMethods.z_svd_factor(computeVectors, rowsA, columnsA, a, s, u, vt); @@ -975,12 +974,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Mkl if (x.Length != y.Length) { - throw new ArgumentException(Resources.ArgumentArraysSameLength); + throw new ArgumentException("The array arguments must have the same length."); } if (x.Length != result.Length) { - throw new ArgumentException(Resources.ArgumentArraysSameLength); + throw new ArgumentException("The array arguments must have the same length."); } SafeNativeMethods.z_vector_add(x.Length, x, y, result); @@ -1010,12 +1009,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Mkl if (x.Length != y.Length) { - throw new ArgumentException(Resources.ArgumentArraysSameLength); + throw new ArgumentException("The array arguments must have the same length."); } if (x.Length != result.Length) { - throw new ArgumentException(Resources.ArgumentArraysSameLength); + throw new ArgumentException("The array arguments must have the same length."); } SafeNativeMethods.z_vector_subtract(x.Length, x, y, result); @@ -1045,12 +1044,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Mkl if (x.Length != y.Length) { - throw new ArgumentException(Resources.ArgumentArraysSameLength); + throw new ArgumentException("The array arguments must have the same length."); } if (x.Length != result.Length) { - throw new ArgumentException(Resources.ArgumentArraysSameLength); + throw new ArgumentException("The array arguments must have the same length."); } SafeNativeMethods.z_vector_multiply(x.Length, x, y, result); @@ -1085,12 +1084,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Mkl if (x.Length != y.Length) { - throw new ArgumentException(Resources.ArgumentArraysSameLength); + throw new ArgumentException("The array arguments must have the same length."); } if (x.Length != result.Length) { - throw new ArgumentException(Resources.ArgumentArraysSameLength); + throw new ArgumentException("The array arguments must have the same length."); } SafeNativeMethods.z_vector_power(x.Length, x, y, result); @@ -1120,12 +1119,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Mkl if (x.Length != y.Length) { - throw new ArgumentException(Resources.ArgumentArraysSameLength); + throw new ArgumentException("The array arguments must have the same length."); } if (x.Length != result.Length) { - throw new ArgumentException(Resources.ArgumentArraysSameLength); + throw new ArgumentException("The array arguments must have the same length."); } SafeNativeMethods.z_vector_divide(x.Length, x, y, result); @@ -1149,7 +1148,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Mkl if (matrix.Length != order * order) { - throw new ArgumentException(String.Format(Resources.ArgumentArrayWrongLength, order * order), nameof(matrix)); + throw new ArgumentException($"The given array has the wrong length. Should be {order * order}.", nameof(matrix)); } if (matrixEv == null) @@ -1159,7 +1158,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Mkl if (matrixEv.Length != order * order) { - throw new ArgumentException(String.Format(Resources.ArgumentArrayWrongLength, order * order), nameof(matrixEv)); + throw new ArgumentException($"The given array has the wrong length. Should be {order * order}.", nameof(matrixEv)); } if (vectorEv == null) @@ -1169,7 +1168,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Mkl if (vectorEv.Length != order) { - throw new ArgumentException(String.Format(Resources.ArgumentArrayWrongLength, order), nameof(vectorEv)); + throw new ArgumentException($"The given array has the wrong length. Should be {order}.", nameof(vectorEv)); } if (matrixD == null) @@ -1179,7 +1178,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Mkl if (matrixD.Length != order * order) { - throw new ArgumentException(String.Format(Resources.ArgumentArrayWrongLength, order * order), nameof(matrixD)); + throw new ArgumentException($"The given array has the wrong length. Should be {order * order}.", nameof(matrixD)); } var info = SafeNativeMethods.z_eigen(isSymmetric, order, matrix, matrixEv, vectorEv, matrixD); diff --git a/src/Numerics/Providers/LinearAlgebra/Mkl/MklLinearAlgebraProvider.Complex32.cs b/src/Numerics/Providers/LinearAlgebra/Mkl/MklLinearAlgebraProvider.Complex32.cs index 185a30b1..cfbdd8de 100644 --- a/src/Numerics/Providers/LinearAlgebra/Mkl/MklLinearAlgebraProvider.Complex32.cs +++ b/src/Numerics/Providers/LinearAlgebra/Mkl/MklLinearAlgebraProvider.Complex32.cs @@ -32,7 +32,6 @@ using System; using System.Security; using MathNet.Numerics.LinearAlgebra.Factorization; -using MathNet.Numerics.Properties; using MathNet.Numerics.Providers.Common.Mkl; using Complex = System.Numerics.Complex; @@ -63,17 +62,17 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Mkl if (rows <= 0) { - throw new ArgumentException(Resources.ArgumentMustBePositive, nameof(rows)); + throw new ArgumentException("Value must be positive.", nameof(rows)); } if (columns <= 0) { - throw new ArgumentException(Resources.ArgumentMustBePositive, nameof(columns)); + throw new ArgumentException("Value must be positive.", nameof(columns)); } if (matrix.Length < rows * columns) { - throw new ArgumentException(string.Format(Resources.ArrayTooSmall, rows * columns), nameof(matrix)); + throw new ArgumentException($"The given array is too small. It must be at least {rows * columns} long.", nameof(matrix)); } return SafeNativeMethods.c_matrix_norm((byte)norm, rows, columns, matrix); @@ -101,7 +100,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Mkl if (x.Length != y.Length) { - throw new ArgumentException(Resources.ArgumentArraysSameLength); + throw new ArgumentException("The array arguments must have the same length."); } return SafeNativeMethods.c_dot_product(x.Length, x, y); @@ -130,7 +129,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Mkl if (y.Length != x.Length) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } if (!ReferenceEquals(y, result)) @@ -230,12 +229,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Mkl if (c.Length != m*n) { - throw new ArgumentException(Resources.ArgumentMatrixDimensions); + throw new ArgumentException("Matrix dimensions must agree."); } if (k != l) { - throw new ArgumentException(Resources.ArgumentMatrixDimensions); + throw new ArgumentException("Matrix dimensions must agree."); } SafeNativeMethods.c_matrix_multiply(transposeA, transposeB, m, n, k, alpha, a, b, beta, c); @@ -265,12 +264,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Mkl if (data.Length != order*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(data)); + throw new ArgumentException("The array arguments must have the same length.", nameof(data)); } if (ipiv.Length != order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(ipiv)); + throw new ArgumentException("The array arguments must have the same length.", nameof(ipiv)); } var info = SafeNativeMethods.c_lu_factor(order, data, ipiv); @@ -297,7 +296,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Mkl if (a.Length != order*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(a)); + throw new ArgumentException("The array arguments must have the same length.", nameof(a)); } var info = SafeNativeMethods.c_lu_inverse(order, a); @@ -340,12 +339,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Mkl if (a.Length != order*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(a)); + throw new ArgumentException("The array arguments must have the same length.", nameof(a)); } if (ipiv.Length != order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(ipiv)); + throw new ArgumentException("The array arguments must have the same length.", nameof(ipiv)); } var info = SafeNativeMethods.c_lu_inverse_factored(order, a, ipiv); @@ -379,17 +378,17 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Mkl if (a.Length != order*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(a)); + throw new ArgumentException("The array arguments must have the same length.", nameof(a)); } if (b.Length != columnsOfB*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (ReferenceEquals(a, b)) { - throw new ArgumentException(Resources.ArgumentReferenceDifferent); + throw new ArgumentException("Arguments must be different objects."); } var info = SafeNativeMethods.c_lu_solve(order, columnsOfB, a, b); @@ -429,22 +428,22 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Mkl if (a.Length != order*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(a)); + throw new ArgumentException("The array arguments must have the same length.", nameof(a)); } if (ipiv.Length != order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(ipiv)); + throw new ArgumentException("The array arguments must have the same length.", nameof(ipiv)); } if (b.Length != columnsOfB*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (ReferenceEquals(a, b)) { - throw new ArgumentException(Resources.ArgumentReferenceDifferent); + throw new ArgumentException("Arguments must be different objects."); } var info = SafeNativeMethods.c_lu_solve_factored(order, columnsOfB, a, ipiv, b); @@ -472,12 +471,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Mkl if (order < 1) { - throw new ArgumentException(Resources.ArgumentMustBePositive, nameof(order)); + throw new ArgumentException("Value must be positive.", nameof(order)); } if (a.Length != order*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(a)); + throw new ArgumentException("The array arguments must have the same length.", nameof(a)); } var info = SafeNativeMethods.c_cholesky_factor(order, a); @@ -489,7 +488,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Mkl if (info > 0) { - throw new ArgumentException(Resources.ArgumentMatrixPositiveDefinite); + throw new ArgumentException("Matrix must be positive definite."); } } @@ -517,12 +516,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Mkl if (b.Length != orderA*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (ReferenceEquals(a, b)) { - throw new ArgumentException(Resources.ArgumentReferenceDifferent); + throw new ArgumentException("Arguments must be different objects."); } var info = SafeNativeMethods.c_cholesky_solve(orderA, columnsB, a, b); @@ -561,12 +560,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Mkl if (b.Length != orderA*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (ReferenceEquals(a, b)) { - throw new ArgumentException(Resources.ArgumentReferenceDifferent); + throw new ArgumentException("Arguments must be different objects."); } var info = SafeNativeMethods.c_cholesky_solve_factored(orderA, columnsB, a, b); @@ -604,17 +603,17 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Mkl if (r.Length != rowsR*columnsR) { - throw new ArgumentException(string.Format(Resources.ArgumentArrayWrongLength, "rowsR * columnsR"), nameof(r)); + throw new ArgumentException("The given array has the wrong length. Should be rowsR * columnsR.", nameof(r)); } if (tau.Length < Math.Min(rowsR, columnsR)) { - throw new ArgumentException(string.Format(Resources.ArrayTooSmall, "min(m,n)"), nameof(tau)); + throw new ArgumentException("The given array is too small. It must be at least min(m,n) long.", nameof(tau)); } if (q.Length != rowsR*rowsR) { - throw new ArgumentException(string.Format(Resources.ArgumentArrayWrongLength, "rowsR * rowsR"), nameof(q)); + throw new ArgumentException("The given array has the wrong length. Should be rowsR * rowsR.", nameof(q)); } var info = SafeNativeMethods.c_qr_factor(rowsR, columnsR, r, tau, q); @@ -652,17 +651,17 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Mkl if (q.Length != rowsA * columnsA) { - throw new ArgumentException(string.Format(Resources.ArgumentArrayWrongLength, "rowsR * columnsR"), nameof(q)); + throw new ArgumentException("The given array has the wrong length. Should be rowsR * columnsR.", nameof(q)); } if (tau.Length < Math.Min(rowsA, columnsA)) { - throw new ArgumentException(string.Format(Resources.ArrayTooSmall, "min(m,n)"), nameof(tau)); + throw new ArgumentException("The given array is too small. It must be at least min(m,n) long.", nameof(tau)); } if (r.Length != columnsA * columnsA) { - throw new ArgumentException(string.Format(Resources.ArgumentArrayWrongLength, "columnsA * columnsA"), nameof(r)); + throw new ArgumentException("The given array has the wrong length. Should be columnsA * columnsA.", nameof(r)); } var info = SafeNativeMethods.c_qr_thin_factor(rowsA, columnsA, q, tau, r); @@ -704,22 +703,22 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Mkl if (a.Length != rows * columns) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(a)); + throw new ArgumentException("The array arguments must have the same length.", nameof(a)); } if (b.Length != rows * columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (x.Length != columns * columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(x)); + throw new ArgumentException("The array arguments must have the same length.", nameof(x)); } if (rows < columns) { - throw new ArgumentException(Resources.RowsLessThanColumns); + throw new ArgumentException("The number of rows must greater than or equal to the number of columns."); } var info = SafeNativeMethods.c_qr_solve(rows, columns, columnsB, a, b, x); @@ -736,7 +735,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Mkl if (info > 0) { - throw new ArgumentException(Resources.ArgumentMatrixNotRankDeficient, nameof(a)); + throw new ArgumentException("Matrix must not be rank deficient.", nameof(a)); } } @@ -791,22 +790,22 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Mkl if (r.Length != rowsR * columnsR) { - throw new ArgumentException(string.Format(Resources.ArgumentArrayWrongLength, rowsR * columnsR), nameof(r)); + throw new ArgumentException($"The given array has the wrong length. Should be {rowsR * columnsR}.", nameof(r)); } if (q.Length != rowsQ * columnsQ) { - throw new ArgumentException(string.Format(Resources.ArgumentArrayWrongLength, rowsQ * columnsQ), nameof(q)); + throw new ArgumentException($"The given array has the wrong length. Should be {rowsQ * columnsQ}.", nameof(q)); } if (b.Length != rowsA * columnsB) { - throw new ArgumentException(string.Format(Resources.ArgumentArrayWrongLength, rowsA * columnsB), nameof(b)); + throw new ArgumentException($"The given array has the wrong length. Should be {rowsA * columnsB}.", nameof(b)); } if (x.Length != columnsA * columnsB) { - throw new ArgumentException(string.Format(Resources.ArgumentArrayWrongLength, columnsA * columnsB), nameof(x)); + throw new ArgumentException($"The given array has the wrong length. Should be {columnsA * columnsB}.", nameof(x)); } if (method == QRMethod.Full) @@ -859,12 +858,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Mkl if (b.Length != rowsA*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (x.Length != columnsA*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } var s = new Complex32[Math.Min(rowsA, columnsA)]; @@ -915,17 +914,17 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Mkl if (u.Length != rowsA * rowsA) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(u)); + throw new ArgumentException("The array arguments must have the same length.", nameof(u)); } if (vt.Length != columnsA * columnsA) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(vt)); + throw new ArgumentException("The array arguments must have the same length.", nameof(vt)); } if (s.Length != Math.Min(rowsA, columnsA)) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(s)); + throw new ArgumentException("The array arguments must have the same length.", nameof(s)); } var info = SafeNativeMethods.c_svd_factor(computeVectors, rowsA, columnsA, a, s, u, vt); @@ -970,12 +969,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Mkl if (x.Length != y.Length) { - throw new ArgumentException(Resources.ArgumentArraysSameLength); + throw new ArgumentException("The array arguments must have the same length."); } if (x.Length != result.Length) { - throw new ArgumentException(Resources.ArgumentArraysSameLength); + throw new ArgumentException("The array arguments must have the same length."); } SafeNativeMethods.c_vector_add(x.Length, x, y, result); @@ -1005,12 +1004,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Mkl if (x.Length != y.Length) { - throw new ArgumentException(Resources.ArgumentArraysSameLength); + throw new ArgumentException("The array arguments must have the same length."); } if (x.Length != result.Length) { - throw new ArgumentException(Resources.ArgumentArraysSameLength); + throw new ArgumentException("The array arguments must have the same length."); } SafeNativeMethods.c_vector_subtract(x.Length, x, y, result); @@ -1040,12 +1039,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Mkl if (x.Length != y.Length) { - throw new ArgumentException(Resources.ArgumentArraysSameLength); + throw new ArgumentException("The array arguments must have the same length."); } if (x.Length != result.Length) { - throw new ArgumentException(Resources.ArgumentArraysSameLength); + throw new ArgumentException("The array arguments must have the same length."); } SafeNativeMethods.c_vector_multiply(x.Length, x, y, result); @@ -1075,12 +1074,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Mkl if (x.Length != y.Length) { - throw new ArgumentException(Resources.ArgumentArraysSameLength); + throw new ArgumentException("The array arguments must have the same length."); } if (x.Length != result.Length) { - throw new ArgumentException(Resources.ArgumentArraysSameLength); + throw new ArgumentException("The array arguments must have the same length."); } SafeNativeMethods.c_vector_divide(x.Length, x, y, result); @@ -1115,12 +1114,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Mkl if (x.Length != y.Length) { - throw new ArgumentException(Resources.ArgumentArraysSameLength); + throw new ArgumentException("The array arguments must have the same length."); } if (x.Length != result.Length) { - throw new ArgumentException(Resources.ArgumentArraysSameLength); + throw new ArgumentException("The array arguments must have the same length."); } SafeNativeMethods.c_vector_power(x.Length, x, y, result); @@ -1144,7 +1143,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Mkl if (matrix.Length != order * order) { - throw new ArgumentException(String.Format(Resources.ArgumentArrayWrongLength, order * order), nameof(matrix)); + throw new ArgumentException($"The given array has the wrong length. Should be {order * order}.", nameof(matrix)); } if (matrixEv == null) @@ -1154,7 +1153,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Mkl if (matrixEv.Length != order * order) { - throw new ArgumentException(String.Format(Resources.ArgumentArrayWrongLength, order * order), nameof(matrixEv)); + throw new ArgumentException($"The given array has the wrong length. Should be {order * order}.", nameof(matrixEv)); } if (vectorEv == null) @@ -1164,7 +1163,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Mkl if (vectorEv.Length != order) { - throw new ArgumentException(String.Format(Resources.ArgumentArrayWrongLength, order), nameof(vectorEv)); + throw new ArgumentException($"The given array has the wrong length. Should be {order}.", nameof(vectorEv)); } if (matrixD == null) @@ -1174,7 +1173,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Mkl if (matrixD.Length != order * order) { - throw new ArgumentException(string.Format(Resources.ArgumentArrayWrongLength, order * order), nameof(matrixD)); + throw new ArgumentException($"The given array has the wrong length. Should be {order * order}.", nameof(matrixD)); } var info = SafeNativeMethods.c_eigen(isSymmetric, order, matrix, matrixEv, vectorEv, matrixD); diff --git a/src/Numerics/Providers/LinearAlgebra/Mkl/MklLinearAlgebraProvider.Double.cs b/src/Numerics/Providers/LinearAlgebra/Mkl/MklLinearAlgebraProvider.Double.cs index 3136d51e..cbb0b590 100644 --- a/src/Numerics/Providers/LinearAlgebra/Mkl/MklLinearAlgebraProvider.Double.cs +++ b/src/Numerics/Providers/LinearAlgebra/Mkl/MklLinearAlgebraProvider.Double.cs @@ -32,7 +32,6 @@ using System; using System.Security; using MathNet.Numerics.LinearAlgebra.Factorization; -using MathNet.Numerics.Properties; using MathNet.Numerics.Providers.Common.Mkl; using Complex = System.Numerics.Complex; @@ -63,17 +62,17 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Mkl if (rows <= 0) { - throw new ArgumentException(Resources.ArgumentMustBePositive, nameof(rows)); + throw new ArgumentException("Value must be positive.", nameof(rows)); } if (columns <= 0) { - throw new ArgumentException(Resources.ArgumentMustBePositive, nameof(columns)); + throw new ArgumentException("Value must be positive.", nameof(columns)); } if (matrix.Length < rows * columns) { - throw new ArgumentException(string.Format(Resources.ArrayTooSmall, rows * columns), nameof(matrix)); + throw new ArgumentException($"The given array is too small. It must be at least {rows * columns} long.", nameof(matrix)); } return SafeNativeMethods.d_matrix_norm((byte)norm, rows, columns, matrix); @@ -101,7 +100,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Mkl if (x.Length != y.Length) { - throw new ArgumentException(Resources.ArgumentArraysSameLength); + throw new ArgumentException("The array arguments must have the same length."); } return SafeNativeMethods.d_dot_product(x.Length, x, y); @@ -130,7 +129,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Mkl if (y.Length != x.Length) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } if (!ReferenceEquals(y, result)) @@ -230,12 +229,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Mkl if (c.Length != m*n) { - throw new ArgumentException(Resources.ArgumentMatrixDimensions); + throw new ArgumentException("Matrix dimensions must agree."); } if (k != l) { - throw new ArgumentException(Resources.ArgumentMatrixDimensions); + throw new ArgumentException("Matrix dimensions must agree."); } SafeNativeMethods.d_matrix_multiply(transposeA, transposeB, m, n, k, alpha, a, b, beta, c); @@ -265,12 +264,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Mkl if (data.Length != order*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(data)); + throw new ArgumentException("The array arguments must have the same length.", nameof(data)); } if (ipiv.Length != order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(ipiv)); + throw new ArgumentException("The array arguments must have the same length.", nameof(ipiv)); } var info = SafeNativeMethods.d_lu_factor(order, data, ipiv); @@ -297,7 +296,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Mkl if (a.Length != order*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(a)); + throw new ArgumentException("The array arguments must have the same length.", nameof(a)); } var info = SafeNativeMethods.d_lu_inverse(order, a); @@ -340,12 +339,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Mkl if (a.Length != order*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(a)); + throw new ArgumentException("The array arguments must have the same length.", nameof(a)); } if (ipiv.Length != order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(ipiv)); + throw new ArgumentException("The array arguments must have the same length.", nameof(ipiv)); } var info = SafeNativeMethods.d_lu_inverse_factored(order, a, ipiv); @@ -379,17 +378,17 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Mkl if (a.Length != order*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(a)); + throw new ArgumentException("The array arguments must have the same length.", nameof(a)); } if (b.Length != columnsOfB*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (ReferenceEquals(a, b)) { - throw new ArgumentException(Resources.ArgumentReferenceDifferent); + throw new ArgumentException("Arguments must be different objects."); } var info = SafeNativeMethods.d_lu_solve(order, columnsOfB, a, b); @@ -429,22 +428,22 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Mkl if (a.Length != order*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(a)); + throw new ArgumentException("The array arguments must have the same length.", nameof(a)); } if (ipiv.Length != order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(ipiv)); + throw new ArgumentException("The array arguments must have the same length.", nameof(ipiv)); } if (b.Length != columnsOfB*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (ReferenceEquals(a, b)) { - throw new ArgumentException(Resources.ArgumentReferenceDifferent); + throw new ArgumentException("Arguments must be different objects."); } var info = SafeNativeMethods.d_lu_solve_factored(order, columnsOfB, a, ipiv, b); @@ -472,12 +471,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Mkl if (order < 1) { - throw new ArgumentException(Resources.ArgumentMustBePositive, nameof(order)); + throw new ArgumentException("Value must be positive.", nameof(order)); } if (a.Length != order*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(a)); + throw new ArgumentException("The array arguments must have the same length.", nameof(a)); } var info = SafeNativeMethods.d_cholesky_factor(order, a); @@ -494,7 +493,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Mkl if (info > 0) { - throw new ArgumentException(Resources.ArgumentMatrixPositiveDefinite); + throw new ArgumentException("Matrix must be positive definite."); } } @@ -522,12 +521,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Mkl if (b.Length != orderA*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (ReferenceEquals(a, b)) { - throw new ArgumentException(Resources.ArgumentReferenceDifferent); + throw new ArgumentException("Arguments must be different objects."); } var info = SafeNativeMethods.d_cholesky_solve(orderA, columnsB, a, b); @@ -566,12 +565,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Mkl if (b.Length != orderA*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (ReferenceEquals(a, b)) { - throw new ArgumentException(Resources.ArgumentReferenceDifferent); + throw new ArgumentException("Arguments must be different objects."); } var info = SafeNativeMethods.d_cholesky_solve_factored(orderA, columnsB, a, b); @@ -609,17 +608,17 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Mkl if (r.Length != rowsR*columnsR) { - throw new ArgumentException(string.Format(Resources.ArgumentArrayWrongLength, "rowsR * columnsR"), nameof(r)); + throw new ArgumentException("The given array has the wrong length. Should be rowsR * columnsR.", nameof(r)); } if (tau.Length < Math.Min(rowsR, columnsR)) { - throw new ArgumentException(string.Format(Resources.ArrayTooSmall, "min(m,n)"), nameof(tau)); + throw new ArgumentException("The given array is too small. It must be at least min(m,n) long.", nameof(tau)); } if (q.Length != rowsR*rowsR) { - throw new ArgumentException(string.Format(Resources.ArgumentArrayWrongLength, "rowsR * rowsR"), nameof(q)); + throw new ArgumentException("The given array has the wrong length. Should be rowsR * rowsR.", nameof(q)); } var info = SafeNativeMethods.d_qr_factor(rowsR, columnsR, r, tau, q); @@ -657,17 +656,17 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Mkl if (q.Length != rowsA*columnsA) { - throw new ArgumentException(string.Format(Resources.ArgumentArrayWrongLength, "rowsR * columnsR"), nameof(q)); + throw new ArgumentException("The given array has the wrong length. Should be rowsR * columnsR.", nameof(q)); } if (tau.Length < Math.Min(rowsA, columnsA)) { - throw new ArgumentException(string.Format(Resources.ArrayTooSmall, "min(m,n)"), nameof(tau)); + throw new ArgumentException("The given array is too small. It must be at least min(m,n) long.", nameof(tau)); } if (r.Length != columnsA*columnsA) { - throw new ArgumentException(string.Format(Resources.ArgumentArrayWrongLength, "columnsA * columnsA"), nameof(r)); + throw new ArgumentException("The given array has the wrong length. Should be columnsA * columnsA.", nameof(r)); } var info = SafeNativeMethods.d_qr_thin_factor(rowsA, columnsA, q, tau, r); @@ -709,22 +708,22 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Mkl if (a.Length != rows * columns) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(a)); + throw new ArgumentException("The array arguments must have the same length.", nameof(a)); } if (b.Length != rows * columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (x.Length != columns * columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(x)); + throw new ArgumentException("The array arguments must have the same length.", nameof(x)); } if (rows < columns) { - throw new ArgumentException(Resources.RowsLessThanColumns); + throw new ArgumentException("The number of rows must greater than or equal to the number of columns."); } var info = SafeNativeMethods.d_qr_solve(rows, columns, columnsB, a, b, x); @@ -741,7 +740,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Mkl if (info > 0) { - throw new ArgumentException(Resources.ArgumentMatrixNotRankDeficient, nameof(a)); + throw new ArgumentException("Matrix must not be rank deficient.", nameof(a)); } } @@ -796,22 +795,22 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Mkl if (r.Length != rowsR * columnsR) { - throw new ArgumentException(string.Format(Resources.ArgumentArrayWrongLength, rowsR * columnsR), nameof(r)); + throw new ArgumentException($"The given array has the wrong length. Should be {rowsR * columnsR}.", nameof(r)); } if (q.Length != rowsQ * columnsQ) { - throw new ArgumentException(string.Format(Resources.ArgumentArrayWrongLength, rowsQ * columnsQ), nameof(q)); + throw new ArgumentException($"The given array has the wrong length. Should be {rowsQ * columnsQ}.", nameof(q)); } if (b.Length != rowsA * columnsB) { - throw new ArgumentException(string.Format(Resources.ArgumentArrayWrongLength, rowsA * columnsB), nameof(b)); + throw new ArgumentException($"The given array has the wrong length. Should be {rowsA * columnsB}.", nameof(b)); } if (x.Length != columnsA * columnsB) { - throw new ArgumentException(string.Format(Resources.ArgumentArrayWrongLength, columnsA * columnsB), nameof(x)); + throw new ArgumentException($"The given array has the wrong length. Should be {columnsA * columnsB}.", nameof(x)); } if (method == QRMethod.Full) @@ -864,12 +863,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Mkl if (b.Length != rowsA*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (x.Length != columnsA*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } var s = new double[Math.Min(rowsA, columnsA)]; @@ -920,17 +919,17 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Mkl if (u.Length != rowsA * rowsA) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(u)); + throw new ArgumentException("The array arguments must have the same length.", nameof(u)); } if (vt.Length != columnsA * columnsA) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(vt)); + throw new ArgumentException("The array arguments must have the same length.", nameof(vt)); } if (s.Length != Math.Min(rowsA, columnsA)) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(s)); + throw new ArgumentException("The array arguments must have the same length.", nameof(s)); } var info = SafeNativeMethods.d_svd_factor(computeVectors, rowsA, columnsA, a, s, u, vt); @@ -975,12 +974,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Mkl if (x.Length != y.Length) { - throw new ArgumentException(Resources.ArgumentArraysSameLength); + throw new ArgumentException("The array arguments must have the same length."); } if (x.Length != result.Length) { - throw new ArgumentException(Resources.ArgumentArraysSameLength); + throw new ArgumentException("The array arguments must have the same length."); } SafeNativeMethods.d_vector_add(x.Length, x, y, result); @@ -1010,12 +1009,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Mkl if (x.Length != y.Length) { - throw new ArgumentException(Resources.ArgumentArraysSameLength); + throw new ArgumentException("The array arguments must have the same length."); } if (x.Length != result.Length) { - throw new ArgumentException(Resources.ArgumentArraysSameLength); + throw new ArgumentException("The array arguments must have the same length."); } SafeNativeMethods.d_vector_subtract(x.Length, x, y, result); @@ -1045,12 +1044,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Mkl if (x.Length != y.Length) { - throw new ArgumentException(Resources.ArgumentArraysSameLength); + throw new ArgumentException("The array arguments must have the same length."); } if (x.Length != result.Length) { - throw new ArgumentException(Resources.ArgumentArraysSameLength); + throw new ArgumentException("The array arguments must have the same length."); } SafeNativeMethods.d_vector_multiply(x.Length, x, y, result); @@ -1080,12 +1079,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Mkl if (x.Length != y.Length) { - throw new ArgumentException(Resources.ArgumentArraysSameLength); + throw new ArgumentException("The array arguments must have the same length."); } if (x.Length != result.Length) { - throw new ArgumentException(Resources.ArgumentArraysSameLength); + throw new ArgumentException("The array arguments must have the same length."); } SafeNativeMethods.d_vector_divide(x.Length, x, y, result); @@ -1120,12 +1119,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Mkl if (x.Length != y.Length) { - throw new ArgumentException(Resources.ArgumentArraysSameLength); + throw new ArgumentException("The array arguments must have the same length."); } if (x.Length != result.Length) { - throw new ArgumentException(Resources.ArgumentArraysSameLength); + throw new ArgumentException("The array arguments must have the same length."); } SafeNativeMethods.d_vector_power(x.Length, x, y, result); @@ -1149,7 +1148,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Mkl if (matrix.Length != order*order) { - throw new ArgumentException(String.Format(Resources.ArgumentArrayWrongLength, order*order), nameof(matrix)); + throw new ArgumentException($"The given array has the wrong length. Should be {order * order}.", nameof(matrix)); } if (matrixEv == null) @@ -1159,7 +1158,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Mkl if (matrixEv.Length != order*order) { - throw new ArgumentException(String.Format(Resources.ArgumentArrayWrongLength, order*order), nameof(matrixEv)); + throw new ArgumentException($"The given array has the wrong length. Should be {order * order}.", nameof(matrixEv)); } if (vectorEv == null) @@ -1169,7 +1168,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Mkl if (vectorEv.Length != order) { - throw new ArgumentException(String.Format(Resources.ArgumentArrayWrongLength, order), nameof(vectorEv)); + throw new ArgumentException($"The given array has the wrong length. Should be {order}.", nameof(vectorEv)); } if (matrixD == null) @@ -1179,7 +1178,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Mkl if (matrixD.Length != order*order) { - throw new ArgumentException(String.Format(Resources.ArgumentArrayWrongLength, order*order), nameof(matrixD)); + throw new ArgumentException($"The given array has the wrong length. Should be {order * order}.", nameof(matrixD)); } var info = SafeNativeMethods.d_eigen(isSymmetric, order, matrix, matrixEv, vectorEv, matrixD); diff --git a/src/Numerics/Providers/LinearAlgebra/Mkl/MklLinearAlgebraProvider.Single.cs b/src/Numerics/Providers/LinearAlgebra/Mkl/MklLinearAlgebraProvider.Single.cs index 888e16db..6a85e797 100644 --- a/src/Numerics/Providers/LinearAlgebra/Mkl/MklLinearAlgebraProvider.Single.cs +++ b/src/Numerics/Providers/LinearAlgebra/Mkl/MklLinearAlgebraProvider.Single.cs @@ -32,7 +32,6 @@ using System; using System.Security; using MathNet.Numerics.LinearAlgebra.Factorization; -using MathNet.Numerics.Properties; using MathNet.Numerics.Providers.Common.Mkl; using Complex = System.Numerics.Complex; @@ -63,17 +62,17 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Mkl if (rows <= 0) { - throw new ArgumentException(Resources.ArgumentMustBePositive, nameof(rows)); + throw new ArgumentException("Value must be positive.", nameof(rows)); } if (columns <= 0) { - throw new ArgumentException(Resources.ArgumentMustBePositive, nameof(columns)); + throw new ArgumentException("Value must be positive.", nameof(columns)); } if (matrix.Length < rows * columns) { - throw new ArgumentException(string.Format(Resources.ArrayTooSmall, rows * columns), nameof(matrix)); + throw new ArgumentException($"The given array is too small. It must be at least {rows * columns} long.", nameof(matrix)); } return SafeNativeMethods.s_matrix_norm((byte)norm, rows, columns, matrix); @@ -101,7 +100,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Mkl if (x.Length != y.Length) { - throw new ArgumentException(Resources.ArgumentArraysSameLength); + throw new ArgumentException("The array arguments must have the same length."); } return SafeNativeMethods.s_dot_product(x.Length, x, y); @@ -130,7 +129,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Mkl if (y.Length != x.Length) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } if (!ReferenceEquals(y, result)) @@ -230,12 +229,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Mkl if (c.Length != m*n) { - throw new ArgumentException(Resources.ArgumentMatrixDimensions); + throw new ArgumentException("Matrix dimensions must agree."); } if (k != l) { - throw new ArgumentException(Resources.ArgumentMatrixDimensions); + throw new ArgumentException("Matrix dimensions must agree."); } SafeNativeMethods.s_matrix_multiply(transposeA, transposeB, m, n, k, alpha, a, b, beta, c); @@ -265,12 +264,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Mkl if (data.Length != order*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(data)); + throw new ArgumentException("The array arguments must have the same length.", nameof(data)); } if (ipiv.Length != order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(ipiv)); + throw new ArgumentException("The array arguments must have the same length.", nameof(ipiv)); } var info = SafeNativeMethods.s_lu_factor(order, data, ipiv); @@ -297,7 +296,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Mkl if (a.Length != order*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(a)); + throw new ArgumentException("The array arguments must have the same length.", nameof(a)); } var info = SafeNativeMethods.s_lu_inverse(order, a); @@ -340,12 +339,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Mkl if (a.Length != order*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(a)); + throw new ArgumentException("The array arguments must have the same length.", nameof(a)); } if (ipiv.Length != order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(ipiv)); + throw new ArgumentException("The array arguments must have the same length.", nameof(ipiv)); } var info = SafeNativeMethods.s_lu_inverse_factored(order, a, ipiv); @@ -379,17 +378,17 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Mkl if (a.Length != order*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(a)); + throw new ArgumentException("The array arguments must have the same length.", nameof(a)); } if (b.Length != columnsOfB*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (ReferenceEquals(a, b)) { - throw new ArgumentException(Resources.ArgumentReferenceDifferent); + throw new ArgumentException("Arguments must be different objects."); } var info = SafeNativeMethods.s_lu_solve(order, columnsOfB, a, b); @@ -429,22 +428,22 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Mkl if (a.Length != order*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(a)); + throw new ArgumentException("The array arguments must have the same length.", nameof(a)); } if (ipiv.Length != order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(ipiv)); + throw new ArgumentException("The array arguments must have the same length.", nameof(ipiv)); } if (b.Length != columnsOfB*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (ReferenceEquals(a, b)) { - throw new ArgumentException(Resources.ArgumentReferenceDifferent); + throw new ArgumentException("Arguments must be different objects."); } var info = SafeNativeMethods.s_lu_solve_factored(order, columnsOfB, a, ipiv, b); @@ -472,12 +471,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Mkl if (order < 1) { - throw new ArgumentException(Resources.ArgumentMustBePositive, nameof(order)); + throw new ArgumentException("Value must be positive.", nameof(order)); } if (a.Length != order*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(a)); + throw new ArgumentException("The array arguments must have the same length.", nameof(a)); } var info = SafeNativeMethods.s_cholesky_factor(order, a); @@ -489,7 +488,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Mkl if (info > 0) { - throw new ArgumentException(Resources.ArgumentMatrixPositiveDefinite); + throw new ArgumentException("Matrix must be positive definite."); } } @@ -517,12 +516,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Mkl if (b.Length != orderA*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (ReferenceEquals(a, b)) { - throw new ArgumentException(Resources.ArgumentReferenceDifferent); + throw new ArgumentException("Arguments must be different objects."); } var info = SafeNativeMethods.s_cholesky_solve(orderA, columnsB, a, b); @@ -561,12 +560,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Mkl if (b.Length != orderA*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (ReferenceEquals(a, b)) { - throw new ArgumentException(Resources.ArgumentReferenceDifferent); + throw new ArgumentException("Arguments must be different objects."); } var info = SafeNativeMethods.s_cholesky_solve_factored(orderA, columnsB, a, b); @@ -604,17 +603,17 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Mkl if (r.Length != rowsR*columnsR) { - throw new ArgumentException(string.Format(Resources.ArgumentArrayWrongLength, "rowsR * columnsR"), nameof(r)); + throw new ArgumentException("The given array has the wrong length. Should be rowsR * columnsR.", nameof(r)); } if (tau.Length < Math.Min(rowsR, columnsR)) { - throw new ArgumentException(string.Format(Resources.ArrayTooSmall, "min(m,n)"), nameof(tau)); + throw new ArgumentException("The given array is too small. It must be at least min(m,n) long.", nameof(tau)); } if (q.Length != rowsR*rowsR) { - throw new ArgumentException(string.Format(Resources.ArgumentArrayWrongLength, "rowsR * rowsR"), nameof(q)); + throw new ArgumentException("The given array has the wrong length. Should be rowsR * rowsR.", nameof(q)); } var info = SafeNativeMethods.s_qr_factor(rowsR, columnsR, r, tau, q); @@ -652,17 +651,17 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Mkl if (q.Length != rowsA * columnsA) { - throw new ArgumentException(string.Format(Resources.ArgumentArrayWrongLength, "rowsR * columnsR"), nameof(q)); + throw new ArgumentException("The given array has the wrong length. Should be rowsR * columnsR.", nameof(q)); } if (tau.Length < Math.Min(rowsA, columnsA)) { - throw new ArgumentException(string.Format(Resources.ArrayTooSmall, "min(m,n)"), nameof(tau)); + throw new ArgumentException("The given array is too small. It must be at least min(m,n) long.", nameof(tau)); } if (r.Length != columnsA * columnsA) { - throw new ArgumentException(string.Format(Resources.ArgumentArrayWrongLength, "columnsA * columnsA"), nameof(r)); + throw new ArgumentException("The given array has the wrong length. Should be columnsA * columnsA.", nameof(r)); } var info = SafeNativeMethods.s_qr_thin_factor(rowsA, columnsA, q, tau, r); @@ -704,22 +703,22 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Mkl if (a.Length != rows * columns) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(a)); + throw new ArgumentException("The array arguments must have the same length.", nameof(a)); } if (b.Length != rows * columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (x.Length != columns * columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(x)); + throw new ArgumentException("The array arguments must have the same length.", nameof(x)); } if (rows < columns) { - throw new ArgumentException(Resources.RowsLessThanColumns); + throw new ArgumentException("The number of rows must greater than or equal to the number of columns."); } var info = SafeNativeMethods.s_qr_solve(rows, columns, columnsB, a, b, x); @@ -736,7 +735,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Mkl if (info > 0) { - throw new ArgumentException(Resources.ArgumentMatrixNotRankDeficient, nameof(a)); + throw new ArgumentException("Matrix must not be rank deficient.", nameof(a)); } } @@ -791,22 +790,22 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Mkl if (r.Length != rowsR * columnsR) { - throw new ArgumentException(string.Format(Resources.ArgumentArrayWrongLength, rowsR * columnsR), nameof(r)); + throw new ArgumentException($"The given array has the wrong length. Should be {rowsR * columnsR}.", nameof(r)); } if (q.Length != rowsQ * columnsQ) { - throw new ArgumentException(string.Format(Resources.ArgumentArrayWrongLength, rowsQ * columnsQ), nameof(q)); + throw new ArgumentException($"The given array has the wrong length. Should be {rowsQ * columnsQ}.", nameof(q)); } if (b.Length != rowsA * columnsB) { - throw new ArgumentException(string.Format(Resources.ArgumentArrayWrongLength, rowsA * columnsB), nameof(b)); + throw new ArgumentException($"The given array has the wrong length. Should be {rowsA * columnsB}.", nameof(b)); } if (x.Length != columnsA * columnsB) { - throw new ArgumentException(string.Format(Resources.ArgumentArrayWrongLength, columnsA * columnsB), nameof(x)); + throw new ArgumentException($"The given array has the wrong length. Should be {columnsA * columnsB}.", nameof(x)); } if (method == QRMethod.Full) @@ -859,12 +858,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Mkl if (b.Length != rowsA*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (x.Length != columnsA*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } var s = new float[Math.Min(rowsA, columnsA)]; @@ -915,17 +914,17 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Mkl if (u.Length != rowsA*rowsA) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(u)); + throw new ArgumentException("The array arguments must have the same length.", nameof(u)); } if (vt.Length != columnsA*columnsA) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(vt)); + throw new ArgumentException("The array arguments must have the same length.", nameof(vt)); } if (s.Length != Math.Min(rowsA, columnsA)) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(s)); + throw new ArgumentException("The array arguments must have the same length.", nameof(s)); } var info = SafeNativeMethods.s_svd_factor(computeVectors, rowsA, columnsA, a, s, u, vt); @@ -970,12 +969,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Mkl if (x.Length != y.Length) { - throw new ArgumentException(Resources.ArgumentArraysSameLength); + throw new ArgumentException("The array arguments must have the same length."); } if (x.Length != result.Length) { - throw new ArgumentException(Resources.ArgumentArraysSameLength); + throw new ArgumentException("The array arguments must have the same length."); } SafeNativeMethods.s_vector_add(x.Length, x, y, result); @@ -1005,12 +1004,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Mkl if (x.Length != y.Length) { - throw new ArgumentException(Resources.ArgumentArraysSameLength); + throw new ArgumentException("The array arguments must have the same length."); } if (x.Length != result.Length) { - throw new ArgumentException(Resources.ArgumentArraysSameLength); + throw new ArgumentException("The array arguments must have the same length."); } SafeNativeMethods.s_vector_subtract(x.Length, x, y, result); @@ -1040,12 +1039,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Mkl if (x.Length != y.Length) { - throw new ArgumentException(Resources.ArgumentArraysSameLength); + throw new ArgumentException("The array arguments must have the same length."); } if (x.Length != result.Length) { - throw new ArgumentException(Resources.ArgumentArraysSameLength); + throw new ArgumentException("The array arguments must have the same length."); } SafeNativeMethods.s_vector_multiply(x.Length, x, y, result); @@ -1075,12 +1074,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Mkl if (x.Length != y.Length) { - throw new ArgumentException(Resources.ArgumentArraysSameLength); + throw new ArgumentException("The array arguments must have the same length."); } if (x.Length != result.Length) { - throw new ArgumentException(Resources.ArgumentArraysSameLength); + throw new ArgumentException("The array arguments must have the same length."); } SafeNativeMethods.s_vector_divide(x.Length, x, y, result); @@ -1115,12 +1114,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Mkl if (x.Length != y.Length) { - throw new ArgumentException(Resources.ArgumentArraysSameLength); + throw new ArgumentException("The array arguments must have the same length."); } if (x.Length != result.Length) { - throw new ArgumentException(Resources.ArgumentArraysSameLength); + throw new ArgumentException("The array arguments must have the same length."); } SafeNativeMethods.s_vector_power(x.Length, x, y, result); @@ -1144,7 +1143,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Mkl if (matrix.Length != order*order) { - throw new ArgumentException(String.Format(Resources.ArgumentArrayWrongLength, order*order), nameof(matrix)); + throw new ArgumentException($"The given array has the wrong length. Should be {order * order}.", nameof(matrix)); } if (matrixEv == null) @@ -1154,7 +1153,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Mkl if (matrixEv.Length != order*order) { - throw new ArgumentException(String.Format(Resources.ArgumentArrayWrongLength, order*order), nameof(matrixEv)); + throw new ArgumentException($"The given array has the wrong length. Should be {order * order}.", nameof(matrixEv)); } if (vectorEv == null) @@ -1164,7 +1163,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Mkl if (vectorEv.Length != order) { - throw new ArgumentException(String.Format(Resources.ArgumentArrayWrongLength, order), nameof(vectorEv)); + throw new ArgumentException($"The given array has the wrong length. Should be {order}.", nameof(vectorEv)); } if (matrixD == null) @@ -1174,7 +1173,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.Mkl if (matrixD.Length != order*order) { - throw new ArgumentException(String.Format(Resources.ArgumentArrayWrongLength, order*order), nameof(matrixD)); + throw new ArgumentException($"The given array has the wrong length. Should be {order * order}.", nameof(matrixD)); } var info = SafeNativeMethods.s_eigen(isSymmetric, order, matrix, matrixEv, vectorEv, matrixD); diff --git a/src/Numerics/Providers/LinearAlgebra/OpenBlas/OpenBlasLinearAlgebraProvider.Complex.cs b/src/Numerics/Providers/LinearAlgebra/OpenBlas/OpenBlasLinearAlgebraProvider.Complex.cs index 377fbba3..d545cac0 100644 --- a/src/Numerics/Providers/LinearAlgebra/OpenBlas/OpenBlasLinearAlgebraProvider.Complex.cs +++ b/src/Numerics/Providers/LinearAlgebra/OpenBlas/OpenBlasLinearAlgebraProvider.Complex.cs @@ -32,7 +32,6 @@ using System; using System.Security; using MathNet.Numerics.LinearAlgebra.Factorization; -using MathNet.Numerics.Properties; using MathNet.Numerics.Providers.Common.OpenBlas; using Complex = System.Numerics.Complex; @@ -63,17 +62,17 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.OpenBlas if (rows <= 0) { - throw new ArgumentException(Resources.ArgumentMustBePositive, nameof(rows)); + throw new ArgumentException("Value must be positive.", nameof(rows)); } if (columns <= 0) { - throw new ArgumentException(Resources.ArgumentMustBePositive, nameof(columns)); + throw new ArgumentException("Value must be positive.", nameof(columns)); } if (matrix.Length < rows * columns) { - throw new ArgumentException(string.Format(Resources.ArrayTooSmall, rows * columns), nameof(matrix)); + throw new ArgumentException($"The given array is too small. It must be at least {rows * columns} long.", nameof(matrix)); } return SafeNativeMethods.z_matrix_norm((byte)norm, rows, columns, matrix); @@ -101,7 +100,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.OpenBlas if (x.Length != y.Length) { - throw new ArgumentException(Resources.ArgumentArraysSameLength); + throw new ArgumentException("The array arguments must have the same length."); } return SafeNativeMethods.z_dot_product(x.Length, x, y); @@ -130,7 +129,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.OpenBlas if (y.Length != x.Length) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } if (!ReferenceEquals(y, result)) @@ -230,12 +229,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.OpenBlas if (c.Length != m*n) { - throw new ArgumentException(Resources.ArgumentMatrixDimensions); + throw new ArgumentException("Matrix dimensions must agree."); } if (k != l) { - throw new ArgumentException(Resources.ArgumentMatrixDimensions); + throw new ArgumentException("Matrix dimensions must agree."); } SafeNativeMethods.z_matrix_multiply(transposeA, transposeB, m, n, k, alpha, a, b, beta, c); @@ -265,12 +264,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.OpenBlas if (data.Length != order*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(data)); + throw new ArgumentException("The array arguments must have the same length.", nameof(data)); } if (ipiv.Length != order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(ipiv)); + throw new ArgumentException("The array arguments must have the same length.", nameof(ipiv)); } var info = SafeNativeMethods.z_lu_factor(order, data, ipiv); @@ -297,7 +296,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.OpenBlas if (a.Length != order*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(a)); + throw new ArgumentException("The array arguments must have the same length.", nameof(a)); } var info = SafeNativeMethods.z_lu_inverse(order, a); @@ -340,12 +339,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.OpenBlas if (a.Length != order*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(a)); + throw new ArgumentException("The array arguments must have the same length.", nameof(a)); } if (ipiv.Length != order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(ipiv)); + throw new ArgumentException("The array arguments must have the same length.", nameof(ipiv)); } var info = SafeNativeMethods.z_lu_inverse_factored(order, a, ipiv); @@ -379,17 +378,17 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.OpenBlas if (a.Length != order*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(a)); + throw new ArgumentException("The array arguments must have the same length.", nameof(a)); } if (b.Length != columnsOfB*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (ReferenceEquals(a, b)) { - throw new ArgumentException(Resources.ArgumentReferenceDifferent); + throw new ArgumentException("Arguments must be different objects."); } var info = SafeNativeMethods.z_lu_solve(order, columnsOfB, a, b); @@ -429,22 +428,22 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.OpenBlas if (a.Length != order*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(a)); + throw new ArgumentException("The array arguments must have the same length.", nameof(a)); } if (ipiv.Length != order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(ipiv)); + throw new ArgumentException("The array arguments must have the same length.", nameof(ipiv)); } if (b.Length != columnsOfB*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (ReferenceEquals(a, b)) { - throw new ArgumentException(Resources.ArgumentReferenceDifferent); + throw new ArgumentException("Arguments must be different objects."); } var info = SafeNativeMethods.z_lu_solve_factored(order, columnsOfB, a, ipiv, b); @@ -477,12 +476,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.OpenBlas if (order < 1) { - throw new ArgumentException(Resources.ArgumentMustBePositive, nameof(order)); + throw new ArgumentException("Value must be positive.", nameof(order)); } if (a.Length != order*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(a)); + throw new ArgumentException("The array arguments must have the same length.", nameof(a)); } var info = SafeNativeMethods.z_cholesky_factor(order, a); @@ -494,7 +493,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.OpenBlas if (info > 0) { - throw new ArgumentException(Resources.ArgumentMatrixPositiveDefinite); + throw new ArgumentException("Matrix must be positive definite."); } } @@ -522,12 +521,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.OpenBlas if (b.Length != orderA*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (ReferenceEquals(a, b)) { - throw new ArgumentException(Resources.ArgumentReferenceDifferent); + throw new ArgumentException("Arguments must be different objects."); } var info = SafeNativeMethods.z_cholesky_solve(orderA, columnsB, a, b); @@ -566,12 +565,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.OpenBlas if (b.Length != orderA*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (ReferenceEquals(a, b)) { - throw new ArgumentException(Resources.ArgumentReferenceDifferent); + throw new ArgumentException("Arguments must be different objects."); } var info = SafeNativeMethods.z_cholesky_solve_factored(orderA, columnsB, a, b); @@ -609,17 +608,17 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.OpenBlas if (r.Length != rowsR*columnsR) { - throw new ArgumentException(string.Format(Resources.ArgumentArrayWrongLength, "rowsR * columnsR"), nameof(r)); + throw new ArgumentException("The given array has the wrong length. Should be rowsR * columnsR.", nameof(r)); } if (tau.Length < Math.Min(rowsR, columnsR)) { - throw new ArgumentException(string.Format(Resources.ArrayTooSmall, "min(m,n)"), nameof(tau)); + throw new ArgumentException("The given array is too small. It must be at least min(m,n) long.", nameof(tau)); } if (q.Length != rowsR*rowsR) { - throw new ArgumentException(string.Format(Resources.ArgumentArrayWrongLength, "rowsR * rowsR"), nameof(q)); + throw new ArgumentException("The given array has the wrong length. Should be rowsR * rowsR.", nameof(q)); } var info = SafeNativeMethods.z_qr_factor(rowsR, columnsR, r, tau, q); @@ -657,17 +656,17 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.OpenBlas if (q.Length != rowsA * columnsA) { - throw new ArgumentException(string.Format(Resources.ArgumentArrayWrongLength, "rowsR * columnsR"), nameof(q)); + throw new ArgumentException("The given array has the wrong length. Should be rowsR * columnsR.", nameof(q)); } if (tau.Length < Math.Min(rowsA, columnsA)) { - throw new ArgumentException(string.Format(Resources.ArrayTooSmall, "min(m,n)"), nameof(tau)); + throw new ArgumentException("The given array is too small. It must be at least min(m,n) long.", nameof(tau)); } if (r.Length != columnsA * columnsA) { - throw new ArgumentException(string.Format(Resources.ArgumentArrayWrongLength, "columnsA * columnsA"), nameof(r)); + throw new ArgumentException("The given array has the wrong length. Should be columnsA * columnsA.", nameof(r)); } var info = SafeNativeMethods.z_qr_thin_factor(rowsA, columnsA, q, tau, r); @@ -709,22 +708,22 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.OpenBlas if (a.Length != rows * columns) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(a)); + throw new ArgumentException("The array arguments must have the same length.", nameof(a)); } if (b.Length != rows * columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (x.Length != columns * columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(x)); + throw new ArgumentException("The array arguments must have the same length.", nameof(x)); } if (rows < columns) { - throw new ArgumentException(Resources.RowsLessThanColumns); + throw new ArgumentException("The number of rows must greater than or equal to the number of columns."); } var info = SafeNativeMethods.z_qr_solve(rows, columns, columnsB, a, b, x); @@ -741,7 +740,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.OpenBlas if (info > 0) { - throw new ArgumentException(Resources.ArgumentMatrixNotRankDeficient, nameof(a)); + throw new ArgumentException("Matrix must not be rank deficient.", nameof(a)); } } @@ -796,22 +795,22 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.OpenBlas if (r.Length != rowsR * columnsR) { - throw new ArgumentException(string.Format(Resources.ArgumentArrayWrongLength, rowsR * columnsR), nameof(r)); + throw new ArgumentException($"The given array has the wrong length. Should be {rowsR * columnsR}.", nameof(r)); } if (q.Length != rowsQ * columnsQ) { - throw new ArgumentException(string.Format(Resources.ArgumentArrayWrongLength, rowsQ * columnsQ), nameof(q)); + throw new ArgumentException($"The given array has the wrong length. Should be {rowsQ * columnsQ}.", nameof(q)); } if (b.Length != rowsA * columnsB) { - throw new ArgumentException(string.Format(Resources.ArgumentArrayWrongLength, rowsA * columnsB), nameof(b)); + throw new ArgumentException($"The given array has the wrong length. Should be {rowsA * columnsB}.", nameof(b)); } if (x.Length != columnsA * columnsB) { - throw new ArgumentException(string.Format(Resources.ArgumentArrayWrongLength, columnsA * columnsB), nameof(x)); + throw new ArgumentException($"The given array has the wrong length. Should be {columnsA * columnsB}.", nameof(x)); } if (method == QRMethod.Full) @@ -864,12 +863,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.OpenBlas if (b.Length != rowsA*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (x.Length != columnsA*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } var s = new Complex[Math.Min(rowsA, columnsA)]; @@ -920,17 +919,17 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.OpenBlas if (u.Length != rowsA*rowsA) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(u)); + throw new ArgumentException("The array arguments must have the same length.", nameof(u)); } if (vt.Length != columnsA*columnsA) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(vt)); + throw new ArgumentException("The array arguments must have the same length.", nameof(vt)); } if (s.Length != Math.Min(rowsA, columnsA)) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(s)); + throw new ArgumentException("The array arguments must have the same length.", nameof(s)); } var info = SafeNativeMethods.z_svd_factor(computeVectors, rowsA, columnsA, a, s, u, vt); @@ -969,7 +968,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.OpenBlas if (matrix.Length != order * order) { - throw new ArgumentException(String.Format(Resources.ArgumentArrayWrongLength, order * order), nameof(matrix)); + throw new ArgumentException($"The given array has the wrong length. Should be {order * order}.", nameof(matrix)); } if (matrixEv == null) @@ -979,7 +978,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.OpenBlas if (matrixEv.Length != order * order) { - throw new ArgumentException(String.Format(Resources.ArgumentArrayWrongLength, order * order), nameof(matrixEv)); + throw new ArgumentException($"The given array has the wrong length. Should be {order * order}.", nameof(matrixEv)); } if (vectorEv == null) @@ -989,7 +988,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.OpenBlas if (vectorEv.Length != order) { - throw new ArgumentException(String.Format(Resources.ArgumentArrayWrongLength, order), nameof(vectorEv)); + throw new ArgumentException($"The given array has the wrong length. Should be {order}.", nameof(vectorEv)); } if (matrixD == null) @@ -999,7 +998,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.OpenBlas if (matrixD.Length != order * order) { - throw new ArgumentException(String.Format(Resources.ArgumentArrayWrongLength, order * order), nameof(matrixD)); + throw new ArgumentException($"The given array has the wrong length. Should be {order * order}.", nameof(matrixD)); } var info = SafeNativeMethods.z_eigen(isSymmetric, order, matrix, matrixEv, vectorEv, matrixD); diff --git a/src/Numerics/Providers/LinearAlgebra/OpenBlas/OpenBlasLinearAlgebraProvider.Complex32.cs b/src/Numerics/Providers/LinearAlgebra/OpenBlas/OpenBlasLinearAlgebraProvider.Complex32.cs index bbf27368..7c5cd120 100644 --- a/src/Numerics/Providers/LinearAlgebra/OpenBlas/OpenBlasLinearAlgebraProvider.Complex32.cs +++ b/src/Numerics/Providers/LinearAlgebra/OpenBlas/OpenBlasLinearAlgebraProvider.Complex32.cs @@ -32,7 +32,6 @@ using System; using System.Security; using MathNet.Numerics.LinearAlgebra.Factorization; -using MathNet.Numerics.Properties; using MathNet.Numerics.Providers.Common.OpenBlas; using Complex = System.Numerics.Complex; @@ -63,17 +62,17 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.OpenBlas if (rows <= 0) { - throw new ArgumentException(Resources.ArgumentMustBePositive, nameof(rows)); + throw new ArgumentException("Value must be positive.", nameof(rows)); } if (columns <= 0) { - throw new ArgumentException(Resources.ArgumentMustBePositive, nameof(columns)); + throw new ArgumentException("Value must be positive.", nameof(columns)); } if (matrix.Length < rows * columns) { - throw new ArgumentException(string.Format(Resources.ArrayTooSmall, rows * columns), nameof(matrix)); + throw new ArgumentException($"The given array is too small. It must be at least {rows * columns} long.", nameof(matrix)); } return SafeNativeMethods.c_matrix_norm((byte)norm, rows, columns, matrix); @@ -101,7 +100,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.OpenBlas if (x.Length != y.Length) { - throw new ArgumentException(Resources.ArgumentArraysSameLength); + throw new ArgumentException("The array arguments must have the same length."); } return SafeNativeMethods.c_dot_product(x.Length, x, y); @@ -130,7 +129,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.OpenBlas if (y.Length != x.Length) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } if (!ReferenceEquals(y, result)) @@ -230,12 +229,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.OpenBlas if (c.Length != m*n) { - throw new ArgumentException(Resources.ArgumentMatrixDimensions); + throw new ArgumentException("Matrix dimensions must agree."); } if (k != l) { - throw new ArgumentException(Resources.ArgumentMatrixDimensions); + throw new ArgumentException("Matrix dimensions must agree."); } SafeNativeMethods.c_matrix_multiply(transposeA, transposeB, m, n, k, alpha, a, b, beta, c); @@ -265,12 +264,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.OpenBlas if (data.Length != order*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(data)); + throw new ArgumentException("The array arguments must have the same length.", nameof(data)); } if (ipiv.Length != order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(ipiv)); + throw new ArgumentException("The array arguments must have the same length.", nameof(ipiv)); } var info = SafeNativeMethods.c_lu_factor(order, data, ipiv); @@ -297,7 +296,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.OpenBlas if (a.Length != order*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(a)); + throw new ArgumentException("The array arguments must have the same length.", nameof(a)); } var info = SafeNativeMethods.c_lu_inverse(order, a); @@ -340,12 +339,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.OpenBlas if (a.Length != order*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(a)); + throw new ArgumentException("The array arguments must have the same length.", nameof(a)); } if (ipiv.Length != order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(ipiv)); + throw new ArgumentException("The array arguments must have the same length.", nameof(ipiv)); } var info = SafeNativeMethods.c_lu_inverse_factored(order, a, ipiv); @@ -379,17 +378,17 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.OpenBlas if (a.Length != order*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(a)); + throw new ArgumentException("The array arguments must have the same length.", nameof(a)); } if (b.Length != columnsOfB*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (ReferenceEquals(a, b)) { - throw new ArgumentException(Resources.ArgumentReferenceDifferent); + throw new ArgumentException("Arguments must be different objects."); } var info = SafeNativeMethods.c_lu_solve(order, columnsOfB, a, b); @@ -429,22 +428,22 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.OpenBlas if (a.Length != order*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(a)); + throw new ArgumentException("The array arguments must have the same length.", nameof(a)); } if (ipiv.Length != order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(ipiv)); + throw new ArgumentException("The array arguments must have the same length.", nameof(ipiv)); } if (b.Length != columnsOfB*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (ReferenceEquals(a, b)) { - throw new ArgumentException(Resources.ArgumentReferenceDifferent); + throw new ArgumentException("Arguments must be different objects."); } var info = SafeNativeMethods.c_lu_solve_factored(order, columnsOfB, a, ipiv, b); @@ -472,12 +471,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.OpenBlas if (order < 1) { - throw new ArgumentException(Resources.ArgumentMustBePositive, nameof(order)); + throw new ArgumentException("Value must be positive.", nameof(order)); } if (a.Length != order*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(a)); + throw new ArgumentException("The array arguments must have the same length.", nameof(a)); } var info = SafeNativeMethods.c_cholesky_factor(order, a); @@ -489,7 +488,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.OpenBlas if (info > 0) { - throw new ArgumentException(Resources.ArgumentMatrixPositiveDefinite); + throw new ArgumentException("Matrix must be positive definite."); } } @@ -517,12 +516,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.OpenBlas if (b.Length != orderA*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (ReferenceEquals(a, b)) { - throw new ArgumentException(Resources.ArgumentReferenceDifferent); + throw new ArgumentException("Arguments must be different objects."); } var info = SafeNativeMethods.c_cholesky_solve(orderA, columnsB, a, b); @@ -561,12 +560,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.OpenBlas if (b.Length != orderA*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (ReferenceEquals(a, b)) { - throw new ArgumentException(Resources.ArgumentReferenceDifferent); + throw new ArgumentException("Arguments must be different objects."); } var info = SafeNativeMethods.c_cholesky_solve_factored(orderA, columnsB, a, b); @@ -604,17 +603,17 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.OpenBlas if (r.Length != rowsR*columnsR) { - throw new ArgumentException(string.Format(Resources.ArgumentArrayWrongLength, "rowsR * columnsR"), nameof(r)); + throw new ArgumentException("The given array has the wrong length. Should be rowsR * columnsR.", nameof(r)); } if (tau.Length < Math.Min(rowsR, columnsR)) { - throw new ArgumentException(string.Format(Resources.ArrayTooSmall, "min(m,n)"), nameof(tau)); + throw new ArgumentException("The given array is too small. It must be at least min(m,n) long.", nameof(tau)); } if (q.Length != rowsR*rowsR) { - throw new ArgumentException(string.Format(Resources.ArgumentArrayWrongLength, "rowsR * rowsR"), nameof(q)); + throw new ArgumentException("The given array has the wrong length. Should be rowsR * rowsR.", nameof(q)); } var info = SafeNativeMethods.c_qr_factor(rowsR, columnsR, r, tau, q); @@ -652,17 +651,17 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.OpenBlas if (q.Length != rowsA * columnsA) { - throw new ArgumentException(string.Format(Resources.ArgumentArrayWrongLength, "rowsR * columnsR"), nameof(q)); + throw new ArgumentException("The given array has the wrong length. Should be rowsR * columnsR.", nameof(q)); } if (tau.Length < Math.Min(rowsA, columnsA)) { - throw new ArgumentException(string.Format(Resources.ArrayTooSmall, "min(m,n)"), nameof(tau)); + throw new ArgumentException("The given array is too small. It must be at least min(m,n) long.", nameof(tau)); } if (r.Length != columnsA * columnsA) { - throw new ArgumentException(string.Format(Resources.ArgumentArrayWrongLength, "columnsA * columnsA"), nameof(r)); + throw new ArgumentException("The given array has the wrong length. Should be columnsA * columnsA.", nameof(r)); } var info = SafeNativeMethods.c_qr_thin_factor(rowsA, columnsA, q, tau, r); @@ -704,22 +703,22 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.OpenBlas if (a.Length != rows * columns) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(a)); + throw new ArgumentException("The array arguments must have the same length.", nameof(a)); } if (b.Length != rows * columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (x.Length != columns * columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(x)); + throw new ArgumentException("The array arguments must have the same length.", nameof(x)); } if (rows < columns) { - throw new ArgumentException(Resources.RowsLessThanColumns); + throw new ArgumentException("The number of rows must greater than or equal to the number of columns."); } var info = SafeNativeMethods.c_qr_solve(rows, columns, columnsB, a, b, x); @@ -736,7 +735,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.OpenBlas if (info > 0) { - throw new ArgumentException(Resources.ArgumentMatrixNotRankDeficient, nameof(a)); + throw new ArgumentException("Matrix must not be rank deficient.", nameof(a)); } } @@ -791,22 +790,22 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.OpenBlas if (r.Length != rowsR * columnsR) { - throw new ArgumentException(string.Format(Resources.ArgumentArrayWrongLength, rowsR * columnsR), nameof(r)); + throw new ArgumentException($"The given array has the wrong length. Should be {rowsR * columnsR}.", nameof(r)); } if (q.Length != rowsQ * columnsQ) { - throw new ArgumentException(string.Format(Resources.ArgumentArrayWrongLength, rowsQ * columnsQ), nameof(q)); + throw new ArgumentException($"The given array has the wrong length. Should be {rowsQ * columnsQ}.", nameof(q)); } if (b.Length != rowsA * columnsB) { - throw new ArgumentException(string.Format(Resources.ArgumentArrayWrongLength, rowsA * columnsB), nameof(b)); + throw new ArgumentException($"The given array has the wrong length. Should be {rowsA * columnsB}.", nameof(b)); } if (x.Length != columnsA * columnsB) { - throw new ArgumentException(string.Format(Resources.ArgumentArrayWrongLength, columnsA * columnsB), nameof(x)); + throw new ArgumentException($"The given array has the wrong length. Should be {columnsA * columnsB}.", nameof(x)); } if (method == QRMethod.Full) @@ -859,12 +858,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.OpenBlas if (b.Length != rowsA*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (x.Length != columnsA*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } var s = new Complex32[Math.Min(rowsA, columnsA)]; @@ -915,17 +914,17 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.OpenBlas if (u.Length != rowsA * rowsA) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(u)); + throw new ArgumentException("The array arguments must have the same length.", nameof(u)); } if (vt.Length != columnsA * columnsA) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(vt)); + throw new ArgumentException("The array arguments must have the same length.", nameof(vt)); } if (s.Length != Math.Min(rowsA, columnsA)) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(s)); + throw new ArgumentException("The array arguments must have the same length.", nameof(s)); } var info = SafeNativeMethods.c_svd_factor(computeVectors, rowsA, columnsA, a, s, u, vt); @@ -964,7 +963,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.OpenBlas if (matrix.Length != order * order) { - throw new ArgumentException(String.Format(Resources.ArgumentArrayWrongLength, order * order), nameof(matrix)); + throw new ArgumentException($"The given array has the wrong length. Should be {order * order}.", nameof(matrix)); } if (matrixEv == null) @@ -974,7 +973,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.OpenBlas if (matrixEv.Length != order * order) { - throw new ArgumentException(String.Format(Resources.ArgumentArrayWrongLength, order * order), nameof(matrixEv)); + throw new ArgumentException($"The given array has the wrong length. Should be {order * order}.", nameof(matrixEv)); } if (vectorEv == null) @@ -984,7 +983,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.OpenBlas if (vectorEv.Length != order) { - throw new ArgumentException(String.Format(Resources.ArgumentArrayWrongLength, order), nameof(vectorEv)); + throw new ArgumentException($"The given array has the wrong length. Should be {order}.", nameof(vectorEv)); } if (matrixD == null) @@ -994,7 +993,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.OpenBlas if (matrixD.Length != order * order) { - throw new ArgumentException(string.Format(Resources.ArgumentArrayWrongLength, order * order), nameof(matrixD)); + throw new ArgumentException($"The given array has the wrong length. Should be {order * order}.", nameof(matrixD)); } var info = SafeNativeMethods.c_eigen(isSymmetric, order, matrix, matrixEv, vectorEv, matrixD); diff --git a/src/Numerics/Providers/LinearAlgebra/OpenBlas/OpenBlasLinearAlgebraProvider.Double.cs b/src/Numerics/Providers/LinearAlgebra/OpenBlas/OpenBlasLinearAlgebraProvider.Double.cs index be0793b7..ecd06070 100644 --- a/src/Numerics/Providers/LinearAlgebra/OpenBlas/OpenBlasLinearAlgebraProvider.Double.cs +++ b/src/Numerics/Providers/LinearAlgebra/OpenBlas/OpenBlasLinearAlgebraProvider.Double.cs @@ -32,7 +32,6 @@ using System; using System.Security; using MathNet.Numerics.LinearAlgebra.Factorization; -using MathNet.Numerics.Properties; using MathNet.Numerics.Providers.Common.OpenBlas; using Complex = System.Numerics.Complex; @@ -63,17 +62,17 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.OpenBlas if (rows <= 0) { - throw new ArgumentException(Resources.ArgumentMustBePositive, nameof(rows)); + throw new ArgumentException("Value must be positive.", nameof(rows)); } if (columns <= 0) { - throw new ArgumentException(Resources.ArgumentMustBePositive, nameof(columns)); + throw new ArgumentException("Value must be positive.", nameof(columns)); } if (matrix.Length < rows * columns) { - throw new ArgumentException(string.Format(Resources.ArrayTooSmall, rows * columns), nameof(matrix)); + throw new ArgumentException($"The given array is too small. It must be at least {rows * columns} long.", nameof(matrix)); } return SafeNativeMethods.d_matrix_norm((byte)norm, rows, columns, matrix); @@ -101,7 +100,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.OpenBlas if (x.Length != y.Length) { - throw new ArgumentException(Resources.ArgumentArraysSameLength); + throw new ArgumentException("The array arguments must have the same length."); } return SafeNativeMethods.d_dot_product(x.Length, x, y); @@ -130,7 +129,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.OpenBlas if (y.Length != x.Length) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } if (!ReferenceEquals(y, result)) @@ -230,12 +229,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.OpenBlas if (c.Length != m*n) { - throw new ArgumentException(Resources.ArgumentMatrixDimensions); + throw new ArgumentException("Matrix dimensions must agree."); } if (k != l) { - throw new ArgumentException(Resources.ArgumentMatrixDimensions); + throw new ArgumentException("Matrix dimensions must agree."); } SafeNativeMethods.d_matrix_multiply(transposeA, transposeB, m, n, k, alpha, a, b, beta, c); @@ -265,12 +264,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.OpenBlas if (data.Length != order*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(data)); + throw new ArgumentException("The array arguments must have the same length.", nameof(data)); } if (ipiv.Length != order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(ipiv)); + throw new ArgumentException("The array arguments must have the same length.", nameof(ipiv)); } var info = SafeNativeMethods.d_lu_factor(order, data, ipiv); @@ -297,7 +296,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.OpenBlas if (a.Length != order*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(a)); + throw new ArgumentException("The array arguments must have the same length.", nameof(a)); } var info = SafeNativeMethods.d_lu_inverse(order, a); @@ -340,12 +339,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.OpenBlas if (a.Length != order*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(a)); + throw new ArgumentException("The array arguments must have the same length.", nameof(a)); } if (ipiv.Length != order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(ipiv)); + throw new ArgumentException("The array arguments must have the same length.", nameof(ipiv)); } var info = SafeNativeMethods.d_lu_inverse_factored(order, a, ipiv); @@ -379,17 +378,17 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.OpenBlas if (a.Length != order*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(a)); + throw new ArgumentException("The array arguments must have the same length.", nameof(a)); } if (b.Length != columnsOfB*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (ReferenceEquals(a, b)) { - throw new ArgumentException(Resources.ArgumentReferenceDifferent); + throw new ArgumentException("Arguments must be different objects."); } var info = SafeNativeMethods.d_lu_solve(order, columnsOfB, a, b); @@ -429,22 +428,22 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.OpenBlas if (a.Length != order*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(a)); + throw new ArgumentException("The array arguments must have the same length.", nameof(a)); } if (ipiv.Length != order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(ipiv)); + throw new ArgumentException("The array arguments must have the same length.", nameof(ipiv)); } if (b.Length != columnsOfB*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (ReferenceEquals(a, b)) { - throw new ArgumentException(Resources.ArgumentReferenceDifferent); + throw new ArgumentException("Arguments must be different objects."); } var info = SafeNativeMethods.d_lu_solve_factored(order, columnsOfB, a, ipiv, b); @@ -472,12 +471,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.OpenBlas if (order < 1) { - throw new ArgumentException(Resources.ArgumentMustBePositive, nameof(order)); + throw new ArgumentException("Value must be positive.", nameof(order)); } if (a.Length != order*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(a)); + throw new ArgumentException("The array arguments must have the same length.", nameof(a)); } var info = SafeNativeMethods.d_cholesky_factor(order, a); @@ -494,7 +493,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.OpenBlas if (info > 0) { - throw new ArgumentException(Resources.ArgumentMatrixPositiveDefinite); + throw new ArgumentException("Matrix must be positive definite."); } } @@ -522,12 +521,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.OpenBlas if (b.Length != orderA*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (ReferenceEquals(a, b)) { - throw new ArgumentException(Resources.ArgumentReferenceDifferent); + throw new ArgumentException("Arguments must be different objects."); } var info = SafeNativeMethods.d_cholesky_solve(orderA, columnsB, a, b); @@ -566,12 +565,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.OpenBlas if (b.Length != orderA*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (ReferenceEquals(a, b)) { - throw new ArgumentException(Resources.ArgumentReferenceDifferent); + throw new ArgumentException("Arguments must be different objects."); } var info = SafeNativeMethods.d_cholesky_solve_factored(orderA, columnsB, a, b); @@ -609,17 +608,17 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.OpenBlas if (r.Length != rowsR*columnsR) { - throw new ArgumentException(string.Format(Resources.ArgumentArrayWrongLength, "rowsR * columnsR"), nameof(r)); + throw new ArgumentException("The given array has the wrong length. Should be rowsR * columnsR.", nameof(r)); } if (tau.Length < Math.Min(rowsR, columnsR)) { - throw new ArgumentException(string.Format(Resources.ArrayTooSmall, "min(m,n)"), nameof(tau)); + throw new ArgumentException("The given array is too small. It must be at least min(m,n) long.", nameof(tau)); } if (q.Length != rowsR*rowsR) { - throw new ArgumentException(string.Format(Resources.ArgumentArrayWrongLength, "rowsR * rowsR"), nameof(q)); + throw new ArgumentException("The given array has the wrong length. Should be rowsR * rowsR.", nameof(q)); } var info = SafeNativeMethods.d_qr_factor(rowsR, columnsR, r, tau, q); @@ -657,17 +656,17 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.OpenBlas if (q.Length != rowsA*columnsA) { - throw new ArgumentException(string.Format(Resources.ArgumentArrayWrongLength, "rowsR * columnsR"), nameof(q)); + throw new ArgumentException("The given array has the wrong length. Should be rowsR * columnsR.", nameof(q)); } if (tau.Length < Math.Min(rowsA, columnsA)) { - throw new ArgumentException(string.Format(Resources.ArrayTooSmall, "min(m,n)"), nameof(tau)); + throw new ArgumentException("The given array is too small. It must be at least min(m,n) long.", nameof(tau)); } if (r.Length != columnsA*columnsA) { - throw new ArgumentException(string.Format(Resources.ArgumentArrayWrongLength, "columnsA * columnsA"), nameof(r)); + throw new ArgumentException("The given array has the wrong length. Should be columnsA * columnsA.", nameof(r)); } var info = SafeNativeMethods.d_qr_thin_factor(rowsA, columnsA, q, tau, r); @@ -709,22 +708,22 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.OpenBlas if (a.Length != rows * columns) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(a)); + throw new ArgumentException("The array arguments must have the same length.", nameof(a)); } if (b.Length != rows * columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (x.Length != columns * columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(x)); + throw new ArgumentException("The array arguments must have the same length.", nameof(x)); } if (rows < columns) { - throw new ArgumentException(Resources.RowsLessThanColumns); + throw new ArgumentException("The number of rows must greater than or equal to the number of columns."); } var info = SafeNativeMethods.d_qr_solve(rows, columns, columnsB, a, b, x); @@ -741,7 +740,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.OpenBlas if (info > 0) { - throw new ArgumentException(Resources.ArgumentMatrixNotRankDeficient, nameof(a)); + throw new ArgumentException("Matrix must not be rank deficient.", nameof(a)); } } @@ -796,22 +795,22 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.OpenBlas if (r.Length != rowsR * columnsR) { - throw new ArgumentException(string.Format(Resources.ArgumentArrayWrongLength, rowsR * columnsR), nameof(r)); + throw new ArgumentException($"The given array has the wrong length. Should be {rowsR * columnsR}.", nameof(r)); } if (q.Length != rowsQ * columnsQ) { - throw new ArgumentException(string.Format(Resources.ArgumentArrayWrongLength, rowsQ * columnsQ), nameof(q)); + throw new ArgumentException($"The given array has the wrong length. Should be {rowsQ * columnsQ}.", nameof(q)); } if (b.Length != rowsA * columnsB) { - throw new ArgumentException(string.Format(Resources.ArgumentArrayWrongLength, rowsA * columnsB), nameof(b)); + throw new ArgumentException($"The given array has the wrong length. Should be {rowsA * columnsB}.", nameof(b)); } if (x.Length != columnsA * columnsB) { - throw new ArgumentException(string.Format(Resources.ArgumentArrayWrongLength, columnsA * columnsB), nameof(x)); + throw new ArgumentException($"The given array has the wrong length. Should be {columnsA * columnsB}.", nameof(x)); } if (method == QRMethod.Full) @@ -864,12 +863,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.OpenBlas if (b.Length != rowsA*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (x.Length != columnsA*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } var s = new double[Math.Min(rowsA, columnsA)]; @@ -920,17 +919,17 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.OpenBlas if (u.Length != rowsA * rowsA) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(u)); + throw new ArgumentException("The array arguments must have the same length.", nameof(u)); } if (vt.Length != columnsA * columnsA) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(vt)); + throw new ArgumentException("The array arguments must have the same length.", nameof(vt)); } if (s.Length != Math.Min(rowsA, columnsA)) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(s)); + throw new ArgumentException("The array arguments must have the same length.", nameof(s)); } var info = SafeNativeMethods.d_svd_factor(computeVectors, rowsA, columnsA, a, s, u, vt); @@ -969,7 +968,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.OpenBlas if (matrix.Length != order*order) { - throw new ArgumentException(String.Format(Resources.ArgumentArrayWrongLength, order*order), nameof(matrix)); + throw new ArgumentException($"The given array has the wrong length. Should be {order * order}.", nameof(matrix)); } if (matrixEv == null) @@ -979,7 +978,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.OpenBlas if (matrixEv.Length != order*order) { - throw new ArgumentException(String.Format(Resources.ArgumentArrayWrongLength, order*order), nameof(matrixEv)); + throw new ArgumentException($"The given array has the wrong length. Should be {order * order}.", nameof(matrixEv)); } if (vectorEv == null) @@ -989,7 +988,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.OpenBlas if (vectorEv.Length != order) { - throw new ArgumentException(String.Format(Resources.ArgumentArrayWrongLength, order), nameof(vectorEv)); + throw new ArgumentException($"The given array has the wrong length. Should be {order}.", nameof(vectorEv)); } if (matrixD == null) @@ -999,7 +998,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.OpenBlas if (matrixD.Length != order*order) { - throw new ArgumentException(String.Format(Resources.ArgumentArrayWrongLength, order*order), nameof(matrixD)); + throw new ArgumentException($"The given array has the wrong length. Should be {order * order}.", nameof(matrixD)); } var info = SafeNativeMethods.d_eigen(isSymmetric, order, matrix, matrixEv, vectorEv, matrixD); diff --git a/src/Numerics/Providers/LinearAlgebra/OpenBlas/OpenBlasLinearAlgebraProvider.Single.cs b/src/Numerics/Providers/LinearAlgebra/OpenBlas/OpenBlasLinearAlgebraProvider.Single.cs index 6603aa73..a439a143 100644 --- a/src/Numerics/Providers/LinearAlgebra/OpenBlas/OpenBlasLinearAlgebraProvider.Single.cs +++ b/src/Numerics/Providers/LinearAlgebra/OpenBlas/OpenBlasLinearAlgebraProvider.Single.cs @@ -32,7 +32,6 @@ using System; using System.Security; using MathNet.Numerics.LinearAlgebra.Factorization; -using MathNet.Numerics.Properties; using MathNet.Numerics.Providers.Common.OpenBlas; using Complex = System.Numerics.Complex; @@ -63,17 +62,17 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.OpenBlas if (rows <= 0) { - throw new ArgumentException(Resources.ArgumentMustBePositive, nameof(rows)); + throw new ArgumentException("Value must be positive.", nameof(rows)); } if (columns <= 0) { - throw new ArgumentException(Resources.ArgumentMustBePositive, nameof(columns)); + throw new ArgumentException("Value must be positive.", nameof(columns)); } if (matrix.Length < rows * columns) { - throw new ArgumentException(string.Format(Resources.ArrayTooSmall, rows * columns), nameof(matrix)); + throw new ArgumentException($"The given array is too small. It must be at least {rows * columns} long.", nameof(matrix)); } return SafeNativeMethods.s_matrix_norm((byte)norm, rows, columns, matrix); @@ -101,7 +100,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.OpenBlas if (x.Length != y.Length) { - throw new ArgumentException(Resources.ArgumentArraysSameLength); + throw new ArgumentException("The array arguments must have the same length."); } return SafeNativeMethods.s_dot_product(x.Length, x, y); @@ -130,7 +129,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.OpenBlas if (y.Length != x.Length) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } if (!ReferenceEquals(y, result)) @@ -230,12 +229,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.OpenBlas if (c.Length != m*n) { - throw new ArgumentException(Resources.ArgumentMatrixDimensions); + throw new ArgumentException("Matrix dimensions must agree."); } if (k != l) { - throw new ArgumentException(Resources.ArgumentMatrixDimensions); + throw new ArgumentException("Matrix dimensions must agree."); } SafeNativeMethods.s_matrix_multiply(transposeA, transposeB, m, n, k, alpha, a, b, beta, c); @@ -265,12 +264,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.OpenBlas if (data.Length != order*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(data)); + throw new ArgumentException("The array arguments must have the same length.", nameof(data)); } if (ipiv.Length != order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(ipiv)); + throw new ArgumentException("The array arguments must have the same length.", nameof(ipiv)); } var info = SafeNativeMethods.s_lu_factor(order, data, ipiv); @@ -297,7 +296,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.OpenBlas if (a.Length != order*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(a)); + throw new ArgumentException("The array arguments must have the same length.", nameof(a)); } var info = SafeNativeMethods.s_lu_inverse(order, a); @@ -340,12 +339,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.OpenBlas if (a.Length != order*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(a)); + throw new ArgumentException("The array arguments must have the same length.", nameof(a)); } if (ipiv.Length != order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(ipiv)); + throw new ArgumentException("The array arguments must have the same length.", nameof(ipiv)); } var info = SafeNativeMethods.s_lu_inverse_factored(order, a, ipiv); @@ -379,17 +378,17 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.OpenBlas if (a.Length != order*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(a)); + throw new ArgumentException("The array arguments must have the same length.", nameof(a)); } if (b.Length != columnsOfB*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (ReferenceEquals(a, b)) { - throw new ArgumentException(Resources.ArgumentReferenceDifferent); + throw new ArgumentException("Arguments must be different objects."); } var info = SafeNativeMethods.s_lu_solve(order, columnsOfB, a, b); @@ -429,22 +428,22 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.OpenBlas if (a.Length != order*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(a)); + throw new ArgumentException("The array arguments must have the same length.", nameof(a)); } if (ipiv.Length != order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(ipiv)); + throw new ArgumentException("The array arguments must have the same length.", nameof(ipiv)); } if (b.Length != columnsOfB*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (ReferenceEquals(a, b)) { - throw new ArgumentException(Resources.ArgumentReferenceDifferent); + throw new ArgumentException("Arguments must be different objects."); } var info = SafeNativeMethods.s_lu_solve_factored(order, columnsOfB, a, ipiv, b); @@ -472,12 +471,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.OpenBlas if (order < 1) { - throw new ArgumentException(Resources.ArgumentMustBePositive, nameof(order)); + throw new ArgumentException("Value must be positive.", nameof(order)); } if (a.Length != order*order) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(a)); + throw new ArgumentException("The array arguments must have the same length.", nameof(a)); } var info = SafeNativeMethods.s_cholesky_factor(order, a); @@ -489,7 +488,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.OpenBlas if (info > 0) { - throw new ArgumentException(Resources.ArgumentMatrixPositiveDefinite); + throw new ArgumentException("Matrix must be positive definite."); } } @@ -517,12 +516,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.OpenBlas if (b.Length != orderA*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (ReferenceEquals(a, b)) { - throw new ArgumentException(Resources.ArgumentReferenceDifferent); + throw new ArgumentException("Arguments must be different objects."); } var info = SafeNativeMethods.s_cholesky_solve(orderA, columnsB, a, b); @@ -561,12 +560,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.OpenBlas if (b.Length != orderA*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (ReferenceEquals(a, b)) { - throw new ArgumentException(Resources.ArgumentReferenceDifferent); + throw new ArgumentException("Arguments must be different objects."); } var info = SafeNativeMethods.s_cholesky_solve_factored(orderA, columnsB, a, b); @@ -604,17 +603,17 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.OpenBlas if (r.Length != rowsR*columnsR) { - throw new ArgumentException(string.Format(Resources.ArgumentArrayWrongLength, "rowsR * columnsR"), nameof(r)); + throw new ArgumentException("The given array has the wrong length. Should be rowsR * columnsR.", nameof(r)); } if (tau.Length < Math.Min(rowsR, columnsR)) { - throw new ArgumentException(string.Format(Resources.ArrayTooSmall, "min(m,n)"), nameof(tau)); + throw new ArgumentException("The given array is too small. It must be at least min(m,n) long.", nameof(tau)); } if (q.Length != rowsR*rowsR) { - throw new ArgumentException(string.Format(Resources.ArgumentArrayWrongLength, "rowsR * rowsR"), nameof(q)); + throw new ArgumentException("The given array has the wrong length. Should be rowsR * rowsR.", nameof(q)); } var info = SafeNativeMethods.s_qr_factor(rowsR, columnsR, r, tau, q); @@ -652,17 +651,17 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.OpenBlas if (q.Length != rowsA * columnsA) { - throw new ArgumentException(string.Format(Resources.ArgumentArrayWrongLength, "rowsR * columnsR"), nameof(q)); + throw new ArgumentException("The given array has the wrong length. Should be rowsR * columnsR.", nameof(q)); } if (tau.Length < Math.Min(rowsA, columnsA)) { - throw new ArgumentException(string.Format(Resources.ArrayTooSmall, "min(m,n)"), nameof(tau)); + throw new ArgumentException("The given array is too small. It must be at least min(m,n) long.", nameof(tau)); } if (r.Length != columnsA * columnsA) { - throw new ArgumentException(string.Format(Resources.ArgumentArrayWrongLength, "columnsA * columnsA"), nameof(r)); + throw new ArgumentException("The given array has the wrong length. Should be columnsA * columnsA.", nameof(r)); } var info = SafeNativeMethods.s_qr_thin_factor(rowsA, columnsA, q, tau, r); @@ -704,22 +703,22 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.OpenBlas if (a.Length != rows * columns) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(a)); + throw new ArgumentException("The array arguments must have the same length.", nameof(a)); } if (b.Length != rows * columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (x.Length != columns * columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(x)); + throw new ArgumentException("The array arguments must have the same length.", nameof(x)); } if (rows < columns) { - throw new ArgumentException(Resources.RowsLessThanColumns); + throw new ArgumentException("The number of rows must greater than or equal to the number of columns."); } var info = SafeNativeMethods.s_qr_solve(rows, columns, columnsB, a, b, x); @@ -736,7 +735,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.OpenBlas if (info > 0) { - throw new ArgumentException(Resources.ArgumentMatrixNotRankDeficient, nameof(a)); + throw new ArgumentException("Matrix must not be rank deficient.", nameof(a)); } } @@ -791,22 +790,22 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.OpenBlas if (r.Length != rowsR * columnsR) { - throw new ArgumentException(string.Format(Resources.ArgumentArrayWrongLength, rowsR * columnsR), nameof(r)); + throw new ArgumentException($"The given array has the wrong length. Should be {rowsR * columnsR}.", nameof(r)); } if (q.Length != rowsQ * columnsQ) { - throw new ArgumentException(string.Format(Resources.ArgumentArrayWrongLength, rowsQ * columnsQ), nameof(q)); + throw new ArgumentException($"The given array has the wrong length. Should be {rowsQ * columnsQ}.", nameof(q)); } if (b.Length != rowsA * columnsB) { - throw new ArgumentException(string.Format(Resources.ArgumentArrayWrongLength, rowsA * columnsB), nameof(b)); + throw new ArgumentException($"The given array has the wrong length. Should be {rowsA * columnsB}.", nameof(b)); } if (x.Length != columnsA * columnsB) { - throw new ArgumentException(string.Format(Resources.ArgumentArrayWrongLength, columnsA * columnsB), nameof(x)); + throw new ArgumentException($"The given array has the wrong length. Should be {columnsA * columnsB}.", nameof(x)); } if (method == QRMethod.Full) @@ -859,12 +858,12 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.OpenBlas if (b.Length != rowsA*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } if (x.Length != columnsA*columnsB) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(b)); + throw new ArgumentException("The array arguments must have the same length.", nameof(b)); } var s = new float[Math.Min(rowsA, columnsA)]; @@ -915,17 +914,17 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.OpenBlas if (u.Length != rowsA*rowsA) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(u)); + throw new ArgumentException("The array arguments must have the same length.", nameof(u)); } if (vt.Length != columnsA*columnsA) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(vt)); + throw new ArgumentException("The array arguments must have the same length.", nameof(vt)); } if (s.Length != Math.Min(rowsA, columnsA)) { - throw new ArgumentException(Resources.ArgumentArraysSameLength, nameof(s)); + throw new ArgumentException("The array arguments must have the same length.", nameof(s)); } var info = SafeNativeMethods.s_svd_factor(computeVectors, rowsA, columnsA, a, s, u, vt); @@ -964,7 +963,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.OpenBlas if (matrix.Length != order*order) { - throw new ArgumentException(String.Format(Resources.ArgumentArrayWrongLength, order*order), nameof(matrix)); + throw new ArgumentException($"The given array has the wrong length. Should be {order * order}.", nameof(matrix)); } if (matrixEv == null) @@ -974,7 +973,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.OpenBlas if (matrixEv.Length != order*order) { - throw new ArgumentException(String.Format(Resources.ArgumentArrayWrongLength, order*order), nameof(matrixEv)); + throw new ArgumentException($"The given array has the wrong length. Should be {order * order}.", nameof(matrixEv)); } if (vectorEv == null) @@ -984,7 +983,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.OpenBlas if (vectorEv.Length != order) { - throw new ArgumentException(String.Format(Resources.ArgumentArrayWrongLength, order), nameof(vectorEv)); + throw new ArgumentException($"The given array has the wrong length. Should be {order}.", nameof(vectorEv)); } if (matrixD == null) @@ -994,7 +993,7 @@ namespace MathNet.Numerics.Providers.LinearAlgebra.OpenBlas if (matrixD.Length != order*order) { - throw new ArgumentException(String.Format(Resources.ArgumentArrayWrongLength, order*order), nameof(matrixD)); + throw new ArgumentException($"The given array has the wrong length. Should be {order * order}.", nameof(matrixD)); } var info = SafeNativeMethods.s_eigen(isSymmetric, order, matrix, matrixEv, vectorEv, matrixD); diff --git a/src/Numerics/Random/Palf.cs b/src/Numerics/Random/Palf.cs index 966696b8..a2d6d97d 100644 --- a/src/Numerics/Random/Palf.cs +++ b/src/Numerics/Random/Palf.cs @@ -30,7 +30,6 @@ using System; using System.Collections.Generic; using System.Runtime.Serialization; -using MathNet.Numerics.Properties; #if !NETSTANDARD1_3 using System.Runtime; @@ -117,12 +116,12 @@ namespace MathNet.Numerics.Random { if (shortLag < 1) { - throw new ArgumentException(Resources.ArgumentMustBePositive, nameof(shortLag)); + throw new ArgumentException("Value must be positive.", nameof(shortLag)); } if (longLag <= shortLag) { - throw new ArgumentException(Resources.ArgumentUpperBoundMustBeLargerThanLowerBound, nameof(longLag)); + throw new ArgumentException("The upper bound must be strictly larger than the lower bound.", nameof(longLag)); } if (seed == 0) diff --git a/src/Numerics/Random/RandomSource.cs b/src/Numerics/Random/RandomSource.cs index 9b764518..fea61287 100644 --- a/src/Numerics/Random/RandomSource.cs +++ b/src/Numerics/Random/RandomSource.cs @@ -30,7 +30,6 @@ using System; using System.Collections.Generic; using System.Runtime.Serialization; -using MathNet.Numerics.Properties; namespace MathNet.Numerics.Random { @@ -153,7 +152,7 @@ namespace MathNet.Numerics.Random // Invalid case: Zero and less are not valid use cases. if (maxExclusive <= 0) { - throw new ArgumentException(Resources.ArgumentMustBePositive); + throw new ArgumentException("Value must be positive."); } // Fast case: Only zero is allowed to be returned. No sampling is needed. @@ -196,7 +195,7 @@ namespace MathNet.Numerics.Random // Invalid case: empty range. if (minInclusive >= maxExclusive) { - throw new ArgumentException(Resources.ArgumentMaxExclusiveMustBeLargerThanMinInclusive); + throw new ArgumentException("In the specified range, the exclusive maximum must be greater than the inclusive minimum."); } // Fast case: Only minInclusive is allowed to be returned. No sampling is needed. @@ -277,7 +276,7 @@ namespace MathNet.Numerics.Random // Invalid case: Zero and less are not valid use cases. if (maxExclusive <= 0) { - throw new ArgumentException(Resources.ArgumentMustBePositive); + throw new ArgumentException("Value must be positive."); } // Fast case: Only zero is allowed to be returned. No sampling is needed. @@ -337,7 +336,7 @@ namespace MathNet.Numerics.Random // Invalid case: empty range. if (minInclusive >= maxExclusive) { - throw new ArgumentException(Resources.ArgumentMaxExclusiveMustBeLargerThanMinInclusive); + throw new ArgumentException("In the specified range, the exclusive maximum must be greater than the inclusive minimum."); } // Fast case: Only minInclusive is allowed to be returned. No sampling is needed. @@ -427,7 +426,7 @@ namespace MathNet.Numerics.Random { if (minInclusive > maxExclusive) { - throw new ArgumentException(Resources.ArgumentMinValueGreaterThanMaxValue); + throw new ArgumentException("In the specified range, the minimum is greater than maximum."); } for (int i = 0; i < 64; i++) diff --git a/src/Numerics/Random/Xorshift.cs b/src/Numerics/Random/Xorshift.cs index 2324364b..29a23af4 100644 --- a/src/Numerics/Random/Xorshift.cs +++ b/src/Numerics/Random/Xorshift.cs @@ -30,7 +30,6 @@ using System; using System.Collections.Generic; using System.Runtime.Serialization; -using MathNet.Numerics.Properties; #if !NETSTANDARD1_3 using System.Runtime; @@ -248,7 +247,7 @@ namespace MathNet.Numerics.Random if (a <= c) { - throw new ArgumentException(string.Format(Resources.ArgumentOutOfRangeGreater, "a", "c"), nameof(a)); + throw new ArgumentException("a must be greater than c.", nameof(a)); } _x = (uint)seed; @@ -316,7 +315,7 @@ namespace MathNet.Numerics.Random { if (a <= c) { - throw new ArgumentException(string.Format(Resources.ArgumentOutOfRangeGreater, "a", "c"), nameof(a)); + throw new ArgumentException("a must be greater than c.", nameof(a)); } if (seed == 0) @@ -359,7 +358,7 @@ namespace MathNet.Numerics.Random { if (a <= c) { - throw new ArgumentException(string.Format(Resources.ArgumentOutOfRangeGreater, "a", "c"), nameof(a)); + throw new ArgumentException("a must be greater than c.", nameof(a)); } if (seed == 0) diff --git a/src/Numerics/RootFinding/Bisection.cs b/src/Numerics/RootFinding/Bisection.cs index d0faa3f5..1df8e06f 100644 --- a/src/Numerics/RootFinding/Bisection.cs +++ b/src/Numerics/RootFinding/Bisection.cs @@ -28,7 +28,6 @@ // using System; -using MathNet.Numerics.Properties; namespace MathNet.Numerics.RootFinding { @@ -69,7 +68,7 @@ namespace MathNet.Numerics.RootFinding return root; } - throw new NonConvergenceException(Resources.RootFindingFailed); + throw new NonConvergenceException("The algorithm has failed, exceeded the number of iterations allowed or there is no root within the provided bounds."); } /// Find a solution of the equation f(x)=0. diff --git a/src/Numerics/RootFinding/Brent.cs b/src/Numerics/RootFinding/Brent.cs index fd9bb31e..f797c17d 100644 --- a/src/Numerics/RootFinding/Brent.cs +++ b/src/Numerics/RootFinding/Brent.cs @@ -28,7 +28,6 @@ // using System; -using MathNet.Numerics.Properties; namespace MathNet.Numerics.RootFinding { @@ -70,7 +69,7 @@ namespace MathNet.Numerics.RootFinding return root; } - throw new NonConvergenceException(Resources.RootFindingFailed); + throw new NonConvergenceException("The algorithm has failed, exceeded the number of iterations allowed or there is no root within the provided bounds."); } /// Find a solution of the equation f(x)=0. diff --git a/src/Numerics/RootFinding/Broyden.cs b/src/Numerics/RootFinding/Broyden.cs index e4cd2a83..f7c2240c 100644 --- a/src/Numerics/RootFinding/Broyden.cs +++ b/src/Numerics/RootFinding/Broyden.cs @@ -30,7 +30,6 @@ using System; using MathNet.Numerics.LinearAlgebra; using MathNet.Numerics.LinearAlgebra.Double; -using MathNet.Numerics.Properties; namespace MathNet.Numerics.RootFinding { @@ -56,7 +55,7 @@ namespace MathNet.Numerics.RootFinding return root; } - throw new NonConvergenceException(Resources.RootFindingFailed); + throw new NonConvergenceException("The algorithm has failed, exceeded the number of iterations allowed or there is no root within the provided bounds."); } /// Find a solution of the equation f(x)=0. diff --git a/src/Numerics/RootFinding/NewtonRaphson.cs b/src/Numerics/RootFinding/NewtonRaphson.cs index 948da0fd..367809c6 100644 --- a/src/Numerics/RootFinding/NewtonRaphson.cs +++ b/src/Numerics/RootFinding/NewtonRaphson.cs @@ -28,7 +28,6 @@ // using System; -using MathNet.Numerics.Properties; namespace MathNet.Numerics.RootFinding { @@ -56,7 +55,7 @@ namespace MathNet.Numerics.RootFinding return root; } - throw new NonConvergenceException(Resources.RootFindingFailedRecommendRobustNewtonRaphson); + throw new NonConvergenceException("The algorithm has failed, exceeded the number of iterations allowed or there is no root within the provided bounds. Consider to use RobustNewtonRaphson instead."); } /// Find a solution of the equation f(x)=0. @@ -77,7 +76,7 @@ namespace MathNet.Numerics.RootFinding return root; } - throw new NonConvergenceException(Resources.RootFindingFailedRecommendRobustNewtonRaphson); + throw new NonConvergenceException("The algorithm has failed, exceeded the number of iterations allowed or there is no root within the provided bounds. Consider to use RobustNewtonRaphson instead."); } /// Find a solution of the equation f(x)=0. diff --git a/src/Numerics/RootFinding/RobustNewtonRaphson.cs b/src/Numerics/RootFinding/RobustNewtonRaphson.cs index 9dce9661..8bf285c6 100644 --- a/src/Numerics/RootFinding/RobustNewtonRaphson.cs +++ b/src/Numerics/RootFinding/RobustNewtonRaphson.cs @@ -28,7 +28,6 @@ // using System; -using MathNet.Numerics.Properties; namespace MathNet.Numerics.RootFinding { @@ -56,7 +55,7 @@ namespace MathNet.Numerics.RootFinding return root; } - throw new NonConvergenceException(Resources.RootFindingFailed); + throw new NonConvergenceException("The algorithm has failed, exceeded the number of iterations allowed or there is no root within the provided bounds."); } /// Find a solution of the equation f(x)=0. diff --git a/src/Numerics/RootFinding/Secant.cs b/src/Numerics/RootFinding/Secant.cs index 5a8ef5cd..9de8fe41 100644 --- a/src/Numerics/RootFinding/Secant.cs +++ b/src/Numerics/RootFinding/Secant.cs @@ -28,7 +28,6 @@ // using System; -using MathNet.Numerics.Properties; namespace MathNet.Numerics.RootFinding { @@ -57,7 +56,7 @@ namespace MathNet.Numerics.RootFinding return root; } - throw new NonConvergenceException(Resources.RootFindingFailed); + throw new NonConvergenceException("The algorithm has failed, exceeded the number of iterations allowed or there is no root within the provided bounds."); } /// Find a solution of the equation f(x)=0. diff --git a/src/Numerics/RootFinding/ZeroCrossingBracketing.cs b/src/Numerics/RootFinding/ZeroCrossingBracketing.cs index c1caeb83..070ab3bd 100644 --- a/src/Numerics/RootFinding/ZeroCrossingBracketing.cs +++ b/src/Numerics/RootFinding/ZeroCrossingBracketing.cs @@ -29,7 +29,6 @@ using System; using System.Collections.Generic; -using MathNet.Numerics.Properties; namespace MathNet.Numerics.RootFinding { @@ -87,7 +86,7 @@ namespace MathNet.Numerics.RootFinding if (lowerBound >= upperBound) { - throw new ArgumentOutOfRangeException(nameof(upperBound), string.Format(Resources.ArgumentOutOfRangeGreater, "xmax", "xmin")); + throw new ArgumentOutOfRangeException(nameof(upperBound), "xmax must be greater than xmin."); } double fmin = f(lowerBound); @@ -124,7 +123,7 @@ namespace MathNet.Numerics.RootFinding if (lowerBound >= upperBound) { - throw new ArgumentOutOfRangeException(nameof(upperBound), string.Format(Resources.ArgumentOutOfRangeGreater, "xmax", "xmin")); + throw new ArgumentOutOfRangeException(nameof(upperBound), "xmax must be greater than xmin."); } // TODO: Consider binary-style search instead of linear scan diff --git a/src/Numerics/SpecialFunctions/Beta.cs b/src/Numerics/SpecialFunctions/Beta.cs index 3612e2d7..06ef61f8 100644 --- a/src/Numerics/SpecialFunctions/Beta.cs +++ b/src/Numerics/SpecialFunctions/Beta.cs @@ -33,7 +33,6 @@ // using System; -using MathNet.Numerics.Properties; // ReSharper disable CheckNamespace namespace MathNet.Numerics @@ -53,12 +52,12 @@ namespace MathNet.Numerics { if (z <= 0.0) { - throw new ArgumentException(Resources.ArgumentMustBePositive, nameof(z)); + throw new ArgumentException("Value must be positive.", nameof(z)); } if (w <= 0.0) { - throw new ArgumentException(Resources.ArgumentMustBePositive, nameof(w)); + throw new ArgumentException("Value must be positive.", nameof(w)); } return GammaLn(z) + GammaLn(w) - GammaLn(z + w); @@ -101,17 +100,17 @@ namespace MathNet.Numerics { if (a < 0.0) { - throw new ArgumentOutOfRangeException(nameof(a), Resources.ArgumentNotNegative); + throw new ArgumentOutOfRangeException(nameof(a), "Value must not be negative (zero is ok)."); } if (b < 0.0) { - throw new ArgumentOutOfRangeException(nameof(b), Resources.ArgumentNotNegative); + throw new ArgumentOutOfRangeException(nameof(b), "Value must not be negative (zero is ok)."); } if (x < 0.0 || x > 1.0) { - throw new ArgumentOutOfRangeException(nameof(x), Resources.ArgumentInIntervalXYInclusive); + throw new ArgumentOutOfRangeException(nameof(x), $"Value is expected to be between 0.0 and 1.0 (including 0.0 and 1.0)."); } var bt = (x == 0.0 || x == 1.0) diff --git a/src/Numerics/SpecialFunctions/Factorial.cs b/src/Numerics/SpecialFunctions/Factorial.cs index abdf943a..a6ba40a4 100644 --- a/src/Numerics/SpecialFunctions/Factorial.cs +++ b/src/Numerics/SpecialFunctions/Factorial.cs @@ -28,7 +28,6 @@ // using System; -using MathNet.Numerics.Properties; using BigInteger = System.Numerics.BigInteger; // ReSharper disable CheckNamespace @@ -59,7 +58,7 @@ namespace MathNet.Numerics { if (x < 0) { - throw new ArgumentOutOfRangeException(nameof(x), Resources.ArgumentPositive); + throw new ArgumentOutOfRangeException(nameof(x), "Value must be positive (and not zero)."); } if (x < _factorialCache.Length) @@ -77,7 +76,7 @@ namespace MathNet.Numerics { if (x < 0) { - throw new ArgumentOutOfRangeException(nameof(x), Resources.ArgumentPositive); + throw new ArgumentOutOfRangeException(nameof(x), "Value must be positive (and not zero)."); } if (x == 0) @@ -102,7 +101,7 @@ namespace MathNet.Numerics { if (x < 0) { - throw new ArgumentOutOfRangeException(nameof(x), Resources.ArgumentPositive); + throw new ArgumentOutOfRangeException(nameof(x), "Value must be positive (and not zero)."); } if (x <= 1) @@ -163,7 +162,7 @@ namespace MathNet.Numerics { if (n < 0) { - throw new ArgumentException(Resources.ArgumentMustBePositive, nameof(n)); + throw new ArgumentException("Value must be positive.", nameof(n)); } if (ni == null) @@ -177,7 +176,7 @@ namespace MathNet.Numerics { if (ni[i] < 0) { - throw new ArgumentException(Resources.ArgumentMustBePositive, "ni[" + i + "]"); + throw new ArgumentException("Value must be positive.", "ni[" + i + "]"); } ret -= FactorialLn(ni[i]); @@ -187,7 +186,7 @@ namespace MathNet.Numerics // Before returning, check that the sum of all elements was equal to n. if (sum != n) { - throw new ArgumentException(Resources.ArgumentParameterSetInvalid, nameof(ni)); + throw new ArgumentException("The chosen parameter set is invalid (probably some value is out of range).", nameof(ni)); } return Math.Floor(0.5 + Math.Exp(ret)); diff --git a/src/Numerics/SpecialFunctions/Gamma.cs b/src/Numerics/SpecialFunctions/Gamma.cs index 0aa14f02..fdcd7911 100644 --- a/src/Numerics/SpecialFunctions/Gamma.cs +++ b/src/Numerics/SpecialFunctions/Gamma.cs @@ -262,12 +262,12 @@ namespace MathNet.Numerics if (a < 0d) { - throw new ArgumentOutOfRangeException(nameof(a), Properties.Resources.ArgumentNotNegative); + throw new ArgumentOutOfRangeException(nameof(a), "Value must not be negative (zero is ok)."); } if (x < 0d) { - throw new ArgumentOutOfRangeException(nameof(x), Properties.Resources.ArgumentNotNegative); + throw new ArgumentOutOfRangeException(nameof(x), "Value must not be negative (zero is ok)."); } if (a.AlmostEqual(0.0)) diff --git a/src/Numerics/SpecialFunctions/Logistic.cs b/src/Numerics/SpecialFunctions/Logistic.cs index 1cfe76d0..b7f2efbc 100644 --- a/src/Numerics/SpecialFunctions/Logistic.cs +++ b/src/Numerics/SpecialFunctions/Logistic.cs @@ -33,7 +33,6 @@ // using System; -using MathNet.Numerics.Properties; // ReSharper disable CheckNamespace namespace MathNet.Numerics @@ -64,7 +63,7 @@ namespace MathNet.Numerics { if (p < 0.0 || p > 1.0) { - throw new ArgumentOutOfRangeException(nameof(p), Resources.ArgumentBetween0And1); + throw new ArgumentOutOfRangeException(nameof(p), "The argument must be between 0 and 1."); } return Math.Log(p/(1.0 - p)); diff --git a/src/Numerics/Statistics/ArrayStatistics.Int32.cs b/src/Numerics/Statistics/ArrayStatistics.Int32.cs index a9f0b02d..d77524b6 100644 --- a/src/Numerics/Statistics/ArrayStatistics.Int32.cs +++ b/src/Numerics/Statistics/ArrayStatistics.Int32.cs @@ -28,7 +28,6 @@ // using System; -using MathNet.Numerics.Properties; namespace MathNet.Numerics.Statistics { @@ -203,7 +202,7 @@ namespace MathNet.Numerics.Statistics { if (samples1.Length != samples2.Length) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } if (samples1.Length <= 1) @@ -233,7 +232,7 @@ namespace MathNet.Numerics.Statistics { if (population1.Length != population2.Length) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } if (population1.Length == 0) diff --git a/src/Numerics/Statistics/ArrayStatistics.Single.cs b/src/Numerics/Statistics/ArrayStatistics.Single.cs index 9cba31de..4fb53431 100644 --- a/src/Numerics/Statistics/ArrayStatistics.Single.cs +++ b/src/Numerics/Statistics/ArrayStatistics.Single.cs @@ -28,7 +28,6 @@ // using System; -using MathNet.Numerics.Properties; namespace MathNet.Numerics.Statistics { @@ -299,7 +298,7 @@ namespace MathNet.Numerics.Statistics { if (samples1.Length != samples2.Length) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } if (samples1.Length <= 1) @@ -329,7 +328,7 @@ namespace MathNet.Numerics.Statistics { if (population1.Length != population2.Length) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } if (population1.Length == 0) diff --git a/src/Numerics/Statistics/ArrayStatistics.cs b/src/Numerics/Statistics/ArrayStatistics.cs index cb6d3f6c..3e7cc0b2 100644 --- a/src/Numerics/Statistics/ArrayStatistics.cs +++ b/src/Numerics/Statistics/ArrayStatistics.cs @@ -28,7 +28,6 @@ // using System; -using MathNet.Numerics.Properties; namespace MathNet.Numerics.Statistics { @@ -309,7 +308,7 @@ namespace MathNet.Numerics.Statistics { if (samples1.Length != samples2.Length) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } if (samples1.Length <= 1) @@ -339,7 +338,7 @@ namespace MathNet.Numerics.Statistics { if (population1.Length != population2.Length) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } if (population1.Length == 0) diff --git a/src/Numerics/Statistics/Correlation.cs b/src/Numerics/Statistics/Correlation.cs index f3289fbb..1cb38063 100644 --- a/src/Numerics/Statistics/Correlation.cs +++ b/src/Numerics/Statistics/Correlation.cs @@ -32,7 +32,6 @@ using System.Collections.Generic; using System.Linq; using MathNet.Numerics.IntegralTransforms; using MathNet.Numerics.LinearAlgebra; -using MathNet.Numerics.Properties; using Complex = System.Numerics.Complex; namespace MathNet.Numerics.Statistics @@ -185,7 +184,7 @@ namespace MathNet.Numerics.Statistics { if (!ieB.MoveNext()) { - throw new ArgumentOutOfRangeException(nameof(dataB), Resources.ArgumentArraysSameLength); + throw new ArgumentOutOfRangeException(nameof(dataB), "The array arguments must have the same length."); } double currentA = ieA.Current; @@ -207,7 +206,7 @@ namespace MathNet.Numerics.Statistics if (ieB.MoveNext()) { - throw new ArgumentOutOfRangeException(nameof(dataA), Resources.ArgumentArraysSameLength); + throw new ArgumentOutOfRangeException(nameof(dataA), "The array arguments must have the same length."); } } @@ -241,11 +240,11 @@ namespace MathNet.Numerics.Statistics { if (!ieB.MoveNext()) { - throw new ArgumentOutOfRangeException(nameof(dataB), Resources.ArgumentArraysSameLength); + throw new ArgumentOutOfRangeException(nameof(dataB), "The array arguments must have the same length."); } if (!ieW.MoveNext()) { - throw new ArgumentOutOfRangeException(nameof(weights), Resources.ArgumentArraysSameLength); + throw new ArgumentOutOfRangeException(nameof(weights), "The array arguments must have the same length."); } ++n; @@ -270,11 +269,11 @@ namespace MathNet.Numerics.Statistics } if (ieB.MoveNext()) { - throw new ArgumentOutOfRangeException(nameof(dataB), Resources.ArgumentArraysSameLength); + throw new ArgumentOutOfRangeException(nameof(dataB), "The array arguments must have the same length."); } if (ieW.MoveNext()) { - throw new ArgumentOutOfRangeException(nameof(weights), Resources.ArgumentArraysSameLength); + throw new ArgumentOutOfRangeException(nameof(weights), "The array arguments must have the same length."); } } return covariance/Math.Sqrt(varA*varB); diff --git a/src/Numerics/Statistics/Histogram.cs b/src/Numerics/Statistics/Histogram.cs index 0a655fbf..8505a2cc 100644 --- a/src/Numerics/Statistics/Histogram.cs +++ b/src/Numerics/Statistics/Histogram.cs @@ -31,7 +31,6 @@ using System; using System.Collections.Generic; using System.Runtime.Serialization; using System.Text; -using MathNet.Numerics.Properties; namespace MathNet.Numerics.Statistics { @@ -101,12 +100,12 @@ namespace MathNet.Numerics.Statistics { if (lowerBound > upperBound) { - throw new ArgumentException(Resources.ArgumentUpperBoundMustBeLargerThanOrEqualToLowerBound); + throw new ArgumentException("The upper bound must be at least as large as the lower bound."); } if (count < 0.0) { - throw new ArgumentOutOfRangeException(nameof(count), Resources.ArgumentMustBePositive); + throw new ArgumentOutOfRangeException(nameof(count), "Value must be positive."); } LowerBound = lowerBound; @@ -186,7 +185,7 @@ namespace MathNet.Numerics.Statistics { if (UpperBound > bucket.LowerBound && LowerBound < bucket.LowerBound) { - throw new ArgumentException(Resources.PartialOrderException); + throw new ArgumentException("The two arguments can\'t be compared (maybe they are part of a partial ordering?)"); } if (UpperBound.Equals(bucket.UpperBound) @@ -423,7 +422,7 @@ namespace MathNet.Numerics.Statistics if (index < 0) { - throw new ArgumentException(Resources.ArgumentHistogramContainsNot); + throw new ArgumentException("The histogram does not contain the value."); } return index; diff --git a/src/Numerics/Statistics/MCMC/HybridMCGeneric.cs b/src/Numerics/Statistics/MCMC/HybridMCGeneric.cs index c46123a6..39afbc04 100644 --- a/src/Numerics/Statistics/MCMC/HybridMCGeneric.cs +++ b/src/Numerics/Statistics/MCMC/HybridMCGeneric.cs @@ -31,7 +31,6 @@ namespace MathNet.Numerics.Statistics.Mcmc { using System; using Distributions; - using Properties; /// /// The Hybrid (also called Hamiltonian) Monte Carlo produces samples from distribution P using a set @@ -273,7 +272,7 @@ namespace MathNet.Numerics.Statistics.Mcmc { if (value < 0) { - throw new ArgumentOutOfRangeException(nameof(value), Resources.ArgumentNotNegative); + throw new ArgumentOutOfRangeException(nameof(value), "Value must not be negative (zero is ok)."); } return value; } @@ -288,7 +287,7 @@ namespace MathNet.Numerics.Statistics.Mcmc { if (value <= 0) { - throw new ArgumentOutOfRangeException(nameof(value), Resources.ArgumentNotNegative); + throw new ArgumentOutOfRangeException(nameof(value), "Value must not be negative (zero is ok)."); } return value; } @@ -303,7 +302,7 @@ namespace MathNet.Numerics.Statistics.Mcmc { if (value <= 0) { - throw new ArgumentOutOfRangeException(nameof(value), Resources.ArgumentNotNegative); + throw new ArgumentOutOfRangeException(nameof(value), "Value must not be negative (zero is ok)."); } return value; } diff --git a/src/Numerics/Statistics/MCMC/MCMCDiagnostics.cs b/src/Numerics/Statistics/MCMC/MCMCDiagnostics.cs index 2a2795be..b2df6cd7 100644 --- a/src/Numerics/Statistics/MCMC/MCMCDiagnostics.cs +++ b/src/Numerics/Statistics/MCMC/MCMCDiagnostics.cs @@ -30,7 +30,6 @@ using System; using System.Collections.Generic; using System.Linq; -using MathNet.Numerics.Properties; namespace MathNet.Numerics.Statistics.Mcmc { @@ -53,13 +52,13 @@ namespace MathNet.Numerics.Statistics.Mcmc { if (lag < 0) { - throw new ArgumentOutOfRangeException(nameof(lag), Resources.LagMustBePositive); + throw new ArgumentOutOfRangeException(nameof(lag), "Lag must be positive"); } int length = series.Count(); if (lag >= length) { - throw new ArgumentOutOfRangeException(nameof(lag), Resources.LagMustBeSmallerThanTheSampleSize); + throw new ArgumentOutOfRangeException(nameof(lag), "Lag must be smaller than the sample size"); } var transformedSeries = series.Select(f); diff --git a/src/Numerics/Statistics/MCMC/MetropolisHastingsSampler.cs b/src/Numerics/Statistics/MCMC/MetropolisHastingsSampler.cs index 7997440d..e0216e7d 100644 --- a/src/Numerics/Statistics/MCMC/MetropolisHastingsSampler.cs +++ b/src/Numerics/Statistics/MCMC/MetropolisHastingsSampler.cs @@ -31,7 +31,6 @@ namespace MathNet.Numerics.Statistics.Mcmc { using System; using Distributions; - using Properties; /// /// Metropolis-Hastings sampling produces samples from distribution P by sampling from a proposal distribution Q @@ -108,7 +107,7 @@ namespace MathNet.Numerics.Statistics.Mcmc { if (value < 0) { - throw new ArgumentException(Resources.ArgumentNotNegative); + throw new ArgumentException("Value must not be negative (zero is ok)."); } _burnInterval = value; } diff --git a/src/Numerics/Statistics/MCMC/MetropolisSampler.cs b/src/Numerics/Statistics/MCMC/MetropolisSampler.cs index 55f9ab80..5f586235 100644 --- a/src/Numerics/Statistics/MCMC/MetropolisSampler.cs +++ b/src/Numerics/Statistics/MCMC/MetropolisSampler.cs @@ -27,12 +27,11 @@ // OTHER DEALINGS IN THE SOFTWARE. // +using System; +using MathNet.Numerics.Distributions; + namespace MathNet.Numerics.Statistics.Mcmc { - using System; - using Distributions; - using Properties; - /// /// Metropolis sampling produces samples from distribution P by sampling from a proposal distribution Q /// and accepting/rejecting based on the density of P. Metropolis sampling requires that the proposal @@ -99,7 +98,7 @@ namespace MathNet.Numerics.Statistics.Mcmc { if (value < 0) { - throw new ArgumentException(Resources.ArgumentNotNegative); + throw new ArgumentException("Value must not be negative (zero is ok)."); } _burnInterval = value; } diff --git a/src/Numerics/Statistics/MCMC/RejectionSampler.cs b/src/Numerics/Statistics/MCMC/RejectionSampler.cs index 9cc94639..822879c5 100644 --- a/src/Numerics/Statistics/MCMC/RejectionSampler.cs +++ b/src/Numerics/Statistics/MCMC/RejectionSampler.cs @@ -30,7 +30,6 @@ namespace MathNet.Numerics.Statistics.Mcmc { using System; - using Properties; /// /// Rejection sampling produces samples from distribution P by sampling from a proposal distribution Q @@ -90,7 +89,7 @@ namespace MathNet.Numerics.Statistics.Mcmc if (q < p) { - throw new ArgumentException(Resources.ProposalDistributionNoUpperBound); + throw new ArgumentException("The sampler\'s proposal distribution is not upper bounding the target density."); } if (u < p) { diff --git a/src/Numerics/Statistics/MCMC/UnivariateSliceSampler.cs b/src/Numerics/Statistics/MCMC/UnivariateSliceSampler.cs index 6e8f5e32..85649bac 100644 --- a/src/Numerics/Statistics/MCMC/UnivariateSliceSampler.cs +++ b/src/Numerics/Statistics/MCMC/UnivariateSliceSampler.cs @@ -27,11 +27,10 @@ // OTHER DEALINGS IN THE SOFTWARE. // +using System; + namespace MathNet.Numerics.Statistics.Mcmc { - using System; - using Properties; - /// /// Slice sampling produces samples from distribution P by uniformly sampling from under the pdf of P using /// a technique described in "Slice Sampling", R. Neal, 2003. All densities are required to be in log space. @@ -111,7 +110,7 @@ namespace MathNet.Numerics.Statistics.Mcmc { if (value < 0) { - throw new ArgumentException(Resources.ArgumentNotNegative); + throw new ArgumentException("Value must not be negative (zero is ok)."); } _burnInterval = value; } @@ -127,7 +126,7 @@ namespace MathNet.Numerics.Statistics.Mcmc { if (value <= 0.0) { - throw new ArgumentException(Resources.ArgumentPositive); + throw new ArgumentException("Value must be positive (and not zero)."); } _scale = value; } diff --git a/src/Numerics/Statistics/MovingStatistics.cs b/src/Numerics/Statistics/MovingStatistics.cs index a845544c..472446ff 100644 --- a/src/Numerics/Statistics/MovingStatistics.cs +++ b/src/Numerics/Statistics/MovingStatistics.cs @@ -29,7 +29,6 @@ using System; using System.Collections.Generic; -using MathNet.Numerics.Properties; namespace MathNet.Numerics.Statistics { @@ -57,7 +56,7 @@ namespace MathNet.Numerics.Statistics { if (windowSize < 1) { - throw new ArgumentException(string.Format(Resources.ArgumentMustBePositive), nameof(windowSize)); + throw new ArgumentException(string.Format("Value must be positive."), nameof(windowSize)); } _windowSize = windowSize; _oldValues = new double[_windowSize]; diff --git a/src/Numerics/Statistics/StreamingStatistics.cs b/src/Numerics/Statistics/StreamingStatistics.cs index 97e5ae7e..619f359c 100644 --- a/src/Numerics/Statistics/StreamingStatistics.cs +++ b/src/Numerics/Statistics/StreamingStatistics.cs @@ -30,7 +30,6 @@ using System; using System.Collections.Generic; using System.Linq; -using MathNet.Numerics.Properties; using Complex = System.Numerics.Complex; namespace MathNet.Numerics.Statistics @@ -661,7 +660,7 @@ namespace MathNet.Numerics.Statistics { if (!s2.MoveNext()) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } var mean2Prev = mean2; @@ -673,7 +672,7 @@ namespace MathNet.Numerics.Statistics if (s2.MoveNext()) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } } @@ -714,7 +713,7 @@ namespace MathNet.Numerics.Statistics { if (!p2.MoveNext()) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } var mean2Prev = mean2; @@ -726,7 +725,7 @@ namespace MathNet.Numerics.Statistics if (p2.MoveNext()) { - throw new ArgumentException(Resources.ArgumentVectorsSameLength); + throw new ArgumentException("All vectors must have the same dimensionality."); } }