|
From: <in...@dn...> - 2006-01-25 09:22:16
|
Author: marcus
Date: 2006-01-25 04:22:06 -0500 (Wed, 25 Jan 2006)
New Revision: 187
Modified:
trunk/LinearAlgebra/Decomposition/DenseQR.cs
trunk/LinearAlgebra/Decomposition/IQR.cs
trunk/LinearAlgebra/Decomposition/QR.cs
Log:
implemented changes as suggested in code review ticket #39.
Modified: trunk/LinearAlgebra/Decomposition/DenseQR.cs
===================================================================
--- trunk/LinearAlgebra/Decomposition/DenseQR.cs 2006-01-25 08:56:38 UTC (rev 186)
+++ trunk/LinearAlgebra/Decomposition/DenseQR.cs 2006-01-25 09:22:06 UTC (rev 187)
@@ -12,7 +12,7 @@
namespace dnAnalytics.LinearAlgebra.Decomposition
{
/// <summary>
- /// Computes the QR decomposition of a <see cref="Matrix"/>.
+ /// Computes the QR decomposition of a dense <see cref="Matrix"/>.
/// </summary>
internal sealed class DenseQR : Algorithm, IQR
{
@@ -67,6 +67,9 @@
/// Copies the orthogonal Q matrix into the result matrix.
/// </summary>
/// <param name="result">A matrix to copy the orthogonal Q matrix into.</param>
+ /// <exception cref="ArgumentNullException">If <paramref name="result"/> is <c>null</c>.</exception>
+ /// <exception cref="NotConformableException">If <paramref name="result"/> is not a square matrix
+ /// with an order equal to the number of rows of the matrix being factored.</exception>
public void Q(Matrix result)
{
if (result == null)
@@ -74,7 +77,7 @@
throw new ArgumentNullException("result", Strings.NullParameterException);
}
- if (result.Rows != q.Rows || result.Columns != q.Columns)
+ if (result.Rows != r.Rows || result.Columns != r.Rows)
{
throw new NotConformableException("result", Strings.ParameterNotConformable);
}
@@ -86,6 +89,10 @@
/// Copies the upper triangular factor R into the result matrix.
/// </summary>
/// <param name="result">A matrix to copy upper triangular factor R into.</param>
+ /// <exception cref="ArgumentNullException">If <paramref name="result"/> is <c>null</c>.</exception>
+ /// <exception cref="NotConformableException">If <paramref name="result"/> does not have the
+ /// dimensions m by n, where m and n are the number of columns and rows of the matrix being
+ /// factored, respectively.</exception>
public void R(Matrix result)
{
if (result == null)
@@ -114,9 +121,9 @@
return det;
}
/// <summary>
- /// Determine whether the matrix is full rank or not.
+ /// Determines whether the matrix is full rank or not.
/// </summary>
- /// <returns>Boolean value indicates whether the given matrix is full rank or not.</returns>
+ /// <returns><c>true</c> if the matrix is full rank; othewise <c>false</c>.</returns>
public bool IsFullRank()
{
Compute();
Modified: trunk/LinearAlgebra/Decomposition/IQR.cs
===================================================================
--- trunk/LinearAlgebra/Decomposition/IQR.cs 2006-01-25 08:56:38 UTC (rev 186)
+++ trunk/LinearAlgebra/Decomposition/IQR.cs 2006-01-25 09:22:06 UTC (rev 187)
@@ -6,6 +6,7 @@
#region Using Directives
+using System;
using dnAnalytics.Exceptions;
using dnAnalytics.Math;
@@ -19,9 +20,9 @@
internal interface IQR : IAlgorithm
{
/// <summary>
- /// Determine whether the matrix is full rank or not.
+ /// Determines whether the matrix is full rank or not.
/// </summary>
- /// <returns>Boolean value indicates whether the given matrix is full rank or not.</returns>
+ /// <returns><c>true</c> if the matrix is full rank; othewise <c>false</c>.</returns>
bool IsFullRank();
/// <summary>
@@ -34,6 +35,9 @@
/// Copies the orthogonal Q matrix into the result matrix.
/// </summary>
/// <param name="result">A matrix to copy the orthogonal Q matrix into.</param>
+ /// <exception cref="ArgumentNullException">If <paramref name="result"/> is <c>null</c>.</exception>
+ /// <exception cref="NotConformableException">If <paramref name="result"/> is not a square matrix
+ /// with an order equal to the number of rows of the matrix being factored.</exception>
void Q(Matrix result);
/// <summary>
@@ -46,6 +50,10 @@
/// Copies the upper triangular factor R into the result matrix.
/// </summary>
/// <param name="result">A matrix to copy upper triangular factor R into.</param>
+ /// <exception cref="ArgumentNullException">If <paramref name="result"/> is <c>null</c>.</exception>
+ /// <exception cref="NotConformableException">If <paramref name="result"/> does not have the
+ /// dimensions m by n, where m and n are the number of columns and rows of the matrix being
+ /// factored, respectively.</exception>
void R(Matrix result);
///<summary>Calculates the determinant (absolute value) of the matrix.</summary>
Modified: trunk/LinearAlgebra/Decomposition/QR.cs
===================================================================
--- trunk/LinearAlgebra/Decomposition/QR.cs 2006-01-25 08:56:38 UTC (rev 186)
+++ trunk/LinearAlgebra/Decomposition/QR.cs 2006-01-25 09:22:06 UTC (rev 187)
@@ -68,6 +68,9 @@
/// Copies the orthogonal Q matrix into the result matrix.
/// </summary>
/// <param name="result">A matrix to copy the orthogonal Q matrix into.</param>
+ /// <exception cref="ArgumentNullException">If <paramref name="result"/> is <c>null</c>.</exception>
+ /// <exception cref="NotConformableException">If <paramref name="result"/> is not a square matrix
+ /// with an order equal to the number of rows of the matrix being factored.</exception>
public void Q(Matrix result)
{
if (result == null)
@@ -85,6 +88,10 @@
/// Copies the upper triangular factor R into the result matrix.
/// </summary>
/// <param name="result">A matrix to copy upper triangular factor R into.</param>
+ /// <exception cref="ArgumentNullException">If <paramref name="result"/> is <c>null</c>.</exception>
+ /// <exception cref="NotConformableException">If <paramref name="result"/> does not have the
+ /// dimensions m by n, where m and n are the number of columns and rows of the matrix being
+ /// factored, respectively.</exception>
public void R(Matrix result)
{
if (result == null)
@@ -99,20 +106,15 @@
decomp.R(result);
}
-
- #endregion Public Methods
-
- #region Public Properties
/// <summary>
- /// Determine whether the matrix is full rank or not.
+ /// Determines whether the matrix is full rank or not.
/// </summary>
- /// <returns>Boolean value indicates whether the given matrix is full rank or not.</returns>
+ /// <returns><c>true</c> if the matrix is full rank; othewise <c>false</c>.</returns>
public bool IsFullRank()
{
return decomp.IsFullRank();
}
-
///<summary>Calculates the determinant (absolute value) of the matrix.</summary>
///<returns>The determinant of the matrix.</returns>
///<exception cref="NotSquareMatrixException">If the matrix is not square.</exception>
@@ -121,7 +123,7 @@
return decomp.Determinant();
}
- #endregion Public Properites
+ #endregion Public Methods
#region Protected Members
|