Browse Source

removed redundant code in lapack.cpp, using gels for all qr solving (dropping gelsy)

v2
Marcus Cuda 14 years ago
parent
commit
d26d41e848
  1. 1238
      src/NativeWrappers/MKL/lapack.cpp
  2. 8
      src/NativeWrappers/Windows/MKLWrapperTests/MKLWrapperTests.csproj
  3. 9
      src/Numerics/Algorithms/LinearAlgebra/Mkl/MklLinearAlgebraProvider.Complex.cs
  4. 9
      src/Numerics/Algorithms/LinearAlgebra/Mkl/MklLinearAlgebraProvider.Complex32.cs
  5. 9
      src/Numerics/Algorithms/LinearAlgebra/Mkl/MklLinearAlgebraProvider.double.cs
  6. 9
      src/Numerics/Algorithms/LinearAlgebra/Mkl/MklLinearAlgebraProvider.float.cs
  7. 12
      src/Numerics/Algorithms/LinearAlgebra/Mkl/SafeNativeMethods.cs
  8. 2
      src/UnitTests/LinearAlgebraTests/Single/Factorization/QRTests.cs

1238
src/NativeWrappers/MKL/lapack.cpp

File diff suppressed because it is too large

8
src/NativeWrappers/Windows/MKLWrapperTests/MKLWrapperTests.csproj

@ -78,16 +78,16 @@
<Link>AssertHelpers.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\LinearAlgebraProviderTests\Complex32\LinearAlgebraProviderTests.cs">
<Link>LinearAlgebra\Complex32\LinearAlgebraProviderTests.cs</Link>
<Link>LinearAlgebraProviderTests\Complex32\LinearAlgebraProviderTests.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\LinearAlgebraProviderTests\Complex\LinearAlgebraProviderTests.cs">
<Link>LinearAlgebra\Complex\LinearAlgebraProviderTests.cs</Link>
<Link>LinearAlgebraProviderTests\Complex\LinearAlgebraProviderTests.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\LinearAlgebraProviderTests\Double\LinearAlgebraProviderTests.cs">
<Link>LinearAlgebra\Double\LinearAlgebraProviderTests.cs</Link>
<Link>LinearAlgebraProviderTests\Double\LinearAlgebraProviderTests.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\LinearAlgebraProviderTests\Single\LinearAlgebraProviderTests.cs">
<Link>LinearAlgebra\Single\LinearAlgebraProviderTests.cs</Link>
<Link>LinearAlgebraProviderTests\Single\LinearAlgebraProviderTests.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\LinearAlgebraTests\Complex32\DenseMatrixTests.cs">
<Link>LinearAlgebraTests\Complex32\DenseMatrixTests.cs</Link>

9
src/Numerics/Algorithms/LinearAlgebra/Mkl/MklLinearAlgebraProvider.Complex.cs

@ -740,14 +740,7 @@ namespace MathNet.Numerics.Algorithms.LinearAlgebra.Mkl
throw new ArgumentException(Resources.WorkArrayTooSmall, "work");
}
if (method == QRMethod.Full)
{
SafeNativeMethods.z_qr_solve(rows, columns, columnsB, a, b, x, work, work.Length);
}
else
{
SafeNativeMethods.z_thin_qr_solve(rows, columns, columnsB, a, b, x, work, work.Length);
}
SafeNativeMethods.z_qr_solve(rows, columns, columnsB, a, b, x, work, work.Length);
}
/// <summary>

9
src/Numerics/Algorithms/LinearAlgebra/Mkl/MklLinearAlgebraProvider.Complex32.cs

@ -739,14 +739,7 @@ namespace MathNet.Numerics.Algorithms.LinearAlgebra.Mkl
throw new ArgumentException(Resources.WorkArrayTooSmall, "work");
}
if (method == QRMethod.Full)
{
SafeNativeMethods.c_qr_solve(rows, columns, columnsB, a, b, x, work, work.Length);
}
else
{
SafeNativeMethods.c_thin_qr_solve(rows, columns, columnsB, a, b, x, work, work.Length);
}
SafeNativeMethods.c_qr_solve(rows, columns, columnsB, a, b, x, work, work.Length);
}
/// <summary>

9
src/Numerics/Algorithms/LinearAlgebra/Mkl/MklLinearAlgebraProvider.double.cs

@ -843,14 +843,7 @@ namespace MathNet.Numerics.Algorithms.LinearAlgebra.Mkl
throw new ArgumentException(Resources.WorkArrayTooSmall, "work");
}
if (method == QRMethod.Full)
{
SafeNativeMethods.d_qr_solve(rows, columns, columnsB, a, b, x, work, work.Length);
}
else
{
SafeNativeMethods.d_thin_qr_solve(rows, columns, columnsB, a, b, x, work, work.Length);
}
SafeNativeMethods.d_qr_solve(rows, columns, columnsB, a, b, x, work, work.Length);
}
/// <summary>

9
src/Numerics/Algorithms/LinearAlgebra/Mkl/MklLinearAlgebraProvider.float.cs

@ -743,14 +743,7 @@ namespace MathNet.Numerics.Algorithms.LinearAlgebra.Mkl
throw new ArgumentException(Resources.WorkArrayTooSmall, "work");
}
if (method == QRMethod.Full)
{
SafeNativeMethods.s_qr_solve(rows, columns, columnsB, a, b, x, work, work.Length);
}
else
{
SafeNativeMethods.s_thin_qr_solve(rows, columns, columnsB, a, b, x, work, work.Length);
}
SafeNativeMethods.s_qr_solve(rows, columns, columnsB, a, b, x, work, work.Length);
}
/// <summary>

12
src/Numerics/Algorithms/LinearAlgebra/Mkl/SafeNativeMethods.cs

@ -242,18 +242,6 @@ namespace MathNet.Numerics.Algorithms.LinearAlgebra.Mkl
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)]
internal static extern int z_qr_solve(int m, int n, int bn, Complex[] r, Complex[] b, [In, Out] Complex[] x, [In, Out] Complex[] work, int len);
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)]
internal static extern int s_thin_qr_solve(int m, int n, int bn, float[] r, float[] b, [In, Out] float[] x, [In, Out] float[] work, int len);
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)]
internal static extern int d_thin_qr_solve(int m, int n, int bn, double[] r, double[] b, [In, Out] double[] x, [In, Out] double[] work, int len);
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)]
internal static extern int c_thin_qr_solve(int m, int n, int bn, Complex32[] r, Complex32[] b, [In, Out] Complex32[] x, [In, Out] Complex32[] work, int len);
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)]
internal static extern int z_thin_qr_solve(int m, int n, int bn, Complex[] r, Complex[] b, [In, Out] Complex[] x, [In, Out] Complex[] work, int len);
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)]
internal static extern int s_qr_solve_factored(int m, int n, int bn, float[] r, float[] b, float[] tau, [In, Out] float[] x, [In, Out] float[] work, int len);

2
src/UnitTests/LinearAlgebraTests/Single/Factorization/QRTests.cs

@ -446,7 +446,7 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Single.Factorization
// Check the reconstruction.
for (var i = 0; i < order; i++)
{
AssertHelpers.AlmostEqual(vectorb[i], matrixBReconstruct[i], 9);
AssertHelpers.AlmostEqual(vectorb[i], matrixBReconstruct[i], 3);
}
// Make sure A didn't change.

Loading…
Cancel
Save