mirror of https://github.com/CGAL/cgal
Use 'if' rather than %
This commit is contained in:
parent
96f698ca09
commit
270a2398d6
|
|
@ -993,7 +993,7 @@ Triangulation<TT, TDS>
|
||||||
// Otherwise, let's find the right infinite cell
|
// Otherwise, let's find the right infinite cell
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
inf_v_cell = inf_v_cell->neighbor((inf_v_index + 1) % 2);
|
inf_v_cell = inf_v_cell->neighbor((inf_v_index + 1) & 1);
|
||||||
inf_v_index = inf_v_cell->index(infinite_vertex());
|
inf_v_index = inf_v_cell->index(infinite_vertex());
|
||||||
// Is "inf_v_cell" the right infinite cell?
|
// Is "inf_v_cell" the right infinite cell?
|
||||||
// Then inf_v_index should be 1
|
// Then inf_v_index should be 1
|
||||||
|
|
@ -1096,9 +1096,14 @@ Triangulation<TT, TDS>
|
||||||
// For the remembering stochastic walk, we need to start trying
|
// For the remembering stochastic walk, we need to start trying
|
||||||
// with a random index:
|
// with a random index:
|
||||||
int j, i = rng_.get_int(0, cur_dim);
|
int j, i = rng_.get_int(0, cur_dim);
|
||||||
// we check |p| against all the full_cell's hyperplanes in turn
|
|
||||||
|
|
||||||
for(j = 0; j <= cur_dim; ++j, i = (i + 1) % (cur_dim + 1) )
|
// i = (i + 1) % m where 0 <= i < m
|
||||||
|
auto incr_mod = [] (int&i, int m) {
|
||||||
|
if( ++i >= m ) i = 0; // >= or ==
|
||||||
|
};
|
||||||
|
|
||||||
|
// we check |p| against all the full_cell's hyperplanes in turn
|
||||||
|
for(j = 0; j <= cur_dim; ++j, incr_mod(i, cur_dim + 1))
|
||||||
{
|
{
|
||||||
Full_cell_handle next = s->neighbor(i);
|
Full_cell_handle next = s->neighbor(i);
|
||||||
if( previous == next )
|
if( previous == next )
|
||||||
|
|
@ -1127,6 +1132,9 @@ Triangulation<TT, TDS>
|
||||||
// full_cell because orientation_[i] == NEGATIVE
|
// full_cell because orientation_[i] == NEGATIVE
|
||||||
previous = s;
|
previous = s;
|
||||||
s = next;
|
s = next;
|
||||||
|
// We only need to test is_infinite(next->vertex(next->index(previous)))
|
||||||
|
// or equivalently is_infinite(next->vertex(previous->mirror_index(i)))
|
||||||
|
// but it does not seem to help, even when storing mirror indices.
|
||||||
if( is_infinite(next) )
|
if( is_infinite(next) )
|
||||||
{ // we have arrived OUTSIDE the convex hull of the triangulation,
|
{ // we have arrived OUTSIDE the convex hull of the triangulation,
|
||||||
// so we stop the search
|
// so we stop the search
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue