Skip to content

Commit

Permalink
Merge pull request #950 from isivigno/patchSmartCH
Browse files Browse the repository at this point in the history
Patch SmartCH
  • Loading branch information
dcoeurjo committed Apr 7, 2015
2 parents acfd210 + 794a6e8 commit a5f1f29
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 11 deletions.
2 changes: 2 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@
- Fix bug of method ArithmeticalDSL::getPoint with negative values
of positions as input arguments.
(Tristan Roussillon, [#944](https://github.com/DGtal-team/DGtal/pull/944))
- Fix too restrictive asserts of methods ArithmeticalDSSConvexHull::smartCH and ArithmeticalDSSConvexHull::smartCHNextVertex to enable negative positions as input arguments. (Isabelle Sivignon, [#950](https://github.com/DGtal-team/DGtal/pull/950))
- Fix Bezout Vector computation (Isabelle Sivignon,
[#948](https://github.com/DGtal-team/DGtal/pull/948))
- Fix issues with SphereFitting and TensorVoting local estimators on
Expand All @@ -105,6 +106,7 @@
- Change in the mesh export in OFF format: now it tries by default to export colors (if stored).
(Bertrand Kerautret, [#985](https://github.com/DGtal-team/DGtal/pull/985))


# DGtal 0.8


Expand Down
3 changes: 1 addition & 2 deletions src/DGtal/geometry/curves/ArithmeticalDSSConvexHull.ih
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ smartCH(const PointVector& aFirstPoint,
BOOST_STATIC_ASSERT(( ConceptUtils::SameType<Position, typename PositionFunctor::Position>::value ));
BOOST_CONCEPT_ASSERT(( boost_concepts::IncrementableIteratorConcept<OutputIterator> ));
BOOST_CONCEPT_ASSERT(( boost_concepts::WritableIteratorConcept<OutputIterator,PointVector> ));
ASSERT( aPositionBound > NumberTraits<Position>::ZERO );


//----------------- init --------------------//
//functors
Expand Down Expand Up @@ -165,7 +165,6 @@ smartCHNextVertex(const Position& positionBound,
const TruncationFunctor1& f1,
const TruncationFunctor2& f2)
{
ASSERT( positionBound > NumberTraits<Position>::ZERO );
ASSERT( rV != NumberTraits<Coordinate>::ZERO );
ASSERT( ((V[0]*(X-Y)[1] - V[1]*(X-Y)[0]) == 1)||
((V[0]*(X-Y)[1] - V[1]*(X-Y)[0]) == -1) );
Expand Down
19 changes: 10 additions & 9 deletions tests/geometry/curves/testArithmeticalDSSConvexHull.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -423,15 +423,16 @@ bool comparisonSubsegment(typename DSL::Coordinate a, typename DSL::Coordinate b
DSL aDSL(a, b, 0);
for (typename DSL::Integer mu = 0; ( (mu-1 >= -aDSL.omega())&&(nbok == nb) ); --mu)
{
trace.info() << "mu=" << mu << std::endl;

for (typename DSL::Position l = 1; ( (l <= 2*aDSL.patternLength())&&(nbok == nb) ); ++l)
{
trace.info() << "l=" << l << std::endl;

if (comparisonSubsegment(DSL(a, b, mu), 0, l))
nbok++;
nb++;
//trace.info() << "mu=" << mu << std::endl;

for (typename DSL::Position f = -2*aDSL.patternLength(); ( (f <= 2*aDSL.patternLength())&&(nbok == nb) ); ++f)
for (typename DSL::Position l = 1; ( (l <= 2*aDSL.patternLength())&&(nbok == nb) ); ++l)
{
//trace.info() << "f=" << f << " l=" << l << std::endl;

if (comparisonSubsegment(DSL(a, b, mu), f, f+l))
nbok++;
nb++;
}

}
Expand Down

0 comments on commit a5f1f29

Please sign in to comment.