Browse Source

started lu solve

la-knuth
Marcus Cuda 16 years ago
parent
commit
4628fc4de6
  1. 55
      src/NativeWrappers/MKL/lapack.cpp
  2. 23
      src/Numerics/Algorithms/LinearAlgebra/safe.native.common.include

55
src/NativeWrappers/MKL/lapack.cpp

@ -221,7 +221,7 @@ extern "C" {
}
}
DLLEXPORT void s_lu_solve(int n, int nrhs, float a[], int ipiv[], float b[])
DLLEXPORT void s_lu_solve_factored(int n, int nrhs, float a[], int ipiv[], float b[])
{
int info;
int i;
@ -236,7 +236,7 @@ extern "C" {
}
}
DLLEXPORT void d_lu_solve(int n, int nrhs, double a[], int ipiv[], double b[])
DLLEXPORT void d_lu_solve_factored(int n, int nrhs, double a[], int ipiv[], double b[])
{
int info;
int i;
@ -251,7 +251,7 @@ extern "C" {
}
}
DLLEXPORT void c_lu_solve(int n, int nrhs, MKL_Complex8 a[], int ipiv[], MKL_Complex8 b[])
DLLEXPORT void c_lu_solve_factored(int n, int nrhs, MKL_Complex8 a[], int ipiv[], MKL_Complex8 b[])
{
int info;
int i;
@ -266,7 +266,7 @@ extern "C" {
}
}
DLLEXPORT void z_lu_solve(int n, int nrhs, MKL_Complex16 a[], int ipiv[], MKL_Complex16 b[])
DLLEXPORT void z_lu_solve_factored(int n, int nrhs, MKL_Complex16 a[], int ipiv[], MKL_Complex16 b[])
{
int info;
int i;
@ -281,7 +281,52 @@ extern "C" {
}
}
DLLEXPORT void s_cholesky_solve(int n, int nrhs, float a[], float b[])
DLLEXPORT void s_lu_solve(int n, int nrhs, float a[], float b[])
{
int* ipiv = new int[n];
int info;
SGETRF(&n,&n,a,&n,ipiv,&info);
char trans = 'N';
SGETRS(&trans, &n, &nrhs, a, &n, ipiv, b, &n, &info);
delete[] ipiv;
}
DLLEXPORT void d_lu_solve(int n, int nrhs, double a[], double b[])
{
int* ipiv = new int[n];
int info;
DGETRF(&n,&n,a,&n,ipiv,&info);
char trans = 'N';
DGETRS(&trans, &n, &nrhs, a, &n, ipiv, b, &n, &info);
delete[] ipiv;
}
DLLEXPORT void c_lu_solve(int n, int nrhs, MKL_Complex8 a[], MKL_Complex8 b[])
{
int* ipiv = new int[n];
int info;
CGETRF(&n,&n,a,&n,ipiv,&info);
char trans = 'N';
CGETRS(&trans, &n, &nrhs, a, &n, ipiv, b, &n, &info);
delete[] ipiv;
}
DLLEXPORT void z_lu_solve(int n, int nrhs, MKL_Complex16 a[], MKL_Complex16 b[])
{
int* ipiv = new int[n];
int info;
ZGETRF(&n,&n,a,&n,ipiv,&info);
char trans = 'N';
ZGETRS(&trans, &n, &nrhs, a, &n, ipiv, b, &n, &info);
delete[] ipiv;
}
DLLEXPORT void s_cholesky_solve(int n, int nrhs, float a[], float b[])
{
char uplo = 'L';
int info = 0;

23
src/Numerics/Algorithms/LinearAlgebra/safe.native.common.include

@ -161,4 +161,27 @@ namespace MathNet.Numerics.Algorithms.LinearAlgebra.<#= namespaceSuffix #>
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)]
internal static extern void z_lu_inverse_factored(int n, [In, Out] Complex[] a, [In, Out] int[] ipiv, [In, Out] Complex[] work, int lwork);
/* [DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)]
internal static extern void s_lu_solve_factored(int n, int nrhs, float a[], int ipiv[], float b[])
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)]
internal static extern void d_lu_solve_factored(int n, int nrhs, double a[], int ipiv[], double b[])
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)]
internal static extern void c_lu_solve_factored(int n, int nrhs, MKL_Complex8 a[], int ipiv[], MKL_Complex8 b[])
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)]
internal static extern void z_lu_solve_factored(int n, int nrhs, MKL_Complex16 a[], int ipiv[], MKL_Complex16 b[])
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)]
internal static extern void s_lu_solve(int n, int nrhs, float a[], float b[])
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)]
internal static extern void d_lu_solve(int n, int nrhs, double a[], double b[])
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)]
internal static extern void c_lu_solve(int n, int nrhs, MKL_Complex8 a[], MKL_Complex8 b[])
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)]
internal static extern void z_lu_solve(int n, int nrhs, MKL_Complex16 a[], MKL_Complex16 b[])*/
#endregion LAPACK

Loading…
Cancel
Save