// dgesv.cc // 実一般行列の線形方程式を解く #include extern "C" { void dgesv_ ( const int& N, const int& NRHS, double** A, const int& LDA, int* IPIV, double** B, const int& LDB, int& INFO ); }; // 実一般行列 A の線形方程式 A x = b を解く簡易関数 // Input: A[N][N], b[N] Output: x[N] // template int dgesv( double A[N][N], double x[N], const double b[N] ) { int i, j, info; static int ipiv[N]; static double U[N][N]; for( j=0; j