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

Remove more boost usage and replace with C++11 equivalents. #105

Merged
merged 2 commits into from
Mar 25, 2016
Merged

Conversation

mamoll
Copy link
Member

@mamoll mamoll commented Mar 24, 2016

Note: BVH_Model has a copy constructor, so having it derive from boost::noncopyable makes no sense. We can delete the copy assignment operator, if desired.
Only remaining boost usage in include/ and src/ is boost::dynamic_bitset. Use std::vector instead?

Note: BVH_Model has a copy constructor, so having it derive from boost::noncopyable makes no sense. We can delete the copy assignment operator, if desired.
Only remaining boost usage in include/ and src/ is boost::dynamic_bitset. Use std::vector<bool> instead?
@sherm1
Copy link
Member

sherm1 commented Mar 24, 2016

This is great, Mark! I'll try it on Windows.

@sherm1
Copy link
Member

sherm1 commented Mar 24, 2016

Only remaining boost usage in include/ and src/ is boost::dynamic_bitset. Use std::vector instead?

It would be easier if it could be replaced by std::bitset although that requires a compile-time size. However, it looks to me as though it is only used as a specialization of morton_functor, which requires the size to be provided at construction and then doesn't allow that size to be changed dynamically. And then that specialization isn't used in FCL except in a test case, where a constant size is used. The bitset specialization of morton_functor could make bit_num a template argument.

Does anyone know if there is an actual requirement for a dynamically-sized morton code? Jia, do you remember why this is using dynamic_bitset and whether that is required? @panjia1983

@isucan
Copy link
Contributor

isucan commented Mar 24, 2016

+1 for merging!

@sherm1
Copy link
Member

sherm1 commented Mar 25, 2016

Works fine in Windows (64 bit VS 2015, both Release and Debug). I'm seeing:

  • boost::dynamic_bitset in broadphase/morton.h

And in test:

  • boost::unit_test
  • boost::timer
  • boost::filesystem
  • boost::dynamic_bitset

And nothing else!

Ready to merge this PR.

@@ -222,7 +222,7 @@ void fcl::tools::Profiler::printThreadInfo(std::ostream &out, const PerThread &d
{
const AvgInfo &a = data.avg.find(avg[i].name)->second;
out << avg[i].name << ": " << avg[i].value << " (stddev = " <<
sqrt(fabs(a.totalSqr - (double)a.parts * avg[i].value * avg[i].value) / ((double)a.parts - 1.)) << ")" << std::endl;
sqrt(std::fabs(a.totalSqr - (double)a.parts * avg[i].value * avg[i].value) / ((double)a.parts - 1.)) << ")" << std::endl;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be std::abs rather than std::fabs.

@sherm1 sherm1 merged commit 0eeb075 into flexible-collision-library:master Mar 25, 2016
@jslee02 jslee02 added this to the FCL 0.5.0 milestone Mar 25, 2016
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 this pull request may close these issues.

None yet

4 participants