Permalink
Browse files

Preparations for next release.

  • Loading branch information...
1 parent 7890123 commit 8e0cbd03b55f0d22ff536b6a524a62b523dd9f62 @cesarsouza cesarsouza committed Jan 10, 2017
@@ -6,4 +6,4 @@
[assembly: AssemblyCultureAttribute("")]
[assembly: AssemblyVersionAttribute("3.4.0")]
[assembly: AssemblyInformationalVersionAttribute("3.4.0")]
-[assembly: AssemblyFileVersionAttribute("3.4.0.5851")]
+[assembly: AssemblyFileVersionAttribute("3.4.0.5853")]
@@ -60,6 +60,29 @@ public sealed class EigenvalueDecomposition : ICloneable
private Double[] ort; // storage for nonsymmetric algorithm.
private bool symmetric;
+ private const Double eps = 2 * Constants.DoubleEpsilon;
+
+
+ /// <summary>
+ /// Returns the effective numerical matrix rank.
+ /// </summary>
+ ///
+ /// <value>Number of non-negligible eigen values.</value>
+ ///
+ public int Rank
+ {
+ get
+ {
+ Double tol = n * d[0] * eps;
+
+ int r = 0;
+ for (int i = 0; i < d.Length; i++)
+ if (d[i] > tol) r++;
+
+ return r;
+ }
+ }
+
/// <summary>
/// Construct an eigenvalue decomposition.</summary>
///
@@ -78,6 +78,29 @@ namespace Accord.Math.Decompositions
private <#=T#>[] ort; // storage for nonsymmetric algorithm.
private bool symmetric;
+ private const <#=T#> eps = 2 * Constants.<#=T#>Epsilon;
+
+
+ /// <summary>
+ /// Returns the effective numerical matrix rank.
+ /// </summary>
+ ///
+ /// <value>Number of non-negligible eigen values.</value>
+ ///
+ public int Rank
+ {
+ get
+ {
+ <#=T#> tol = n * d[0] * eps;
+
+ int r = 0;
+ for (int i = 0; i < d.Length; i++)
+ if (d[i] > tol) r++;
+
+ return r;
+ }
+ }
+
/// <summary>
/// Construct an eigenvalue decomposition.</summary>
///
@@ -60,6 +60,29 @@ public sealed class EigenvalueDecompositionF : ICloneable
private Single[] ort; // storage for nonsymmetric algorithm.
private bool symmetric;
+ private const Single eps = 2 * Constants.SingleEpsilon;
+
+
+ /// <summary>
+ /// Returns the effective numerical matrix rank.
+ /// </summary>
+ ///
+ /// <value>Number of non-negligible eigen values.</value>
+ ///
+ public int Rank
+ {
+ get
+ {
+ Single tol = n * d[0] * eps;
+
+ int r = 0;
+ for (int i = 0; i < d.Length; i++)
+ if (d[i] > tol) r++;
+
+ return r;
+ }
+ }
+
/// <summary>
/// Construct an eigenvalue decomposition.</summary>
///
@@ -7,4 +7,4 @@ using namespace System::Reflection;
[assembly: AssemblyCultureAttribute("")];
[assembly: AssemblyVersionAttribute("3.4.0")];
[assembly: AssemblyInformationalVersionAttribute("3.4.0")];
-[assembly: AssemblyFileVersionAttribute("3.4.0.5851")];
+[assembly: AssemblyFileVersionAttribute("3.4.0.5853")];
@@ -62,7 +62,12 @@ public void ConstructorTest()
Assert.Fail();
}
- [Test]
+
+ [Test,
+#if !DEBUG
+ Ignore
+#endif
+ ]
public void learn_test()
{
#region doc_learn

0 comments on commit 8e0cbd0

Please sign in to comment.