Skip to content

Commit

Permalink
temporary fix to failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lucaperju committed Aug 7, 2024
1 parent 725606b commit c61c4bd
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
10 changes: 8 additions & 2 deletions include/convex_bodies/hpolytope.h
Original file line number Diff line number Diff line change
Expand Up @@ -974,7 +974,7 @@ class HPolytope {
normalized = true;
}

void compute_reflection(Point& v, Point& p, int const& facet) const
void compute_reflection(Point& v, Point const&, int const& facet) const
{
v += -2 * v.dot(A.row(facet)) * A.row(facet);
}
Expand Down Expand Up @@ -1009,7 +1009,13 @@ class HPolytope {
}

template <typename update_parameters>
void compute_reflection(Point &v, Point &p, update_parameters const& params) const {
void compute_reflection(Point &v, Point const&, update_parameters const& params) const {
Point a((-2.0 * params.inner_vi_ak) * A.row(params.facet_prev));
v += a;
}

template <typename update_parameters>
void compute_reflection_abw(Point &v, Point &p, update_parameters const& params) const {
if constexpr (std::is_same<MT, Eigen::SparseMatrix<NT, Eigen::RowMajor>>::value) { // MT must be in RowMajor format
NT* v_data = v.pointerToData();
NT* p_data = p.pointerToData();
Expand Down
8 changes: 4 additions & 4 deletions include/random_walks/uniform_accelerated_billiard_walk.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ struct AcceleratedBilliardWalk
_p += (_lambda_prev * _v);
}
T -= _lambda_prev;
P.compute_reflection(_v, _p, _update_parameters);
P.compute_reflection_abw(_v, _p, _update_parameters);
it++;

while (it < _rho)
Expand All @@ -177,7 +177,7 @@ struct AcceleratedBilliardWalk
_p += (_lambda_prev * _v);
}
T -= _lambda_prev;
P.compute_reflection(_v, _p, _update_parameters);
P.compute_reflection_abw(_v, _p, _update_parameters);
it++;
}
_p += _update_parameters.moved_dist * _v;
Expand Down Expand Up @@ -298,7 +298,7 @@ struct AcceleratedBilliardWalk
_lambda_prev = dl * pbpair.first;
_p += (_lambda_prev * _v);
T -= _lambda_prev;
P.compute_reflection(_v, _p, _update_parameters);
P.compute_reflection_abw(_v, _p, _update_parameters);

while (it <= _rho)
{
Expand All @@ -316,7 +316,7 @@ struct AcceleratedBilliardWalk
_lambda_prev = dl * pbpair.first;
_p += (_lambda_prev * _v);
T -= _lambda_prev;
P.compute_reflection(_v, _p, _update_parameters);
P.compute_reflection_abw(_v, _p, _update_parameters);
it++;
}
}
Expand Down

0 comments on commit c61c4bd

Please sign in to comment.