void SLHA_io::convert_symmetric_fermion_mixings_to_slha(Eigen::Array<double, N, 1>& m, Eigen::Matrix<std::complex<double>, N, N>& z) { for (int i = 0; i < N; i++) { // check if i'th row contains non-zero imaginary parts if (!is_zero(z.row(i).imag().cwiseAbs().maxCoeff())) { z.row(i) *= std::complex<double>(0.0,1.0); m(i) *= -1; } } }
void extractInternalFaces(const UnstructuredGrid& grid, Eigen::Array<int, Eigen::Dynamic, 1>& internal_faces, Eigen::Array<int, Eigen::Dynamic, 2, Eigen::RowMajor>& nbi) { typedef Eigen::Array<bool, Eigen::Dynamic, 1> OneColBool; typedef Eigen::Array<int, Eigen::Dynamic, 2, Eigen::RowMajor> TwoColInt; typedef Eigen::Array<bool, Eigen::Dynamic, 2, Eigen::RowMajor> TwoColBool; TwoColInt nb = faceCells(grid); // std::cout << "nb = \n" << nb << std::endl; // Extracts the internal faces of the grid. // These are stored in internal_faces. TwoColBool nbib = nb >= 0; OneColBool ifaces = nbib.rowwise().all(); const int num_internal = ifaces.cast<int>().sum(); // std::cout << num_internal << " internal faces." << std::endl; nbi.resize(num_internal, 2); internal_faces.resize(num_internal); int fi = 0; int nf = numFaces(grid); for (int f = 0; f < nf; ++f) { if (ifaces[f]) { internal_faces[fi] = f; nbi.row(fi) = nb.row(f); ++fi; } } }
void SLHA_io::convert_symmetric_fermion_mixings_to_hk(Eigen::Array<double, N, 1>& m, Eigen::Matrix<std::complex<double>, N, N>& z) { for (int i = 0; i < N; i++) { if (m(i) < 0.) { z.row(i) *= std::complex<double>(0.0,1.0); m(i) *= -1; } } }