Skip to content

Commit

Permalink
Updating release notes.
Browse files Browse the repository at this point in the history
  • Loading branch information
cesarsouza committed Dec 3, 2013
1 parent aeee415 commit a35d0e9
Show file tree
Hide file tree
Showing 4 changed files with 400 additions and 76 deletions.
58 changes: 58 additions & 0 deletions Release notes.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,61 @@
Accord.NET Framework 2.12b1 release notes
-----------------------------------------
06.12.2013.

Version updates and fixes:

* General
- The general focus for this release was again to improve
the documentation and provide standard bug-fixing;
- The project now also provides Debug binaries which be used
to provide more detailed information when debugging applications.

* Accord.Controls
- Adding a WavechartBox control to display wavecharts with ease, in
the same way as MessageBox can display text messages on screen.

* Accord.Audio
- Correcting WaveDecoder.AverageBytesPerSecond (Google Code #80);
- Correcting the creation of base audio windows;
- Adding the ExtractChannel filter for extracting single channels
from multiple-channel audio signals.

* Accord.Statistics
- Adding generic base classes for probability distributions;
- Adding support for computing the cumulative multivariate normal
distribution function for specifically one and two dimensions;
- Correcting behavior of the Binomial test under .NET 4.5;
- Updating DescriptiveAnalysis to provide sums and confidence intervals;
- Updating ChiSquareTest to accept ConfusionMatrices as input;
- Unifying Univariate and Multivariate mixture distribution fitting
through Expectation-Maximization into a single and generic class;
- Updating the WeightedMean method to accept unnormalized weights;
- Updating the Codification filter to work without DataTables;
- Adding fitting options for empirical distributions (Google Code #66);
- Adding options to robustly fit Multivariate Normal Distributions using
the Singular Value Decomposition, avoiding non-positive definite issues.

* Accord.MachineLearning
- GaussianMixtureModel now accepts a maximum number of iterations;
- Updating the KDTree class to provide a non-generic version when there
is no interest in the kind of values stored as information in the nodes;
- Adding specialized methods for when only the closest neighbor is needed
in a KDTree. Also adding options to provide only an approximate answer;
- Updating the K-Means algorithm to fully support parallel processing;
- Adding support for generating decision rules from Decision Trees.

* Accord.Math
- Correcting InsertColumn and InsertRow implementations;
- Improving Submatrix creation to avoid extra memory allocations when desired;
- Reshape method for jagged arrays can now work with non-rectangular arrays;
- Correcting relative convergence issues with negative watched interest values;
- Adding Modulo and Modular distance for double-precision floating point inputs.

* AForge Compatibility
- Compiled against AForge.NET Framework 2.2.5. May work with newer versions.



Accord.NET Framework 2.11.0 release notes
-----------------------------------------
27.10.2013.
Expand Down
128 changes: 80 additions & 48 deletions Sources/Accord.Math/Decompositions/SingularValueDecomposition.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ namespace Accord.Math.Decompositions
/// <summary>
/// Singular Value Decomposition for a rectangular matrix.
/// </summary>
///
/// <remarks>
/// <para>
/// For an m-by-n matrix <c>A</c> with <c>m >= n</c>, the singular value decomposition
Expand Down Expand Up @@ -69,10 +70,10 @@ public sealed class SingularValueDecomposition : ICloneable, ISolverMatrixDecomp
private const Double eps = 2 * Constants.DoubleEpsilon;
private const Double tiny = Constants.DoubleSmall;

double? determinant;
double? lndeterminant;
double? pseudoDeterminant;
double? lnpseudoDeterminant;
Double? determinant;
Double? lndeterminant;
Double? pseudoDeterminant;
Double? lnpseudoDeterminant;

/// <summary>
/// Returns the condition number <c>max(S) / min(S)</c>.
Expand Down Expand Up @@ -102,11 +103,11 @@ public Double TwoNorm
}

/// <summary>
/// Returns the effective numerical matrix rank.
/// </summary>
///
/// Returns the effective numerical matrix rank.
/// </summary>
///
/// <value>Number of non-negligible singular values.</value>
///
///
public int Rank
{
get
Expand All @@ -121,59 +122,71 @@ public int Rank
}
}

/// <summary>
/// Gets whether the decomposed matrix is singular.
/// </summary>
///
public bool IsSingular
/// <summary>
/// Gets whether the decomposed matrix is singular.
/// </summary>
///
public bool IsSingular
{
get { return Rank < Math.Min(m, n); }
}

/// <summary>
/// Gets the one-dimensional array of singular values.
/// </summary>
///
/// Gets the one-dimensional array of singular values.
/// </summary>
///
public Double[] Diagonal
{
get { return this.s; }
}

/// <summary>Returns the block diagonal matrix of singular values.</summary>
/// <summary>
/// Returns the block diagonal matrix of singular values.
/// </summary>
///
public Double[,] DiagonalMatrix
{
get { return Matrix.Diagonal(s); }
}

/// <summary>Returns the V matrix of Singular Vectors.</summary>
/// <summary>
/// Returns the V matrix of Singular Vectors.
/// </summary>
///
public Double[,] RightSingularVectors
{
get { return v; }
}

/// <summary>Returns the U matrix of Singular Vectors.</summary>
/// <summary>
/// Returns the U matrix of Singular Vectors.
/// </summary>
///
public Double[,] LeftSingularVectors
{
get { return u; }
}

/// <summary>Returns the ordering in which the singular values have been sorted.</summary>
/// <summary>
/// Returns the ordering in which the singular values have been sorted.
/// </summary>
///
public int[] Ordering
{
get { return si; }
}

/// <summary>
/// <summary>
/// Returns the absolute value of the matrix determinant.
/// </summary>
///
public double AbsoluteDeterminant
public Double AbsoluteDeterminant
{
get
{
if (!determinant.HasValue)
{
double det = 1;
Double det = 1;
for (int i = 0; i < s.Length; i++)
det *= s[i];
determinant = det;
Expand All @@ -187,7 +200,7 @@ public double AbsoluteDeterminant
/// Returns the log of the absolute value for the matrix determinant.
/// </summary>
///
public double LogDeterminant
public Double LogDeterminant
{
get
{
Expand All @@ -196,7 +209,7 @@ public double LogDeterminant
double det = 0;
for (int i = 0; i < s.Length; i++)
det += Math.Log(s[i]);
lndeterminant = det;
lndeterminant = (Double)det;
}

return lndeterminant.Value;
Expand All @@ -208,13 +221,13 @@ public double LogDeterminant
/// Returns the pseudo-determinant for the matrix.
/// </summary>
///
public double PseudoDeterminant
public Double PseudoDeterminant
{
get
{
if (!pseudoDeterminant.HasValue)
{
double det = 1;
Double det = 1;
for (int i = 0; i < s.Length; i++)
if (s[i] != 0) det *= s[i];
pseudoDeterminant = det;
Expand All @@ -228,7 +241,7 @@ public double PseudoDeterminant
/// Returns the log of the pseudo-determinant for the matrix.
/// </summary>
///
public double LogPseudoDeterminant
public Double LogPseudoDeterminant
{
get
{
Expand All @@ -237,24 +250,31 @@ public double LogPseudoDeterminant
double det = 0;
for (int i = 0; i < s.Length; i++)
if (s[i] != 0) det += Math.Log(s[i]);
lnpseudoDeterminant = det;
lnpseudoDeterminant = (Double)det;
}

return lnpseudoDeterminant.Value;
}
}


/// <summary>Constructs a new singular value decomposition.</summary>
/// <summary>
/// Constructs a new singular value decomposition.
/// </summary>
///
/// <param name="value">
/// The matrix to be decomposed.</param>
///
public SingularValueDecomposition(Double[,] value)
: this(value, true, true)
{
}


/// <summary>Constructs a new singular value decomposition.</summary>
/// <summary>
/// Constructs a new singular value decomposition.
/// </summary>
///
/// <param name="value">
/// The matrix to be decomposed.</param>
/// <param name="computeLeftSingularVectors">
Expand All @@ -265,12 +285,17 @@ public SingularValueDecomposition(Double[,] value)
/// Pass <see langword="true"/> if the right singular vector matrix V
/// should be computed. Pass <see langword="false"/> otherwise. Default
/// is <see langword="true"/>.</param>
public SingularValueDecomposition(Double[,] value, bool computeLeftSingularVectors, bool computeRightSingularVectors)
///
public SingularValueDecomposition(Double[,] value,
bool computeLeftSingularVectors, bool computeRightSingularVectors)
: this(value, computeLeftSingularVectors, computeRightSingularVectors, false)
{
}

/// <summary>Constructs a new singular value decomposition.</summary>
/// <summary>
/// Constructs a new singular value decomposition.
/// </summary>
///
/// <param name="value">
/// The matrix to be decomposed.</param>
/// <param name="computeLeftSingularVectors">
Expand All @@ -285,12 +310,17 @@ public SingularValueDecomposition(Double[,] value, bool computeLeftSingularVecto
/// Pass <see langword="true"/> to automatically transpose the value matrix in
/// case JAMA's assumptions about the dimensionality of the matrix are violated.
/// Pass <see langword="false"/> otherwise. Default is <see langword="false"/>.</param>
public SingularValueDecomposition(Double[,] value, bool computeLeftSingularVectors, bool computeRightSingularVectors, bool autoTranspose)
///
public SingularValueDecomposition(Double[,] value,
bool computeLeftSingularVectors, bool computeRightSingularVectors, bool autoTranspose)
: this(value, computeLeftSingularVectors, computeRightSingularVectors, autoTranspose, false)
{
}

/// <summary>Constructs a new singular value decomposition.</summary>
/// <summary>
/// Constructs a new singular value decomposition.
/// </summary>
///
/// <param name="value">
/// The matrix to be decomposed.</param>
/// <param name="computeLeftSingularVectors">
Expand All @@ -308,8 +338,10 @@ public SingularValueDecomposition(Double[,] value, bool computeLeftSingularVecto
/// <param name="inPlace">
/// Pass <see langword="true"/> to perform the decomposition in place. The matrix
/// <paramref name="value"/> will be destroyed in the process, resulting in less
/// memory consumption.</param>
public unsafe SingularValueDecomposition(Double[,] value, bool computeLeftSingularVectors, bool computeRightSingularVectors, bool autoTranspose, bool inPlace)
/// memory comsumption.</param>
///
public unsafe SingularValueDecomposition(Double[,] value,
bool computeLeftSingularVectors, bool computeRightSingularVectors, bool autoTranspose, bool inPlace)
{
if (value == null)
{
Expand All @@ -320,11 +352,11 @@ public unsafe SingularValueDecomposition(Double[,] value, bool computeLeftSingul
m = value.GetLength(0); // rows
n = value.GetLength(1); // cols

if (m == 0 || n == 0)
{
throw new ArgumentException("Matrix does not have any rows or columns.", "value");
}

if (m == 0 || n == 0)
{
throw new ArgumentException("Matrix does not have any rows or columns.", "value");
}


if (m < n) // Check if we are violating JAMA's assumption
Expand Down Expand Up @@ -637,13 +669,13 @@ public unsafe SingularValueDecomposition(Double[,] value, bool computeLeftSingul

// This section of the program inspects for
// negligible elements in the s and e arrays. On
// completion the variables case and k are set as follows.
// completion the variables kase and k are set as follows.

// case = 1 if s(p) and e[k-1] are negligible and k<p
// case = 2 if s(k) is negligible and k<p
// case = 3 if e[k-1] is negligible, k<p, and
// kase = 1 if s(p) and e[k-1] are negligible and k<p
// kase = 2 if s(k) is negligible and k<p
// kase = 3 if e[k-1] is negligible, k<p, and
// s(k), ..., s(p) are not negligible (qr step).
// case = 4 if e(p-1) is negligible (convergence).
// kase = 4 if e(p-1) is negligible (convergence).

for (k = p - 2; k >= -1; k--)
{
Expand Down Expand Up @@ -692,7 +724,7 @@ public unsafe SingularValueDecomposition(Double[,] value, bool computeLeftSingul

k++;

// Perform the task indicated by case.
// Perform the task indicated by kase.
switch (kase)
{
// Deflate negligible s(p).
Expand Down
Loading

0 comments on commit a35d0e9

Please sign in to comment.