diff --git a/src/Numerics/Complex32.cs b/src/Numerics/Complex32.cs
index 5aa4c7eb..db32e73a 100644
--- a/src/Numerics/Complex32.cs
+++ b/src/Numerics/Complex32.cs
@@ -824,22 +824,6 @@ namespace MathNet.Numerics
#region Parse Functions
- ///
- /// Creates a complex number based on a string. The string can be in the
- /// following formats (without the quotes): 'n', 'ni', 'n +/- ni',
- /// 'ni +/- n', 'n,n', 'n,ni,' '(n,n)', or '(n,ni)', where n is a float.
- ///
- ///
- /// A complex number containing the value specified by the given string.
- ///
- ///
- /// The string to parse.
- ///
- public static Complex32 Parse(string value)
- {
- return Parse(value, null);
- }
-
///
/// Creates a complex number based on a string. The string can be in the
/// following formats (without the quotes): 'n', 'ni', 'n +/- ni',
@@ -855,7 +839,7 @@ namespace MathNet.Numerics
/// An that supplies culture-specific
/// formatting information.
///
- public static Complex32 Parse(string value, IFormatProvider formatProvider)
+ public static Complex32 Parse(string value, IFormatProvider formatProvider = null)
{
if (value == null)
{
diff --git a/src/Numerics/Fit.cs b/src/Numerics/Fit.cs
index 378e3edd..d0bedb42 100644
--- a/src/Numerics/Fit.cs
+++ b/src/Numerics/Fit.cs
@@ -31,7 +31,6 @@
using System;
using System.Linq;
using MathNet.Numerics.LinearAlgebra.Double;
-using MathNet.Numerics.LinearAlgebra.Factorization;
using MathNet.Numerics.Properties;
namespace MathNet.Numerics
@@ -102,7 +101,7 @@ namespace MathNet.Numerics
{
return DenseMatrix
.OfColumns(x.Length, order + 1, Enumerable.Range(0, order + 1).Select(j => DenseVector.Create(x.Length, i => Math.Pow(x[i], j))))
- .QR(QRMethod.Thin).Solve(new DenseVector(y))
+ .QR().Solve(new DenseVector(y))
.ToArray();
}
@@ -124,7 +123,7 @@ namespace MathNet.Numerics
{
return DenseMatrix
.OfColumns(x.Length, functions.Length, functions.Select(f => DenseVector.Create(x.Length, i => f(x[i]))))
- .QR(QRMethod.Thin).Solve(new DenseVector(y))
+ .QR().Solve(new DenseVector(y))
.ToArray();
}
@@ -146,7 +145,7 @@ namespace MathNet.Numerics
{
return DenseMatrix
.OfRows(x.Length, functions.Length, x.Select(xi => functions.Select(f => f(xi))))
- .QR(QRMethod.Thin).Solve(new DenseVector(y))
+ .QR().Solve(new DenseVector(y))
.ToArray();
}
@@ -168,7 +167,7 @@ namespace MathNet.Numerics
{
return DenseMatrix
.OfRows(x.Length, functions.Length, x.Select(xi => functions.Select(f => f(xi))))
- .QR(QRMethod.Thin).Solve(new DenseVector(y))
+ .QR().Solve(new DenseVector(y))
.ToArray();
}
diff --git a/src/Numerics/LinearAlgebra/Complex/DenseVector.cs b/src/Numerics/LinearAlgebra/Complex/DenseVector.cs
index b5fcd701..ee7178cb 100644
--- a/src/Numerics/LinearAlgebra/Complex/DenseVector.cs
+++ b/src/Numerics/LinearAlgebra/Complex/DenseVector.cs
@@ -692,21 +692,6 @@ namespace MathNet.Numerics.LinearAlgebra.Complex
#region Parse Functions
- ///
- /// Creates a Complex dense vector based on a string. The string can be in the following formats (without the
- /// quotes): 'n', 'n;n;..', '(n;n;..)', '[n;n;...]', where n is a Complex.
- ///
- ///
- /// A Complex dense vector containing the values specified by the given string.
- ///
- ///
- /// The string to parse.
- ///
- public static DenseVector Parse(string value)
- {
- return Parse(value, null);
- }
-
///
/// Creates a Complex dense vector based on a string. The string can be in the following formats (without the
/// quotes): 'n', 'n;n;..', '(n;n;..)', '[n;n;...]', where n is a double.
@@ -720,7 +705,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex
///
/// An that supplies culture-specific formatting information.
///
- public static DenseVector Parse(string value, IFormatProvider formatProvider)
+ public static DenseVector Parse(string value, IFormatProvider formatProvider = null)
{
if (value == null)
{
diff --git a/src/Numerics/LinearAlgebra/Complex/Factorization/UserEvd.cs b/src/Numerics/LinearAlgebra/Complex/Factorization/UserEvd.cs
index bc6b37a1..9e130fb2 100644
--- a/src/Numerics/LinearAlgebra/Complex/Factorization/UserEvd.cs
+++ b/src/Numerics/LinearAlgebra/Complex/Factorization/UserEvd.cs
@@ -247,6 +247,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex.Factorization
///
/// Symmetric tridiagonal QL algorithm.
///
+ /// The eigen vectors to work on.
/// Arrays for internal storage of real parts of eigenvalues
/// Arrays for internal storage of imaginary parts of eigenvalues
/// Order of initial matrix
@@ -393,6 +394,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex.Factorization
///
/// Determines eigenvectors by undoing the symmetric tridiagonalize transformation
///
+ /// The eigen vectors to work on.
/// Previously tridiagonalized matrix by .
/// Contains further information about the transformations
/// Input matrix order
@@ -438,6 +440,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex.Factorization
///
/// Nonsymmetric reduction to Hessenberg form.
///
+ /// The eigen vectors to work on.
/// Array for internal storage of nonsymmetric Hessenberg form.
/// Order of initial matrix
/// This is derived from the Algol procedures orthes and ortran,
@@ -583,6 +586,8 @@ namespace MathNet.Numerics.LinearAlgebra.Complex.Factorization
///
/// Nonsymmetric reduction from Hessenberg to real Schur form.
///
+ /// The eigen vectors to work on.
+ /// The eigen values to work on.
/// Array for internal storage of nonsymmetric Hessenberg form.
/// Order of initial matrix
/// This is derived from the Algol procedure hqr2,
diff --git a/src/Numerics/LinearAlgebra/Complex/Solvers/BiCgStab.cs b/src/Numerics/LinearAlgebra/Complex/Solvers/BiCgStab.cs
index da6f0829..b09df01e 100644
--- a/src/Numerics/LinearAlgebra/Complex/Solvers/BiCgStab.cs
+++ b/src/Numerics/LinearAlgebra/Complex/Solvers/BiCgStab.cs
@@ -98,6 +98,8 @@ namespace MathNet.Numerics.LinearAlgebra.Complex.Solvers
/// The coefficient , A.
/// The solution , b.
/// The result , x.
+ /// The iterator to use to control when to stop iterating.
+ /// The preconditioner to use for approximations.
public void Solve(Matrix matrix, Vector input, Vector result, Iterator iterator, IPreconditioner preconditioner)
{
if (matrix.RowCount != matrix.ColumnCount)
diff --git a/src/Numerics/LinearAlgebra/Complex/Solvers/CompositeSolver.cs b/src/Numerics/LinearAlgebra/Complex/Solvers/CompositeSolver.cs
index 329588b3..672a185c 100644
--- a/src/Numerics/LinearAlgebra/Complex/Solvers/CompositeSolver.cs
+++ b/src/Numerics/LinearAlgebra/Complex/Solvers/CompositeSolver.cs
@@ -77,6 +77,8 @@ namespace MathNet.Numerics.LinearAlgebra.Complex.Solvers
/// The coefficient matrix, A.
/// The solution vector, b
/// The result vector, x
+ /// The iterator to use to control when to stop iterating.
+ /// The preconditioner to use for approximations.
public void Solve(Matrix matrix, Vector input, Vector result, Iterator iterator, IPreconditioner preconditioner)
{
if (matrix.RowCount != matrix.ColumnCount)
diff --git a/src/Numerics/LinearAlgebra/Complex/Solvers/GpBiCg.cs b/src/Numerics/LinearAlgebra/Complex/Solvers/GpBiCg.cs
index d9f89ae6..1644b7bc 100644
--- a/src/Numerics/LinearAlgebra/Complex/Solvers/GpBiCg.cs
+++ b/src/Numerics/LinearAlgebra/Complex/Solvers/GpBiCg.cs
@@ -161,6 +161,8 @@ namespace MathNet.Numerics.LinearAlgebra.Complex.Solvers
/// The coefficient matrix, A.
/// The solution vector, b
/// The result vector, x
+ /// The iterator to use to control when to stop iterating.
+ /// The preconditioner to use for approximations.
public void Solve(Matrix matrix, Vector input, Vector result, Iterator iterator, IPreconditioner preconditioner)
{
if (matrix.RowCount != matrix.ColumnCount)
diff --git a/src/Numerics/LinearAlgebra/Complex/Solvers/MlkBiCgStab.cs b/src/Numerics/LinearAlgebra/Complex/Solvers/MlkBiCgStab.cs
index b34e19e5..28a992a4 100644
--- a/src/Numerics/LinearAlgebra/Complex/Solvers/MlkBiCgStab.cs
+++ b/src/Numerics/LinearAlgebra/Complex/Solvers/MlkBiCgStab.cs
@@ -247,6 +247,8 @@ namespace MathNet.Numerics.LinearAlgebra.Complex.Solvers
/// The coefficient matrix, A.
/// The solution vector, b
/// The result vector, x
+ /// The iterator to use to control when to stop iterating.
+ /// The preconditioner to use for approximations.
public void Solve(Matrix matrix, Vector input, Vector result, Iterator iterator, IPreconditioner preconditioner)
{
if (matrix.RowCount != matrix.ColumnCount)
diff --git a/src/Numerics/LinearAlgebra/Complex/Solvers/StopCriterium/DivergenceStopCriterium.cs b/src/Numerics/LinearAlgebra/Complex/Solvers/StopCriterium/DivergenceStopCriterium.cs
index ce8d8ab6..c2677c38 100644
--- a/src/Numerics/LinearAlgebra/Complex/Solvers/StopCriterium/DivergenceStopCriterium.cs
+++ b/src/Numerics/LinearAlgebra/Complex/Solvers/StopCriterium/DivergenceStopCriterium.cs
@@ -89,39 +89,13 @@ namespace MathNet.Numerics.LinearAlgebra.Complex.Solvers.StopCriterium
///
int _lastIteration = DefaultLastIterationNumber;
- ///
- /// Initializes a new instance of the class with the default maximum
- /// relative increase and the default minimum number of tracking iterations.
- ///
- public DivergenceStopCriterium() : this(DefaultMaximumRelativeIncrease, DefaultMinimumNumberOfIterations)
- {
- }
-
- ///
- /// Initializes a new instance of the class with the specified maximum
- /// relative increase and the default minimum number of tracking iterations.
- ///
- /// The maximum relative increase that the residual may experience before a divergence warning is issued.
- public DivergenceStopCriterium(double maximumRelativeIncrease) : this(maximumRelativeIncrease, DefaultMinimumNumberOfIterations)
- {
- }
-
- ///
- /// Initializes a new instance of the class with the default maximum
- /// relative increase and the specified minimum number of tracking iterations.
- ///
- /// The minimum number of iterations over which the residual must grow before a divergence warning is issued.
- public DivergenceStopCriterium(int minimumIterations) : this(DefaultMinimumNumberOfIterations, minimumIterations)
- {
- }
-
///
/// Initializes a new instance of the class with the specified maximum
/// relative increase and the specified minimum number of tracking iterations.
///
/// The maximum relative increase that the residual may experience before a divergence warning is issued.
/// The minimum number of iterations over which the residual must grow before a divergence warning is issued.
- public DivergenceStopCriterium(double maximumRelativeIncrease, int minimumIterations)
+ public DivergenceStopCriterium(double maximumRelativeIncrease = DefaultMaximumRelativeIncrease, int minimumIterations = DefaultMinimumNumberOfIterations)
{
if (maximumRelativeIncrease <= 0)
{
diff --git a/src/Numerics/LinearAlgebra/Complex/Solvers/StopCriterium/ResidualStopCriterium.cs b/src/Numerics/LinearAlgebra/Complex/Solvers/StopCriterium/ResidualStopCriterium.cs
index 3680311b..aba3ac8b 100644
--- a/src/Numerics/LinearAlgebra/Complex/Solvers/StopCriterium/ResidualStopCriterium.cs
+++ b/src/Numerics/LinearAlgebra/Complex/Solvers/StopCriterium/ResidualStopCriterium.cs
@@ -88,35 +88,6 @@ namespace MathNet.Numerics.LinearAlgebra.Complex.Solvers.StopCriterium
///
int _lastIteration = DefaultLastIterationNumber;
- ///
- /// Initializes a new instance of the class with the default maximum
- /// residual and the default minimum number of iterations.
- ///
- public ResidualStopCriterium() : this(DefaultMaximumResidual, DefaultMinimumIterationsBelowMaximum)
- {
- }
-
- ///
- /// Initializes a new instance of the class with the specified
- /// maximum residual and the default minimum number of iterations.
- ///
- /// The maximum value for the residual below which the calculation is considered converged.
- public ResidualStopCriterium(double maximum) : this(maximum, DefaultMinimumIterationsBelowMaximum)
- {
- }
-
- ///
- /// Initializes a new instance of the class with the default maximum residual
- /// and specified minimum number of iterations.
- ///
- ///
- /// The minimum number of iterations for which the residual has to be below the maximum before
- /// the calculation is considered converged.
- ///
- public ResidualStopCriterium(int minimumIterationsBelowMaximum) : this(DefaultMaximumResidual, minimumIterationsBelowMaximum)
- {
- }
-
///
/// Initializes a new instance of the class with the specified
/// maximum residual and minimum number of iterations.
@@ -128,7 +99,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex.Solvers.StopCriterium
/// The minimum number of iterations for which the residual has to be below the maximum before
/// the calculation is considered converged.
///
- public ResidualStopCriterium(double maximum, int minimumIterationsBelowMaximum)
+ public ResidualStopCriterium(double maximum = DefaultMaximumResidual, int minimumIterationsBelowMaximum = DefaultMinimumIterationsBelowMaximum)
{
if (maximum < 0)
{
diff --git a/src/Numerics/LinearAlgebra/Complex/Solvers/TFQMR.cs b/src/Numerics/LinearAlgebra/Complex/Solvers/TFQMR.cs
index 53da4217..2b5f324c 100644
--- a/src/Numerics/LinearAlgebra/Complex/Solvers/TFQMR.cs
+++ b/src/Numerics/LinearAlgebra/Complex/Solvers/TFQMR.cs
@@ -95,6 +95,8 @@ namespace MathNet.Numerics.LinearAlgebra.Complex.Solvers
/// The coefficient matrix, A.
/// The solution vector, b
/// The result vector, x
+ /// The iterator to use to control when to stop iterating.
+ /// The preconditioner to use for approximations.
public void Solve(Matrix matrix, Vector input, Vector result, Iterator iterator, IPreconditioner preconditioner)
{
if (matrix.RowCount != matrix.ColumnCount)
diff --git a/src/Numerics/LinearAlgebra/Complex/SparseVector.cs b/src/Numerics/LinearAlgebra/Complex/SparseVector.cs
index 2fa68581..d1980c50 100644
--- a/src/Numerics/LinearAlgebra/Complex/SparseVector.cs
+++ b/src/Numerics/LinearAlgebra/Complex/SparseVector.cs
@@ -853,21 +853,6 @@ namespace MathNet.Numerics.LinearAlgebra.Complex
#region Parse Functions
- ///
- /// Creates a double sparse vector based on a string. The string can be in the following formats (without the
- /// quotes): 'n', 'n,n,..', '(n,n,..)', '[n,n,...]', where n is a Complex.
- ///
- ///
- /// A double sparse vector containing the values specified by the given string.
- ///
- ///
- /// The string to parse.
- ///
- public static SparseVector Parse(string value)
- {
- return Parse(value, null);
- }
-
///
/// Creates a double sparse vector based on a string. The string can be in the following formats (without the
/// quotes): 'n', 'n;n;..', '(n;n;..)', '[n;n;...]', where n is a Complex.
@@ -881,7 +866,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex
///
/// An that supplies culture-specific formatting information.
///
- public static SparseVector Parse(string value, IFormatProvider formatProvider)
+ public static SparseVector Parse(string value, IFormatProvider formatProvider = null)
{
if (value == null)
{
diff --git a/src/Numerics/LinearAlgebra/Complex32/DenseVector.cs b/src/Numerics/LinearAlgebra/Complex32/DenseVector.cs
index 2aeb2f25..d62a6280 100644
--- a/src/Numerics/LinearAlgebra/Complex32/DenseVector.cs
+++ b/src/Numerics/LinearAlgebra/Complex32/DenseVector.cs
@@ -687,21 +687,6 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32
#region Parse Functions
- ///
- /// Creates a Complex32 dense vector based on a string. The string can be in the following formats (without the
- /// quotes): 'n', 'n;n;..', '(n;n;..)', '[n;n;...]', where n is a Complex32.
- ///
- ///
- /// A Complex32 dense vector containing the values specified by the given string.
- ///
- ///
- /// The string to parse.
- ///
- public static DenseVector Parse(string value)
- {
- return Parse(value, null);
- }
-
///
/// Creates a Complex32 dense vector based on a string. The string can be in the following formats (without the
/// quotes): 'n', 'n;n;..', '(n;n;..)', '[n;n;...]', where n is a double.
@@ -715,7 +700,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32
///
/// An that supplies culture-specific formatting information.
///
- public static DenseVector Parse(string value, IFormatProvider formatProvider)
+ public static DenseVector Parse(string value, IFormatProvider formatProvider = null)
{
if (value == null)
{
diff --git a/src/Numerics/LinearAlgebra/Complex32/Factorization/DenseEvd.cs b/src/Numerics/LinearAlgebra/Complex32/Factorization/DenseEvd.cs
index 80ed36a2..07448866 100644
--- a/src/Numerics/LinearAlgebra/Complex32/Factorization/DenseEvd.cs
+++ b/src/Numerics/LinearAlgebra/Complex32/Factorization/DenseEvd.cs
@@ -111,10 +111,10 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32.Factorization
/// Smith, Boyle, Dongarra, Garbow, Ikebe, Klema, Moler, and Wilkinson, Handbook for
/// Auto. Comp., Vol.ii-Linear Algebra, and the corresponding
/// Fortran subroutine in EISPACK.
- internal static void SymmetricTridiagonalize(Numerics.Complex32[] matrixA, float[] d, float[] e, Numerics.Complex32[] tau, int order)
+ internal static void SymmetricTridiagonalize(Complex32[] matrixA, float[] d, float[] e, Complex32[] tau, int order)
{
float hh;
- tau[order - 1] = Numerics.Complex32.One;
+ tau[order - 1] = Complex32.One;
for (var i = 0; i < order; i++)
{
@@ -135,7 +135,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32.Factorization
if (scale == 0.0f)
{
- tau[i - 1] = Numerics.Complex32.One;
+ tau[i - 1] = Complex32.One;
e[i] = 0.0f;
}
else
@@ -146,10 +146,10 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32.Factorization
h += matrixA[k*order + i].MagnitudeSquared;
}
- Numerics.Complex32 g = (float) Math.Sqrt(h);
+ Complex32 g = (float) Math.Sqrt(h);
e[i] = scale*g.Real;
- Numerics.Complex32 temp;
+ Complex32 temp;
var im1Oi = (i - 1)*order + i;
var f = matrixA[im1Oi];
if (f.Magnitude != 0.0f)
@@ -167,10 +167,10 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32.Factorization
if ((f.Magnitude == 0.0f) || (i != 1))
{
- f = Numerics.Complex32.Zero;
+ f = Complex32.Zero;
for (var j = 0; j < i; j++)
{
- var tmp = Numerics.Complex32.Zero;
+ var tmp = Complex32.Zero;
var jO = j*order;
// Form element of A*U.
for (var k = 0; k <= j; k++)
@@ -214,7 +214,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32.Factorization
hh = d[i];
d[i] = matrixA[i*order + i].Real;
- matrixA[i*order + i] = new Numerics.Complex32(hh, scale*(float) Math.Sqrt(h));
+ matrixA[i*order + i] = new Complex32(hh, scale*(float) Math.Sqrt(h));
}
hh = d[0];
@@ -235,7 +235,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32.Factorization
/// Auto. Comp., Vol.ii-Linear Algebra, and the corresponding
/// Fortran subroutine in EISPACK.
///
- internal static void SymmetricDiagonalize(Numerics.Complex32[] dataEv, float[] d, float[] e, int order)
+ internal static void SymmetricDiagonalize(Complex32[] dataEv, float[] d, float[] e, int order)
{
const int maxiter = 1000;
@@ -381,7 +381,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32.Factorization
/// by Smith, Boyle, Dongarra, Garbow, Ikebe, Klema, Moler, and Wilkinson, Handbook for
/// Auto. Comp., Vol.ii-Linear Algebra, and the corresponding
/// Fortran subroutine in EISPACK.
- internal static void SymmetricUntridiagonalize(Numerics.Complex32[] dataEv, Numerics.Complex32[] matrixA, Numerics.Complex32[] tau, int order)
+ internal static void SymmetricUntridiagonalize(Complex32[] dataEv, Complex32[] matrixA, Complex32[] tau, int order)
{
for (var i = 0; i < order; i++)
{
@@ -399,7 +399,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32.Factorization
{
for (var j = 0; j < order; j++)
{
- var s = Numerics.Complex32.Zero;
+ var s = Complex32.Zero;
for (var k = 0; k < i; k++)
{
s += dataEv[(j*order) + k]*matrixA[k*order + i];
@@ -426,9 +426,9 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32.Factorization
/// by Martin and Wilkinson, Handbook for Auto. Comp.,
/// Vol.ii-Linear Algebra, and the corresponding
/// Fortran subroutines in EISPACK.
- internal static void NonsymmetricReduceToHessenberg(Numerics.Complex32[] dataEv, Numerics.Complex32[] matrixH, int order)
+ internal static void NonsymmetricReduceToHessenberg(Complex32[] dataEv, Complex32[] matrixH, int order)
{
- var ort = new Numerics.Complex32[order];
+ var ort = new Complex32[order];
for (var m = 1; m < order - 1; m++)
{
@@ -467,7 +467,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32.Factorization
// H = (I-u*u'/h)*H*(I-u*u')/h)
for (var j = m; j < order; j++)
{
- var f = Numerics.Complex32.Zero;
+ var f = Complex32.Zero;
var jO = j*order;
for (var i = order - 1; i >= m; i--)
{
@@ -483,7 +483,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32.Factorization
for (var i = 0; i < order; i++)
{
- var f = Numerics.Complex32.Zero;
+ var f = Complex32.Zero;
for (var j = order - 1; j >= m; j--)
{
f += ort[j]*matrixH[j*order + i];
@@ -506,7 +506,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32.Factorization
{
for (var j = 0; j < order; j++)
{
- dataEv[(j*order) + i] = i == j ? Numerics.Complex32.One : Numerics.Complex32.Zero;
+ dataEv[(j*order) + i] = i == j ? Complex32.One : Complex32.Zero;
}
}
@@ -514,7 +514,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32.Factorization
{
var mm1O = (m - 1)*order;
var mm1Om = mm1O + m;
- if (matrixH[mm1Om] != Numerics.Complex32.Zero && ort[m] != Numerics.Complex32.Zero)
+ if (matrixH[mm1Om] != Complex32.Zero && ort[m] != Complex32.Zero)
{
var norm = (matrixH[mm1Om].Real*ort[m].Real) + (matrixH[mm1Om].Imaginary*ort[m].Imaginary);
@@ -525,7 +525,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32.Factorization
for (var j = m; j < order; j++)
{
- var g = Numerics.Complex32.Zero;
+ var g = Complex32.Zero;
for (var i = m; i < order; i++)
{
g += ort[i].Conjugate()*dataEv[(j*order) + i];
@@ -581,14 +581,14 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32.Factorization
/// by Martin and Wilkinson, Handbook for Auto. Comp.,
/// Vol.ii-Linear Algebra, and the corresponding
/// Fortran subroutine in EISPACK.
- internal static void NonsymmetricReduceHessenberToRealSchur(Numerics.Complex32[] vectorV, Numerics.Complex32[] dataEv, Numerics.Complex32[] matrixH, int order)
+ internal static void NonsymmetricReduceHessenberToRealSchur(Complex32[] vectorV, Complex32[] dataEv, Complex32[] matrixH, int order)
{
// Initialize
var n = order - 1;
var eps = (float) Precision.SingleMachinePrecision;
float norm;
- Numerics.Complex32 x, y, z, exshift = Numerics.Complex32.Zero;
+ Complex32 x, y, z, exshift = Complex32.Zero;
// Outer loop over eigenvalue index
var iter = 0;
@@ -626,7 +626,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32.Factorization
else
{
// Form shift
- Numerics.Complex32 s;
+ Complex32 s;
if (iter != 10 && iter != 20)
{
s = matrixH[nOn];
@@ -670,7 +670,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32.Factorization
x = matrixH[im1Oim1]/norm;
vectorV[i - 1] = x;
matrixH[im1Oim1] = norm;
- matrixH[im1O + i] = new Numerics.Complex32(0.0f, s.Real/norm);
+ matrixH[im1O + i] = new Complex32(0.0f, s.Real/norm);
for (var j = i; j < order; j++)
{
@@ -714,7 +714,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32.Factorization
else
{
y = matrixH[jm1Oi].Real;
- matrixH[jm1Oi] = new Numerics.Complex32((x.Real*y.Real) - (x.Imaginary*y.Imaginary) + (matrixH[jm1O + j].Imaginary*z.Real), matrixH[jm1Oi].Imaginary);
+ matrixH[jm1Oi] = new Complex32((x.Real*y.Real) - (x.Imaginary*y.Imaginary) + (matrixH[jm1O + j].Imaginary*z.Real), matrixH[jm1Oi].Imaginary);
}
matrixH[jO + i] = (x.Conjugate()*z) - (matrixH[jm1O + j].Imaginary*y);
@@ -806,7 +806,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32.Factorization
var jO = j*order;
for (var i = 0; i < order; i++)
{
- z = Numerics.Complex32.Zero;
+ z = Complex32.Zero;
for (var k = 0; k <= j; k++)
{
z += dataEv[(k*order) + i]*matrixH[jO + k];
@@ -822,7 +822,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32.Factorization
///
/// The right hand side , B.
/// The left hand side , X.
- public override void Solve(Matrix input, Matrix result)
+ public override void Solve(Matrix input, Matrix result)
{
// The solution X should have the same number of columns as B
if (input.ColumnCount != result.ColumnCount)
@@ -845,13 +845,13 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32.Factorization
if (IsSymmetric)
{
var order = EigenValues.Count;
- var tmp = new Numerics.Complex32[order];
+ var tmp = new Complex32[order];
for (var k = 0; k < order; k++)
{
for (var j = 0; j < order; j++)
{
- Numerics.Complex32 value = 0.0f;
+ Complex32 value = 0.0f;
if (j < order)
{
for (var i = 0; i < order; i++)
@@ -867,7 +867,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32.Factorization
for (var j = 0; j < order; j++)
{
- Numerics.Complex32 value = 0.0f;
+ Complex32 value = 0.0f;
for (var i = 0; i < order; i++)
{
value += ((DenseMatrix) EigenVectors).Values[(i*order) + j]*tmp[i];
@@ -888,7 +888,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32.Factorization
///
/// The right hand side vector, b.
/// The left hand side , x.
- public override void Solve(Vector input, Vector result)
+ public override void Solve(Vector input, Vector result)
{
// Ax=b where A is an m x m matrix
// Check that b is a column vector with m entries
@@ -907,8 +907,8 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32.Factorization
{
// Symmetric case -> x = V * inv(λ) * VH * b;
var order = EigenValues.Count;
- var tmp = new Numerics.Complex32[order];
- Numerics.Complex32 value;
+ var tmp = new Complex32[order];
+ Complex32 value;
for (var j = 0; j < order; j++)
{
diff --git a/src/Numerics/LinearAlgebra/Complex32/Factorization/UserEvd.cs b/src/Numerics/LinearAlgebra/Complex32/Factorization/UserEvd.cs
index f9eb61d0..0527f33b 100644
--- a/src/Numerics/LinearAlgebra/Complex32/Factorization/UserEvd.cs
+++ b/src/Numerics/LinearAlgebra/Complex32/Factorization/UserEvd.cs
@@ -249,6 +249,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32.Factorization
///
/// Symmetric tridiagonal QL algorithm.
///
+ /// The eigen vectors to work on.
/// Arrays for internal storage of real parts of eigenvalues
/// Arrays for internal storage of imaginary parts of eigenvalues
/// Order of initial matrix
@@ -395,6 +396,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32.Factorization
///
/// Determines eigenvectors by undoing the symmetric tridiagonalize transformation
///
+ /// The eigen vectors to work on.
/// Previously tridiagonalized matrix by .
/// Contains further information about the transformations
/// Input matrix order
@@ -440,6 +442,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32.Factorization
///
/// Nonsymmetric reduction to Hessenberg form.
///
+ /// The eigen vectors to work on.
/// Array for internal storage of nonsymmetric Hessenberg form.
/// Order of initial matrix
/// This is derived from the Algol procedures orthes and ortran,
@@ -585,6 +588,8 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32.Factorization
///
/// Nonsymmetric reduction from Hessenberg to real Schur form.
///
+ /// The eigen vectors to work on.
+ /// The eigen values to work on.
/// Array for internal storage of nonsymmetric Hessenberg form.
/// Order of initial matrix
/// This is derived from the Algol procedure hqr2,
diff --git a/src/Numerics/LinearAlgebra/Complex32/Solvers/BiCgStab.cs b/src/Numerics/LinearAlgebra/Complex32/Solvers/BiCgStab.cs
index c09fb1f8..f6eedb5d 100644
--- a/src/Numerics/LinearAlgebra/Complex32/Solvers/BiCgStab.cs
+++ b/src/Numerics/LinearAlgebra/Complex32/Solvers/BiCgStab.cs
@@ -91,6 +91,8 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32.Solvers
/// The coefficient , A.
/// The solution , b.
/// The result , x.
+ /// The iterator to use to control when to stop iterating.
+ /// The preconditioner to use for approximations.
public void Solve(Matrix matrix, Vector input, Vector result, Iterator iterator, IPreconditioner preconditioner)
{
if (matrix.RowCount != matrix.ColumnCount)
diff --git a/src/Numerics/LinearAlgebra/Complex32/Solvers/CompositeSolver.cs b/src/Numerics/LinearAlgebra/Complex32/Solvers/CompositeSolver.cs
index bb7e97d3..89dda2c9 100644
--- a/src/Numerics/LinearAlgebra/Complex32/Solvers/CompositeSolver.cs
+++ b/src/Numerics/LinearAlgebra/Complex32/Solvers/CompositeSolver.cs
@@ -70,6 +70,8 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32.Solvers
/// The coefficient matrix, A.
/// The solution vector, b
/// The result vector, x
+ /// The iterator to use to control when to stop iterating.
+ /// The preconditioner to use for approximations.
public void Solve(Matrix matrix, Vector input, Vector result, Iterator iterator, IPreconditioner preconditioner)
{
if (matrix.RowCount != matrix.ColumnCount)
diff --git a/src/Numerics/LinearAlgebra/Complex32/Solvers/GpBiCg.cs b/src/Numerics/LinearAlgebra/Complex32/Solvers/GpBiCg.cs
index 6257fb8d..65817d2c 100644
--- a/src/Numerics/LinearAlgebra/Complex32/Solvers/GpBiCg.cs
+++ b/src/Numerics/LinearAlgebra/Complex32/Solvers/GpBiCg.cs
@@ -154,6 +154,8 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32.Solvers
/// The coefficient matrix, A.
/// The solution vector, b
/// The result vector, x
+ /// The iterator to use to control when to stop iterating.
+ /// The preconditioner to use for approximations.
public void Solve(Matrix matrix, Vector input, Vector result, Iterator iterator, IPreconditioner preconditioner)
{
if (matrix.RowCount != matrix.ColumnCount)
diff --git a/src/Numerics/LinearAlgebra/Complex32/Solvers/MlkBiCgStab.cs b/src/Numerics/LinearAlgebra/Complex32/Solvers/MlkBiCgStab.cs
index 9e27dd7e..cfebe47e 100644
--- a/src/Numerics/LinearAlgebra/Complex32/Solvers/MlkBiCgStab.cs
+++ b/src/Numerics/LinearAlgebra/Complex32/Solvers/MlkBiCgStab.cs
@@ -240,6 +240,8 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32.Solvers
/// The coefficient matrix, A.
/// The solution vector, b
/// The result vector, x
+ /// The iterator to use to control when to stop iterating.
+ /// The preconditioner to use for approximations.
public void Solve(Matrix matrix, Vector input, Vector result, Iterator iterator, IPreconditioner preconditioner)
{
if (matrix.RowCount != matrix.ColumnCount)
diff --git a/src/Numerics/LinearAlgebra/Complex32/Solvers/StopCriterium/DivergenceStopCriterium.cs b/src/Numerics/LinearAlgebra/Complex32/Solvers/StopCriterium/DivergenceStopCriterium.cs
index 3e00bb21..ede15238 100644
--- a/src/Numerics/LinearAlgebra/Complex32/Solvers/StopCriterium/DivergenceStopCriterium.cs
+++ b/src/Numerics/LinearAlgebra/Complex32/Solvers/StopCriterium/DivergenceStopCriterium.cs
@@ -84,39 +84,13 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32.Solvers.StopCriterium
///
int _lastIteration = DefaultLastIterationNumber;
- ///
- /// Initializes a new instance of the class with the default maximum
- /// relative increase and the default minimum number of tracking iterations.
- ///
- public DivergenceStopCriterium() : this(DefaultMaximumRelativeIncrease, DefaultMinimumNumberOfIterations)
- {
- }
-
- ///
- /// Initializes a new instance of the class with the specified maximum
- /// relative increase and the default minimum number of tracking iterations.
- ///
- /// The maximum relative increase that the residual may experience before a divergence warning is issued.
- public DivergenceStopCriterium(double maximumRelativeIncrease) : this(maximumRelativeIncrease, DefaultMinimumNumberOfIterations)
- {
- }
-
- ///
- /// Initializes a new instance of the class with the default maximum
- /// relative increase and the specified minimum number of tracking iterations.
- ///
- /// The minimum number of iterations over which the residual must grow before a divergence warning is issued.
- public DivergenceStopCriterium(int minimumIterations) : this(DefaultMinimumNumberOfIterations, minimumIterations)
- {
- }
-
///
/// Initializes a new instance of the class with the specified maximum
/// relative increase and the specified minimum number of tracking iterations.
///
/// The maximum relative increase that the residual may experience before a divergence warning is issued.
/// The minimum number of iterations over which the residual must grow before a divergence warning is issued.
- public DivergenceStopCriterium(double maximumRelativeIncrease, int minimumIterations)
+ public DivergenceStopCriterium(double maximumRelativeIncrease = DefaultMaximumRelativeIncrease, int minimumIterations = DefaultMinimumNumberOfIterations)
{
if (maximumRelativeIncrease <= 0)
{
diff --git a/src/Numerics/LinearAlgebra/Complex32/Solvers/StopCriterium/ResidualStopCriterium.cs b/src/Numerics/LinearAlgebra/Complex32/Solvers/StopCriterium/ResidualStopCriterium.cs
index 96f14308..77e144dc 100644
--- a/src/Numerics/LinearAlgebra/Complex32/Solvers/StopCriterium/ResidualStopCriterium.cs
+++ b/src/Numerics/LinearAlgebra/Complex32/Solvers/StopCriterium/ResidualStopCriterium.cs
@@ -83,35 +83,6 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32.Solvers.StopCriterium
///
int _lastIteration = DefaultLastIterationNumber;
- ///
- /// Initializes a new instance of the class with the default maximum
- /// residual and the default minimum number of iterations.
- ///
- public ResidualStopCriterium() : this(DefaultMaximumResidual, DefaultMinimumIterationsBelowMaximum)
- {
- }
-
- ///
- /// Initializes a new instance of the class with the specified
- /// maximum residual and the default minimum number of iterations.
- ///
- /// The maximum value for the residual below which the calculation is considered converged.
- public ResidualStopCriterium(float maximum) : this(maximum, DefaultMinimumIterationsBelowMaximum)
- {
- }
-
- ///
- /// Initializes a new instance of the class with the default maximum residual
- /// and specified minimum number of iterations.
- ///
- ///
- /// The minimum number of iterations for which the residual has to be below the maximum before
- /// the calculation is considered converged.
- ///
- public ResidualStopCriterium(int minimumIterationsBelowMaximum) : this(DefaultMaximumResidual, minimumIterationsBelowMaximum)
- {
- }
-
///
/// Initializes a new instance of the class with the specified
/// maximum residual and minimum number of iterations.
@@ -123,7 +94,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32.Solvers.StopCriterium
/// The minimum number of iterations for which the residual has to be below the maximum before
/// the calculation is considered converged.
///
- public ResidualStopCriterium(float maximum, int minimumIterationsBelowMaximum)
+ public ResidualStopCriterium(float maximum = DefaultMaximumResidual, int minimumIterationsBelowMaximum = DefaultMinimumIterationsBelowMaximum)
{
if (maximum < 0)
{
diff --git a/src/Numerics/LinearAlgebra/Complex32/Solvers/TFQMR.cs b/src/Numerics/LinearAlgebra/Complex32/Solvers/TFQMR.cs
index c8799b7f..dd71d37b 100644
--- a/src/Numerics/LinearAlgebra/Complex32/Solvers/TFQMR.cs
+++ b/src/Numerics/LinearAlgebra/Complex32/Solvers/TFQMR.cs
@@ -87,6 +87,8 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32.Solvers
/// The coefficient matrix, A.
/// The solution vector, b
/// The result vector, x
+ /// The iterator to use to control when to stop iterating.
+ /// The preconditioner to use for approximations.
public void Solve(Matrix matrix, Vector input, Vector result, Iterator iterator, IPreconditioner preconditioner)
{
if (matrix.RowCount != matrix.ColumnCount)
diff --git a/src/Numerics/LinearAlgebra/Complex32/SparseVector.cs b/src/Numerics/LinearAlgebra/Complex32/SparseVector.cs
index bc6ecfc6..e886410a 100644
--- a/src/Numerics/LinearAlgebra/Complex32/SparseVector.cs
+++ b/src/Numerics/LinearAlgebra/Complex32/SparseVector.cs
@@ -848,21 +848,6 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32
#region Parse Functions
- ///
- /// Creates a double sparse vector based on a string. The string can be in the following formats (without the
- /// quotes): 'n', 'n,n,..', '(n,n,..)', '[n,n,...]', where n is a Complex32.
- ///
- ///
- /// A double sparse vector containing the values specified by the given string.
- ///
- ///
- /// The string to parse.
- ///
- public static SparseVector Parse(string value)
- {
- return Parse(value, null);
- }
-
///
/// Creates a double sparse vector based on a string. The string can be in the following formats (without the
/// quotes): 'n', 'n;n;..', '(n;n;..)', '[n;n;...]', where n is a Complex32.
@@ -876,7 +861,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32
///
/// An that supplies culture-specific formatting information.
///
- public static SparseVector Parse(string value, IFormatProvider formatProvider)
+ public static SparseVector Parse(string value, IFormatProvider formatProvider = null)
{
if (value == null)
{
diff --git a/src/Numerics/LinearAlgebra/Double/DenseVector.cs b/src/Numerics/LinearAlgebra/Double/DenseVector.cs
index da9665f0..51b86d7f 100644
--- a/src/Numerics/LinearAlgebra/Double/DenseVector.cs
+++ b/src/Numerics/LinearAlgebra/Double/DenseVector.cs
@@ -759,21 +759,6 @@ namespace MathNet.Numerics.LinearAlgebra.Double
#region Parse Functions
- ///
- /// Creates a double dense vector based on a string. The string can be in the following formats (without the
- /// quotes): 'n', 'n,n,..', '(n,n,..)', '[n,n,...]', where n is a double.
- ///
- ///
- /// A double dense vector containing the values specified by the given string.
- ///
- ///
- /// The string to parse.
- ///
- public static DenseVector Parse(string value)
- {
- return Parse(value, null);
- }
-
///
/// Creates a double dense vector based on a string. The string can be in the following formats (without the
/// quotes): 'n', 'n,n,..', '(n,n,..)', '[n,n,...]', where n is a double.
@@ -787,7 +772,7 @@ namespace MathNet.Numerics.LinearAlgebra.Double
///
/// An that supplies culture-specific formatting information.
///
- public static DenseVector Parse(string value, IFormatProvider formatProvider)
+ public static DenseVector Parse(string value, IFormatProvider formatProvider = null)
{
if (value == null)
{
diff --git a/src/Numerics/LinearAlgebra/Double/Factorization/UserEvd.cs b/src/Numerics/LinearAlgebra/Double/Factorization/UserEvd.cs
index 7eb206e6..336ec750 100644
--- a/src/Numerics/LinearAlgebra/Double/Factorization/UserEvd.cs
+++ b/src/Numerics/LinearAlgebra/Double/Factorization/UserEvd.cs
@@ -137,6 +137,7 @@ namespace MathNet.Numerics.LinearAlgebra.Double.Factorization
///
/// Symmetric Householder reduction to tridiagonal form.
///
+ /// The eigen vectors to work on.
/// Arrays for internal storage of real parts of eigenvalues
/// Arrays for internal storage of imaginary parts of eigenvalues
/// Order of initial matrix
@@ -289,6 +290,7 @@ namespace MathNet.Numerics.LinearAlgebra.Double.Factorization
///
/// Symmetric tridiagonal QL algorithm.
///
+ /// The eigen vectors to work on.
/// Arrays for internal storage of real parts of eigenvalues
/// Arrays for internal storage of imaginary parts of eigenvalues
/// Order of initial matrix
@@ -435,6 +437,7 @@ namespace MathNet.Numerics.LinearAlgebra.Double.Factorization
///
/// Nonsymmetric reduction to Hessenberg form.
///
+ /// The eigen vectors to work on.
/// Array for internal storage of nonsymmetric Hessenberg form.
/// Order of initial matrix
/// This is derived from the Algol procedures orthes and ortran,
@@ -550,6 +553,7 @@ namespace MathNet.Numerics.LinearAlgebra.Double.Factorization
///
/// Nonsymmetric reduction from Hessenberg to real Schur form.
///
+ /// The eigen vectors to work on.
/// Array for internal storage of nonsymmetric Hessenberg form.
/// Arrays for internal storage of real parts of eigenvalues
/// Arrays for internal storage of imaginary parts of eigenvalues
diff --git a/src/Numerics/LinearAlgebra/Double/Solvers/BiCgStab.cs b/src/Numerics/LinearAlgebra/Double/Solvers/BiCgStab.cs
index ed19649d..7443ef50 100644
--- a/src/Numerics/LinearAlgebra/Double/Solvers/BiCgStab.cs
+++ b/src/Numerics/LinearAlgebra/Double/Solvers/BiCgStab.cs
@@ -91,6 +91,8 @@ namespace MathNet.Numerics.LinearAlgebra.Double.Solvers
/// The coefficient , A.
/// The solution , b.
/// The result , x.
+ /// The iterator to use to control when to stop iterating.
+ /// The preconditioner to use for approximations.
public void Solve(Matrix matrix, Vector input, Vector result, Iterator iterator, IPreconditioner preconditioner)
{
if (matrix.RowCount != matrix.ColumnCount)
diff --git a/src/Numerics/LinearAlgebra/Double/Solvers/CompositeSolver.cs b/src/Numerics/LinearAlgebra/Double/Solvers/CompositeSolver.cs
index 994f65d0..398f4515 100644
--- a/src/Numerics/LinearAlgebra/Double/Solvers/CompositeSolver.cs
+++ b/src/Numerics/LinearAlgebra/Double/Solvers/CompositeSolver.cs
@@ -70,6 +70,8 @@ namespace MathNet.Numerics.LinearAlgebra.Double.Solvers
/// The coefficient matrix, A.
/// The solution vector, b
/// The result vector, x
+ /// The iterator to use to control when to stop iterating.
+ /// The preconditioner to use for approximations.
public void Solve(Matrix matrix, Vector input, Vector result, Iterator iterator, IPreconditioner preconditioner)
{
if (matrix.RowCount != matrix.ColumnCount)
diff --git a/src/Numerics/LinearAlgebra/Double/Solvers/GpBiCg.cs b/src/Numerics/LinearAlgebra/Double/Solvers/GpBiCg.cs
index 0a818da2..e5154630 100644
--- a/src/Numerics/LinearAlgebra/Double/Solvers/GpBiCg.cs
+++ b/src/Numerics/LinearAlgebra/Double/Solvers/GpBiCg.cs
@@ -160,6 +160,8 @@ namespace MathNet.Numerics.LinearAlgebra.Double.Solvers
/// The coefficient matrix, A.
/// The solution vector, b
/// The result vector, x
+ /// The iterator to use to control when to stop iterating.
+ /// The preconditioner to use for approximations.
public void Solve(Matrix matrix, Vector input, Vector result, Iterator iterator, IPreconditioner preconditioner)
{
if (matrix.RowCount != matrix.ColumnCount)
diff --git a/src/Numerics/LinearAlgebra/Double/Solvers/MlkBiCgStab.cs b/src/Numerics/LinearAlgebra/Double/Solvers/MlkBiCgStab.cs
index 7a264119..d3e9eb25 100644
--- a/src/Numerics/LinearAlgebra/Double/Solvers/MlkBiCgStab.cs
+++ b/src/Numerics/LinearAlgebra/Double/Solvers/MlkBiCgStab.cs
@@ -240,6 +240,8 @@ namespace MathNet.Numerics.LinearAlgebra.Double.Solvers
/// The coefficient matrix, A.
/// The solution vector, b
/// The result vector, x
+ /// The iterator to use to control when to stop iterating.
+ /// The preconditioner to use for approximations.
public void Solve(Matrix matrix, Vector input, Vector result, Iterator iterator, IPreconditioner preconditioner)
{
if (matrix.RowCount != matrix.ColumnCount)
diff --git a/src/Numerics/LinearAlgebra/Double/Solvers/StopCriterium/DivergenceStopCriterium.cs b/src/Numerics/LinearAlgebra/Double/Solvers/StopCriterium/DivergenceStopCriterium.cs
index ab6b52d9..116c65e2 100644
--- a/src/Numerics/LinearAlgebra/Double/Solvers/StopCriterium/DivergenceStopCriterium.cs
+++ b/src/Numerics/LinearAlgebra/Double/Solvers/StopCriterium/DivergenceStopCriterium.cs
@@ -82,39 +82,13 @@ namespace MathNet.Numerics.LinearAlgebra.Double.Solvers.StopCriterium
///
int _lastIteration = DefaultLastIterationNumber;
- ///
- /// Initializes a new instance of the class with the default maximum
- /// relative increase and the default minimum number of tracking iterations.
- ///
- public DivergenceStopCriterium() : this(DefaultMaximumRelativeIncrease, DefaultMinimumNumberOfIterations)
- {
- }
-
- ///
- /// Initializes a new instance of the class with the specified maximum
- /// relative increase and the default minimum number of tracking iterations.
- ///
- /// The maximum relative increase that the residual may experience before a divergence warning is issued.
- public DivergenceStopCriterium(double maximumRelativeIncrease) : this(maximumRelativeIncrease, DefaultMinimumNumberOfIterations)
- {
- }
-
- ///
- /// Initializes a new instance of the class with the default maximum
- /// relative increase and the specified minimum number of tracking iterations.
- ///
- /// The minimum number of iterations over which the residual must grow before a divergence warning is issued.
- public DivergenceStopCriterium(int minimumIterations) : this(DefaultMinimumNumberOfIterations, minimumIterations)
- {
- }
-
///
/// Initializes a new instance of the class with the specified maximum
/// relative increase and the specified minimum number of tracking iterations.
///
/// The maximum relative increase that the residual may experience before a divergence warning is issued.
/// The minimum number of iterations over which the residual must grow before a divergence warning is issued.
- public DivergenceStopCriterium(double maximumRelativeIncrease, int minimumIterations)
+ public DivergenceStopCriterium(double maximumRelativeIncrease = DefaultMaximumRelativeIncrease, int minimumIterations = DefaultMinimumNumberOfIterations)
{
if (maximumRelativeIncrease <= 0)
{
diff --git a/src/Numerics/LinearAlgebra/Double/Solvers/StopCriterium/ResidualStopCriterium.cs b/src/Numerics/LinearAlgebra/Double/Solvers/StopCriterium/ResidualStopCriterium.cs
index f3f541f7..4342be07 100644
--- a/src/Numerics/LinearAlgebra/Double/Solvers/StopCriterium/ResidualStopCriterium.cs
+++ b/src/Numerics/LinearAlgebra/Double/Solvers/StopCriterium/ResidualStopCriterium.cs
@@ -81,35 +81,6 @@ namespace MathNet.Numerics.LinearAlgebra.Double.Solvers.StopCriterium
///
int _lastIteration = DefaultLastIterationNumber;
- ///
- /// Initializes a new instance of the class with the default maximum
- /// residual and the default minimum number of iterations.
- ///
- public ResidualStopCriterium() : this(DefaultMaximumResidual, DefaultMinimumIterationsBelowMaximum)
- {
- }
-
- ///
- /// Initializes a new instance of the class with the specified
- /// maximum residual and the default minimum number of iterations.
- ///
- /// The maximum value for the residual below which the calculation is considered converged.
- public ResidualStopCriterium(double maximum) : this(maximum, DefaultMinimumIterationsBelowMaximum)
- {
- }
-
- ///
- /// Initializes a new instance of the class with the default maximum residual
- /// and specified minimum number of iterations.
- ///
- ///
- /// The minimum number of iterations for which the residual has to be below the maximum before
- /// the calculation is considered converged.
- ///
- public ResidualStopCriterium(int minimumIterationsBelowMaximum) : this(DefaultMaximumResidual, minimumIterationsBelowMaximum)
- {
- }
-
///
/// Initializes a new instance of the class with the specified
/// maximum residual and minimum number of iterations.
@@ -121,7 +92,7 @@ namespace MathNet.Numerics.LinearAlgebra.Double.Solvers.StopCriterium
/// The minimum number of iterations for which the residual has to be below the maximum before
/// the calculation is considered converged.
///
- public ResidualStopCriterium(double maximum, int minimumIterationsBelowMaximum)
+ public ResidualStopCriterium(double maximum = DefaultMaximumResidual, int minimumIterationsBelowMaximum = DefaultMinimumIterationsBelowMaximum)
{
if (maximum < 0)
{
diff --git a/src/Numerics/LinearAlgebra/Double/Solvers/TFQMR.cs b/src/Numerics/LinearAlgebra/Double/Solvers/TFQMR.cs
index a9890f57..bf33f8de 100644
--- a/src/Numerics/LinearAlgebra/Double/Solvers/TFQMR.cs
+++ b/src/Numerics/LinearAlgebra/Double/Solvers/TFQMR.cs
@@ -87,6 +87,8 @@ namespace MathNet.Numerics.LinearAlgebra.Double.Solvers
/// The coefficient matrix, A.
/// The solution vector, b
/// The result vector, x
+ /// The iterator to use to control when to stop iterating.
+ /// The preconditioner to use for approximations.
public void Solve(Matrix matrix, Vector input, Vector result, Iterator iterator, IPreconditioner preconditioner)
{
if (matrix.RowCount != matrix.ColumnCount)
diff --git a/src/Numerics/LinearAlgebra/Double/SparseVector.cs b/src/Numerics/LinearAlgebra/Double/SparseVector.cs
index b287b7a6..578b9d3b 100644
--- a/src/Numerics/LinearAlgebra/Double/SparseVector.cs
+++ b/src/Numerics/LinearAlgebra/Double/SparseVector.cs
@@ -856,21 +856,6 @@ namespace MathNet.Numerics.LinearAlgebra.Double
#region Parse Functions
- ///
- /// Creates a double sparse vector based on a string. The string can be in the following formats (without the
- /// quotes): 'n', 'n,n,..', '(n,n,..)', '[n,n,...]', where n is a double.
- ///
- ///
- /// A double sparse vector containing the values specified by the given string.
- ///
- ///
- /// The string to parse.
- ///
- public static SparseVector Parse(string value)
- {
- return Parse(value, null);
- }
-
///
/// Creates a double sparse vector based on a string. The string can be in the following formats (without the
/// quotes): 'n', 'n,n,..', '(n,n,..)', '[n,n,...]', where n is a double.
@@ -884,7 +869,7 @@ namespace MathNet.Numerics.LinearAlgebra.Double
///
/// An that supplies culture-specific formatting information.
///
- public static SparseVector Parse(string value, IFormatProvider formatProvider)
+ public static SparseVector Parse(string value, IFormatProvider formatProvider = null)
{
if (value == null)
{
diff --git a/src/Numerics/LinearAlgebra/Matrix.Arithmetic.cs b/src/Numerics/LinearAlgebra/Matrix.Arithmetic.cs
index d7c741c8..ce7ab0c9 100644
--- a/src/Numerics/LinearAlgebra/Matrix.Arithmetic.cs
+++ b/src/Numerics/LinearAlgebra/Matrix.Arithmetic.cs
@@ -87,7 +87,7 @@ namespace MathNet.Numerics.LinearAlgebra
///
/// The scalar to subtract from.
/// The matrix to store the result of the subtraction.
- protected virtual void DoSubtractFrom(T scalar, Matrix result)
+ protected void DoSubtractFrom(T scalar, Matrix result)
{
DoNegate(result);
result.DoAdd(scalar, result);
@@ -1072,7 +1072,7 @@ namespace MathNet.Numerics.LinearAlgebra
///
/// The other matrix.
/// The kronecker product of the two matrices.
- public virtual Matrix KroneckerProduct(Matrix other)
+ public Matrix KroneckerProduct(Matrix other)
{
var result = CreateMatrix(RowCount*other.RowCount, ColumnCount*other.ColumnCount);
KroneckerProduct(other, result);
@@ -1108,14 +1108,14 @@ namespace MathNet.Numerics.LinearAlgebra
/// The norm under which to normalize the columns under.
/// A normalized version of the matrix.
/// If the parameter p is not positive.
- public virtual Matrix NormalizeColumns(int p)
+ public Matrix NormalizeColumns(int p)
{
if (p < 1)
{
throw new ArgumentOutOfRangeException("p", Resources.ArgumentMustBePositive);
}
- var ret = Clone();
+ var ret = CreateMatrix(RowCount, ColumnCount);
for (var index = 0; index < ColumnCount; index++)
{
@@ -1131,14 +1131,14 @@ namespace MathNet.Numerics.LinearAlgebra
/// The norm under which to normalize the rows under.
/// A normalized version of the matrix.
/// If the parameter p is not positive.
- public virtual Matrix NormalizeRows(int p)
+ public Matrix NormalizeRows(int p)
{
if (p < 1)
{
throw new ArgumentOutOfRangeException("p", Resources.ArgumentMustBePositive);
}
- var ret = Clone();
+ var ret = CreateMatrix(RowCount, ColumnCount);
for (var index = 0; index < RowCount; index++)
{
@@ -1150,46 +1150,46 @@ namespace MathNet.Numerics.LinearAlgebra
#region Exceptions - possibly move elsewhere?
- public static Exception DimensionsDontMatch(Matrix left, Matrix right, Matrix result, string paramName = null)
+ 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);
return CreateException(message, paramName);
}
- public static Exception DimensionsDontMatch(Matrix left, Matrix right, string paramName = null)
+ 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);
return CreateException(message, paramName);
}
- public static Exception DimensionsDontMatch(Matrix matrix)
+ internal static Exception DimensionsDontMatch(Matrix matrix)
where TException : Exception
{
var message = string.Format(Resources.ArgumentMatrixDimensions1, matrix.RowCount + "x" + matrix.ColumnCount);
return CreateException(message);
}
- public static Exception DimensionsDontMatch(Matrix left, Vector right, Vector result, string paramName = null)
+ internal static Exception DimensionsDontMatch(Matrix left, Vector right, Vector result, string paramName = null)
where TException : Exception
{
return DimensionsDontMatch(left, right.ToColumnMatrix(), result.ToColumnMatrix(), paramName);
}
- public static Exception DimensionsDontMatch(Matrix left, Vector right, string paramName = null)
+ internal static Exception DimensionsDontMatch(Matrix left, Vector right, string paramName = null)
where TException : Exception
{
return DimensionsDontMatch(left, right.ToColumnMatrix(), paramName);
}
- public static Exception DimensionsDontMatch(Vector left, Matrix right, string paramName = null)
+ internal static Exception DimensionsDontMatch(Vector left, Matrix right, string paramName = null)
where TException : Exception
{
return DimensionsDontMatch(left.ToColumnMatrix(), right, paramName);
}
- public static Exception DimensionsDontMatch(Vector left, Vector right, string paramName = null)
+ internal static Exception DimensionsDontMatch(Vector left, Vector right, string paramName = null)
where TException : Exception
{
return DimensionsDontMatch(left.ToColumnMatrix(), right.ToColumnMatrix(), paramName);
diff --git a/src/Numerics/LinearAlgebra/Matrix.Solve.cs b/src/Numerics/LinearAlgebra/Matrix.Solve.cs
index 70ad8a2c..8ed75110 100644
--- a/src/Numerics/LinearAlgebra/Matrix.Solve.cs
+++ b/src/Numerics/LinearAlgebra/Matrix.Solve.cs
@@ -155,7 +155,9 @@ namespace MathNet.Numerics.LinearAlgebra
/// The solution vector b.
/// The result vector x.
/// The iterative solver to use.
- public IterationStatus TrySolveIterative(Vector input, Vector result, IIterativeSolver solver, IPreconditioner preconditioner, Iterator iterator = null)
+ /// The iterator to use to control when to stop iterating.
+ /// The preconditioner to use for approximations.
+ public IterationStatus TrySolveIterative(Vector input, Vector result, IIterativeSolver solver, Iterator iterator = null, IPreconditioner preconditioner = null)
{
if (iterator == null)
{
@@ -178,7 +180,9 @@ namespace MathNet.Numerics.LinearAlgebra
/// The solution matrix B.
/// The result matrix X
/// The iterative solver to use.
- public IterationStatus TrySolveIterative(Matrix input, Matrix result, IIterativeSolver solver, IPreconditioner preconditioner, Iterator iterator = null)
+ /// The iterator to use to control when to stop iterating.
+ /// The preconditioner to use for approximations.
+ public IterationStatus TrySolveIterative(Matrix input, Matrix result, IIterativeSolver solver, Iterator iterator = null, IPreconditioner preconditioner = null)
{
if (RowCount != input.RowCount || input.RowCount != result.RowCount || input.ColumnCount != result.ColumnCount)
{
@@ -210,100 +214,46 @@ namespace MathNet.Numerics.LinearAlgebra
return iterator.Status;
}
- public IterationStatus TrySolveIterative(Vector input, Vector result, IIterativeSolver solver, Iterator iterator)
- {
- var preconditioner = new UnitPreconditioner();
- return TrySolveIterative(input, result, solver, preconditioner, iterator);
- }
-
- public IterationStatus TrySolveIterative(Matrix input, Matrix result, IIterativeSolver solver, Iterator iterator)
- {
- var preconditioner = new UnitPreconditioner();
- return TrySolveIterative(input, result, solver, preconditioner, iterator);
- }
-
- public IterationStatus TrySolveIterative(Vector input, Vector result, IIterativeSolver solver)
- {
- var preconditioner = new UnitPreconditioner();
- var iterator = new Iterator(Builder.IterativeSolverStopCriteria());
- return TrySolveIterative(input, result, solver, preconditioner, iterator);
- }
-
- public IterationStatus TrySolveIterative(Matrix input, Matrix result, IIterativeSolver solver)
- {
- var preconditioner = new UnitPreconditioner();
- var iterator = new Iterator(Builder.IterativeSolverStopCriteria());
- return TrySolveIterative(input, result, solver, preconditioner, iterator);
- }
-
public IterationStatus TrySolveIterative(Vector input, Vector result, IIterativeSolver solver, IPreconditioner preconditioner, params IIterationStopCriterium[] stopCriteria)
{
var iterator = new Iterator(stopCriteria.Length == 0 ? Builder.IterativeSolverStopCriteria() : stopCriteria);
- return TrySolveIterative(input, result, solver, preconditioner, iterator);
+ return TrySolveIterative(input, result, solver, iterator, preconditioner);
}
public IterationStatus TrySolveIterative(Matrix input, Matrix result, IIterativeSolver solver, IPreconditioner preconditioner, params IIterationStopCriterium[] stopCriteria)
{
var iterator = new Iterator(stopCriteria.Length == 0 ? Builder.IterativeSolverStopCriteria() : stopCriteria);
- return TrySolveIterative(input, result, solver, preconditioner, iterator);
+ return TrySolveIterative(input, result, solver, iterator, preconditioner);
}
public IterationStatus TrySolveIterative(Vector input, Vector result, IIterativeSolver solver, params IIterationStopCriterium[] stopCriteria)
{
- var preconditioner = new UnitPreconditioner();
var iterator = new Iterator(stopCriteria.Length == 0 ? Builder.IterativeSolverStopCriteria() : stopCriteria);
- return TrySolveIterative(input, result, solver, preconditioner, iterator);
+ return TrySolveIterative(input, result, solver, iterator);
}
public IterationStatus TrySolveIterative(Matrix input, Matrix result, IIterativeSolver solver, params IIterationStopCriterium[] stopCriteria)
{
- var preconditioner = new UnitPreconditioner();
var iterator = new Iterator(stopCriteria.Length == 0 ? Builder.IterativeSolverStopCriteria() : stopCriteria);
- return TrySolveIterative(input, result, solver, preconditioner, iterator);
+ return TrySolveIterative(input, result, solver, iterator);
}
// Iterative Solvers: Simple
- public Vector SolveIterative(Vector input, IIterativeSolver solver, IPreconditioner preconditioner, Iterator iterator)
- {
- var result = Builder.DenseVector(RowCount);
- TrySolveIterative(input, result, solver, preconditioner, iterator);
- return result;
- }
-
- public Matrix SolveIterative(Matrix input, IIterativeSolver solver, IPreconditioner preconditioner, Iterator iterator)
- {
- var result = Builder.DenseMatrix(input.RowCount, input.ColumnCount);
- TrySolveIterative(input, result, solver, preconditioner, iterator);
- return result;
- }
-
- public Vector SolveIterative(Vector input, IIterativeSolver solver, Iterator iterator)
- {
- var result = Builder.DenseVector(RowCount);
- TrySolveIterative(input, result, solver, iterator);
- return result;
- }
-
- public Matrix SolveIterative(Matrix input, IIterativeSolver solver, Iterator iterator)
- {
- var result = Builder.DenseMatrix(input.RowCount, input.ColumnCount);
- TrySolveIterative(input, result, solver, iterator);
- return result;
- }
-
///
/// Solves the matrix equation Ax = b, where A is the coefficient matrix (this matrix), b is the solution vector and x is the unknown vector.
///
/// The solution vector b.
/// The iterative solver to use.
+ /// The iterator to use to control when to stop iterating.
+ /// The preconditioner to use for approximations.
/// The result vector x.
- public Vector SolveIterative(Vector input, IIterativeSolver solver)
+ public Vector SolveIterative(Vector input, IIterativeSolver solver, Iterator iterator = null, IPreconditioner preconditioner = null)
{
var result = Builder.DenseVector(RowCount);
- TrySolveIterative(input, result, solver);
+ TrySolveIterative(input, result, solver, iterator, preconditioner);
return result;
}
@@ -312,11 +262,13 @@ namespace MathNet.Numerics.LinearAlgebra
///
/// The solution matrix B.
/// The iterative solver to use.
+ /// The iterator to use to control when to stop iterating.
+ /// The preconditioner to use for approximations.
/// The result matrix X.
- public Matrix SolveIterative(Matrix input, IIterativeSolver solver)
+ public Matrix SolveIterative(Matrix input, IIterativeSolver solver, Iterator iterator = null, IPreconditioner preconditioner = null)
{
var result = Builder.DenseMatrix(input.RowCount, input.ColumnCount);
- TrySolveIterative(input, result, solver);
+ TrySolveIterative(input, result, solver, iterator, preconditioner);
return result;
}
diff --git a/src/Numerics/LinearAlgebra/Single/DenseVector.cs b/src/Numerics/LinearAlgebra/Single/DenseVector.cs
index a74868fb..b49411b7 100644
--- a/src/Numerics/LinearAlgebra/Single/DenseVector.cs
+++ b/src/Numerics/LinearAlgebra/Single/DenseVector.cs
@@ -748,21 +748,6 @@ namespace MathNet.Numerics.LinearAlgebra.Single
#region Parse Functions
- ///
- /// Creates a float dense vector based on a string. The string can be in the following formats (without the
- /// quotes): 'n', 'n,n,..', '(n,n,..)', '[n,n,...]', where n is a float.
- ///
- ///
- /// A float dense vector containing the values specified by the given string.
- ///
- ///
- /// The string to parse.
- ///
- public static DenseVector Parse(string value)
- {
- return Parse(value, null);
- }
-
///
/// Creates a float dense vector based on a string. The string can be in the following formats (without the
/// quotes): 'n', 'n,n,..', '(n,n,..)', '[n,n,...]', where n is a float.
@@ -776,7 +761,7 @@ namespace MathNet.Numerics.LinearAlgebra.Single
///
/// An that supplies culture-specific formatting information.
///
- public static DenseVector Parse(string value, IFormatProvider formatProvider)
+ public static DenseVector Parse(string value, IFormatProvider formatProvider = null)
{
if (value == null)
{
diff --git a/src/Numerics/LinearAlgebra/Single/Factorization/UserEvd.cs b/src/Numerics/LinearAlgebra/Single/Factorization/UserEvd.cs
index 34d1cb48..67b0d1f1 100644
--- a/src/Numerics/LinearAlgebra/Single/Factorization/UserEvd.cs
+++ b/src/Numerics/LinearAlgebra/Single/Factorization/UserEvd.cs
@@ -136,6 +136,7 @@ namespace MathNet.Numerics.LinearAlgebra.Single.Factorization
///
/// Symmetric Householder reduction to tridiagonal form.
///
+ /// The eigen vectors to work on.
/// Arrays for internal storage of real parts of eigenvalues
/// Arrays for internal storage of imaginary parts of eigenvalues
/// Order of initial matrix
@@ -288,6 +289,7 @@ namespace MathNet.Numerics.LinearAlgebra.Single.Factorization
///
/// Symmetric tridiagonal QL algorithm.
///
+ /// The eigen vectors to work on.
/// Arrays for internal storage of real parts of eigenvalues
/// Arrays for internal storage of imaginary parts of eigenvalues
/// Order of initial matrix
@@ -434,6 +436,7 @@ namespace MathNet.Numerics.LinearAlgebra.Single.Factorization
///
/// Nonsymmetric reduction to Hessenberg form.
///
+ /// The eigen vectors to work on.
/// Array for internal storage of nonsymmetric Hessenberg form.
/// Order of initial matrix
/// This is derived from the Algol procedures orthes and ortran,
@@ -549,6 +552,7 @@ namespace MathNet.Numerics.LinearAlgebra.Single.Factorization
///
/// Nonsymmetric reduction from Hessenberg to real Schur form.
///
+ /// The eigen vectors to work on.
/// Array for internal storage of nonsymmetric Hessenberg form.
/// Arrays for internal storage of real parts of eigenvalues
/// Arrays for internal storage of imaginary parts of eigenvalues
diff --git a/src/Numerics/LinearAlgebra/Single/Solvers/BiCgStab.cs b/src/Numerics/LinearAlgebra/Single/Solvers/BiCgStab.cs
index c9618ab1..066c300f 100644
--- a/src/Numerics/LinearAlgebra/Single/Solvers/BiCgStab.cs
+++ b/src/Numerics/LinearAlgebra/Single/Solvers/BiCgStab.cs
@@ -91,6 +91,8 @@ namespace MathNet.Numerics.LinearAlgebra.Single.Solvers
/// The coefficient , A.
/// The solution , b.
/// The result , x.
+ /// The iterator to use to control when to stop iterating.
+ /// The preconditioner to use for approximations.
public void Solve(Matrix matrix, Vector input, Vector result, Iterator iterator, IPreconditioner preconditioner)
{
if (matrix.RowCount != matrix.ColumnCount)
diff --git a/src/Numerics/LinearAlgebra/Single/Solvers/CompositeSolver.cs b/src/Numerics/LinearAlgebra/Single/Solvers/CompositeSolver.cs
index d4503b1d..55986055 100644
--- a/src/Numerics/LinearAlgebra/Single/Solvers/CompositeSolver.cs
+++ b/src/Numerics/LinearAlgebra/Single/Solvers/CompositeSolver.cs
@@ -70,6 +70,8 @@ namespace MathNet.Numerics.LinearAlgebra.Single.Solvers
/// The coefficient matrix, A.
/// The solution vector, b
/// The result vector, x
+ /// The iterator to use to control when to stop iterating.
+ /// The preconditioner to use for approximations.
public void Solve(Matrix matrix, Vector input, Vector result, Iterator iterator, IPreconditioner preconditioner)
{
if (matrix.RowCount != matrix.ColumnCount)
diff --git a/src/Numerics/LinearAlgebra/Single/Solvers/GpBiCg.cs b/src/Numerics/LinearAlgebra/Single/Solvers/GpBiCg.cs
index 09c78625..246044fa 100644
--- a/src/Numerics/LinearAlgebra/Single/Solvers/GpBiCg.cs
+++ b/src/Numerics/LinearAlgebra/Single/Solvers/GpBiCg.cs
@@ -154,6 +154,8 @@ namespace MathNet.Numerics.LinearAlgebra.Single.Solvers
/// The coefficient matrix, A.
/// The solution vector, b
/// The result vector, x
+ /// The iterator to use to control when to stop iterating.
+ /// The preconditioner to use for approximations.
public void Solve(Matrix matrix, Vector input, Vector result, Iterator iterator, IPreconditioner preconditioner)
{
if (matrix.RowCount != matrix.ColumnCount)
diff --git a/src/Numerics/LinearAlgebra/Single/Solvers/MlkBiCgStab.cs b/src/Numerics/LinearAlgebra/Single/Solvers/MlkBiCgStab.cs
index e5b67495..c1a0f2a2 100644
--- a/src/Numerics/LinearAlgebra/Single/Solvers/MlkBiCgStab.cs
+++ b/src/Numerics/LinearAlgebra/Single/Solvers/MlkBiCgStab.cs
@@ -243,6 +243,8 @@ namespace MathNet.Numerics.LinearAlgebra.Single.Solvers
/// The coefficient matrix, A.
/// The solution vector, b
/// The result vector, x
+ /// The iterator to use to control when to stop iterating.
+ /// The preconditioner to use for approximations.
public void Solve(Matrix matrix, Vector input, Vector result, Iterator iterator, IPreconditioner preconditioner)
{
if (matrix.RowCount != matrix.ColumnCount)
diff --git a/src/Numerics/LinearAlgebra/Single/Solvers/StopCriterium/DivergenceStopCriterium.cs b/src/Numerics/LinearAlgebra/Single/Solvers/StopCriterium/DivergenceStopCriterium.cs
index 66918ab1..c2c4e7c3 100644
--- a/src/Numerics/LinearAlgebra/Single/Solvers/StopCriterium/DivergenceStopCriterium.cs
+++ b/src/Numerics/LinearAlgebra/Single/Solvers/StopCriterium/DivergenceStopCriterium.cs
@@ -82,39 +82,13 @@ namespace MathNet.Numerics.LinearAlgebra.Single.Solvers.StopCriterium
///
int _lastIteration = DefaultLastIterationNumber;
- ///
- /// Initializes a new instance of the class with the default maximum
- /// relative increase and the default minimum number of tracking iterations.
- ///
- public DivergenceStopCriterium() : this(DefaultMaximumRelativeIncrease, DefaultMinimumNumberOfIterations)
- {
- }
-
- ///
- /// Initializes a new instance of the class with the specified maximum
- /// relative increase and the default minimum number of tracking iterations.
- ///
- /// The maximum relative increase that the residual may experience before a divergence warning is issued.
- public DivergenceStopCriterium(double maximumRelativeIncrease) : this(maximumRelativeIncrease, DefaultMinimumNumberOfIterations)
- {
- }
-
- ///
- /// Initializes a new instance of the class with the default maximum
- /// relative increase and the specified minimum number of tracking iterations.
- ///
- /// The minimum number of iterations over which the residual must grow before a divergence warning is issued.
- public DivergenceStopCriterium(int minimumIterations) : this(DefaultMinimumNumberOfIterations, minimumIterations)
- {
- }
-
///
/// Initializes a new instance of the class with the specified maximum
/// relative increase and the specified minimum number of tracking iterations.
///
/// The maximum relative increase that the residual may experience before a divergence warning is issued.
/// The minimum number of iterations over which the residual must grow before a divergence warning is issued.
- public DivergenceStopCriterium(double maximumRelativeIncrease, int minimumIterations)
+ public DivergenceStopCriterium(double maximumRelativeIncrease = DefaultMaximumRelativeIncrease, int minimumIterations = DefaultMinimumNumberOfIterations)
{
if (maximumRelativeIncrease <= 0)
{
diff --git a/src/Numerics/LinearAlgebra/Single/Solvers/StopCriterium/ResidualStopCriterium.cs b/src/Numerics/LinearAlgebra/Single/Solvers/StopCriterium/ResidualStopCriterium.cs
index 0540e4a0..63078e0c 100644
--- a/src/Numerics/LinearAlgebra/Single/Solvers/StopCriterium/ResidualStopCriterium.cs
+++ b/src/Numerics/LinearAlgebra/Single/Solvers/StopCriterium/ResidualStopCriterium.cs
@@ -81,35 +81,6 @@ namespace MathNet.Numerics.LinearAlgebra.Single.Solvers.StopCriterium
///
int _lastIteration = DefaultLastIterationNumber;
- ///
- /// Initializes a new instance of the class with the default maximum
- /// residual and the default minimum number of iterations.
- ///
- public ResidualStopCriterium() : this(DefaultMaximumResidual, DefaultMinimumIterationsBelowMaximum)
- {
- }
-
- ///
- /// Initializes a new instance of the class with the specified
- /// maximum residual and the default minimum number of iterations.
- ///
- /// The maximum value for the residual below which the calculation is considered converged.
- public ResidualStopCriterium(float maximum) : this(maximum, DefaultMinimumIterationsBelowMaximum)
- {
- }
-
- ///
- /// Initializes a new instance of the class with the default maximum residual
- /// and specified minimum number of iterations.
- ///
- ///
- /// The minimum number of iterations for which the residual has to be below the maximum before
- /// the calculation is considered converged.
- ///
- public ResidualStopCriterium(int minimumIterationsBelowMaximum) : this(DefaultMaximumResidual, minimumIterationsBelowMaximum)
- {
- }
-
///
/// Initializes a new instance of the class with the specified
/// maximum residual and minimum number of iterations.
@@ -121,7 +92,7 @@ namespace MathNet.Numerics.LinearAlgebra.Single.Solvers.StopCriterium
/// The minimum number of iterations for which the residual has to be below the maximum before
/// the calculation is considered converged.
///
- public ResidualStopCriterium(float maximum, int minimumIterationsBelowMaximum)
+ public ResidualStopCriterium(float maximum = DefaultMaximumResidual, int minimumIterationsBelowMaximum = DefaultMinimumIterationsBelowMaximum)
{
if (maximum < 0)
{
diff --git a/src/Numerics/LinearAlgebra/Single/Solvers/TFQMR.cs b/src/Numerics/LinearAlgebra/Single/Solvers/TFQMR.cs
index d7077524..4faa7648 100644
--- a/src/Numerics/LinearAlgebra/Single/Solvers/TFQMR.cs
+++ b/src/Numerics/LinearAlgebra/Single/Solvers/TFQMR.cs
@@ -87,6 +87,8 @@ namespace MathNet.Numerics.LinearAlgebra.Single.Solvers
/// The coefficient matrix, A.
/// The solution vector, b
/// The result vector, x
+ /// The iterator to use to control when to stop iterating.
+ /// The preconditioner to use for approximations.
public void Solve(Matrix matrix, Vector input, Vector result, Iterator iterator, IPreconditioner preconditioner)
{
if (matrix.RowCount != matrix.ColumnCount)
diff --git a/src/Numerics/LinearAlgebra/Single/SparseVector.cs b/src/Numerics/LinearAlgebra/Single/SparseVector.cs
index 8701efbd..3a70decd 100644
--- a/src/Numerics/LinearAlgebra/Single/SparseVector.cs
+++ b/src/Numerics/LinearAlgebra/Single/SparseVector.cs
@@ -860,21 +860,6 @@ namespace MathNet.Numerics.LinearAlgebra.Single
#region Parse Functions
- ///
- /// Creates a float sparse vector based on a string. The string can be in the following formats (without the
- /// quotes): 'n', 'n,n,..', '(n,n,..)', '[n,n,...]', where n is a float.
- ///
- ///
- /// A float sparse vector containing the values specified by the given string.
- ///
- ///
- /// The string to parse.
- ///
- public static SparseVector Parse(string value)
- {
- return Parse(value, null);
- }
-
///
/// Creates a float sparse vector based on a string. The string can be in the following formats (without the
/// quotes): 'n', 'n,n,..', '(n,n,..)', '[n,n,...]', where n is a float.
@@ -888,7 +873,7 @@ namespace MathNet.Numerics.LinearAlgebra.Single
///
/// An that supplies culture-specific formatting information.
///
- public static SparseVector Parse(string value, IFormatProvider formatProvider)
+ public static SparseVector Parse(string value, IFormatProvider formatProvider = null)
{
if (value == null)
{
diff --git a/src/Numerics/LinearAlgebra/Solvers/IIterativeSolver.cs b/src/Numerics/LinearAlgebra/Solvers/IIterativeSolver.cs
index 76c53aed..13bf041c 100644
--- a/src/Numerics/LinearAlgebra/Solvers/IIterativeSolver.cs
+++ b/src/Numerics/LinearAlgebra/Solvers/IIterativeSolver.cs
@@ -45,6 +45,8 @@ namespace MathNet.Numerics.LinearAlgebra.Solvers
/// The coefficient matrix, A.
/// The solution vector, b
/// The result vector, x
+ /// The iterator to use to control when to stop iterating.
+ /// The preconditioner to use for approximations.
void Solve(Matrix matrix, Vector input, Vector result, Iterator iterator, IPreconditioner preconditioner);
}
}
diff --git a/src/Numerics/LinearAlgebra/Solvers/SolverSetup.cs b/src/Numerics/LinearAlgebra/Solvers/SolverSetup.cs
index caa79b46..e8c8f5aa 100644
--- a/src/Numerics/LinearAlgebra/Solvers/SolverSetup.cs
+++ b/src/Numerics/LinearAlgebra/Solvers/SolverSetup.cs
@@ -41,8 +41,9 @@ namespace MathNet.Numerics.LinearAlgebra.Solvers
/// Loads the available objects from the specified assembly.
///
/// The assembly which will be searched for setup objects.
+ /// If true, types that fail to load are simply ignored. Otherwise the exception is rethrown.
/// The types that should not be loaded.
- public static IEnumerable> LoadFromAssembly(Assembly assembly, bool ignoreFailed, params Type[] typesToExclude)
+ public static IEnumerable> LoadFromAssembly(Assembly assembly, bool ignoreFailed = true, params Type[] typesToExclude)
{
var excludedTypes = new List(typesToExclude);
var setupInterfaceType = typeof (IIterativeSolverSetup);
@@ -71,53 +72,28 @@ namespace MathNet.Numerics.LinearAlgebra.Solvers
.OrderBy(s => s.SolutionSpeed/s.Reliability);
}
- ///
- /// Loads the available objects from the specified assembly.
- ///
- /// The assembly which will be searched for setup objects.
- public static IEnumerable> LoadFromAssembly(Assembly assembly)
- {
- return LoadFromAssembly(assembly, true);
- }
-
///
/// Loads the available objects from the specified assembly.
///
/// The type in the assembly which should be searched for setup objects.
+ /// If true, types that fail to load are simply ignored. Otherwise the exception is rethrown.
/// The types that should not be loaded.
- public static IEnumerable> LoadFromAssembly(Type typeInAssembly, bool ignoreFailed, params Type[] typesToExclude)
+ public static IEnumerable> LoadFromAssembly(Type typeInAssembly, bool ignoreFailed = true, params Type[] typesToExclude)
{
return LoadFromAssembly(typeInAssembly.Assembly, ignoreFailed, typesToExclude);
}
- ///
- /// Loads the available objects from the specified assembly.
- ///
- /// The type in the assembly which should be searched for setup objects.
- public static IEnumerable> LoadFromAssembly(Type typeInAssembly)
- {
- return LoadFromAssembly(typeInAssembly.Assembly, true);
- }
-
///
/// Loads the available objects from the specified assembly.
///
/// The of the assembly that should be searched for setup objects.
+ /// If true, types that fail to load are simply ignored. Otherwise the exception is rethrown.
/// The types that should not be loaded.
- public static IEnumerable> LoadFromAssembly(AssemblyName assemblyName, bool ignoreFailed, params Type[] typesToExclude)
+ public static IEnumerable> LoadFromAssembly(AssemblyName assemblyName, bool ignoreFailed = true, params Type[] typesToExclude)
{
return LoadFromAssembly(Assembly.Load(assemblyName.FullName), ignoreFailed, typesToExclude);
}
- ///
- /// Loads the available objects from the specified assembly.
- ///
- /// The of the assembly that should be searched for setup objects.
- public static IEnumerable> LoadFromAssembly(AssemblyName assemblyName)
- {
- return LoadFromAssembly(Assembly.Load(assemblyName.FullName), true);
- }
-
///
/// Loads the available objects from the Math.NET Numerics assembly.
///
diff --git a/src/Numerics/LinearAlgebra/Storage/DenseVectorStorage.cs b/src/Numerics/LinearAlgebra/Storage/DenseVectorStorage.cs
index 4532e12c..e79486c0 100644
--- a/src/Numerics/LinearAlgebra/Storage/DenseVectorStorage.cs
+++ b/src/Numerics/LinearAlgebra/Storage/DenseVectorStorage.cs
@@ -142,7 +142,7 @@ namespace MathNet.Numerics.LinearAlgebra.Storage
return new DenseVectorStorage(copy.Length, copy);
}
- var array = Enumerable.ToArray(data);
+ var array = data.ToArray();
return new DenseVectorStorage(array.Length, array);
}
diff --git a/src/Numerics/LinearAlgebra/Vector.Arithmetic.cs b/src/Numerics/LinearAlgebra/Vector.Arithmetic.cs
index 5bfd9451..c948d592 100644
--- a/src/Numerics/LinearAlgebra/Vector.Arithmetic.cs
+++ b/src/Numerics/LinearAlgebra/Vector.Arithmetic.cs
@@ -83,7 +83,7 @@ namespace MathNet.Numerics.LinearAlgebra
///
/// The scalar to subtract from.
/// The vector to store the result of the subtraction.
- protected virtual void DoSubtractFrom(T scalar, Vector result)
+ protected void DoSubtractFrom(T scalar, Vector result)
{
DoNegate(result);
result.DoAdd(scalar, result);
diff --git a/src/Numerics/LinearAlgebra/Vector.BCL.cs b/src/Numerics/LinearAlgebra/Vector.BCL.cs
index 5d80a3f8..38246da8 100644
--- a/src/Numerics/LinearAlgebra/Vector.BCL.cs
+++ b/src/Numerics/LinearAlgebra/Vector.BCL.cs
@@ -129,7 +129,7 @@ namespace MathNet.Numerics.LinearAlgebra
bool ICollection.Contains(T item)
{
- // Do NOT convert this loop to LINQ (since LINQ would redirect to this very method)!
+ // ReSharper disable once LoopCanBeConvertedToQuery
foreach (var x in this)
{
if (x.Equals(item))
@@ -211,7 +211,7 @@ namespace MathNet.Numerics.LinearAlgebra
object ICollection.SyncRoot
{
- get { return null; }
+ get { return Storage; }
}
void ICollection.CopyTo(Array array, int index)
diff --git a/src/Numerics/LinearAlgebra/Vector.cs b/src/Numerics/LinearAlgebra/Vector.cs
index d272b0c3..e10a1828 100644
--- a/src/Numerics/LinearAlgebra/Vector.cs
+++ b/src/Numerics/LinearAlgebra/Vector.cs
@@ -43,7 +43,7 @@ namespace MathNet.Numerics.LinearAlgebra
/// Supported data types are double, single, , and .
[Serializable]
public abstract partial class Vector :
- IFormattable, IEnumerable, IEquatable>, IList, IList
+ IFormattable, IEquatable>, IList, IList
#if !PORTABLE
, ICloneable
#endif
diff --git a/src/Numerics/Precision.cs b/src/Numerics/Precision.cs
index 9a26bc54..66136719 100644
--- a/src/Numerics/Precision.cs
+++ b/src/Numerics/Precision.cs
@@ -338,20 +338,6 @@ namespace MathNet.Numerics
return (result >= 0) ? result : (int.MinValue - result);
}
- ///
- /// Increments a floating point number to the next bigger number representable by the data type.
- ///
- /// The value which needs to be incremented.
- ///
- /// The incrementation step length depends on the provided value.
- /// Increment(double.MaxValue) will return positive infinity.
- ///
- /// The next larger floating point value.
- public static double Increment(this double value)
- {
- return Increment(value, 1);
- }
-
///
/// Increments a floating point number to the next bigger number representable by the data type.
///
@@ -362,7 +348,7 @@ namespace MathNet.Numerics
/// Increment(double.MaxValue) will return positive infinity.
///
/// The next larger floating point value.
- public static double Increment(this double value, int count)
+ public static double Increment(this double value, int count = 1)
{
if (double.IsInfinity(value) || double.IsNaN(value) || count == 0)
{
@@ -405,20 +391,6 @@ namespace MathNet.Numerics
#endif
}
- ///
- /// Decrements a floating point number to the next smaller number representable by the data type.
- ///
- /// The value which should be decremented.
- ///
- /// The decrementation step length depends on the provided value.
- /// Decrement(double.MinValue) will return negative infinity.
- ///
- /// The next smaller floating point value.
- public static double Decrement(this double value)
- {
- return Decrement(value, 1);
- }
-
///
/// Decrements a floating point number to the next smaller number representable by the data type.
///
@@ -429,7 +401,7 @@ namespace MathNet.Numerics
/// Decrement(double.MinValue) will return negative infinity.
///
/// The next smaller floating point value.
- public static double Decrement(this double value, int count)
+ public static double Decrement(this double value, int count = 1)
{
if (double.IsInfinity(value) || double.IsNaN(value) || count == 0)
{
diff --git a/src/Numerics/SpecialFunctions/ModifiedBessel.cs b/src/Numerics/SpecialFunctions/ModifiedBessel.cs
index ec4e3716..aaee3a4e 100644
--- a/src/Numerics/SpecialFunctions/ModifiedBessel.cs
+++ b/src/Numerics/SpecialFunctions/ModifiedBessel.cs
@@ -65,14 +65,14 @@ namespace MathNet.Numerics
///
/// lim(x->0){ exp(-x) I0(x) } = 1.
///
- private static readonly double[] BesselI0A = new[] { -4.41534164647933937950e-18, 3.33079451882223809783e-17, -2.43127984654795469359e-16, 1.71539128555513303061e-15, -1.16853328779934516808e-14, 7.67618549860493561688e-14, -4.85644678311192946090e-13, 2.95505266312963983461e-12, -1.72682629144155570723e-11, 9.67580903537323691224e-11, -5.18979560163526290666e-10, 2.65982372468238665035e-9, -1.30002500998624804212e-8, 6.04699502254191894932e-8, -2.67079385394061173391e-7, 1.11738753912010371815e-6, -4.41673835845875056359e-6, 1.64484480707288970893e-5, -5.75419501008210370398e-5, 1.88502885095841655729e-4, -5.76375574538582365885e-4, 1.63947561694133579842e-3, -4.32430999505057594430e-3, 1.05464603945949983183e-2, -2.37374148058994688156e-2, 4.93052842396707084878e-2, -9.49010970480476444210e-2, 1.71620901522208775349e-1, -3.04682672343198398683e-1, 6.76795274409476084995e-1 };
+ private static readonly double[] BesselI0A = { -4.41534164647933937950e-18, 3.33079451882223809783e-17, -2.43127984654795469359e-16, 1.71539128555513303061e-15, -1.16853328779934516808e-14, 7.67618549860493561688e-14, -4.85644678311192946090e-13, 2.95505266312963983461e-12, -1.72682629144155570723e-11, 9.67580903537323691224e-11, -5.18979560163526290666e-10, 2.65982372468238665035e-9, -1.30002500998624804212e-8, 6.04699502254191894932e-8, -2.67079385394061173391e-7, 1.11738753912010371815e-6, -4.41673835845875056359e-6, 1.64484480707288970893e-5, -5.75419501008210370398e-5, 1.88502885095841655729e-4, -5.76375574538582365885e-4, 1.63947561694133579842e-3, -4.32430999505057594430e-3, 1.05464603945949983183e-2, -2.37374148058994688156e-2, 4.93052842396707084878e-2, -9.49010970480476444210e-2, 1.71620901522208775349e-1, -3.04682672343198398683e-1, 6.76795274409476084995e-1 };
/// Chebyshev coefficients for exp(-x) sqrt(x) I0(x)
/// in the inverted interval [8, infinity].
///
/// lim(x->inf){ exp(-x) sqrt(x) I0(x) } = 1/sqrt(2pi).
///
- private static readonly double[] BesselI0B = new[] { -7.23318048787475395456e-18, -4.83050448594418207126e-18, 4.46562142029675999901e-17, 3.46122286769746109310e-17, -2.82762398051658348494e-16, -3.42548561967721913462e-16, 1.77256013305652638360e-15, 3.81168066935262242075e-15, -9.55484669882830764870e-15, -4.15056934728722208663e-14, 1.54008621752140982691e-14, 3.85277838274214270114e-13, 7.18012445138366623367e-13, -1.79417853150680611778e-12, -1.32158118404477131188e-11, -3.14991652796324136454e-11, 1.18891471078464383424e-11, 4.94060238822496958910e-10, 3.39623202570838634515e-9, 2.26666899049817806459e-8, 2.04891858946906374183e-7, 2.89137052083475648297e-6, 6.88975834691682398426e-5, 3.36911647825569408990e-3, 8.04490411014108831608e-1 };
+ private static readonly double[] BesselI0B = { -7.23318048787475395456e-18, -4.83050448594418207126e-18, 4.46562142029675999901e-17, 3.46122286769746109310e-17, -2.82762398051658348494e-16, -3.42548561967721913462e-16, 1.77256013305652638360e-15, 3.81168066935262242075e-15, -9.55484669882830764870e-15, -4.15056934728722208663e-14, 1.54008621752140982691e-14, 3.85277838274214270114e-13, 7.18012445138366623367e-13, -1.79417853150680611778e-12, -1.32158118404477131188e-11, -3.14991652796324136454e-11, 1.18891471078464383424e-11, 4.94060238822496958910e-10, 3.39623202570838634515e-9, 2.26666899049817806459e-8, 2.04891858946906374183e-7, 2.89137052083475648297e-6, 6.88975834691682398426e-5, 3.36911647825569408990e-3, 8.04490411014108831608e-1 };
///
/// **************************************
@@ -84,14 +84,14 @@ namespace MathNet.Numerics
///
/// lim(x->0){ exp(-x) I1(x) / x } = 1/2.
///
- private static readonly double[] BesselI1A = new[] { 2.77791411276104639959e-18, -2.11142121435816608115e-17, 1.55363195773620046921e-16, -1.10559694773538630805e-15, 7.60068429473540693410e-15, -5.04218550472791168711e-14, 3.22379336594557470981e-13, -1.98397439776494371520e-12, 1.17361862988909016308e-11, -6.66348972350202774223e-11, 3.62559028155211703701e-10, -1.88724975172282928790e-9, 9.38153738649577178388e-9, -4.44505912879632808065e-8, 2.00329475355213526229e-7, -8.56872026469545474066e-7, 3.47025130813767847674e-6, -1.32731636560394358279e-5, 4.78156510755005422638e-5, -1.61760815825896745588e-4, 5.12285956168575772895e-4, -1.51357245063125314899e-3, 4.15642294431288815669e-3, -1.05640848946261981558e-2, 2.47264490306265168283e-2, -5.29459812080949914269e-2, 1.02643658689847095384e-1, -1.76416518357834055153e-1, 2.52587186443633654823e-1 };
+ private static readonly double[] BesselI1A = { 2.77791411276104639959e-18, -2.11142121435816608115e-17, 1.55363195773620046921e-16, -1.10559694773538630805e-15, 7.60068429473540693410e-15, -5.04218550472791168711e-14, 3.22379336594557470981e-13, -1.98397439776494371520e-12, 1.17361862988909016308e-11, -6.66348972350202774223e-11, 3.62559028155211703701e-10, -1.88724975172282928790e-9, 9.38153738649577178388e-9, -4.44505912879632808065e-8, 2.00329475355213526229e-7, -8.56872026469545474066e-7, 3.47025130813767847674e-6, -1.32731636560394358279e-5, 4.78156510755005422638e-5, -1.61760815825896745588e-4, 5.12285956168575772895e-4, -1.51357245063125314899e-3, 4.15642294431288815669e-3, -1.05640848946261981558e-2, 2.47264490306265168283e-2, -5.29459812080949914269e-2, 1.02643658689847095384e-1, -1.76416518357834055153e-1, 2.52587186443633654823e-1 };
/// Chebyshev coefficients for exp(-x) sqrt(x) I1(x)
/// in the inverted interval [8, infinity].
///
/// lim(x->inf){ exp(-x) sqrt(x) I1(x) } = 1/sqrt(2pi).
///
- private static readonly double[] BesselI1B = new[] { 7.51729631084210481353e-18, 4.41434832307170791151e-18, -4.65030536848935832153e-17, -3.20952592199342395980e-17, 2.96262899764595013876e-16, 3.30820231092092828324e-16, -1.88035477551078244854e-15, -3.81440307243700780478e-15, 1.04202769841288027642e-14, 4.27244001671195135429e-14, -2.10154184277266431302e-14, -4.08355111109219731823e-13, -7.19855177624590851209e-13, 2.03562854414708950722e-12, 1.41258074366137813316e-11, 3.25260358301548823856e-11, -1.89749581235054123450e-11, -5.58974346219658380687e-10, -3.83538038596423702205e-9, -2.63146884688951950684e-8, -2.51223623787020892529e-7, -3.88256480887769039346e-6, -1.10588938762623716291e-4, -9.76109749136146840777e-3, 7.78576235018280120474e-1 };
+ private static readonly double[] BesselI1B = { 7.51729631084210481353e-18, 4.41434832307170791151e-18, -4.65030536848935832153e-17, -3.20952592199342395980e-17, 2.96262899764595013876e-16, 3.30820231092092828324e-16, -1.88035477551078244854e-15, -3.81440307243700780478e-15, 1.04202769841288027642e-14, 4.27244001671195135429e-14, -2.10154184277266431302e-14, -4.08355111109219731823e-13, -7.19855177624590851209e-13, 2.03562854414708950722e-12, 1.41258074366137813316e-11, 3.25260358301548823856e-11, -1.89749581235054123450e-11, -5.58974346219658380687e-10, -3.83538038596423702205e-9, -2.63146884688951950684e-8, -2.51223623787020892529e-7, -3.88256480887769039346e-6, -1.10588938762623716291e-4, -9.76109749136146840777e-3, 7.78576235018280120474e-1 };
///
/// **************************************
@@ -104,14 +104,14 @@ namespace MathNet.Numerics
///
/// lim(x->0){ K0(x) + log(x/2) I0(x) } = -EUL.
///
- private static readonly double[] BesselK0A = new[] { 1.37446543561352307156e-16, 4.25981614279661018399e-14, 1.03496952576338420167e-11, 1.90451637722020886025e-9, 2.53479107902614945675e-7, 2.28621210311945178607e-5, 1.26461541144692592338e-3, 3.59799365153615016266e-2, 3.44289899924628486886e-1, -5.35327393233902768720e-1 };
+ private static readonly double[] BesselK0A = { 1.37446543561352307156e-16, 4.25981614279661018399e-14, 1.03496952576338420167e-11, 1.90451637722020886025e-9, 2.53479107902614945675e-7, 2.28621210311945178607e-5, 1.26461541144692592338e-3, 3.59799365153615016266e-2, 3.44289899924628486886e-1, -5.35327393233902768720e-1 };
/// Chebyshev coefficients for exp(x) sqrt(x) K0(x)
/// in the inverted interval [2, infinity].
///
/// lim(x->inf){ exp(x) sqrt(x) K0(x) } = sqrt(pi/2).
///
- private static readonly double[] BesselK0B = new[] { 5.30043377268626276149e-18, -1.64758043015242134646e-17, 5.21039150503902756861e-17, -1.67823109680541210385e-16, 5.51205597852431940784e-16, -1.84859337734377901440e-15, 6.34007647740507060557e-15, -2.22751332699166985548e-14, 8.03289077536357521100e-14, -2.98009692317273043925e-13, 1.14034058820847496303e-12, -4.51459788337394416547e-12, 1.85594911495471785253e-11, -7.95748924447710747776e-11, 3.57739728140030116597e-10, -1.69753450938905987466e-9, 8.57403401741422608519e-9, -4.66048989768794782956e-8, 2.76681363944501510342e-7, -1.83175552271911948767e-6, 1.39498137188764993662e-5, -1.28495495816278026384e-4, 1.56988388573005337491e-3, -3.14481013119645005427e-2, 2.44030308206595545468e0 };
+ private static readonly double[] BesselK0B = { 5.30043377268626276149e-18, -1.64758043015242134646e-17, 5.21039150503902756861e-17, -1.67823109680541210385e-16, 5.51205597852431940784e-16, -1.84859337734377901440e-15, 6.34007647740507060557e-15, -2.22751332699166985548e-14, 8.03289077536357521100e-14, -2.98009692317273043925e-13, 1.14034058820847496303e-12, -4.51459788337394416547e-12, 1.85594911495471785253e-11, -7.95748924447710747776e-11, 3.57739728140030116597e-10, -1.69753450938905987466e-9, 8.57403401741422608519e-9, -4.66048989768794782956e-8, 2.76681363944501510342e-7, -1.83175552271911948767e-6, 1.39498137188764993662e-5, -1.28495495816278026384e-4, 1.56988388573005337491e-3, -3.14481013119645005427e-2, 2.44030308206595545468e0 };
///
/// **************************************
@@ -123,14 +123,14 @@ namespace MathNet.Numerics
///
/// lim(x->0){ x(K1(x) - log(x/2) I1(x)) } = 1.
///
- private static readonly double[] BesselK1A = new[] { -7.02386347938628759343e-18, -2.42744985051936593393e-15, -6.66690169419932900609e-13, -1.41148839263352776110e-10, -2.21338763073472585583e-8, -2.43340614156596823496e-6, -1.73028895751305206302e-4, -6.97572385963986435018e-3, -1.22611180822657148235e-1, -3.53155960776544875667e-1, 1.52530022733894777053e0 };
+ private static readonly double[] BesselK1A = { -7.02386347938628759343e-18, -2.42744985051936593393e-15, -6.66690169419932900609e-13, -1.41148839263352776110e-10, -2.21338763073472585583e-8, -2.43340614156596823496e-6, -1.73028895751305206302e-4, -6.97572385963986435018e-3, -1.22611180822657148235e-1, -3.53155960776544875667e-1, 1.52530022733894777053e0 };
/// Chebyshev coefficients for exp(x) sqrt(x) K1(x)
/// in the interval [2, infinity].
///
/// lim(x->inf){ exp(x) sqrt(x) K1(x) } = sqrt(pi/2).
///
- private static readonly double[] BesselK1B = new[] { -5.75674448366501715755e-18, 1.79405087314755922667e-17, -5.68946255844285935196e-17, 1.83809354436663880070e-16, -6.05704724837331885336e-16, 2.03870316562433424052e-15, -7.01983709041831346144e-15, 2.47715442448130437068e-14, -8.97670518232499435011e-14, 3.34841966607842919884e-13, -1.28917396095102890680e-12, 5.13963967348173025100e-12, -2.12996783842756842877e-11, 9.21831518760500529508e-11, -4.19035475934189648750e-10, 2.01504975519703286596e-9, -1.03457624656780970260e-8, 5.74108412545004946722e-8, -3.50196060308781257119e-7, 2.40648494783721712015e-6, -1.93619797416608296024e-5, 1.95215518471351631108e-4, -2.85781685962277938680e-3, 1.03923736576817238437e-1, 2.72062619048444266945e0 };
+ private static readonly double[] BesselK1B = { -5.75674448366501715755e-18, 1.79405087314755922667e-17, -5.68946255844285935196e-17, 1.83809354436663880070e-16, -6.05704724837331885336e-16, 2.03870316562433424052e-15, -7.01983709041831346144e-15, 2.47715442448130437068e-14, -8.97670518232499435011e-14, 3.34841966607842919884e-13, -1.28917396095102890680e-12, 5.13963967348173025100e-12, -2.12996783842756842877e-11, 9.21831518760500529508e-11, -4.19035475934189648750e-10, 2.01504975519703286596e-9, -1.03457624656780970260e-8, 5.74108412545004946722e-8, -3.50196060308781257119e-7, 2.40648494783721712015e-6, -1.93619797416608296024e-5, 1.95215518471351631108e-4, -2.85781685962277938680e-3, 1.03923736576817238437e-1, 2.72062619048444266945e0 };
/// Returns the modified Bessel function of first kind, order 0 of the argument.
///
diff --git a/src/Numerics/Statistics/DescriptiveStatistics.cs b/src/Numerics/Statistics/DescriptiveStatistics.cs
index fb21c5b4..2b6aa1c9 100644
--- a/src/Numerics/Statistics/DescriptiveStatistics.cs
+++ b/src/Numerics/Statistics/DescriptiveStatistics.cs
@@ -41,24 +41,6 @@ namespace MathNet.Numerics.Statistics
///
public class DescriptiveStatistics
{
- ///
- /// Initializes a new instance of the class.
- ///
- /// The sample data.
- public DescriptiveStatistics(IEnumerable data)
- : this(data, false)
- {
- }
-
- ///
- /// Initializes a new instance of the class.
- ///
- /// The sample data.
- public DescriptiveStatistics(IEnumerable data)
- : this(data, false)
- {
- }
-
///
/// Initializes a new instance of the class.
///
@@ -71,7 +53,7 @@ namespace MathNet.Numerics.Statistics
/// Don't use increased accuracy for data sets containing large values (in absolute value).
/// This may cause the calculations to overflow.
///
- public DescriptiveStatistics(IEnumerable data, bool increasedAccuracy)
+ public DescriptiveStatistics(IEnumerable data, bool increasedAccuracy = false)
{
if (data == null)
{
@@ -100,7 +82,7 @@ namespace MathNet.Numerics.Statistics
/// Don't use increased accuracy for data sets containing large values (in absolute value).
/// This may cause the calculations to overflow.
///
- public DescriptiveStatistics(IEnumerable data, bool increasedAccuracy)
+ public DescriptiveStatistics(IEnumerable data, bool increasedAccuracy = false)
{
if (data == null)
{
diff --git a/src/Numerics/Statistics/Histogram.cs b/src/Numerics/Statistics/Histogram.cs
index f5ed110a..33bbb183 100644
--- a/src/Numerics/Statistics/Histogram.cs
+++ b/src/Numerics/Statistics/Histogram.cs
@@ -86,14 +86,7 @@ namespace MathNet.Numerics.Statistics
///
/// Initializes a new instance of the Bucket class.
///
- public Bucket(double lowerBound, double upperBound) : this(lowerBound, upperBound, 0.0)
- {
- }
-
- ///
- /// Initializes a new instance of the Bucket class.
- ///
- public Bucket(double lowerBound, double upperBound, double count)
+ public Bucket(double lowerBound, double upperBound, double count = 0.0)
{
if (lowerBound > upperBound)
{
diff --git a/src/Numerics/Statistics/MCMC/HybridMC.cs b/src/Numerics/Statistics/MCMC/HybridMC.cs
index 865a39e4..1a939f42 100644
--- a/src/Numerics/Statistics/MCMC/HybridMC.cs
+++ b/src/Numerics/Statistics/MCMC/HybridMC.cs
@@ -72,22 +72,6 @@ namespace MathNet.Numerics.Statistics.Mcmc
}
}
- ///
- /// Constructs a new Hybrid Monte Carlo sampler for a multivariate probability distribution.
- /// The burn interval will be set to 0.
- /// The components of the momentum will be sampled from a normal distribution with standard deviation
- /// 1 using the default random
- /// number generator. A three point estimation will be used for differentiation.
- ///
- /// The initial sample.
- /// The log density of the distribution we want to sample from.
- /// Number frogleap simulation steps.
- /// Size of the frogleap simulation steps.
- public HybridMC(double[] x0, DensityLn pdfLnP, int frogLeapSteps, double stepSize)
- : this(x0, pdfLnP, frogLeapSteps, stepSize, 0)
- {
- }
-
///
/// Constructs a new Hybrid Monte Carlo sampler for a multivariate probability distribution.
/// The components of the momentum will be sampled from a normal distribution with standard deviation
@@ -101,7 +85,7 @@ namespace MathNet.Numerics.Statistics.Mcmc
/// Size of the frogleap simulation steps.
/// The number of iterations in between returning samples.
/// When the number of burnInterval iteration is negative.
- public HybridMC(double[] x0, DensityLn pdfLnP, int frogLeapSteps, double stepSize, int burnInterval)
+ public HybridMC(double[] x0, DensityLn pdfLnP, int frogLeapSteps, double stepSize, int burnInterval = 0)
: this(x0, pdfLnP, frogLeapSteps, stepSize, burnInterval, new double[x0.Count()], new Random(), Grad)
{
for (int i = 0; i < _length; i++)
diff --git a/src/Numerics/Statistics/MCMC/MetropolisHastingsSampler.cs b/src/Numerics/Statistics/MCMC/MetropolisHastingsSampler.cs
index 32188eec..3c848d70 100644
--- a/src/Numerics/Statistics/MCMC/MetropolisHastingsSampler.cs
+++ b/src/Numerics/Statistics/MCMC/MetropolisHastingsSampler.cs
@@ -76,19 +76,6 @@ namespace MathNet.Numerics.Statistics.Mcmc
///
private int _burnInterval;
- ///
- /// Constructs a new Metropolis-Hastings sampler using the default random
- /// number generator. The burn interval will be set to 0.
- ///
- /// The initial sample.
- /// The log density of the distribution we want to sample from.
- /// The log transition probability for the proposal distribution.
- /// A method that samples from the proposal distribution.
- public MetropolisHastingsSampler(T x0, DensityLn pdfLnP, TransitionKernelLn krnlQ, LocalProposalSampler proposal)
- : this(x0, pdfLnP, krnlQ, proposal, 0)
- {
- }
-
///
/// Constructs a new Metropolis-Hastings sampler using the default random number generator. This
/// constructor will set the burn interval.
@@ -99,7 +86,7 @@ namespace MathNet.Numerics.Statistics.Mcmc
/// A method that samples from the proposal distribution.
/// The number of iterations in between returning samples.
/// When the number of burnInterval iteration is negative.
- public MetropolisHastingsSampler(T x0, DensityLn pdfLnP, TransitionKernelLn krnlQ, LocalProposalSampler proposal, int burnInterval)
+ public MetropolisHastingsSampler(T x0, DensityLn pdfLnP, TransitionKernelLn krnlQ, LocalProposalSampler proposal, int burnInterval = 0)
{
_current = x0;
_currentDensityLn = pdfLnP(x0);
diff --git a/src/Numerics/Statistics/MCMC/MetropolisSampler.cs b/src/Numerics/Statistics/MCMC/MetropolisSampler.cs
index ed120ee8..d42747e9 100644
--- a/src/Numerics/Statistics/MCMC/MetropolisSampler.cs
+++ b/src/Numerics/Statistics/MCMC/MetropolisSampler.cs
@@ -70,18 +70,6 @@ namespace MathNet.Numerics.Statistics.Mcmc
///
private int _burnInterval;
- ///
- /// Constructs a new Metropolis sampler using the default random
- /// number generator. The burnInterval interval will be set to 0.
- ///
- /// The initial sample.
- /// The log density of the distribution we want to sample from.
- /// A method that samples from the symmetric proposal distribution.
- public MetropolisSampler(T x0, DensityLn pdfLnP, LocalProposalSampler proposal)
- : this(x0, pdfLnP, proposal, 0)
- {
- }
-
///
/// Constructs a new Metropolis sampler using the default random number generator.
///
@@ -90,7 +78,7 @@ namespace MathNet.Numerics.Statistics.Mcmc
/// A method that samples from the symmetric proposal distribution.
/// The number of iterations in between returning samples.
/// When the number of burnInterval iteration is negative.
- public MetropolisSampler(T x0, DensityLn pdfLnP, LocalProposalSampler proposal, int burnInterval)
+ public MetropolisSampler(T x0, DensityLn pdfLnP, LocalProposalSampler proposal, int burnInterval = 0)
{
_current = x0;
_currentDensityLn = pdfLnP(x0);
diff --git a/src/Numerics/Statistics/MCMC/UnivariateHybridMC.cs b/src/Numerics/Statistics/MCMC/UnivariateHybridMC.cs
index 7cd8542d..d1f7016b 100644
--- a/src/Numerics/Statistics/MCMC/UnivariateHybridMC.cs
+++ b/src/Numerics/Statistics/MCMC/UnivariateHybridMC.cs
@@ -68,40 +68,6 @@ namespace MathNet.Numerics.Statistics.Mcmc
}
}
- ///
- /// Constructs a new Hybrid Monte Carlo sampler for a univariate probability distribution.
- /// The burn interval will be set to 0.
- /// The momentum will be sampled from a normal distribution with standard deviation
- /// 1 using the default random
- /// number generator. A three point estimation will be used for differentiation.
- ///
- /// The initial sample.
- /// The log density of the distribution we want to sample from.
- /// Number frogleap simulation steps.
- /// Size of the frogleap simulation steps.
- public UnivariateHybridMC(double x0, DensityLn pdfLnP, int frogLeapSteps, double stepSize)
- : this(x0, pdfLnP, frogLeapSteps, stepSize, 0)
- {
- }
-
- ///
- /// Constructs a new Hybrid Monte Carlo sampler for a univariate probability distribution.
- /// The momentum will be sampled from a normal distribution with standard deviation
- /// 1 using the default random
- /// number generator. A three point estimation will be used for differentiation.
- /// This constructor will set the burn interval.
- ///
- /// The initial sample.
- /// The log density of the distribution we want to sample from.
- /// Number frogleap simulation steps.
- /// Size of the frogleap simulation steps.
- /// The number of iterations in between returning samples.
- /// When the number of burnInterval iteration is negative.
- public UnivariateHybridMC(double x0, DensityLn pdfLnP, int frogLeapSteps, double stepSize, int burnInterval)
- : this(x0, pdfLnP, frogLeapSteps, stepSize, burnInterval, 1)
- {
- }
-
///
/// Constructs a new Hybrid Monte Carlo sampler for a univariate probability distribution.
/// The momentum will be sampled from a normal distribution with standard deviation
@@ -117,7 +83,7 @@ namespace MathNet.Numerics.Statistics.Mcmc
/// The standard deviation of the normal distribution that is used to sample
/// the momentum.
/// When the number of burnInterval iteration is negative.
- public UnivariateHybridMC(double x0, DensityLn pdfLnP, int frogLeapSteps, double stepSize, int burnInterval, double pSdv)
+ public UnivariateHybridMC(double x0, DensityLn pdfLnP, int frogLeapSteps, double stepSize, int burnInterval = 0, double pSdv = 1)
: this(x0, pdfLnP, frogLeapSteps, stepSize, burnInterval, pSdv, new Random())
{
}