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