// zhesv.cc // 複素エルミート行列の線形方程式を解く #include #include typedef std::complex Complex; extern "C" { void zhesv_ ( const char& UPLO, const int& N, const int& NRHS, Complex** A, const int& LDA, int* IPIV, Complex** B, const int& LDB, Complex* WORK, const int& LWORK, int& INFO, int UPLOlen ); }; // 複素エルミート行列 A の線形方程式 A x = b を解く簡易関数 // Input: A[N][N], b[N] Output: x[N] // ただし、A[i][j<=i] の下三角しか参照されない // template int zhesv( Complex A[N][N], Complex x[N], Complex b[N] ) { int i, j, info; static int ipiv[N]; static Complex work[4*N]; static Complex U[N][N]; for( i=0; i