// zgbsv.cc // 複素帯行列の線形方程式を解く #include #include typedef std::complex Complex; extern "C" { void zgbsv_ ( const int& N, const int& KL, const int& KU, const int& NRHS, Complex** AB, const int& LDAB, int* IPIV, Complex** B, const int& LDB, int& INFO ); }; // 複素 3重 帯称行列 A の線形方程式 A x = b を解く簡易関数 // Input: A[3][N], b[N] Output: x[N] // A[1][N] に対角成分、A[0][N] に下副対角成分、A[2][N] に上副対角成分 // template int zgbsv3( Complex A[3][N], Complex x[N], Complex b[N] ) { int i, j, info; static int ipiv[N]; static Complex AB[N][N]; for( j=0; j int zgbsv5( Complex A[5][N], Complex x[N], Complex b[N] ) { int i, j, info; static int ipiv[N]; static Complex AB[N][N]; for( j=0; j