Browse Source

Use the new NonConvergenceException in more places, where appropriate

pull/121/head
Christoph Ruegg 13 years ago
parent
commit
db29d03b9a
  1. 3
      src/Numerics/Algorithms/LinearAlgebra/ManagedLinearAlgebraProvider.Complex.cs
  2. 3
      src/Numerics/Algorithms/LinearAlgebra/ManagedLinearAlgebraProvider.Complex32.cs
  3. 3
      src/Numerics/Algorithms/LinearAlgebra/ManagedLinearAlgebraProvider.Double.cs
  4. 3
      src/Numerics/Algorithms/LinearAlgebra/ManagedLinearAlgebraProvider.Single.cs
  5. 3
      src/Numerics/LinearAlgebra/Complex/Factorization/DenseEvd.cs
  6. 3
      src/Numerics/LinearAlgebra/Complex/Factorization/UserEvd.cs
  7. 4
      src/Numerics/LinearAlgebra/Complex/Factorization/UserSvd.cs
  8. 3
      src/Numerics/LinearAlgebra/Complex32/Factorization/DenseEvd.cs
  9. 3
      src/Numerics/LinearAlgebra/Complex32/Factorization/UserEvd.cs
  10. 4
      src/Numerics/LinearAlgebra/Complex32/Factorization/UserSvd.cs
  11. 6
      src/Numerics/LinearAlgebra/Double/Factorization/DenseEvd.cs
  12. 3
      src/Numerics/LinearAlgebra/Double/Factorization/UserEvd.cs
  13. 4
      src/Numerics/LinearAlgebra/Double/Factorization/UserSvd.cs
  14. 6
      src/Numerics/LinearAlgebra/Single/Factorization/DenseEvd.cs
  15. 3
      src/Numerics/LinearAlgebra/Single/Factorization/UserEvd.cs
  16. 4
      src/Numerics/LinearAlgebra/Single/Factorization/UserSvd.cs

3
src/Numerics/Algorithms/LinearAlgebra/ManagedLinearAlgebraProvider.Complex.cs

@ -2174,6 +2174,7 @@ namespace MathNet.Numerics.Algorithms.LinearAlgebra
/// right singular vectors.</param> /// right singular vectors.</param>
/// <param name="work">The work array. Length should be at least <paramref name="rowsA"/>.</param> /// <param name="work">The work array. Length should be at least <paramref name="rowsA"/>.</param>
/// <remarks>This is equivalent to the GESVD LAPACK routine.</remarks> /// <remarks>This is equivalent to the GESVD LAPACK routine.</remarks>
/// <exception cref="NonConvergenceException"></exception>
public virtual void SingularValueDecomposition(bool computeVectors, Complex[] a, int rowsA, int columnsA, Complex[] s, Complex[] u, Complex[] vt, Complex[] work) public virtual void SingularValueDecomposition(bool computeVectors, Complex[] a, int rowsA, int columnsA, Complex[] s, Complex[] u, Complex[] vt, Complex[] work)
{ {
if (a == null) if (a == null)
@ -2559,7 +2560,7 @@ namespace MathNet.Numerics.Algorithms.LinearAlgebra
// If too many iterations have been performed throw exception. // If too many iterations have been performed throw exception.
if (iter >= Maxiter) if (iter >= Maxiter)
{ {
throw new ArgumentException(Resources.ConvergenceFailed); throw new NonConvergenceException();
} }
// This section of the program inspects for negligible elements in the s and e arrays, // This section of the program inspects for negligible elements in the s and e arrays,

3
src/Numerics/Algorithms/LinearAlgebra/ManagedLinearAlgebraProvider.Complex32.cs

@ -2172,6 +2172,7 @@ namespace MathNet.Numerics.Algorithms.LinearAlgebra
/// right singular vectors.</param> /// right singular vectors.</param>
/// <param name="work">The work array. Length should be at least <paramref name="rowsA"/>.</param> /// <param name="work">The work array. Length should be at least <paramref name="rowsA"/>.</param>
/// <remarks>This is equivalent to the GESVD LAPACK routine.</remarks> /// <remarks>This is equivalent to the GESVD LAPACK routine.</remarks>
/// <exception cref="NonConvergenceException"></exception>
public virtual void SingularValueDecomposition(bool computeVectors, Complex32[] a, int rowsA, int columnsA, Complex32[] s, Complex32[] u, Complex32[] vt, Complex32[] work) public virtual void SingularValueDecomposition(bool computeVectors, Complex32[] a, int rowsA, int columnsA, Complex32[] s, Complex32[] u, Complex32[] vt, Complex32[] work)
{ {
if (a == null) if (a == null)
@ -2557,7 +2558,7 @@ namespace MathNet.Numerics.Algorithms.LinearAlgebra
// If too many iterations have been performed throw exception. // If too many iterations have been performed throw exception.
if (iter >= Maxiter) if (iter >= Maxiter)
{ {
throw new ArgumentException(Resources.ConvergenceFailed); throw new NonConvergenceException();
} }
// This section of the program inspects for negligible elements in the s and e arrays, // This section of the program inspects for negligible elements in the s and e arrays,

3
src/Numerics/Algorithms/LinearAlgebra/ManagedLinearAlgebraProvider.Double.cs

@ -2059,6 +2059,7 @@ namespace MathNet.Numerics.Algorithms.LinearAlgebra
/// right singular vectors.</param> /// right singular vectors.</param>
/// <param name="work">The work array. Length should be at least <paramref name="rowsA"/>.</param> /// <param name="work">The work array. Length should be at least <paramref name="rowsA"/>.</param>
/// <remarks>This is equivalent to the GESVD LAPACK routine.</remarks> /// <remarks>This is equivalent to the GESVD LAPACK routine.</remarks>
/// <exception cref="NonConvergenceException"></exception>
public virtual void SingularValueDecomposition(bool computeVectors, double[] a, int rowsA, int columnsA, double[] s, double[] u, double[] vt, double[] work) public virtual void SingularValueDecomposition(bool computeVectors, double[] a, int rowsA, int columnsA, double[] s, double[] u, double[] vt, double[] work)
{ {
if (a == null) if (a == null)
@ -2446,7 +2447,7 @@ namespace MathNet.Numerics.Algorithms.LinearAlgebra
// If too many iterations have been performed throw exception. // If too many iterations have been performed throw exception.
if (iter >= Maxiter) if (iter >= Maxiter)
{ {
throw new ArgumentException(Resources.ConvergenceFailed); throw new NonConvergenceException();
} }
// This section of the program inspects for negligible elements in the s and e arrays, // This section of the program inspects for negligible elements in the s and e arrays,

3
src/Numerics/Algorithms/LinearAlgebra/ManagedLinearAlgebraProvider.Single.cs

@ -2060,6 +2060,7 @@ namespace MathNet.Numerics.Algorithms.LinearAlgebra
/// <param name="vt">If <paramref name="computeVectors"/> is <c>true</c>, on exit VT contains the transposed /// <param name="vt">If <paramref name="computeVectors"/> is <c>true</c>, on exit VT contains the transposed
/// right singular vectors.</param> /// right singular vectors.</param>
/// <param name="work">The work array. Length should be at least <paramref name="rowsA"/>.</param> /// <param name="work">The work array. Length should be at least <paramref name="rowsA"/>.</param>
/// <exception cref="NonConvergenceException"></exception>
public virtual void SingularValueDecomposition(bool computeVectors, float[] a, int rowsA, int columnsA, float[] s, float[] u, float[] vt, float[] work) public virtual void SingularValueDecomposition(bool computeVectors, float[] a, int rowsA, int columnsA, float[] s, float[] u, float[] vt, float[] work)
{ {
if (a == null) if (a == null)
@ -2449,7 +2450,7 @@ namespace MathNet.Numerics.Algorithms.LinearAlgebra
// If too many iterations have been performed throw exception. // If too many iterations have been performed throw exception.
if (iter >= Maxiter) if (iter >= Maxiter)
{ {
throw new ArgumentException(Resources.ConvergenceFailed); throw new NonConvergenceException();
} }
// This section of the program inspects for negligible elements in the s and e arrays, // This section of the program inspects for negligible elements in the s and e arrays,

3
src/Numerics/LinearAlgebra/Complex/Factorization/DenseEvd.cs

@ -226,6 +226,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex.Factorization
/// Bowdler, Martin, Reinsch, and Wilkinson, Handbook for /// Bowdler, Martin, Reinsch, and Wilkinson, Handbook for
/// Auto. Comp., Vol.ii-Linear Algebra, and the corresponding /// Auto. Comp., Vol.ii-Linear Algebra, and the corresponding
/// Fortran subroutine in EISPACK.</remarks> /// Fortran subroutine in EISPACK.</remarks>
/// <exception cref="NonConvergenceException"></exception>
internal static void SymmetricDiagonalize(System.Numerics.Complex[] dataEv, double[] d, double[] e, int order) internal static void SymmetricDiagonalize(System.Numerics.Complex[] dataEv, double[] d, double[] e, int order)
{ {
const int Maxiter = 1000; const int Maxiter = 1000;
@ -324,7 +325,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex.Factorization
// throw exception that Convergence Failed // throw exception that Convergence Failed
if (iter >= Maxiter) if (iter >= Maxiter)
{ {
throw new ArgumentException(Resources.ConvergenceFailed); throw new NonConvergenceException();
} }
} while (Math.Abs(e[l]) > eps*tst1); } while (Math.Abs(e[l]) > eps*tst1);
} }

3
src/Numerics/LinearAlgebra/Complex/Factorization/UserEvd.cs

@ -246,6 +246,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex.Factorization
/// Bowdler, Martin, Reinsch, and Wilkinson, Handbook for /// Bowdler, Martin, Reinsch, and Wilkinson, Handbook for
/// Auto. Comp., Vol.ii-Linear Algebra, and the corresponding /// Auto. Comp., Vol.ii-Linear Algebra, and the corresponding
/// Fortran subroutine in EISPACK.</remarks> /// Fortran subroutine in EISPACK.</remarks>
/// <exception cref="NonConvergenceException"></exception>
private void SymmetricDiagonalize(double[] d, double[] e, int order) private void SymmetricDiagonalize(double[] d, double[] e, int order)
{ {
const int Maxiter = 1000; const int Maxiter = 1000;
@ -344,7 +345,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex.Factorization
// throw exception that Convergence Failed // throw exception that Convergence Failed
if (iter >= Maxiter) if (iter >= Maxiter)
{ {
throw new ArgumentException(Resources.ConvergenceFailed); throw new NonConvergenceException();
} }
} }
while (Math.Abs(e[l]) > eps * tst1); while (Math.Abs(e[l]) > eps * tst1);

4
src/Numerics/LinearAlgebra/Complex/Factorization/UserSvd.cs

@ -57,7 +57,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex.Factorization
/// <param name="matrix">The matrix to factor.</param> /// <param name="matrix">The matrix to factor.</param>
/// <param name="computeVectors">Compute the singular U and VT vectors or not.</param> /// <param name="computeVectors">Compute the singular U and VT vectors or not.</param>
/// <exception cref="ArgumentNullException">If <paramref name="matrix"/> is <c>null</c>.</exception> /// <exception cref="ArgumentNullException">If <paramref name="matrix"/> is <c>null</c>.</exception>
/// <exception cref="ArgumentException">If SVD algorithm failed to converge with matrix <paramref name="matrix"/>.</exception> /// <exception cref="NonConvergenceException"></exception>
public UserSvd(Matrix<Complex> matrix, bool computeVectors) public UserSvd(Matrix<Complex> matrix, bool computeVectors)
{ {
if (matrix == null) if (matrix == null)
@ -356,7 +356,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex.Factorization
// throw exception that Convergence Failed // throw exception that Convergence Failed
if (iter >= Maxiter) if (iter >= Maxiter)
{ {
throw new ArgumentException(Resources.ConvergenceFailed); throw new NonConvergenceException();
} }
// This section of the program inspects for negligible elements in the s and e arrays. On // This section of the program inspects for negligible elements in the s and e arrays. On

3
src/Numerics/LinearAlgebra/Complex32/Factorization/DenseEvd.cs

@ -227,6 +227,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32.Factorization
/// Bowdler, Martin, Reinsch, and Wilkinson, Handbook for /// Bowdler, Martin, Reinsch, and Wilkinson, Handbook for
/// Auto. Comp., Vol.ii-Linear Algebra, and the corresponding /// Auto. Comp., Vol.ii-Linear Algebra, and the corresponding
/// Fortran subroutine in EISPACK.</remarks> /// Fortran subroutine in EISPACK.</remarks>
/// <exception cref="NonConvergenceException"></exception>
internal static void SymmetricDiagonalize(Numerics.Complex32[] dataEv, float[] d, float[] e, int order) internal static void SymmetricDiagonalize(Numerics.Complex32[] dataEv, float[] d, float[] e, int order)
{ {
const int Maxiter = 1000; const int Maxiter = 1000;
@ -325,7 +326,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32.Factorization
// throw exception that Convergence Failed // throw exception that Convergence Failed
if (iter >= Maxiter) if (iter >= Maxiter)
{ {
throw new ArgumentException(Resources.ConvergenceFailed); throw new NonConvergenceException();
} }
} while (Math.Abs(e[l]) > eps*tst1); } while (Math.Abs(e[l]) > eps*tst1);
} }

3
src/Numerics/LinearAlgebra/Complex32/Factorization/UserEvd.cs

@ -250,6 +250,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32.Factorization
/// Bowdler, Martin, Reinsch, and Wilkinson, Handbook for /// Bowdler, Martin, Reinsch, and Wilkinson, Handbook for
/// Auto. Comp., Vol.ii-Linear Algebra, and the corresponding /// Auto. Comp., Vol.ii-Linear Algebra, and the corresponding
/// Fortran subroutine in EISPACK.</remarks> /// Fortran subroutine in EISPACK.</remarks>
/// <exception cref="NonConvergenceException"></exception>
private void SymmetricDiagonalize(float[] d, float[] e, int order) private void SymmetricDiagonalize(float[] d, float[] e, int order)
{ {
const int Maxiter = 1000; const int Maxiter = 1000;
@ -348,7 +349,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32.Factorization
// throw exception that Convergence Failed // throw exception that Convergence Failed
if (iter >= Maxiter) if (iter >= Maxiter)
{ {
throw new ArgumentException(Resources.ConvergenceFailed); throw new NonConvergenceException();
} }
} }
while (Math.Abs(e[l]) > eps * tst1); while (Math.Abs(e[l]) > eps * tst1);

4
src/Numerics/LinearAlgebra/Complex32/Factorization/UserSvd.cs

@ -57,7 +57,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32.Factorization
/// <param name="matrix">The matrix to factor.</param> /// <param name="matrix">The matrix to factor.</param>
/// <param name="computeVectors">Compute the singular U and VT vectors or not.</param> /// <param name="computeVectors">Compute the singular U and VT vectors or not.</param>
/// <exception cref="ArgumentNullException">If <paramref name="matrix"/> is <c>null</c>.</exception> /// <exception cref="ArgumentNullException">If <paramref name="matrix"/> is <c>null</c>.</exception>
/// <exception cref="ArgumentException">If SVD algorithm failed to converge with matrix <paramref name="matrix"/>.</exception> /// <exception cref="NonConvergenceException"></exception>
public UserSvd(Matrix<Complex32> matrix, bool computeVectors) public UserSvd(Matrix<Complex32> matrix, bool computeVectors)
{ {
if (matrix == null) if (matrix == null)
@ -356,7 +356,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32.Factorization
// throw exception that Convergence Failed // throw exception that Convergence Failed
if (iter >= Maxiter) if (iter >= Maxiter)
{ {
throw new ArgumentException(Resources.ConvergenceFailed); throw new NonConvergenceException();
} }
// This section of the program inspects for negligible elements in the s and e arrays. On // This section of the program inspects for negligible elements in the s and e arrays. On

6
src/Numerics/LinearAlgebra/Double/Factorization/DenseEvd.cs

@ -256,6 +256,7 @@ namespace MathNet.Numerics.LinearAlgebra.Double.Factorization
/// Bowdler, Martin, Reinsch, and Wilkinson, Handbook for /// Bowdler, Martin, Reinsch, and Wilkinson, Handbook for
/// Auto. Comp., Vol.ii-Linear Algebra, and the corresponding /// Auto. Comp., Vol.ii-Linear Algebra, and the corresponding
/// Fortran subroutine in EISPACK.</remarks> /// Fortran subroutine in EISPACK.</remarks>
/// <exception cref="NonConvergenceException"></exception>
internal static void SymmetricDiagonalize(double[] a, double[] d, double[] e, int order) internal static void SymmetricDiagonalize(double[] a, double[] d, double[] e, int order)
{ {
const int maxiter = 1000; const int maxiter = 1000;
@ -354,7 +355,7 @@ namespace MathNet.Numerics.LinearAlgebra.Double.Factorization
// throw exception that Convergence Failed // throw exception that Convergence Failed
if (iter >= maxiter) if (iter >= maxiter)
{ {
throw new ArgumentException(Resources.ConvergenceFailed); throw new NonConvergenceException();
} }
} while (Math.Abs(e[l]) > eps*tst1); } while (Math.Abs(e[l]) > eps*tst1);
} }
@ -528,6 +529,7 @@ namespace MathNet.Numerics.LinearAlgebra.Double.Factorization
/// by Martin and Wilkinson, Handbook for Auto. Comp., /// by Martin and Wilkinson, Handbook for Auto. Comp.,
/// Vol.ii-Linear Algebra, and the corresponding /// Vol.ii-Linear Algebra, and the corresponding
/// Fortran subroutine in EISPACK.</remarks> /// Fortran subroutine in EISPACK.</remarks>
/// <exception cref="NonConvergenceException"></exception>
internal static void NonsymmetricReduceHessenberToRealSchur(double[] a, double[] matrixH, double[] d, double[] e, int order) internal static void NonsymmetricReduceHessenberToRealSchur(double[] a, double[] matrixH, double[] d, double[] e, int order)
{ {
// Initialize // Initialize
@ -732,7 +734,7 @@ namespace MathNet.Numerics.LinearAlgebra.Double.Factorization
iter = iter + 1; iter = iter + 1;
if (iter >= 30*order) if (iter >= 30*order)
{ {
throw new ArgumentException(Resources.ConvergenceFailed); throw new NonConvergenceException();
} }
// Look for two consecutive small sub-diagonal elements // Look for two consecutive small sub-diagonal elements

3
src/Numerics/LinearAlgebra/Double/Factorization/UserEvd.cs

@ -288,6 +288,7 @@ namespace MathNet.Numerics.LinearAlgebra.Double.Factorization
/// Bowdler, Martin, Reinsch, and Wilkinson, Handbook for /// Bowdler, Martin, Reinsch, and Wilkinson, Handbook for
/// Auto. Comp., Vol.ii-Linear Algebra, and the corresponding /// Auto. Comp., Vol.ii-Linear Algebra, and the corresponding
/// Fortran subroutine in EISPACK.</remarks> /// Fortran subroutine in EISPACK.</remarks>
/// <exception cref="NonConvergenceException"></exception>
private void SymmetricDiagonalize(double[] d, double[] e, int order) private void SymmetricDiagonalize(double[] d, double[] e, int order)
{ {
const int Maxiter = 1000; const int Maxiter = 1000;
@ -386,7 +387,7 @@ namespace MathNet.Numerics.LinearAlgebra.Double.Factorization
// throw exception that Convergence Failed // throw exception that Convergence Failed
if (iter >= Maxiter) if (iter >= Maxiter)
{ {
throw new ArgumentException(Resources.ConvergenceFailed); throw new NonConvergenceException();
} }
} }
while (Math.Abs(e[l]) > eps * tst1); while (Math.Abs(e[l]) > eps * tst1);

4
src/Numerics/LinearAlgebra/Double/Factorization/UserSvd.cs

@ -56,7 +56,7 @@ namespace MathNet.Numerics.LinearAlgebra.Double.Factorization
/// <param name="matrix">The matrix to factor.</param> /// <param name="matrix">The matrix to factor.</param>
/// <param name="computeVectors">Compute the singular U and VT vectors or not.</param> /// <param name="computeVectors">Compute the singular U and VT vectors or not.</param>
/// <exception cref="ArgumentNullException">If <paramref name="matrix"/> is <c>null</c>.</exception> /// <exception cref="ArgumentNullException">If <paramref name="matrix"/> is <c>null</c>.</exception>
/// <exception cref="ArgumentException">If SVD algorithm failed to converge with matrix <paramref name="matrix"/>.</exception> /// <exception cref="NonConvergenceException"></exception>
public UserSvd(Matrix<double> matrix, bool computeVectors) public UserSvd(Matrix<double> matrix, bool computeVectors)
{ {
if (matrix == null) if (matrix == null)
@ -341,7 +341,7 @@ namespace MathNet.Numerics.LinearAlgebra.Double.Factorization
// throw exception that Convergence Failed // throw exception that Convergence Failed
if (iter >= Maxiter) if (iter >= Maxiter)
{ {
throw new ArgumentException(Resources.ConvergenceFailed); throw new NonConvergenceException();
} }
// This section of the program inspects for negligible elements in the s and e arrays. On // This section of the program inspects for negligible elements in the s and e arrays. On

6
src/Numerics/LinearAlgebra/Single/Factorization/DenseEvd.cs

@ -256,6 +256,7 @@ namespace MathNet.Numerics.LinearAlgebra.Single.Factorization
/// Bowdler, Martin, Reinsch, and Wilkinson, Handbook for /// Bowdler, Martin, Reinsch, and Wilkinson, Handbook for
/// Auto. Comp., Vol.ii-Linear Algebra, and the corresponding /// Auto. Comp., Vol.ii-Linear Algebra, and the corresponding
/// Fortran subroutine in EISPACK.</remarks> /// Fortran subroutine in EISPACK.</remarks>
/// <exception cref="NonConvergenceException"></exception>
internal static void SymmetricDiagonalize(float[] a, float[] d, float[] e, int order) internal static void SymmetricDiagonalize(float[] a, float[] d, float[] e, int order)
{ {
const int Maxiter = 1000; const int Maxiter = 1000;
@ -354,7 +355,7 @@ namespace MathNet.Numerics.LinearAlgebra.Single.Factorization
// throw exception that Convergence Failed // throw exception that Convergence Failed
if (iter >= Maxiter) if (iter >= Maxiter)
{ {
throw new ArgumentException(Resources.ConvergenceFailed); throw new NonConvergenceException();
} }
} while (Math.Abs(e[l]) > eps*tst1); } while (Math.Abs(e[l]) > eps*tst1);
} }
@ -528,6 +529,7 @@ namespace MathNet.Numerics.LinearAlgebra.Single.Factorization
/// by Martin and Wilkinson, Handbook for Auto. Comp., /// by Martin and Wilkinson, Handbook for Auto. Comp.,
/// Vol.ii-Linear Algebra, and the corresponding /// Vol.ii-Linear Algebra, and the corresponding
/// Fortran subroutine in EISPACK.</remarks> /// Fortran subroutine in EISPACK.</remarks>
/// <exception cref="NonConvergenceException"></exception>
internal static void NonsymmetricReduceHessenberToRealSchur(float[] a, float[] matrixH, float[] d, float[] e, int order) internal static void NonsymmetricReduceHessenberToRealSchur(float[] a, float[] matrixH, float[] d, float[] e, int order)
{ {
// Initialize // Initialize
@ -732,7 +734,7 @@ namespace MathNet.Numerics.LinearAlgebra.Single.Factorization
iter = iter + 1; iter = iter + 1;
if (iter >= 30*order) if (iter >= 30*order)
{ {
throw new ArgumentException(Resources.ConvergenceFailed); throw new NonConvergenceException();
} }
// Look for two consecutive small sub-diagonal elements // Look for two consecutive small sub-diagonal elements

3
src/Numerics/LinearAlgebra/Single/Factorization/UserEvd.cs

@ -289,6 +289,7 @@ namespace MathNet.Numerics.LinearAlgebra.Single.Factorization
/// Bowdler, Martin, Reinsch, and Wilkinson, Handbook for /// Bowdler, Martin, Reinsch, and Wilkinson, Handbook for
/// Auto. Comp., Vol.ii-Linear Algebra, and the corresponding /// Auto. Comp., Vol.ii-Linear Algebra, and the corresponding
/// Fortran subroutine in EISPACK.</remarks> /// Fortran subroutine in EISPACK.</remarks>
/// <exception cref="NonConvergenceException"></exception>
private void SymmetricDiagonalize(float[] d, float[] e, int order) private void SymmetricDiagonalize(float[] d, float[] e, int order)
{ {
const int Maxiter = 1000; const int Maxiter = 1000;
@ -387,7 +388,7 @@ namespace MathNet.Numerics.LinearAlgebra.Single.Factorization
// throw exception that Convergence Failed // throw exception that Convergence Failed
if (iter >= Maxiter) if (iter >= Maxiter)
{ {
throw new ArgumentException(Resources.ConvergenceFailed); throw new NonConvergenceException();
} }
} }
while (Math.Abs(e[l]) > eps * tst1); while (Math.Abs(e[l]) > eps * tst1);

4
src/Numerics/LinearAlgebra/Single/Factorization/UserSvd.cs

@ -56,7 +56,7 @@ namespace MathNet.Numerics.LinearAlgebra.Single.Factorization
/// <param name="matrix">The matrix to factor.</param> /// <param name="matrix">The matrix to factor.</param>
/// <param name="computeVectors">Compute the singular U and VT vectors or not.</param> /// <param name="computeVectors">Compute the singular U and VT vectors or not.</param>
/// <exception cref="ArgumentNullException">If <paramref name="matrix"/> is <c>null</c>.</exception> /// <exception cref="ArgumentNullException">If <paramref name="matrix"/> is <c>null</c>.</exception>
/// <exception cref="ArgumentException">If SVD algorithm failed to converge with matrix <paramref name="matrix"/>.</exception> /// <exception cref="NonConvergenceException"></exception>
public UserSvd(Matrix<float> matrix, bool computeVectors) public UserSvd(Matrix<float> matrix, bool computeVectors)
{ {
if (matrix == null) if (matrix == null)
@ -341,7 +341,7 @@ namespace MathNet.Numerics.LinearAlgebra.Single.Factorization
// throw exception that Convergence Failed // throw exception that Convergence Failed
if (iter >= Maxiter) if (iter >= Maxiter)
{ {
throw new ArgumentException(Resources.ConvergenceFailed); throw new NonConvergenceException();
} }
// This section of the program inspects for negligible elements in the s and e arrays. On // This section of the program inspects for negligible elements in the s and e arrays. On

Loading…
Cancel
Save