-
Notifications
You must be signed in to change notification settings - Fork 121
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
Sparse optimizations for UniformABW sampling #329
Conversation
include/convex_bodies/hpolytope.h
Outdated
/*if(ans.first < 0.00000001) { | ||
std::cout << "distance of 0 found" << std::endl; | ||
exit(0); | ||
}*/ |
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.
Do we need these lines?
const double eps = 0.000000001; | ||
|
||
template<typename NT> | ||
class Heap { |
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.
Does it make sense to rename it to BoundaryOracleHeap
?
typename Point::Coeff b = P.get_vec(); | ||
NT* b_data = b.data(); |
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.
since be the vector b doesn't change, why don't you initialize the b_data
before the loop?
const double eps = 0.000000001; | ||
|
||
template<typename NT> | ||
class Heap { |
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.
Could you please add a few lines of comments to briefly explain what does this data structure does?
You could add what is the improvement it gives regarding the previous implementation.
Don't be afraid to add some equations to help your explanation, e.g., how Av and Ar are updated now etc.
Hi @lucaperju! This is a really high quality PR! Thanks a lot!
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #329 +/- ##
===========================================
+ Coverage 56.95% 57.32% +0.37%
===========================================
Files 114 114
Lines 7155 7241 +86
Branches 3215 3236 +21
===========================================
+ Hits 4075 4151 +76
+ Misses 978 976 -2
- Partials 2102 2114 +12
|
#include <set> | ||
#include <vector> | ||
|
||
const double eps = 0.0000000001; |
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.
please use scientifuc notation of const double eps = 1e-XY
optimized the complexity of the reflection when the A matrix is sparse
Sampled 1000 points from the same order polytope with the same seed using both sparse and dense abw, here are the last 2 points:
Dense:
0.947133 0.13444 0.417853 0.499325 0.995814 0.775422 0.728527 0.715522 0.0377974 0.428896
0.708553 0.119995 0.224509 0.549352 0.919391 0.649939 0.648627 0.55607 0.0863634 0.500581
Sparse:
0.947133 0.13444 0.417853 0.499325 0.995814 0.775422 0.728527 0.715522 0.0377974 0.428896
0.708553 0.119995 0.224509 0.549352 0.919391 0.649939 0.648627 0.55607 0.0863634 0.500581
points_sparse.txt
points_dense.txt