-
-
Notifications
You must be signed in to change notification settings - Fork 115
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
DigitalSetByAssociativeContainer #1023
DigitalSetByAssociativeContainer #1023
Conversation
Can someone have a look to this PR ? |
I review it. |
define digital sets from any associative container of the STL. For | ||
instance, using std::unordered_set (c++11) or boost::unordered_set (hash | ||
function based containers), speed-up up to 40% can be measured when | ||
processing digital set points. (David Coeurjolly, |
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.
"digital set points" => "digital sets"
Both compile errors are related to the concept check: |
Otherwise there are unrelated errors in Board3D. Was there a problem in the last PR merged ? |
The error in |
Ok.. I've switched the default DigitalSet as suggested and got plenty of issues which I'm fixing. BTW, many related issues has been raised because some DigitalSet adapters require more things than expected in the concept. For instance, ImageContainerMap< DigitalSetDomain < DigitalSet > > requires that the set has a reverse iterator which is not the case for DigitalSet models (as described in the concept). So yes i'm working on that and the PR is more bogus than it was. |
@JacquesOlivierLachaud for your issues, was C++11 activated ? |
(everything compiled perfectly on travis bot --ubuntu-gcc / macos-clang--) |
(when you have backtrace like that, please create a gist and add the link, otherwise the markdown interpretation pollutes everything) |
Yes cpp11 was activated. |
I have the same compilation issues with clang 3.5.0 and C++11 enabled, see https://gist.github.com/rolanddenis/18310385c470a3ac2827 |
okay... plenty of concept checks are missing or commented in DGtal... bunch of errors are raised changing the default DigitalSet model. Still working on it |
seems to be ok... @JacquesOlivierLachaud & @rolanddenis can you please check your compilers ? (FYI, iterator == const_iterator on associative containers is compiler version dependent.. 😢 ) |
Everything is fine with my compilers ;) |
cool.. waiting for @JacquesOlivierLachaud 's go and I merge |
It works now on my computer both with clang and g++, both in DEBUG and Release. Good PR since manything will get faster. I merge. |
DigitalSetByAssociativeContainer
Introduce a new model of digital sets using any associative container of the STL.
Basically, std::unordered_set (c++11) or boost::unordered_set (hash function based containers) can be used to store points of a digital set. Hence, just using this model of digital set speeds up the processing up to 40% (see benchmark results).
This PR also specializes std::hash and boost::hash with hash functions on DGtal points/vectors.
Once accepted, we could also remove DigitalSetBySTLSet and derive from DigitalSetByAssociativeContainer on specialized std::set container type.
Furthermore, I would suggest to change the default digital set type in StdDefs.h to a hash-map based container to get huge speed-ups in many DGtal and DGtaltools processes.