void GreenIntegrand::CalculateOriginalIntegrand(const VectorXd &x, VectorXcd &y) const { y.resize(dim_out()); complex_t Hband; getHband(x, Hband, SK, H); for (int L = 0; L < MSIZE; ++L) { y(L) = 1. / (w + mu - Hband - SE(L)); } }
void HIntegrand::CalculateOriginalIntegrand(const VectorXd &x, VectorXcd &y) const { complex_t Hband, Hpow = 1.; y.resize(dim_out()); y.setZero(); getHband(x, Hband, SK, Hf); for (int n = 0; n < N_order; ++n) { Hpow *= Hband; for (int i = 0; i < MSIZE; ++i) y(MSIZE*n+i) = Hpow; } }
void EigsGen::eigenvalueSchur(const MatrixXd &Rm, VectorXcd &result) { int m = Rm.cols(); if(result.size() != m) result.resize(m); for(int i = 0; i < m; i++) { if(i == m - 1 || fabs(Rm(i + 1, i)) < 1e-16) { result[i] = std::complex<double>(Rm(i, i), 0); } else { result[i] = eigenvalue2x2(Rm(i, i), Rm(i, i + 1), Rm(i + 1, i), Rm(i + 1, i + 1)); i++; result[i] = conj(result[i - 1]); } } }