Skip to content
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

Looping over an empty domain results in entering into the loop #88

Closed
EmilyBourne opened this issue Nov 11, 2022 · 0 comments · Fixed by #89
Closed

Looping over an empty domain results in entering into the loop #88

EmilyBourne opened this issue Nov 11, 2022 · 0 comments · Fixed by #89

Comments

@EmilyBourne
Copy link
Collaborator

In the following code:

DiscreteDomain<BSplines> const dom_bsplines_singular(
            DiscreteElement<BSplines>(0),
            DiscreteVector<BSplines>(BSplines::n_singular_basis()));
Chunk<double, DiscreteDomain<BSplines>> singular_spline_coef(dom_bsplines_singular);
for_each(singular_spline_coef.domain(), [&](DiscreteElement<BSplines> const i) {
    singular_spline_coef(i) = 1.0;
});

where n_singular_basis() returns 0, the loop is entered resulting in a seg fault at the line singular_spline_coef(i) = 1.0;

@tpadioleau tpadioleau linked a pull request Nov 11, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant