Skip to content
This repository has been archived by the owner on Nov 19, 2020. It is now read-only.

Commit

Permalink
Preparations for next release.
Browse files Browse the repository at this point in the history
  • Loading branch information
cesarsouza committed Jan 10, 2017
1 parent 7890123 commit 8e0cbd0
Show file tree
Hide file tree
Showing 6 changed files with 77 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Sources/Accord.Core/Properties/VersionInfo.cs
Expand Up @@ -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")]
23 changes: 23 additions & 0 deletions Sources/Accord.Math/Decompositions/EigenvalueDecomposition.cs
Expand Up @@ -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>
///
Expand Down
23 changes: 23 additions & 0 deletions Sources/Accord.Math/Decompositions/EigenvalueDecomposition.tt
Expand Up @@ -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>
///
Expand Down
23 changes: 23 additions & 0 deletions Sources/Accord.Math/Decompositions/EigenvalueDecompositionF.cs
Expand Up @@ -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>
///
Expand Down
2 changes: 1 addition & 1 deletion Sources/Extras/Accord.Video.FFMPEG.GPL/VersionInfo.cpp
Expand Up @@ -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")];
Expand Up @@ -62,7 +62,12 @@ public void ConstructorTest()
Assert.Fail();
}

[Test]

[Test,
#if !DEBUG
Ignore
#endif
]
public void learn_test()
{
#region doc_learn
Expand Down

0 comments on commit 8e0cbd0

Please sign in to comment.