diff --git a/RELEASENOTES.md b/RELEASENOTES.md
index 5cb58025..6310c051 100644
--- a/RELEASENOTES.md
+++ b/RELEASENOTES.md
@@ -67,6 +67,7 @@ Changes as of now:
- Matrix factorizations no longer clone their results at point of access.
- Add direct factorization-based `Solve` methods to matrix type.
- Massive iterative solver implementation/design simplification, now mostly generic and a bit more functional-style.
+- Renamed iterative solver stop criteria from 'criterium' to 'criterion'.
- New MILU(0) iterative solver preconditioner that is much more efficient and fully leverages sparse data. *~Christian Woltering*
- Matrices/Vectors now have more consistent enumerators, with a variant that skips zeros (useful if sparse).
- Matrix/Vector creation routines have been simplified and usually no longer require explicit dimensions. New variants to create diagonal matrices, or such where all fields have the same value. All functions that take a params array now have an overload accepting an enumerable (e.g. `OfColumnVectors`).
diff --git a/src/Examples/LinearAlgebra/IterativeSolvers/BiCgStabSolver.cs b/src/Examples/LinearAlgebra/IterativeSolvers/BiCgStabSolver.cs
index 2cac2457..fcf30c4c 100644
--- a/src/Examples/LinearAlgebra/IterativeSolvers/BiCgStabSolver.cs
+++ b/src/Examples/LinearAlgebra/IterativeSolvers/BiCgStabSolver.cs
@@ -4,7 +4,7 @@
// http://github.com/mathnet/mathnet-numerics
// http://mathnetnumerics.codeplex.com
//
-// Copyright (c) 2009-2013 Math.NET
+// Copyright (c) 2009-2014 Math.NET
//
// Permission is hereby granted, free of charge, to any person
// obtaining a copy of this software and associated documentation
@@ -47,10 +47,7 @@ namespace Examples.LinearAlgebra.IterativeSolversExamples
///
public string Name
{
- get
- {
- return "Bi-Conjugate Gradient Stabilized iterative solver";
- }
+ get { return "Bi-Conjugate Gradient Stabilized iterative solver"; }
}
///
@@ -58,10 +55,7 @@ namespace Examples.LinearAlgebra.IterativeSolversExamples
///
public string Description
{
- get
- {
- return "Solve linear equation using Bi-Conjugate Gradient Stabilized (BiCGStab) solver";
- }
+ get { return "Solve linear equation using Bi-Conjugate Gradient Stabilized (BiCGStab) solver"; }
}
///
@@ -91,20 +85,20 @@ namespace Examples.LinearAlgebra.IterativeSolversExamples
Console.WriteLine(vectorB.ToString("#0.00\t", formatProvider));
Console.WriteLine();
- // Create stop criteriums to monitor an iterative calculation. There are next available stop criteriums:
- // - DivergenceStopCriterium: monitors an iterative calculation for signs of divergence;
- // - FailureStopCriterium: monitors residuals for NaN's;
- // - IterationCountStopCriterium: monitors the numbers of iteration steps;
- // - ResidualStopCriterium: monitors residuals if calculation is considered converged;
+ // Create stop criteria to monitor an iterative calculation. There are next available stop criteria:
+ // - DivergenceStopCriterion: monitors an iterative calculation for signs of divergence;
+ // - FailureStopCriterion: monitors residuals for NaN's;
+ // - IterationCountStopCriterion: monitors the numbers of iteration steps;
+ // - ResidualStopCriterion: monitors residuals if calculation is considered converged;
// Stop calculation if 1000 iterations reached during calculation
- var iterationCountStopCriterium = new IterationCountStopCriterium(1000);
+ var iterationCountStopCriterion = new IterationCountStopCriterion(1000);
// Stop calculation if residuals are below 1E-10 --> the calculation is considered converged
- var residualStopCriterium = new ResidualStopCriterium(1e-10);
-
- // Create monitor with defined stop criteriums
- var monitor = new Iterator(iterationCountStopCriterium, residualStopCriterium);
+ var residualStopCriterion = new ResidualStopCriterion(1e-10);
+
+ // Create monitor with defined stop criteria
+ var monitor = new Iterator(iterationCountStopCriterion, residualStopCriterion);
// Create Bi-Conjugate Gradient Stabilized solver
var solver = new BiCgStab();
@@ -134,7 +128,7 @@ namespace Examples.LinearAlgebra.IterativeSolversExamples
Console.WriteLine();
// 4. Verify result. Multiply coefficient matrix "A" by result vector "x"
- var reconstructVecorB = matrixA * resultX;
+ var reconstructVecorB = matrixA*resultX;
Console.WriteLine(@"4. Multiply coefficient matrix 'A' by result vector 'x'");
Console.WriteLine(reconstructVecorB.ToString("#0.00\t", formatProvider));
Console.WriteLine();
diff --git a/src/Examples/LinearAlgebra/IterativeSolvers/CompositeSolverExample.cs b/src/Examples/LinearAlgebra/IterativeSolvers/CompositeSolverExample.cs
index 2f72fda7..ed4d45e4 100644
--- a/src/Examples/LinearAlgebra/IterativeSolvers/CompositeSolverExample.cs
+++ b/src/Examples/LinearAlgebra/IterativeSolvers/CompositeSolverExample.cs
@@ -4,7 +4,7 @@
// http://github.com/mathnet/mathnet-numerics
// http://mathnetnumerics.codeplex.com
//
-// Copyright (c) 2009-2013 Math.NET
+// Copyright (c) 2009-2014 Math.NET
//
// Permission is hereby granted, free of charge, to any person
// obtaining a copy of this software and associated documentation
@@ -47,10 +47,7 @@ namespace Examples.LinearAlgebra.IterativeSolversExamples
///
public string Name
{
- get
- {
- return "Composite matrix solver";
- }
+ get { return "Composite matrix solver"; }
}
///
@@ -58,10 +55,7 @@ namespace Examples.LinearAlgebra.IterativeSolversExamples
///
public string Description
{
- get
- {
- return "Solve linear equation using composite matrix solver. The actual solver is made by a sequence of matrix solvers";
- }
+ get { return "Solve linear equation using composite matrix solver. The actual solver is made by a sequence of matrix solvers"; }
}
///
@@ -78,7 +72,7 @@ namespace Examples.LinearAlgebra.IterativeSolversExamples
// 3*x - 7*y + 6*z = 38
// 4*x + 1*y + 5*z = 43
- // Create matrix "A" with coefficients
+ // Create matrix "A" with coefficients
var matrixA = DenseMatrix.OfArray(new[,] { { 5.00, 2.00, -4.00 }, { 3.00, -7.00, 6.00 }, { 4.00, 1.00, 5.00 } });
Console.WriteLine(@"Matrix 'A' with coefficients");
Console.WriteLine(matrixA.ToString("#0.00\t", formatProvider));
@@ -90,32 +84,32 @@ namespace Examples.LinearAlgebra.IterativeSolversExamples
Console.WriteLine(vectorB.ToString("#0.00\t", formatProvider));
Console.WriteLine();
- // Create stop criteriums to monitor an iterative calculation. There are next available stop criteriums:
- // - DivergenceStopCriterium: monitors an iterative calculation for signs of divergence;
- // - FailureStopCriterium: monitors residuals for NaN's;
- // - IterationCountStopCriterium: monitors the numbers of iteration steps;
- // - ResidualStopCriterium: monitors residuals if calculation is considered converged;
+ // Create stop criteria to monitor an iterative calculation. There are next available stop criteria:
+ // - DivergenceStopCriterion: monitors an iterative calculation for signs of divergence;
+ // - FailureStopCriterion: monitors residuals for NaN's;
+ // - IterationCountStopCriterion: monitors the numbers of iteration steps;
+ // - ResidualStopCriterion: monitors residuals if calculation is considered converged;
// Stop calculation if 1000 iterations reached during calculation
- var iterationCountStopCriterium = new IterationCountStopCriterium(1000);
+ var iterationCountStopCriterion = new IterationCountStopCriterion(1000);
// Stop calculation if residuals are below 1E-10 --> the calculation is considered converged
- var residualStopCriterium = new ResidualStopCriterium(1e-10);
+ var residualStopCriterion = new ResidualStopCriterion(1e-10);
- // Create monitor with defined stop criteriums
- var monitor = new Iterator(iterationCountStopCriterium, residualStopCriterium);
+ // Create monitor with defined stop criteria
+ var monitor = new Iterator(iterationCountStopCriterion, residualStopCriterion);
// Load all suitable solvers from current assembly. Below in this example, there is user-defined solver
- // "class UserBiCgStab : IIterativeSolverSetup" which uses regular BiCgStab solver. But user may create any other solver
+ // "class UserBiCgStab : IIterativeSolverSetup" which uses regular BiCgStab solver. But user may create any other solver
// and solver setup classes which implement IIterativeSolverSetup and pass assembly to next function:
var solver = new CompositeSolver(SolverSetup.LoadFromAssembly(Assembly.GetExecutingAssembly()));
-
+
// 1. Solve the matrix equation
var resultX = matrixA.SolveIterative(vectorB, solver, monitor);
Console.WriteLine(@"1. Solve the matrix equation");
Console.WriteLine();
- // 2. Check solver status of the iterations.
+ // 2. Check solver status of the iterations.
// Solver has property IterationResult which contains the status of the iteration once the calculation is finished.
// Possible values are:
// - CalculationCancelled: calculation was cancelled by the user;
@@ -135,7 +129,7 @@ namespace Examples.LinearAlgebra.IterativeSolversExamples
Console.WriteLine();
// 4. Verify result. Multiply coefficient matrix "A" by result vector "x"
- var reconstructVecorB = matrixA * resultX;
+ var reconstructVecorB = matrixA*resultX;
Console.WriteLine(@"4. Multiply coefficient matrix 'A' by result vector 'x'");
Console.WriteLine(reconstructVecorB.ToString("#0.00\t", formatProvider));
Console.WriteLine();
@@ -152,10 +146,7 @@ namespace Examples.LinearAlgebra.IterativeSolversExamples
///
public Type SolverType
{
- get
- {
- return null;
- }
+ get { return null; }
}
///
@@ -163,10 +154,7 @@ namespace Examples.LinearAlgebra.IterativeSolversExamples
///
public Type PreconditionerType
{
- get
- {
- return null;
- }
+ get { return null; }
}
///
@@ -185,15 +173,12 @@ namespace Examples.LinearAlgebra.IterativeSolversExamples
}
///
- /// Gets the relative speed of the solver.
+ /// Gets the relative speed of the solver.
///
/// Returns a value between 0 and 1, inclusive.
public double SolutionSpeed
{
- get
- {
- return 0.99;
- }
+ get { return 0.99; }
}
///
@@ -202,10 +187,7 @@ namespace Examples.LinearAlgebra.IterativeSolversExamples
/// Returns a value between 0 and 1 inclusive.
public double Reliability
{
- get
- {
- return 0.99;
- }
+ get { return 0.99; }
}
}
}
diff --git a/src/Examples/LinearAlgebra/IterativeSolvers/GpBiCgSolver.cs b/src/Examples/LinearAlgebra/IterativeSolvers/GpBiCgSolver.cs
index 891610cc..85245038 100644
--- a/src/Examples/LinearAlgebra/IterativeSolvers/GpBiCgSolver.cs
+++ b/src/Examples/LinearAlgebra/IterativeSolvers/GpBiCgSolver.cs
@@ -4,7 +4,7 @@
// http://github.com/mathnet/mathnet-numerics
// http://mathnetnumerics.codeplex.com
//
-// Copyright (c) 2009-2013 Math.NET
+// Copyright (c) 2009-2014 Math.NET
//
// Permission is hereby granted, free of charge, to any person
// obtaining a copy of this software and associated documentation
@@ -41,15 +41,12 @@ namespace Examples.LinearAlgebra.IterativeSolversExamples
///
public class GpBiCgSolver : IExample
{
- ///
+ ///
/// Gets the name of this example
///
public string Name
{
- get
- {
- return "Generalized Product Bi-Conjugate Gradient iterative solver";
- }
+ get { return "Generalized Product Bi-Conjugate Gradient iterative solver"; }
}
///
@@ -57,10 +54,7 @@ namespace Examples.LinearAlgebra.IterativeSolversExamples
///
public string Description
{
- get
- {
- return "Solve linear equation using Generalized Product Bi-Conjugate Gradient (GPBiCG) solver";
- }
+ get { return "Solve linear equation using Generalized Product Bi-Conjugate Gradient (GPBiCG) solver"; }
}
///
@@ -89,20 +83,20 @@ namespace Examples.LinearAlgebra.IterativeSolversExamples
Console.WriteLine(vectorB.ToString("#0.00\t", formatProvider));
Console.WriteLine();
- // Create stop criteriums to monitor an iterative calculation. There are next available stop criteriums:
- // - DivergenceStopCriterium: monitors an iterative calculation for signs of divergence;
- // - FailureStopCriterium: monitors residuals for NaN's;
- // - IterationCountStopCriterium: monitors the numbers of iteration steps;
- // - ResidualStopCriterium: monitors residuals if calculation is considered converged;
+ // Create stop criteria to monitor an iterative calculation. There are next available stop criteria:
+ // - DivergenceStopCriterion: monitors an iterative calculation for signs of divergence;
+ // - FailureStopCriterion: monitors residuals for NaN's;
+ // - IterationCountStopCriterion: monitors the numbers of iteration steps;
+ // - ResidualStopCriterion: monitors residuals if calculation is considered converged;
// Stop calculation if 1000 iterations reached during calculation
- var iterationCountStopCriterium = new IterationCountStopCriterium(1000);
+ var iterationCountStopCriterion = new IterationCountStopCriterion(1000);
// Stop calculation if residuals are below 1E-10 --> the calculation is considered converged
- var residualStopCriterium = new ResidualStopCriterium(1e-10);
+ var residualStopCriterion = new ResidualStopCriterion(1e-10);
- // Create monitor with defined stop criteriums
- var monitor = new Iterator(iterationCountStopCriterium, residualStopCriterium);
+ // Create monitor with defined stop criteria
+ var monitor = new Iterator(iterationCountStopCriterion, residualStopCriterion);
// Create Generalized Product Bi-Conjugate Gradient solver
var solver = new GpBiCg();
@@ -132,7 +126,7 @@ namespace Examples.LinearAlgebra.IterativeSolversExamples
Console.WriteLine();
// 4. Verify result. Multiply coefficient matrix "A" by result vector "x"
- var reconstructVecorB = matrixA * resultX;
+ var reconstructVecorB = matrixA*resultX;
Console.WriteLine(@"4. Multiply coefficient matrix 'A' by result vector 'x'");
Console.WriteLine(reconstructVecorB.ToString("#0.00\t", formatProvider));
Console.WriteLine();
diff --git a/src/Examples/LinearAlgebra/IterativeSolvers/MlkBiCgStabSolver.cs b/src/Examples/LinearAlgebra/IterativeSolvers/MlkBiCgStabSolver.cs
index a9313f67..1c12ebd3 100644
--- a/src/Examples/LinearAlgebra/IterativeSolvers/MlkBiCgStabSolver.cs
+++ b/src/Examples/LinearAlgebra/IterativeSolvers/MlkBiCgStabSolver.cs
@@ -4,7 +4,7 @@
// http://github.com/mathnet/mathnet-numerics
// http://mathnetnumerics.codeplex.com
//
-// Copyright (c) 2009-2013 Math.NET
+// Copyright (c) 2009-2014 Math.NET
//
// Permission is hereby granted, free of charge, to any person
// obtaining a copy of this software and associated documentation
@@ -47,10 +47,7 @@ namespace Examples.LinearAlgebra.IterativeSolversExamples
///
public string Name
{
- get
- {
- return "Multiple-Lanczos Bi-Conjugate Gradient Stabilized iterative solver";
- }
+ get { return "Multiple-Lanczos Bi-Conjugate Gradient Stabilized iterative solver"; }
}
///
@@ -58,10 +55,7 @@ namespace Examples.LinearAlgebra.IterativeSolversExamples
///
public string Description
{
- get
- {
- return "Solve linear equation using Multiple-Lanczos Bi-Conjugate Gradient stabilized (ML(k)-BiCGStab) solver";
- }
+ get { return "Solve linear equation using Multiple-Lanczos Bi-Conjugate Gradient stabilized (ML(k)-BiCGStab) solver"; }
}
///
@@ -78,7 +72,7 @@ namespace Examples.LinearAlgebra.IterativeSolversExamples
// 3*x - 7*y + 6*z = 38
// 4*x + 1*y + 5*z = 43
- // Create matrix "A" with coefficients
+ // Create matrix "A" with coefficients
var matrixA = DenseMatrix.OfArray(new[,] { { 5.00, 2.00, -4.00 }, { 3.00, -7.00, 6.00 }, { 4.00, 1.00, 5.00 } });
Console.WriteLine(@"Matrix 'A' with coefficients");
Console.WriteLine(matrixA.ToString("#0.00\t", formatProvider));
@@ -90,20 +84,20 @@ namespace Examples.LinearAlgebra.IterativeSolversExamples
Console.WriteLine(vectorB.ToString("#0.00\t", formatProvider));
Console.WriteLine();
- // Create stop criteriums to monitor an iterative calculation. There are next available stop criteriums:
- // - DivergenceStopCriterium: monitors an iterative calculation for signs of divergence;
- // - FailureStopCriterium: monitors residuals for NaN's;
- // - IterationCountStopCriterium: monitors the numbers of iteration steps;
- // - ResidualStopCriterium: monitors residuals if calculation is considered converged;
+ // Create stop criteria to monitor an iterative calculation. There are next available stop criteria:
+ // - DivergenceStopCriterion: monitors an iterative calculation for signs of divergence;
+ // - FailureStopCriterion: monitors residuals for NaN's;
+ // - IterationCountStopCriterion: monitors the numbers of iteration steps;
+ // - ResidualStopCriterion: monitors residuals if calculation is considered converged;
// Stop calculation if 1000 iterations reached during calculation
- var iterationCountStopCriterium = new IterationCountStopCriterium(1000);
+ var iterationCountStopCriterion = new IterationCountStopCriterion(1000);
// Stop calculation if residuals are below 1E-10 --> the calculation is considered converged
- var residualStopCriterium = new ResidualStopCriterium(1e-10);
+ var residualStopCriterion = new ResidualStopCriterion(1e-10);
- // Create monitor with defined stop criteriums
- var monitor = new Iterator(iterationCountStopCriterium, residualStopCriterium);
+ // Create monitor with defined stop criteria
+ var monitor = new Iterator(iterationCountStopCriterion, residualStopCriterion);
// Create Multiple-Lanczos Bi-Conjugate Gradient Stabilized solver
var solver = new MlkBiCgStab();
@@ -113,7 +107,7 @@ namespace Examples.LinearAlgebra.IterativeSolversExamples
Console.WriteLine(@"1. Solve the matrix equation");
Console.WriteLine();
- // 2. Check solver status of the iterations.
+ // 2. Check solver status of the iterations.
// Solver has property IterationResult which contains the status of the iteration once the calculation is finished.
// Possible values are:
// - CalculationCancelled: calculation was cancelled by the user;
@@ -133,7 +127,7 @@ namespace Examples.LinearAlgebra.IterativeSolversExamples
Console.WriteLine();
// 4. Verify result. Multiply coefficient matrix "A" by result vector "x"
- var reconstructVecorB = matrixA * resultX;
+ var reconstructVecorB = matrixA*resultX;
Console.WriteLine(@"4. Multiply coefficient matrix 'A' by result vector 'x'");
Console.WriteLine(reconstructVecorB.ToString("#0.00\t", formatProvider));
Console.WriteLine();
diff --git a/src/Examples/LinearAlgebra/IterativeSolvers/TFQMRSolver.cs b/src/Examples/LinearAlgebra/IterativeSolvers/TFQMRSolver.cs
index f4465896..cae69c82 100644
--- a/src/Examples/LinearAlgebra/IterativeSolvers/TFQMRSolver.cs
+++ b/src/Examples/LinearAlgebra/IterativeSolvers/TFQMRSolver.cs
@@ -4,7 +4,7 @@
// http://github.com/mathnet/mathnet-numerics
// http://mathnetnumerics.codeplex.com
//
-// Copyright (c) 2009-2013 Math.NET
+// Copyright (c) 2009-2014 Math.NET
//
// Permission is hereby granted, free of charge, to any person
// obtaining a copy of this software and associated documentation
@@ -47,10 +47,7 @@ namespace Examples.LinearAlgebra.IterativeSolversExamples
///
public string Name
{
- get
- {
- return "Transpose Free Quasi-Minimal Residual iterative solver";
- }
+ get { return "Transpose Free Quasi-Minimal Residual iterative solver"; }
}
///
@@ -58,10 +55,7 @@ namespace Examples.LinearAlgebra.IterativeSolversExamples
///
public string Description
{
- get
- {
- return "Solve linear equation using Transpose Free Quasi-Minimal Residual (TFQMR) iterative solver";
- }
+ get { return "Solve linear equation using Transpose Free Quasi-Minimal Residual (TFQMR) iterative solver"; }
}
///
@@ -90,20 +84,20 @@ namespace Examples.LinearAlgebra.IterativeSolversExamples
Console.WriteLine(vectorB.ToString("#0.00\t", formatProvider));
Console.WriteLine();
- // Create stop criteriums to monitor an iterative calculation. There are next available stop criteriums:
- // - DivergenceStopCriterium: monitors an iterative calculation for signs of divergence;
- // - FailureStopCriterium: monitors residuals for NaN's;
- // - IterationCountStopCriterium: monitors the numbers of iteration steps;
- // - ResidualStopCriterium: monitors residuals if calculation is considered converged;
+ // Create stop criteria to monitor an iterative calculation. There are next available stop criteria:
+ // - DivergenceStopCriterion: monitors an iterative calculation for signs of divergence;
+ // - FailureStopCriterion: monitors residuals for NaN's;
+ // - IterationCountStopCriterion: monitors the numbers of iteration steps;
+ // - ResidualStopCriterion: monitors residuals if calculation is considered converged;
// Stop calculation if 1000 iterations reached during calculation
- var iterationCountStopCriterium = new IterationCountStopCriterium(1000);
+ var iterationCountStopCriterion = new IterationCountStopCriterion(1000);
// Stop calculation if residuals are below 1E-10 --> the calculation is considered converged
- var residualStopCriterium = new ResidualStopCriterium(1e-10);
+ var residualStopCriterion = new ResidualStopCriterion(1e-10);
- // Create monitor with defined stop criteriums
- var monitor = new Iterator(iterationCountStopCriterium, residualStopCriterium);
+ // Create monitor with defined stop criteria
+ var monitor = new Iterator(iterationCountStopCriterion, residualStopCriterion);
// Create Transpose Free Quasi-Minimal Residual solver
var solver = new TFQMR();
@@ -133,7 +127,7 @@ namespace Examples.LinearAlgebra.IterativeSolversExamples
Console.WriteLine();
// 4. Verify result. Multiply coefficient matrix "A" by result vector "x"
- var reconstructVecorB = matrixA * resultX;
+ var reconstructVecorB = matrixA*resultX;
Console.WriteLine(@"4. Multiply coefficient matrix 'A' by result vector 'x'");
Console.WriteLine(reconstructVecorB.ToString("#0.00\t", formatProvider));
Console.WriteLine();
diff --git a/src/Numerics/LinearAlgebra/Builder.cs b/src/Numerics/LinearAlgebra/Builder.cs
index 5201d4a6..090bb1b8 100644
--- a/src/Numerics/LinearAlgebra/Builder.cs
+++ b/src/Numerics/LinearAlgebra/Builder.cs
@@ -4,7 +4,7 @@
// http://github.com/mathnet/mathnet-numerics
// http://mathnetnumerics.codeplex.com
//
-// Copyright (c) 2009-2013 Math.NET
+// Copyright (c) 2009-2014 Math.NET
//
// Permission is hereby granted, free of charge, to any person
// obtaining a copy of this software and associated documentation
@@ -70,14 +70,14 @@ namespace MathNet.Numerics.LinearAlgebra.Double
return Dense(rows, columns, (i, j) => distribution.Sample());
}
- public override IIterationStopCriterium[] IterativeSolverStopCriteria(int maxIterations = 1000)
+ public override IIterationStopCriterion[] IterativeSolverStopCriteria(int maxIterations = 1000)
{
- return new IIterationStopCriterium[]
+ return new IIterationStopCriterion[]
{
- new FailureStopCriterium(),
- new DivergenceStopCriterium(),
- new IterationCountStopCriterium(maxIterations),
- new ResidualStopCriterium(1e-12)
+ new FailureStopCriterion(),
+ new DivergenceStopCriterion(),
+ new IterationCountStopCriterion(maxIterations),
+ new ResidualStopCriterion(1e-12)
};
}
}
@@ -145,14 +145,14 @@ namespace MathNet.Numerics.LinearAlgebra.Single
return Dense(rows, columns, (i, j) => (float) distribution.Sample());
}
- public override IIterationStopCriterium[] IterativeSolverStopCriteria(int maxIterations = 1000)
+ public override IIterationStopCriterion[] IterativeSolverStopCriteria(int maxIterations = 1000)
{
- return new IIterationStopCriterium[]
+ return new IIterationStopCriterion[]
{
- new FailureStopCriterium(),
- new DivergenceStopCriterium(),
- new IterationCountStopCriterium(maxIterations),
- new ResidualStopCriterium(1e-6)
+ new FailureStopCriterion(),
+ new DivergenceStopCriterion(),
+ new IterationCountStopCriterion(maxIterations),
+ new ResidualStopCriterion(1e-6)
};
}
}
@@ -226,14 +226,14 @@ namespace MathNet.Numerics.LinearAlgebra.Complex
return Dense(rows, columns, (i, j) => new Complex(distribution.Sample(), distribution.Sample()));
}
- public override IIterationStopCriterium[] IterativeSolverStopCriteria(int maxIterations = 1000)
+ public override IIterationStopCriterion[] IterativeSolverStopCriteria(int maxIterations = 1000)
{
- return new IIterationStopCriterium[]
+ return new IIterationStopCriterion[]
{
- new FailureStopCriterium(),
- new DivergenceStopCriterium(),
- new IterationCountStopCriterium(maxIterations),
- new ResidualStopCriterium(1e-12)
+ new FailureStopCriterion(),
+ new DivergenceStopCriterion(),
+ new IterationCountStopCriterion(maxIterations),
+ new ResidualStopCriterion(1e-12)
};
}
}
@@ -301,14 +301,14 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32
return Dense(rows, columns, (i, j) => new Numerics.Complex32((float) distribution.Sample(), (float) distribution.Sample()));
}
- public override IIterationStopCriterium[] IterativeSolverStopCriteria(int maxIterations = 1000)
+ public override IIterationStopCriterion[] IterativeSolverStopCriteria(int maxIterations = 1000)
{
- return new IIterationStopCriterium[]
+ return new IIterationStopCriterion[]
{
- new FailureStopCriterium(),
- new DivergenceStopCriterium(),
- new IterationCountStopCriterium(maxIterations),
- new ResidualStopCriterium(1e-6)
+ new FailureStopCriterion(),
+ new DivergenceStopCriterion(),
+ new IterationCountStopCriterion(maxIterations),
+ new ResidualStopCriterion(1e-6)
};
}
}
@@ -349,6 +349,7 @@ namespace MathNet.Numerics.LinearAlgebra
using Complex64 = Numerics.Complex;
#else
using Complex64 = System.Numerics.Complex;
+
#endif
///
@@ -825,7 +826,7 @@ namespace MathNet.Numerics.LinearAlgebra
int coloffset = 0;
for (int j = 0; j < colspans.Length; j++)
{
- m.SetSubMatrix(rowoffset, coloffset, matrices[i,j]);
+ m.SetSubMatrix(rowoffset, coloffset, matrices[i, j]);
coloffset += colspans[j];
}
rowoffset += rowspans[i];
@@ -1302,7 +1303,7 @@ namespace MathNet.Numerics.LinearAlgebra
return m;
}
- public abstract IIterationStopCriterium[] IterativeSolverStopCriteria(int maxIterations = 1000);
+ public abstract IIterationStopCriterion[] IterativeSolverStopCriteria(int maxIterations = 1000);
}
///
@@ -1576,29 +1577,29 @@ namespace MathNet.Numerics.LinearAlgebra
if (typeof (T) == typeof (Complex64))
{
return new Tuple, VectorBuilder>(
- (MatrixBuilder) (object) new Complex.MatrixBuilder(),
- (VectorBuilder) (object) new Complex.VectorBuilder());
+ (MatrixBuilder)(object)new Complex.MatrixBuilder(),
+ (VectorBuilder)(object)new Complex.VectorBuilder());
}
if (typeof (T) == typeof (Numerics.Complex32))
{
return new Tuple, VectorBuilder>(
- (MatrixBuilder) (object) new Complex32.MatrixBuilder(),
- (VectorBuilder) (object) new Complex32.VectorBuilder());
+ (MatrixBuilder)(object)new Complex32.MatrixBuilder(),
+ (VectorBuilder)(object)new Complex32.VectorBuilder());
}
if (typeof (T) == typeof (double))
{
return new Tuple, VectorBuilder>(
- (MatrixBuilder) (object) new Double.MatrixBuilder(),
- (VectorBuilder) (object) new Double.VectorBuilder());
+ (MatrixBuilder)(object)new Double.MatrixBuilder(),
+ (VectorBuilder)(object)new Double.VectorBuilder());
}
if (typeof (T) == typeof (float))
{
return new Tuple, VectorBuilder>(
- (MatrixBuilder) (object) new Single.MatrixBuilder(),
- (VectorBuilder) (object) new Single.VectorBuilder());
+ (MatrixBuilder)(object)new Single.MatrixBuilder(),
+ (VectorBuilder)(object)new Single.VectorBuilder());
}
throw new NotSupportedException();
diff --git a/src/Numerics/LinearAlgebra/Matrix.Solve.cs b/src/Numerics/LinearAlgebra/Matrix.Solve.cs
index 2bee0ca2..d5298e73 100644
--- a/src/Numerics/LinearAlgebra/Matrix.Solve.cs
+++ b/src/Numerics/LinearAlgebra/Matrix.Solve.cs
@@ -4,7 +4,7 @@
// http://github.com/mathnet/mathnet-numerics
// http://mathnetnumerics.codeplex.com
//
-// Copyright (c) 2009-2013 Math.NET
+// Copyright (c) 2009-2014 Math.NET
//
// Permission is hereby granted, free of charge, to any person
// obtaining a copy of this software and associated documentation
@@ -223,7 +223,7 @@ namespace MathNet.Numerics.LinearAlgebra
/// The iterative solver to use.
/// Criteria to control when to stop iterating.
/// The preconditioner to use for approximations.
- public IterationStatus TrySolveIterative(Vector input, Vector result, IIterativeSolver solver, IPreconditioner preconditioner, params IIterationStopCriterium[] stopCriteria)
+ public IterationStatus TrySolveIterative(Vector input, Vector result, IIterativeSolver solver, IPreconditioner preconditioner, params IIterationStopCriterion[] stopCriteria)
{
var iterator = new Iterator(stopCriteria.Length == 0 ? Build.IterativeSolverStopCriteria() : stopCriteria);
return TrySolveIterative(input, result, solver, iterator, preconditioner);
@@ -237,7 +237,7 @@ namespace MathNet.Numerics.LinearAlgebra
/// The iterative solver to use.
/// Criteria to control when to stop iterating.
/// The preconditioner to use for approximations.
- public IterationStatus TrySolveIterative(Matrix input, Matrix result, IIterativeSolver solver, IPreconditioner preconditioner, params IIterationStopCriterium[] stopCriteria)
+ public IterationStatus TrySolveIterative(Matrix input, Matrix result, IIterativeSolver solver, IPreconditioner preconditioner, params IIterationStopCriterion[] stopCriteria)
{
var iterator = new Iterator(stopCriteria.Length == 0 ? Build.IterativeSolverStopCriteria() : stopCriteria);
return TrySolveIterative(input, result, solver, iterator, preconditioner);
@@ -250,7 +250,7 @@ namespace MathNet.Numerics.LinearAlgebra
/// The result vector x.
/// The iterative solver to use.
/// Criteria to control when to stop iterating.
- public IterationStatus TrySolveIterative(Vector input, Vector result, IIterativeSolver solver, params IIterationStopCriterium[] stopCriteria)
+ public IterationStatus TrySolveIterative(Vector input, Vector result, IIterativeSolver solver, params IIterationStopCriterion[] stopCriteria)
{
var iterator = new Iterator(stopCriteria.Length == 0 ? Build.IterativeSolverStopCriteria() : stopCriteria);
return TrySolveIterative(input, result, solver, iterator);
@@ -263,7 +263,7 @@ namespace MathNet.Numerics.LinearAlgebra
/// The result matrix X
/// The iterative solver to use.
/// Criteria to control when to stop iterating.
- public IterationStatus TrySolveIterative(Matrix input, Matrix result, IIterativeSolver solver, params IIterationStopCriterium[] stopCriteria)
+ public IterationStatus TrySolveIterative(Matrix input, Matrix result, IIterativeSolver solver, params IIterationStopCriterion[] stopCriteria)
{
var iterator = new Iterator(stopCriteria.Length == 0 ? Build.IterativeSolverStopCriteria() : stopCriteria);
return TrySolveIterative(input, result, solver, iterator);
@@ -311,7 +311,7 @@ namespace MathNet.Numerics.LinearAlgebra
/// Criteria to control when to stop iterating.
/// The preconditioner to use for approximations.
/// The result vector x.
- public Vector SolveIterative(Vector input, IIterativeSolver solver, IPreconditioner preconditioner, params IIterationStopCriterium[] stopCriteria)
+ public Vector SolveIterative(Vector input, IIterativeSolver solver, IPreconditioner preconditioner, params IIterationStopCriterion[] stopCriteria)
{
var result = Vector.Build.Dense(RowCount);
TrySolveIterative(input, result, solver, preconditioner, stopCriteria);
@@ -326,7 +326,7 @@ namespace MathNet.Numerics.LinearAlgebra
/// Criteria to control when to stop iterating.
/// The preconditioner to use for approximations.
/// The result matrix X.
- public Matrix SolveIterative(Matrix input, IIterativeSolver solver, IPreconditioner preconditioner, params IIterationStopCriterium[] stopCriteria)
+ public Matrix SolveIterative(Matrix input, IIterativeSolver solver, IPreconditioner preconditioner, params IIterationStopCriterion[] stopCriteria)
{
var result = Build.Dense(input.RowCount, input.ColumnCount);
TrySolveIterative(input, result, solver, preconditioner, stopCriteria);
@@ -340,7 +340,7 @@ namespace MathNet.Numerics.LinearAlgebra
/// The iterative solver to use.
/// Criteria to control when to stop iterating.
/// The result vector x.
- public Vector SolveIterative(Vector input, IIterativeSolver solver, params IIterationStopCriterium[] stopCriteria)
+ public Vector SolveIterative(Vector input, IIterativeSolver solver, params IIterationStopCriterion[] stopCriteria)
{
var result = Vector.Build.Dense(RowCount);
TrySolveIterative(input, result, solver, stopCriteria);
@@ -354,7 +354,7 @@ namespace MathNet.Numerics.LinearAlgebra
/// The iterative solver to use.
/// Criteria to control when to stop iterating.
/// The result matrix X.
- public Matrix SolveIterative(Matrix input, IIterativeSolver solver, params IIterationStopCriterium[] stopCriteria)
+ public Matrix SolveIterative(Matrix input, IIterativeSolver solver, params IIterationStopCriterion[] stopCriteria)
{
var result = Build.Dense(input.RowCount, input.ColumnCount);
TrySolveIterative(input, result, solver, stopCriteria);
diff --git a/src/Numerics/LinearAlgebra/Solvers/CancellationStopCriterium.cs b/src/Numerics/LinearAlgebra/Solvers/CancellationStopCriterion.cs
similarity index 78%
rename from src/Numerics/LinearAlgebra/Solvers/CancellationStopCriterium.cs
rename to src/Numerics/LinearAlgebra/Solvers/CancellationStopCriterion.cs
index 04778543..0820ab47 100644
--- a/src/Numerics/LinearAlgebra/Solvers/CancellationStopCriterium.cs
+++ b/src/Numerics/LinearAlgebra/Solvers/CancellationStopCriterion.cs
@@ -1,10 +1,10 @@
-//
+//
// Math.NET Numerics, part of the Math.NET Project
// http://numerics.mathdotnet.com
// http://github.com/mathnet/mathnet-numerics
// http://mathnetnumerics.codeplex.com
//
-// Copyright (c) 2009-2013 Math.NET
+// Copyright (c) 2009-2014 Math.NET
//
// Permission is hereby granted, free of charge, to any person
// obtaining a copy of this software and associated documentation
@@ -35,26 +35,26 @@ using System.Threading;
namespace MathNet.Numerics.LinearAlgebra.Solvers
{
///
- /// Defines an that uses a cancellationn token as stop criterium.
+ /// Defines an that uses a cancellation token as stop criterion.
///
- public sealed class CancellationStopCriterium : IIterationStopCriterium where T : struct, IEquatable, IFormattable
+ public sealed class CancellationStopCriterion : IIterationStopCriterion where T : struct, IEquatable, IFormattable
{
readonly CancellationToken _masterToken;
CancellationTokenSource _currentTcs;
///
- /// Initializes a new instance of the class.
+ /// Initializes a new instance of the class.
///
- public CancellationStopCriterium()
+ public CancellationStopCriterion()
{
_masterToken = CancellationToken.None;
_currentTcs = CancellationTokenSource.CreateLinkedTokenSource(CancellationToken.None);
}
///
- /// Initializes a new instance of the class.
+ /// Initializes a new instance of the class.
///
- public CancellationStopCriterium(CancellationToken masterToken)
+ public CancellationStopCriterion(CancellationToken masterToken)
{
_masterToken = masterToken;
_currentTcs = CancellationTokenSource.CreateLinkedTokenSource(masterToken);
@@ -62,7 +62,7 @@ namespace MathNet.Numerics.LinearAlgebra.Solvers
///
/// Determines the status of the iterative calculation based on the stop criteria stored
- /// by the current . Result is set into Status field.
+ /// by the current . Result is set into Status field.
///
/// The number of iterations that have passed so far.
/// The vector containing the current solution values.
@@ -84,10 +84,7 @@ namespace MathNet.Numerics.LinearAlgebra.Solvers
public IterationStatus Status
{
[DebuggerStepThrough]
- get
- {
- return _currentTcs.Token.IsCancellationRequested ? IterationStatus.Cancelled : IterationStatus.Continue;
- }
+ get { return _currentTcs.Token.IsCancellationRequested ? IterationStatus.Cancelled : IterationStatus.Continue; }
}
public void Cancel()
@@ -96,7 +93,7 @@ namespace MathNet.Numerics.LinearAlgebra.Solvers
}
///
- /// Resets the to the pre-calculation state.
+ /// Resets the to the pre-calculation state.
///
public void Reset()
{
@@ -104,12 +101,12 @@ namespace MathNet.Numerics.LinearAlgebra.Solvers
}
///
- /// Clones the current and its settings.
+ /// Clones the current and its settings.
///
- /// A new instance of the class.
- public IIterationStopCriterium Clone()
+ /// A new instance of the class.
+ public IIterationStopCriterion Clone()
{
- return new CancellationStopCriterium(_masterToken);
+ return new CancellationStopCriterion(_masterToken);
}
}
}
diff --git a/src/Numerics/LinearAlgebra/Solvers/DivergenceStopCriterium.cs b/src/Numerics/LinearAlgebra/Solvers/DivergenceStopCriterion.cs
similarity index 89%
rename from src/Numerics/LinearAlgebra/Solvers/DivergenceStopCriterium.cs
rename to src/Numerics/LinearAlgebra/Solvers/DivergenceStopCriterion.cs
index 3374d538..6534e8f5 100644
--- a/src/Numerics/LinearAlgebra/Solvers/DivergenceStopCriterium.cs
+++ b/src/Numerics/LinearAlgebra/Solvers/DivergenceStopCriterion.cs
@@ -1,10 +1,10 @@
-//
+//
// Math.NET Numerics, part of the Math.NET Project
// http://numerics.mathdotnet.com
// http://github.com/mathnet/mathnet-numerics
// http://mathnetnumerics.codeplex.com
//
-// Copyright (c) 2009-2010 Math.NET
+// Copyright (c) 2009-2014 Math.NET
//
// Permission is hereby granted, free of charge, to any person
// obtaining a copy of this software and associated documentation
@@ -36,7 +36,7 @@ namespace MathNet.Numerics.LinearAlgebra.Solvers
///
/// Monitors an iterative calculation for signs of divergence.
///
- public sealed class DivergenceStopCriterium : IIterationStopCriterium where T : struct, IEquatable, IFormattable
+ public sealed class DivergenceStopCriterion : IIterationStopCriterion where T : struct, IEquatable, IFormattable
{
///
/// The maximum relative increase the residual may experience without triggering a divergence warning.
@@ -64,12 +64,12 @@ namespace MathNet.Numerics.LinearAlgebra.Solvers
int _lastIteration = -1;
///
- /// Initializes a new instance of the class with the specified maximum
+ /// 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 = 0.08, int minimumIterations = 10)
+ public DivergenceStopCriterion(double maximumRelativeIncrease = 0.08, int minimumIterations = 10)
{
if (maximumRelativeIncrease <= 0)
{
@@ -93,10 +93,7 @@ namespace MathNet.Numerics.LinearAlgebra.Solvers
public double MaximumRelativeIncrease
{
[DebuggerStepThrough]
- get
- {
- return _maximumRelativeIncrease;
- }
+ get { return _maximumRelativeIncrease; }
[DebuggerStepThrough]
set
@@ -118,10 +115,7 @@ namespace MathNet.Numerics.LinearAlgebra.Solvers
public int MinimumNumberOfIterations
{
[DebuggerStepThrough]
- get
- {
- return _minimumNumberOfIterations;
- }
+ get { return _minimumNumberOfIterations; }
[DebuggerStepThrough]
set
@@ -139,7 +133,7 @@ namespace MathNet.Numerics.LinearAlgebra.Solvers
///
/// Determines the status of the iterative calculation based on the stop criteria stored
- /// by the current . Result is set into Status field.
+ /// by the current . Result is set into Status field.
///
/// The number of iterations that have passed so far.
/// The vector containing the current solution values.
@@ -147,7 +141,7 @@ namespace MathNet.Numerics.LinearAlgebra.Solvers
/// The vector containing the current residual vectors.
///
/// The individual stop criteria may internally track the progress of the calculation based
- /// on the invocation of this method. Therefore this method should only be called if the
+ /// on the invocation of this method. Therefore this method should only be called if the
/// calculation has moved forwards at least one step.
///
public IterationStatus DetermineStatus(int iterationNumber, Vector solutionVector, Vector sourceVector, Vector residualVector)
@@ -227,10 +221,7 @@ namespace MathNet.Numerics.LinearAlgebra.Solvers
int RequiredHistoryLength
{
[DebuggerStepThrough]
- get
- {
- return _minimumNumberOfIterations + 1;
- }
+ get { return _minimumNumberOfIterations + 1; }
}
///
@@ -239,14 +230,11 @@ namespace MathNet.Numerics.LinearAlgebra.Solvers
public IterationStatus Status
{
[DebuggerStepThrough]
- get
- {
- return _status;
- }
+ get { return _status; }
}
///
- /// Resets the to the pre-calculation state.
+ /// Resets the to the pre-calculation state.
///
public void Reset()
{
@@ -256,12 +244,12 @@ namespace MathNet.Numerics.LinearAlgebra.Solvers
}
///
- /// Clones the current and its settings.
+ /// Clones the current and its settings.
///
- /// A new instance of the class.
- public IIterationStopCriterium Clone()
+ /// A new instance of the class.
+ public IIterationStopCriterion Clone()
{
- return new DivergenceStopCriterium(_maximumRelativeIncrease, _minimumNumberOfIterations);
+ return new DivergenceStopCriterion(_maximumRelativeIncrease, _minimumNumberOfIterations);
}
}
}
diff --git a/src/Numerics/LinearAlgebra/Solvers/FailureStopCriterium.cs b/src/Numerics/LinearAlgebra/Solvers/FailureStopCriterion.cs
similarity index 85%
rename from src/Numerics/LinearAlgebra/Solvers/FailureStopCriterium.cs
rename to src/Numerics/LinearAlgebra/Solvers/FailureStopCriterion.cs
index 1f2e0e97..b1381489 100644
--- a/src/Numerics/LinearAlgebra/Solvers/FailureStopCriterium.cs
+++ b/src/Numerics/LinearAlgebra/Solvers/FailureStopCriterion.cs
@@ -1,10 +1,10 @@
-//
+//
// Math.NET Numerics, part of the Math.NET Project
// http://numerics.mathdotnet.com
// http://github.com/mathnet/mathnet-numerics
// http://mathnetnumerics.codeplex.com
//
-// Copyright (c) 2009-2010 Math.NET
+// Copyright (c) 2009-2014 Math.NET
//
// Permission is hereby granted, free of charge, to any person
// obtaining a copy of this software and associated documentation
@@ -35,9 +35,9 @@ using MathNet.Numerics.Properties;
namespace MathNet.Numerics.LinearAlgebra.Solvers
{
///
- /// Defines an that monitors residuals for NaN's.
+ /// Defines an that monitors residuals for NaN's.
///
- public sealed class FailureStopCriterium : IIterationStopCriterium where T : struct, IEquatable, IFormattable
+ public sealed class FailureStopCriterion : IIterationStopCriterion where T : struct, IEquatable, IFormattable
{
///
/// The status of the calculation
@@ -51,7 +51,7 @@ namespace MathNet.Numerics.LinearAlgebra.Solvers
///
/// Determines the status of the iterative calculation based on the stop criteria stored
- /// by the current . Result is set into Status field.
+ /// by the current . Result is set into Status field.
///
/// The number of iterations that have passed so far.
/// The vector containing the current solution values.
@@ -59,7 +59,7 @@ namespace MathNet.Numerics.LinearAlgebra.Solvers
/// The vector containing the current residual vectors.
///
/// The individual stop criteria may internally track the progress of the calculation based
- /// on the invocation of this method. Therefore this method should only be called if the
+ /// on the invocation of this method. Therefore this method should only be called if the
/// calculation has moved forwards at least one step.
///
public IterationStatus DetermineStatus(int iterationNumber, Vector solutionVector, Vector sourceVector, Vector residualVector)
@@ -97,14 +97,11 @@ namespace MathNet.Numerics.LinearAlgebra.Solvers
public IterationStatus Status
{
[DebuggerStepThrough]
- get
- {
- return _status;
- }
+ get { return _status; }
}
///
- /// Resets the to the pre-calculation state.
+ /// Resets the to the pre-calculation state.
///
public void Reset()
{
@@ -113,12 +110,12 @@ namespace MathNet.Numerics.LinearAlgebra.Solvers
}
///
- /// Clones the current and its settings.
+ /// Clones the current and its settings.
///
- /// A new instance of the class.
- public IIterationStopCriterium Clone()
+ /// A new instance of the class.
+ public IIterationStopCriterion Clone()
{
- return new FailureStopCriterium();
+ return new FailureStopCriterion();
}
}
}
diff --git a/src/Numerics/LinearAlgebra/Solvers/IIterationStopCriterium.cs b/src/Numerics/LinearAlgebra/Solvers/IIterationStopCriterion.cs
similarity index 87%
rename from src/Numerics/LinearAlgebra/Solvers/IIterationStopCriterium.cs
rename to src/Numerics/LinearAlgebra/Solvers/IIterationStopCriterion.cs
index 29718f91..0233a3c1 100644
--- a/src/Numerics/LinearAlgebra/Solvers/IIterationStopCriterium.cs
+++ b/src/Numerics/LinearAlgebra/Solvers/IIterationStopCriterion.cs
@@ -1,10 +1,10 @@
-//
+//
// Math.NET Numerics, part of the Math.NET Project
// http://numerics.mathdotnet.com
// http://github.com/mathnet/mathnet-numerics
// http://mathnetnumerics.codeplex.com
//
-// Copyright (c) 2009-2013 Math.NET
+// Copyright (c) 2009-2014 Math.NET
//
// Permission is hereby granted, free of charge, to any person
// obtaining a copy of this software and associated documentation
@@ -33,13 +33,13 @@ using System;
namespace MathNet.Numerics.LinearAlgebra.Solvers
{
///
- /// The base interface for classes that provide stop criteria for iterative calculations.
+ /// The base interface for classes that provide stop criteria for iterative calculations.
///
- public interface IIterationStopCriterium where T : struct, IEquatable, IFormattable
+ public interface IIterationStopCriterion where T : struct, IEquatable, IFormattable
{
///
/// Determines the status of the iterative calculation based on the stop criteria stored
- /// by the current IIterationStopCriterium. Status is set to Status field of current object.
+ /// by the current IIterationStopCriterion. Status is set to Status field of current object.
///
/// The number of iterations that have passed so far.
/// The vector containing the current solution values.
@@ -47,7 +47,7 @@ namespace MathNet.Numerics.LinearAlgebra.Solvers
/// The vector containing the current residual vectors.
///
/// The individual stop criteria may internally track the progress of the calculation based
- /// on the invocation of this method. Therefore this method should only be called if the
+ /// on the invocation of this method. Therefore this method should only be called if the
/// calculation has moved forwards at least one step.
///
IterationStatus DetermineStatus(int iterationNumber, Vector solutionVector, Vector sourceVector, Vector residualVector);
@@ -59,13 +59,13 @@ namespace MathNet.Numerics.LinearAlgebra.Solvers
IterationStatus Status { get; }
///
- /// Resets the IIterationStopCriterium to the pre-calculation state.
+ /// Resets the IIterationStopCriterion to the pre-calculation state.
///
/// To implementers: Invoking this method should not clear the user defined
- /// property values, only the state that is used to track the progress of the
+ /// property values, only the state that is used to track the progress of the
/// calculation.
void Reset();
- IIterationStopCriterium Clone();
+ IIterationStopCriterion Clone();
}
}
diff --git a/src/Numerics/LinearAlgebra/Solvers/IIterativeSolver.cs b/src/Numerics/LinearAlgebra/Solvers/IIterativeSolver.cs
index 13bf041c..a8be5cf0 100644
--- a/src/Numerics/LinearAlgebra/Solvers/IIterativeSolver.cs
+++ b/src/Numerics/LinearAlgebra/Solvers/IIterativeSolver.cs
@@ -4,7 +4,7 @@
// http://github.com/mathnet/mathnet-numerics
// http://mathnetnumerics.codeplex.com
//
-// Copyright (c) 2009-2013 Math.NET
+// Copyright (c) 2009-2014 Math.NET
//
// Permission is hereby granted, free of charge, to any person
// obtaining a copy of this software and associated documentation
diff --git a/src/Numerics/LinearAlgebra/Solvers/IIterativeSolverSetup.cs b/src/Numerics/LinearAlgebra/Solvers/IIterativeSolverSetup.cs
index 82a1012b..6c0f19f8 100644
--- a/src/Numerics/LinearAlgebra/Solvers/IIterativeSolverSetup.cs
+++ b/src/Numerics/LinearAlgebra/Solvers/IIterativeSolverSetup.cs
@@ -4,7 +4,7 @@
// http://github.com/mathnet/mathnet-numerics
// http://mathnetnumerics.codeplex.com
//
-// Copyright (c) 2009-2013 Math.NET
+// Copyright (c) 2009-2014 Math.NET
//
// Permission is hereby granted, free of charge, to any person
// obtaining a copy of this software and associated documentation
diff --git a/src/Numerics/LinearAlgebra/Solvers/IPreconditioner.cs b/src/Numerics/LinearAlgebra/Solvers/IPreconditioner.cs
index 8bb2cf87..a6ca653d 100644
--- a/src/Numerics/LinearAlgebra/Solvers/IPreconditioner.cs
+++ b/src/Numerics/LinearAlgebra/Solvers/IPreconditioner.cs
@@ -4,7 +4,7 @@
// http://github.com/mathnet/mathnet-numerics
// http://mathnetnumerics.codeplex.com
//
-// Copyright (c) 2009-2013 Math.NET
+// Copyright (c) 2009-2014 Math.NET
//
// Permission is hereby granted, free of charge, to any person
// obtaining a copy of this software and associated documentation
diff --git a/src/Numerics/LinearAlgebra/Solvers/IterationCountStopCriterium.cs b/src/Numerics/LinearAlgebra/Solvers/IterationCountStopCriterion.cs
similarity index 83%
rename from src/Numerics/LinearAlgebra/Solvers/IterationCountStopCriterium.cs
rename to src/Numerics/LinearAlgebra/Solvers/IterationCountStopCriterion.cs
index 54d59750..465b146e 100644
--- a/src/Numerics/LinearAlgebra/Solvers/IterationCountStopCriterium.cs
+++ b/src/Numerics/LinearAlgebra/Solvers/IterationCountStopCriterion.cs
@@ -1,10 +1,10 @@
-//
+//
// Math.NET Numerics, part of the Math.NET Project
// http://numerics.mathdotnet.com
// http://github.com/mathnet/mathnet-numerics
// http://mathnetnumerics.codeplex.com
//
-// Copyright (c) 2009-2013 Math.NET
+// Copyright (c) 2009-2014 Math.NET
//
// Permission is hereby granted, free of charge, to any person
// obtaining a copy of this software and associated documentation
@@ -34,10 +34,10 @@ using System.Diagnostics;
namespace MathNet.Numerics.LinearAlgebra.Solvers
{
///
- /// Defines an that monitors the numbers of iteration
- /// steps as stop criterium.
+ /// Defines an that monitors the numbers of iteration
+ /// steps as stop criterion.
///
- public sealed class IterationCountStopCriterium : IIterationStopCriterium where T : struct, IEquatable, IFormattable
+ public sealed class IterationCountStopCriterion : IIterationStopCriterion where T : struct, IEquatable, IFormattable
{
///
/// The default value for the maximum number of iterations the process is allowed
@@ -56,19 +56,19 @@ namespace MathNet.Numerics.LinearAlgebra.Solvers
IterationStatus _status = IterationStatus.Continue;
///
- /// Initializes a new instance of the class with the default maximum
+ /// Initializes a new instance of the class with the default maximum
/// number of iterations.
///
- public IterationCountStopCriterium() : this(DefaultMaximumNumberOfIterations)
+ public IterationCountStopCriterion() : this(DefaultMaximumNumberOfIterations)
{
}
///
- /// Initializes a new instance of the class with the specified maximum
+ /// Initializes a new instance of the class with the specified maximum
/// number of iterations.
///
/// The maximum number of iterations the calculation is allowed to perform.
- public IterationCountStopCriterium(int maximumNumberOfIterations)
+ public IterationCountStopCriterion(int maximumNumberOfIterations)
{
if (maximumNumberOfIterations < 1)
{
@@ -85,10 +85,7 @@ namespace MathNet.Numerics.LinearAlgebra.Solvers
public int MaximumNumberOfIterations
{
[DebuggerStepThrough]
- get
- {
- return _maximumNumberOfIterations;
- }
+ get { return _maximumNumberOfIterations; }
[DebuggerStepThrough]
set
@@ -112,7 +109,7 @@ namespace MathNet.Numerics.LinearAlgebra.Solvers
///
/// Determines the status of the iterative calculation based on the stop criteria stored
- /// by the current . Result is set into Status field.
+ /// by the current . Result is set into Status field.
///
/// The number of iterations that have passed so far.
/// The vector containing the current solution values.
@@ -141,14 +138,11 @@ namespace MathNet.Numerics.LinearAlgebra.Solvers
public IterationStatus Status
{
[DebuggerStepThrough]
- get
- {
- return _status;
- }
+ get { return _status; }
}
///
- /// Resets the to the pre-calculation state.
+ /// Resets the to the pre-calculation state.
///
public void Reset()
{
@@ -156,12 +150,12 @@ namespace MathNet.Numerics.LinearAlgebra.Solvers
}
///
- /// Clones the current and its settings.
+ /// Clones the current and its settings.
///
- /// A new instance of the class.
- public IIterationStopCriterium Clone()
+ /// A new instance of the class.
+ public IIterationStopCriterion Clone()
{
- return new IterationCountStopCriterium(_maximumNumberOfIterations);
+ return new IterationCountStopCriterion(_maximumNumberOfIterations);
}
}
}
diff --git a/src/Numerics/LinearAlgebra/Solvers/IterationStatus.cs b/src/Numerics/LinearAlgebra/Solvers/IterationStatus.cs
index d70d8360..48493f7a 100644
--- a/src/Numerics/LinearAlgebra/Solvers/IterationStatus.cs
+++ b/src/Numerics/LinearAlgebra/Solvers/IterationStatus.cs
@@ -4,7 +4,7 @@
// http://github.com/mathnet/mathnet-numerics
// http://mathnetnumerics.codeplex.com
//
-// Copyright (c) 2009-2010 Math.NET
+// Copyright (c) 2009-2014 Math.NET
//
// Permission is hereby granted, free of charge, to any person
// obtaining a copy of this software and associated documentation
diff --git a/src/Numerics/LinearAlgebra/Solvers/Iterator.cs b/src/Numerics/LinearAlgebra/Solvers/Iterator.cs
index a0b6b9d0..9478e37d 100644
--- a/src/Numerics/LinearAlgebra/Solvers/Iterator.cs
+++ b/src/Numerics/LinearAlgebra/Solvers/Iterator.cs
@@ -4,7 +4,7 @@
// http://github.com/mathnet/mathnet-numerics
// http://mathnetnumerics.codeplex.com
//
-// Copyright (c) 2009-2013 Math.NET
+// Copyright (c) 2009-2014 Math.NET
//
// Permission is hereby granted, free of charge, to any person
// obtaining a copy of this software and associated documentation
@@ -44,7 +44,7 @@ namespace MathNet.Numerics.LinearAlgebra.Solvers
/// The collection that holds all the stop criteria and the flag indicating if they should be added
/// to the child iterators.
///
- readonly List> _stopCriteria;
+ readonly List> _stopCriteria;
///
/// The status of the iterator.
@@ -56,31 +56,31 @@ namespace MathNet.Numerics.LinearAlgebra.Solvers
///
public Iterator()
{
- _stopCriteria = new List>(Matrix.Build.IterativeSolverStopCriteria());
+ _stopCriteria = new List>(Matrix.Build.IterativeSolverStopCriteria());
}
///
/// Initializes a new instance of the class with the specified stop criteria.
///
///
- /// The specified stop criteria. Only one stop criterium of each type can be passed in. None
+ /// The specified stop criteria. Only one stop criterion of each type can be passed in. None
/// of the stop criteria will be passed on to child iterators.
///
- public Iterator(params IIterationStopCriterium[] stopCriteria)
+ public Iterator(params IIterationStopCriterion[] stopCriteria)
{
- _stopCriteria = new List>(stopCriteria);
+ _stopCriteria = new List>(stopCriteria);
}
///
/// Initializes a new instance of the class with the specified stop criteria.
///
///
- /// The specified stop criteria. Only one stop criterium of each type can be passed in. None
+ /// The specified stop criteria. Only one stop criterion of each type can be passed in. None
/// of the stop criteria will be passed on to child iterators.
///
- public Iterator(IEnumerable> stopCriteria)
+ public Iterator(IEnumerable> stopCriteria)
{
- _stopCriteria = new List>(stopCriteria);
+ _stopCriteria = new List>(stopCriteria);
}
///
@@ -101,14 +101,14 @@ namespace MathNet.Numerics.LinearAlgebra.Solvers
/// The vector containing the current residual vectors.
///
/// The individual iterators may internally track the progress of the calculation based
- /// on the invocation of this method. Therefore this method should only be called if the
+ /// on the invocation of this method. Therefore this method should only be called if the
/// calculation has moved forwards at least one step.
///
public IterationStatus DetermineStatus(int iterationNumber, Vector solutionVector, Vector sourceVector, Vector residualVector)
{
if (_stopCriteria.Count == 0)
{
- throw new ArgumentException(Resources.StopCriteriumMissing);
+ throw new ArgumentException(Resources.StopCriterionMissing);
}
if (iterationNumber < 0)
@@ -122,9 +122,9 @@ namespace MathNet.Numerics.LinearAlgebra.Solvers
return _status;
}
- foreach (var stopCriterium in _stopCriteria)
+ foreach (var stopCriterion in _stopCriteria)
{
- var status = stopCriterium.DetermineStatus(iterationNumber, solutionVector, sourceVector, residualVector);
+ var status = stopCriterion.DetermineStatus(iterationNumber, solutionVector, sourceVector, residualVector);
if (status == IterationStatus.Continue)
{
continue;
@@ -159,9 +159,9 @@ namespace MathNet.Numerics.LinearAlgebra.Solvers
{
_status = IterationStatus.Continue;
- foreach (var stopCriterium in _stopCriteria)
+ foreach (var stopCriterion in _stopCriteria)
{
- stopCriterium.Reset();
+ stopCriterion.Reset();
}
}
diff --git a/src/Numerics/LinearAlgebra/Solvers/ResidualStopCriterium.cs b/src/Numerics/LinearAlgebra/Solvers/ResidualStopCriterion.cs
similarity index 84%
rename from src/Numerics/LinearAlgebra/Solvers/ResidualStopCriterium.cs
rename to src/Numerics/LinearAlgebra/Solvers/ResidualStopCriterion.cs
index 85cc5e18..0c2ef216 100644
--- a/src/Numerics/LinearAlgebra/Solvers/ResidualStopCriterium.cs
+++ b/src/Numerics/LinearAlgebra/Solvers/ResidualStopCriterion.cs
@@ -1,10 +1,10 @@
-//
+//
// Math.NET Numerics, part of the Math.NET Project
// http://numerics.mathdotnet.com
// http://github.com/mathnet/mathnet-numerics
// http://mathnetnumerics.codeplex.com
//
-// Copyright (c) 2009-2010 Math.NET
+// Copyright (c) 2009-2014 Math.NET
//
// Permission is hereby granted, free of charge, to any person
// obtaining a copy of this software and associated documentation
@@ -35,9 +35,9 @@ using MathNet.Numerics.Properties;
namespace MathNet.Numerics.LinearAlgebra.Solvers
{
///
- /// Defines an that monitors residuals as stop criterium.
+ /// Defines an that monitors residuals as stop criterion.
///
- public sealed class ResidualStopCriterium : IIterationStopCriterium where T : struct, IEquatable, IFormattable
+ public sealed class ResidualStopCriterion : IIterationStopCriterion where T : struct, IEquatable, IFormattable
{
///
/// The maximum value for the residual below which the calculation is considered converged.
@@ -66,7 +66,7 @@ namespace MathNet.Numerics.LinearAlgebra.Solvers
int _lastIteration = -1;
///