1, 使用方法
1.1 源代码
#include <stdio.h>
//#include <lapack/lapacke.h>
extern void dgesv_(int*m, int* n, double*A, int*k, int*IP, double*B, int*j, int*info);#define M 2
#define N 2int main()
{int i, j, n=N, m=M;int info, IPIV[N];double A[M * N]= { 1, 2, 4, 2};double B[M*N] = {5, 4, 2.5, 2};dgesv_(&n, &n, A, &n, IPIV, B, &n, &info);for(j=0; j< 2*N; j++){printf("%f\t", B[j]);}printf("\n");return 0;
}
1.2 构建
gcc hello_gesv.c -o hello_gesv ../lapack-3.10.0/liblapack.a ../lapack-3.10.0/librefblas.a -lgfortran -lm
1.3 运行
2. 为什么
2.1 问题1 函数名为何是这样的 dgesv_
2.2 问题2 函数原型
为何是这样的extern void dgesv_(int*m, int* n, double*A, int*k, int*IP, double*B, int*j, int*info);
未完待续... ...