MCPcopy Create free account
hub / github.com/SZAILAB/MaterialDFT-Demo / first_columns

Function first_columns

cpp_core/src/davidson.cpp:1081–1096  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1079}
1080
1081std::vector<Complex> first_columns(
1082 const std::vector<Complex>& matrix,
1083 int rows,
1084 int cols,
1085 int keep_cols
1086) {
1087 (void)cols;
1088 std::vector<Complex> out(static_cast<std::size_t>(rows) * keep_cols, Complex{0.0, 0.0});
1089 for (int col = 0; col < keep_cols; ++col) {
1090 for (int row = 0; row < rows; ++row) {
1091 out[static_cast<std::size_t>(row + rows * col)] =
1092 matrix[static_cast<std::size_t>(row + rows * col)];
1093 }
1094 }
1095 return out;
1096}
1097
1098} // anonymous namespace
1099

Calls

no outgoing calls

Tested by

no test coverage detected