-
Notifications
You must be signed in to change notification settings - Fork 125
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
Dikin, Vaidya, John walk #88
Conversation
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.
Thanks Alex for your PR! I have a few comments.
R-proj/src/sample_points.cpp
Outdated
@@ -22,7 +24,8 @@ | |||
template <typename Polytope, typename RNGType, typename PointList, typename NT, typename Point> | |||
void sample_from_polytope(Polytope &P, RNGType &rng, PointList &randPoints, unsigned int const& walkL, unsigned int const& numpoints, | |||
bool const& gaussian, NT const& a, NT const& L, bool const& boundary, Point const& StartingPoint, unsigned int const& nburns, | |||
bool const& set_L, bool const& cdhr, bool const& rdhr, bool const& billiard, bool const& ball_walk) | |||
bool const& set_L, bool const& cdhr, bool const& rdhr, bool const& billiard, bool const& ball_walk, bool const& dikin, |
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 at least an enum
this list of bool
s is becoming too long
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.
Thanks. I have implemented it.
// Eigen::Dynamic>& cons_A, const Eigen::Matrix<Dtype, Eigen::Dynamic, 1>& cons_b, const Dtype r) : | ||
// Walker<Dtype>(initialization, cons_A, cons_b), r_(r){} | ||
|
||
void init(const Eigen::Matrix<Dtype, Eigen::Dynamic, 1> &initialization, const Eigen::Matrix <Dtype, |
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.
why not at construction time ?
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.
Thanks. I have removed the init function.
|
||
JohnWalker() {} | ||
|
||
//JohnWalker(const Eigen::Matrix<Dtype, Eigen::Dynamic, 1> &initialization, |
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.
similar as above
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.
done as above
#include <boost/random.hpp> | ||
#include <cmath> | ||
|
||
//namespace pwalk { |
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.
if not used remove it
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.
Thanks. I have removed all unused comments
} | ||
|
||
template <typename Dtype> | ||
Dtype gaussian_density(const Eigen::Matrix<Dtype, Eigen::Dynamic, 1>& x, const Eigen::Matrix<Dtype, Eigen::Dynamic, 1>& mu, const Eigen::Matrix<Dtype, Eigen::Dynamic, Eigen::Dynamic>& sqrt_cov) { |
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.
too long line
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 wrapped it among others.
sample_gaussian<Dtype>(this->nb_dim_, 0., 1., gaussian_step); | ||
|
||
// get hessian | ||
Eigen::Matrix <Dtype, Eigen::Dynamic, Eigen::Dynamic> new_sqrt_inv_hess = Eigen::Matrix<Dtype, Eigen::Dynamic, Eigen::Dynamic>::Zero( |
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 wrap long lines
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.
Thanks. I wrapped all long lines.
* implement dikin walk * implement john walk * implement vaidya walk * include random walk * add c++ wrappers for the ellipsoid random walks * update R interface for sampling and parameterized ellipsoid walks * update Rd files and roxygen comments * implement PR comments * use constructors in dikin,vaidya and john walks * improve implementations * improve computation of inner ball for H-polytopes * improve inner ball computation and improve tests * update termination criterions in rounding methods * update Rd file of Birkhoff R generator * improve univariate psrf implemetations * fix c++ tests * update parameters in rounding and minor improvements * fix gcc tests and improve birkhoff generator Rd file * fix c++ tests * update citations
This PR includes c++ and R wrappers for the three c++ implementations of vaidya walk, dikin walk and john walk in https://github.com/rzrsk/vaidya-walk.
sample_points.cpp
inR-proj/src
folder.