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
Move implementation of implicit_function() into .cc file #13932
Move implementation of implicit_function() into .cc file #13932
Conversation
d57a795
to
ada3eb1
Compare
ada3eb1
to
5534994
Compare
This fixes part of #13926, but, in general, we need to avoid including any non-forwarded CGAL headers in our own headers to fully fix the problem. To that end - could you move |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also please rebase on top of master
now.
c16e551
to
be572d6
Compare
/rebuild |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
be572d6
to
8329385
Compare
8329385
to
eee8625
Compare
double facet_s = CGAL::parameters::is_default_parameter(true), | ||
double facet_d = CGAL::parameters::is_default_parameter(true), | ||
double cell_radius_edge_r = CGAL::parameters::is_default_parameter(true), | ||
double cell_s = CGAL::parameters::is_default_parameter(true)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I double checked this and I don't understand why these are the default values. In particular, in my installed copy of CGAL/boost/graph/Named_function_parameters.h
that function is defined as
bool inline is_default_parameter(const internal_np::Param_not_found&)
{
return true;
}
template <class T>
bool is_default_parameter(const T&)
{
return false;
}
i.e., these are always true
which will be converted to 1
- why do we do this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We also don't do this in 2D.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought this is what the CGAL::Mesh_criteria_3 uses as default values. We don't do this in 2d because in 2d we use Surface_mesh_criteria, which takes double values as input, and not named parameters. @fdrmrc, can you double check that this is actually the case? I seem to remember that the default should be something like cgal_ignored
, which is not the same as a default_parameter
when converted to double.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My original issue was that this ignored
value (also written in CGAL documentation) is not available in user codes. However, inside CGAL::Mesh_Criteria_3 they have:
which suggests to replace my CGAL::parameters::is_default_parameter(true)
with their default (doubles) values, as we're allowing only doubles so far. All cgal tests are still okay.
I've just rebased and force pushed this change, but I'm okay with other options as well. The best choice would clearly be to allow named parameters, but that is not something I can fix (and test) in next hours.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking at the lines you pointed out, I think we should replace the default values with std::limits::max for the first guy, and zero for all the others.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, that one was added in one the next PRs. I'll add it here now.
eee8625
to
469fca1
Compare
I can confirm that moving the CGAL headers into the one compilation unit reduces the bogus misleading indentation warning to one compilation unit. Incidentally this improves parsing and compilation of a lot of compilation units. In numbers: Compiling the entire library (debug configuration only, full dependencies) with this pull request took 5:59 min. Without this pull request I get 7:16 min. |
469fca1
to
2aa60d8
Compare
I believe it. We should try hard to avoid putting external library headers in our own headers for precisely this reason. |
…tion_implicit_function Move implementation of implicit_function() into .cc file
This moves the implementation of
GridGenerator::implicit_function()
inside grid_generator.cc and adds the corresponding stub.To fix some issues with headers, this depends on #13929 , only be572d6 should be looked at.