Skip to content

[linalg] formatting for loop in example #6962

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions source/numerics.tex
Original file line number Diff line number Diff line change
Expand Up @@ -12327,7 +12327,7 @@
void test_scaled(mdspan<double, extents<int, 10>> x)
{
auto x_scaled = scaled(5.0, x);
for(int i = 0; i < x.extent(0); ++i) {
for (int i = 0; i < x.extent(0); ++i) {
assert(x_scaled[i] == 5.0 * x[i]);
}
}
Expand Down Expand Up @@ -12486,22 +12486,22 @@
\begin{codeblock}
void test_conjugated_complex(mdspan<complex<double>, extents<int, 10>> a) {
auto a_conj = conjugated(a);
for(int i = 0; i < a.extent(0); ++i) {
for (int i = 0; i < a.extent(0); ++i) {
assert(a_conj[i] == conj(a[i]);
}
auto a_conj_conj = conjugated(a_conj);
for(int i = 0; i < a.extent(0); ++i) {
for (int i = 0; i < a.extent(0); ++i) {
assert(a_conj_conj[i] == a[i]);
}
}

void test_conjugated_real(mdspan<double, extents<int, 10>> a) {
auto a_conj = conjugated(a);
for(int i = 0; i < a.extent(0); ++i) {
for (int i = 0; i < a.extent(0); ++i) {
assert(a_conj[i] == a[i]);
}
auto a_conj_conj = conjugated(a_conj);
for(int i = 0; i < a.extent(0); ++i) {
for (int i = 0; i < a.extent(0); ++i) {
assert(a_conj_conj[i] == a[i]);
}
}
Expand Down Expand Up @@ -12791,8 +12791,8 @@
assert(a.stride(0) == a_t.stride(1));
assert(a.stride(1) == a_t.stride(0));

for(size_t row = 0; row < num_rows; ++row) {
for(size_t col = 0; col < num_rows; ++col) {
for (size_t row = 0; row < num_rows; ++row) {
for (size_t col = 0; col < num_rows; ++col) {
assert(a[row, col] == a_t[col, row]);
}
}
Expand All @@ -12803,8 +12803,8 @@
assert(a.stride(0) == a_t_t.stride(0));
assert(a.stride(1) == a_t_t.stride(1));

for(size_t row = 0; row < num_rows; ++row) {
for(size_t col = 0; col < num_rows; ++col) {
for (size_t row = 0; row < num_rows; ++row) {
for (size_t col = 0; col < num_rows; ++col) {
assert(a[row, col] == a_t_t[row, col]);
}
}
Expand Down Expand Up @@ -12843,8 +12843,8 @@
assert(a.stride(0) == a_ct.stride(1));
assert(a.stride(1) == a_ct.stride(0));

for(size_t row = 0; row < num_rows; ++row) {
for(size_t col = 0; col < num_rows; ++col) {
for (size_t row = 0; row < num_rows; ++row) {
for (size_t col = 0; col < num_rows; ++col) {
assert(a[row, col] == conj(a_ct[col, row]));
}
}
Expand All @@ -12855,8 +12855,8 @@
assert(a.stride(0) == a_ct_ct.stride(0));
assert(a.stride(1) == a_ct_ct.stride(1));

for(size_t row = 0; row < num_rows; ++row) {
for(size_t col = 0; col < num_rows; ++col) {
for (size_t row = 0; row < num_rows; ++row) {
for (size_t col = 0; col < num_rows; ++col) {
assert(a[row, col] == a_ct_ct[row, col]);
assert(conj(a_ct[col, row]) == a_ct_ct[row, col]);
}
Expand Down