Skip to content
Snippets Groups Projects
Verified Commit 0a77b825 authored by Michaël El Kharroubi's avatar Michaël El Kharroubi :satellite:
Browse files

Format

parent 2186c6e4
No related branches found
No related tags found
No related merge requests found
......@@ -21,15 +21,14 @@ void stepSlow(Matrix<T> &current, Matrix<T> &next) {
nxt = next.dataSpan(),
cols](int i) {
auto idxs_cols = std::views::iota(1, cols - 1);
std::for_each(
idxs_cols.begin(), idxs_cols.end(),
[cur, nxt, cols, row = i * cols](int j) {
auto idx = row + j; // we need a 1d index for the spans
nxt[idx] = 0.25 * (cur[idx - 1] +
cur[idx + 1] +
cur[idx - cols] +
cur[idx + cols]);
});
std::for_each(idxs_cols.begin(), idxs_cols.end(),
[cur, nxt, cols, row = i * cols](int j) {
auto idx = row + j; // we need a 1d index for the spans
nxt[idx] = 0.25 * (cur[idx - 1] +
cur[idx + 1] +
cur[idx - cols] +
cur[idx + cols]);
});
});
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment