Browse Source

fixed matrix norm signature

la-knuth
Marcus Cuda 16 years ago
parent
commit
66adcfdd9a
  1. 22
      src/Numerics/Algorithms/LinearAlgebra/Atlas/AtlasLinearAlgebraProvider.cs
  2. 8
      src/Numerics/Algorithms/LinearAlgebra/ILinearAlgebraProviderOfT.cs
  3. 55
      src/Numerics/Algorithms/LinearAlgebra/ManagedLinearAlgebraProvider.cs
  4. 34
      src/Numerics/Algorithms/LinearAlgebra/Mkl/MklLinearAlgebraProvider.cs
  5. 20
      src/Numerics/Algorithms/LinearAlgebra/NativeAlgebraProvider.include

22
src/Numerics/Algorithms/LinearAlgebra/Atlas/AtlasLinearAlgebraProvider.cs

@ -28,7 +28,7 @@
/* This file is automatically generated - do not modify it.
Change NativeLinearAlgebraProvider.include instead.
Last generated on UTC 2010-06-27 13:08:29Z
Last generated on UTC 2010-06-27 13:41:23Z
*/
namespace MathNet.Numerics.Algorithms.LinearAlgebra.Atlas
@ -239,7 +239,7 @@ namespace MathNet.Numerics.Algorithms.LinearAlgebra.Atlas
/// <returns>
/// The requested <see cref="Norm"/> of the matrix.
/// </returns>
public double MatrixNorm(Norm norm, double[] matrix)
public double MatrixNorm(Norm norm, int rows, int columns, double[] matrix)
{
throw new NotImplementedException();
}
@ -254,7 +254,7 @@ namespace MathNet.Numerics.Algorithms.LinearAlgebra.Atlas
/// <returns>
/// The requested <see cref="Norm"/> of the matrix.
/// </returns>
public double MatrixNorm(Norm norm, double[] matrix, double[] work)
public double MatrixNorm(Norm norm, int rows, int columns, double[] matrix, double[] work)
{
throw new NotImplementedException();
}
@ -840,7 +840,7 @@ namespace MathNet.Numerics.Algorithms.LinearAlgebra.Atlas
/// <returns>
/// The requested <see cref="Norm"/> of the matrix.
/// </returns>
public float MatrixNorm(Norm norm, float[] matrix)
public float MatrixNorm(Norm norm, int rows, int columns, float[] matrix)
{
throw new NotImplementedException();
}
@ -855,7 +855,7 @@ namespace MathNet.Numerics.Algorithms.LinearAlgebra.Atlas
/// <returns>
/// The requested <see cref="Norm"/> of the matrix.
/// </returns>
public float MatrixNorm(Norm norm, float[] matrix, float[] work)
public float MatrixNorm(Norm norm, int rows, int columns, float[] matrix, float[] work)
{
throw new NotImplementedException();
}
@ -1441,7 +1441,7 @@ namespace MathNet.Numerics.Algorithms.LinearAlgebra.Atlas
/// <returns>
/// The requested <see cref="Norm"/> of the matrix.
/// </returns>
public Complex MatrixNorm(Norm norm, Complex[] matrix)
public Complex MatrixNorm(Norm norm, int rows, int columns, Complex[] matrix)
{
throw new NotImplementedException();
}
@ -1456,7 +1456,7 @@ namespace MathNet.Numerics.Algorithms.LinearAlgebra.Atlas
/// <returns>
/// The requested <see cref="Norm"/> of the matrix.
/// </returns>
public Complex MatrixNorm(Norm norm, Complex[] matrix, Complex[] work)
public Complex MatrixNorm(Norm norm, int rows, int columns, Complex[] matrix, Complex[] work)
{
throw new NotImplementedException();
}
@ -2038,11 +2038,13 @@ namespace MathNet.Numerics.Algorithms.LinearAlgebra.Atlas
/// Computes the requested <see cref="Norm"/> of the matrix.
/// </summary>
/// <param name="norm">The type of norm to compute.</param>
/// <param name="rows">The number of rows.</param>
/// <param name="columns">The number of columns.</param>
/// <param name="matrix">The matrix to compute the norm from.</param>
/// <returns>
/// The requested <see cref="Norm"/> of the matrix.
/// </returns>
public Complex32 MatrixNorm(Norm norm, Complex32[] matrix)
public Complex32 MatrixNorm(Norm norm, int rows, int columns, Complex32[] matrix)
{
throw new NotImplementedException();
}
@ -2051,13 +2053,15 @@ namespace MathNet.Numerics.Algorithms.LinearAlgebra.Atlas
/// Computes the requested <see cref="Norm"/> of the matrix.
/// </summary>
/// <param name="norm">The type of norm to compute.</param>
/// <param name="rows">The number of rows.</param>
/// <param name="columns">The number of columns.</param>
/// <param name="matrix">The matrix to compute the norm from.</param>
/// <param name="work">The work array. Only used when <see cref="Norm.InfinityNorm"/>
/// and needs to be have a length of at least M (number of rows of <paramref name="matrix"/>.</param>
/// <returns>
/// The requested <see cref="Norm"/> of the matrix.
/// </returns>
public Complex32 MatrixNorm(Norm norm, Complex32[] matrix, Complex32[] work)
public Complex32 MatrixNorm(Norm norm, int rows, int columns, Complex32[] matrix, Complex32[] work)
{
throw new NotImplementedException();
}

8
src/Numerics/Algorithms/LinearAlgebra/ILinearAlgebraProviderOfT.cs

@ -160,23 +160,27 @@ namespace MathNet.Numerics.Algorithms.LinearAlgebra
/// Computes the requested <see cref="Norm"/> of the matrix.
/// </summary>
/// <param name="norm">The type of norm to compute.</param>
/// <param name="rows">The number of rows.</param>
/// <param name="columns">The number of columns.</param>
/// <param name="matrix">The matrix to compute the norm from.</param>
/// <returns>
/// The requested <see cref="Norm"/> of the matrix.
/// </returns>
T MatrixNorm(Norm norm, T[] matrix);
T MatrixNorm(Norm norm, int rows, int columns, T[] matrix);
/// <summary>
/// Computes the requested <see cref="Norm"/> of the matrix.
/// </summary>
/// <param name="norm">The type of norm to compute.</param>
/// <param name="rows">The number of rows.</param>
/// <param name="columns">The number of columns.</param>
/// <param name="matrix">The matrix to compute the norm from.</param>
/// <param name="work">The work array. Only used when <see cref="Norm.InfinityNorm"/>
/// and needs to be have a length of at least M (number of rows of <paramref name="matrix"/>.</param>
/// <returns>
/// The requested <see cref="Norm"/> of the matrix.
/// </returns>
T MatrixNorm(Norm norm, T[] matrix, T[] work);
T MatrixNorm(Norm norm, int rows, int columns, T[] matrix, T[] work);
/// <summary>
/// Multiples two matrices. <c>result = x * y</c>

55
src/Numerics/Algorithms/LinearAlgebra/ManagedLinearAlgebraProvider.cs

@ -230,14 +230,47 @@ namespace MathNet.Numerics.Algorithms.LinearAlgebra
CommonParallel.For(0, y.Length, index => { result[index] = x[index] * y[index]; });
}
public double MatrixNorm(Norm norm, double[] matrix)
{
throw new NotImplementedException();
/// <summary>
/// Computes the requested <see cref="Norm"/> of the matrix.
/// </summary>
/// <param name="norm">The type of norm to compute.</param>
/// <param name="rows">The number of rows.</param>
/// <param name="columns">The number of columns.</param>
/// <param name="matrix">The matrix to compute the norm from.</param>
/// <returns>
/// The requested <see cref="Norm"/> of the matrix.
/// </returns>
public double MatrixNorm(Norm norm, int rows, int columns, double[] matrix)
{
var ret = 0.0;
switch (norm)
{
case Norm.OneNorm:
break;
case Norm.LargestAbsoluteValue:
break;
case Norm.InfinityNorm:
break;
case Norm.FrobeniusNorm:
break;
}
return ret;
}
public double MatrixNorm(Norm norm, double[] matrix, double[] work)
/// <summary>
/// Computes the requested <see cref="Norm"/> of the matrix.
/// </summary>
/// <param name="norm">The type of norm to compute.</param>
/// <param name="rows">The number of rows.</param>
/// <param name="columns">The number of columns.</param>
/// <param name="matrix">The matrix to compute the norm from.</param>
/// <param name="work">The work array. Not used in the managed provider.</param>
/// <returns>
/// The requested <see cref="Norm"/> of the matrix.
/// </returns>
public double MatrixNorm(Norm norm, int rows, int columns, double[] matrix, double[] work)
{
throw new NotImplementedException();
return MatrixNorm(norm, rows, columns, matrix);
}
/// <summary>
@ -1370,12 +1403,12 @@ namespace MathNet.Numerics.Algorithms.LinearAlgebra
CommonParallel.For(0, y.Length, i => result[i] = x[i] * y[i]);
}
public float MatrixNorm(Norm norm, float[] matrix)
public float MatrixNorm(Norm norm, int rows, int columns, float[] matrix)
{
throw new NotImplementedException();
}
public float MatrixNorm(Norm norm, float[] matrix, float[] work)
public float MatrixNorm(Norm norm, int rows, int columns, float[] matrix, float[] work)
{
throw new NotImplementedException();
}
@ -2196,12 +2229,12 @@ namespace MathNet.Numerics.Algorithms.LinearAlgebra
CommonParallel.For(0, y.Length, i => result[i] = x[i] * y[i]);
}
public Complex MatrixNorm(Norm norm, Complex[] matrix)
public Complex MatrixNorm(Norm norm, int rows, int columns, Complex[] matrix)
{
throw new NotImplementedException();
}
public Complex MatrixNorm(Norm norm, Complex[] matrix, Complex[] work)
public Complex MatrixNorm(Norm norm, int rows, int columns, Complex[] matrix, Complex[] work)
{
throw new NotImplementedException();
}
@ -2987,12 +3020,12 @@ namespace MathNet.Numerics.Algorithms.LinearAlgebra
CommonParallel.For(0, y.Length, i => result[i] = x[i] * y[i]);
}
public Complex32 MatrixNorm(Norm norm, Complex32[] matrix)
public Complex32 MatrixNorm(Norm norm, int rows, int columns, Complex32[] matrix)
{
throw new NotImplementedException();
}
public Complex32 MatrixNorm(Norm norm, Complex32[] matrix, Complex32[] work)
public Complex32 MatrixNorm(Norm norm, int rows, int columns, Complex32[] matrix, Complex32[] work)
{
throw new NotImplementedException();
}

34
src/Numerics/Algorithms/LinearAlgebra/Mkl/MklLinearAlgebraProvider.cs

@ -28,7 +28,7 @@
/* This file is automatically generated - do not modify it.
Change NativeLinearAlgebraProvider.include instead.
Last generated on UTC 2010-06-09 08:17:18Z
Last generated on UTC 2010-06-27 13:41:29Z
*/
namespace MathNet.Numerics.Algorithms.LinearAlgebra.Mkl
@ -238,7 +238,7 @@ namespace MathNet.Numerics.Algorithms.LinearAlgebra.Mkl
/// <returns>
/// The requested <see cref="Norm"/> of the matrix.
/// </returns>
public double MatrixNorm(Norm norm, double[] matrix)
public double MatrixNorm(Norm norm, int rows, int columns, double[] matrix)
{
throw new NotImplementedException();
}
@ -253,7 +253,7 @@ namespace MathNet.Numerics.Algorithms.LinearAlgebra.Mkl
/// <returns>
/// The requested <see cref="Norm"/> of the matrix.
/// </returns>
public double MatrixNorm(Norm norm, double[] matrix, double[] work)
public double MatrixNorm(Norm norm, int rows, int columns, double[] matrix, double[] work)
{
throw new NotImplementedException();
}
@ -839,7 +839,7 @@ namespace MathNet.Numerics.Algorithms.LinearAlgebra.Mkl
/// <returns>
/// The requested <see cref="Norm"/> of the matrix.
/// </returns>
public float MatrixNorm(Norm norm, float[] matrix)
public float MatrixNorm(Norm norm, int rows, int columns, float[] matrix)
{
throw new NotImplementedException();
}
@ -854,7 +854,7 @@ namespace MathNet.Numerics.Algorithms.LinearAlgebra.Mkl
/// <returns>
/// The requested <see cref="Norm"/> of the matrix.
/// </returns>
public float MatrixNorm(Norm norm, float[] matrix, float[] work)
public float MatrixNorm(Norm norm, int rows, int columns, float[] matrix, float[] work)
{
throw new NotImplementedException();
}
@ -1440,7 +1440,7 @@ namespace MathNet.Numerics.Algorithms.LinearAlgebra.Mkl
/// <returns>
/// The requested <see cref="Norm"/> of the matrix.
/// </returns>
public Complex MatrixNorm(Norm norm, Complex[] matrix)
public Complex MatrixNorm(Norm norm, int rows, int columns, Complex[] matrix)
{
throw new NotImplementedException();
}
@ -1455,7 +1455,7 @@ namespace MathNet.Numerics.Algorithms.LinearAlgebra.Mkl
/// <returns>
/// The requested <see cref="Norm"/> of the matrix.
/// </returns>
public Complex MatrixNorm(Norm norm, Complex[] matrix, Complex[] work)
public Complex MatrixNorm(Norm norm, int rows, int columns, Complex[] matrix, Complex[] work)
{
throw new NotImplementedException();
}
@ -1834,9 +1834,9 @@ namespace MathNet.Numerics.Algorithms.LinearAlgebra.Mkl
/// Solves A*X=B for X using a previously SVD decomposed matrix.
/// </summary>
/// <param name="columnsOfB">The number of columns of B.</param>
/// <param name="s">The s values returned by <see cref="SingularValueDecomposition(bool,System.Numerics.Complex[],System.Numerics.Complex[],System.Numerics.Complex[],System.Numerics.Complex[])"/>.</param>
/// <param name="u">The left singular vectors returned by <see cref="SingularValueDecomposition(bool,System.Numerics.Complex[],System.Numerics.Complex[],System.Numerics.Complex[],System.Numerics.Complex[])"/>.</param>
/// <param name="vt">The right singular vectors returned by <see cref="SingularValueDecomposition(bool,System.Numerics.Complex[],System.Numerics.Complex[],System.Numerics.Complex[],System.Numerics.Complex[])"/>.</param>
/// <param name="s">The s values returned by <see cref="SingularValueDecomposition(bool,Complex[],Complex[],Complex[],Complex[])"/>.</param>
/// <param name="u">The left singular vectors returned by <see cref="SingluarValueDecomposition(bool,Complex[],Complex[],Complex[],Complex[])"/>.</param>
/// <param name="vt">The right singular vectors returned by <see cref="SingularValueDecomposition(bool,Complex[],Complex[],Complex[],Complex[])"/>.</param>
/// <param name="b">The B matrix.</param>
/// <param name="x">On exit, the solution matrix.</param>
public void SvdSolveFactored(int columnsOfB, Complex[] s, Complex[] u, Complex[] vt, Complex[] b, Complex[] x)
@ -2037,11 +2037,13 @@ namespace MathNet.Numerics.Algorithms.LinearAlgebra.Mkl
/// Computes the requested <see cref="Norm"/> of the matrix.
/// </summary>
/// <param name="norm">The type of norm to compute.</param>
/// <param name="rows">The number of rows.</param>
/// <param name="columns">The number of columns.</param>
/// <param name="matrix">The matrix to compute the norm from.</param>
/// <returns>
/// The requested <see cref="Norm"/> of the matrix.
/// </returns>
public Complex32 MatrixNorm(Norm norm, Complex32[] matrix)
public Complex32 MatrixNorm(Norm norm, int rows, int columns, Complex32[] matrix)
{
throw new NotImplementedException();
}
@ -2050,13 +2052,15 @@ namespace MathNet.Numerics.Algorithms.LinearAlgebra.Mkl
/// Computes the requested <see cref="Norm"/> of the matrix.
/// </summary>
/// <param name="norm">The type of norm to compute.</param>
/// <param name="rows">The number of rows.</param>
/// <param name="columns">The number of columns.</param>
/// <param name="matrix">The matrix to compute the norm from.</param>
/// <param name="work">The work array. Only used when <see cref="Norm.InfinityNorm"/>
/// and needs to be have a length of at least M (number of rows of <paramref name="matrix"/>.</param>
/// <returns>
/// The requested <see cref="Norm"/> of the matrix.
/// </returns>
public Complex32 MatrixNorm(Norm norm, Complex32[] matrix, Complex32[] work)
public Complex32 MatrixNorm(Norm norm, int rows, int columns, Complex32[] matrix, Complex32[] work)
{
throw new NotImplementedException();
}
@ -2435,9 +2439,9 @@ namespace MathNet.Numerics.Algorithms.LinearAlgebra.Mkl
/// Solves A*X=B for X using a previously SVD decomposed matrix.
/// </summary>
/// <param name="columnsOfB">The number of columns of B.</param>
/// <param name="s">The s values returned by <see cref="SingularValueDecomposition(bool,MathNet.Numerics.Complex32[],MathNet.Numerics.Complex32[],MathNet.Numerics.Complex32[],MathNet.Numerics.Complex32[])"/>.</param>
/// <param name="u">The left singular vectors returned by <see cref="SingularValueDecomposition(bool,MathNet.Numerics.Complex32[],MathNet.Numerics.Complex32[],MathNet.Numerics.Complex32[],MathNet.Numerics.Complex32[])"/>.</param>
/// <param name="vt">The right singular vectors returned by <see cref="SingularValueDecomposition(bool,MathNet.Numerics.Complex32[],MathNet.Numerics.Complex32[],MathNet.Numerics.Complex32[],MathNet.Numerics.Complex32[])"/>.</param>
/// <param name="s">The s values returned by <see cref="SingularValueDecomposition(bool,Complex32[],Complex32[],Complex32[],Complex32[])"/>.</param>
/// <param name="u">The left singular vectors returned by <see cref="SingularValueDecomposition(bool,Complex32[],Complex32[],Complex32[],Complex32[])"/>.</param>
/// <param name="vt">The right singular vectors returned by <see cref="SingularValueDecomposition(bool,Complex32[],Complex32[],Complex32[],Complex32[])"/>.</param>
/// <param name="b">The B matrix.</param>
/// <param name="x">On exit, the solution matrix.</param>
public void SvdSolveFactored(int columnsOfB, Complex32[] s, Complex32[] u, Complex32[] vt, Complex32[] b, Complex32[] x)

20
src/Numerics/Algorithms/LinearAlgebra/NativeAlgebraProvider.include

@ -253,7 +253,7 @@ namespace MathNet.Numerics.Algorithms.LinearAlgebra.<#=library#>
/// <returns>
/// The requested <see cref="Norm"/> of the matrix.
/// </returns>
public double MatrixNorm(Norm norm, double[] matrix)
public double MatrixNorm(Norm norm, int rows, int columns, double[] matrix)
{
throw new NotImplementedException();
}
@ -268,7 +268,7 @@ namespace MathNet.Numerics.Algorithms.LinearAlgebra.<#=library#>
/// <returns>
/// The requested <see cref="Norm"/> of the matrix.
/// </returns>
public double MatrixNorm(Norm norm, double[] matrix, double[] work)
public double MatrixNorm(Norm norm, int rows, int columns, double[] matrix, double[] work)
{
throw new NotImplementedException();
}
@ -866,7 +866,7 @@ namespace MathNet.Numerics.Algorithms.LinearAlgebra.<#=library#>
/// <returns>
/// The requested <see cref="Norm"/> of the matrix.
/// </returns>
public float MatrixNorm(Norm norm, float[] matrix)
public float MatrixNorm(Norm norm, int rows, int columns, float[] matrix)
{
throw new NotImplementedException();
}
@ -881,7 +881,7 @@ namespace MathNet.Numerics.Algorithms.LinearAlgebra.<#=library#>
/// <returns>
/// The requested <see cref="Norm"/> of the matrix.
/// </returns>
public float MatrixNorm(Norm norm, float[] matrix, float[] work)
public float MatrixNorm(Norm norm, int rows, int columns, float[] matrix, float[] work)
{
throw new NotImplementedException();
}
@ -1479,7 +1479,7 @@ namespace MathNet.Numerics.Algorithms.LinearAlgebra.<#=library#>
/// <returns>
/// The requested <see cref="Norm"/> of the matrix.
/// </returns>
public Complex MatrixNorm(Norm norm, Complex[] matrix)
public Complex MatrixNorm(Norm norm, int rows, int columns, Complex[] matrix)
{
throw new NotImplementedException();
}
@ -1494,7 +1494,7 @@ namespace MathNet.Numerics.Algorithms.LinearAlgebra.<#=library#>
/// <returns>
/// The requested <see cref="Norm"/> of the matrix.
/// </returns>
public Complex MatrixNorm(Norm norm, Complex[] matrix, Complex[] work)
public Complex MatrixNorm(Norm norm, int rows, int columns, Complex[] matrix, Complex[] work)
{
throw new NotImplementedException();
}
@ -2088,11 +2088,13 @@ namespace MathNet.Numerics.Algorithms.LinearAlgebra.<#=library#>
/// Computes the requested <see cref="Norm"/> of the matrix.
/// </summary>
/// <param name="norm">The type of norm to compute.</param>
/// <param name="rows">The number of rows.</param>
/// <param name="columns">The number of columns.</param>
/// <param name="matrix">The matrix to compute the norm from.</param>
/// <returns>
/// The requested <see cref="Norm"/> of the matrix.
/// </returns>
public Complex32 MatrixNorm(Norm norm, Complex32[] matrix)
public Complex32 MatrixNorm(Norm norm, int rows, int columns, Complex32[] matrix)
{
throw new NotImplementedException();
}
@ -2101,13 +2103,15 @@ namespace MathNet.Numerics.Algorithms.LinearAlgebra.<#=library#>
/// Computes the requested <see cref="Norm"/> of the matrix.
/// </summary>
/// <param name="norm">The type of norm to compute.</param>
/// <param name="rows">The number of rows.</param>
/// <param name="columns">The number of columns.</param>
/// <param name="matrix">The matrix to compute the norm from.</param>
/// <param name="work">The work array. Only used when <see cref="Norm.InfinityNorm"/>
/// and needs to be have a length of at least M (number of rows of <paramref name="matrix"/>.</param>
/// <returns>
/// The requested <see cref="Norm"/> of the matrix.
/// </returns>
public Complex32 MatrixNorm(Norm norm, Complex32[] matrix, Complex32[] work)
public Complex32 MatrixNorm(Norm norm, int rows, int columns, Complex32[] matrix, Complex32[] work)
{
throw new NotImplementedException();
}

Loading…
Cancel
Save