DGtal 1.3.0
|
#include <iostream>
#include "DGtal/base/Common.h"
#include "DGtal/geometry/curves/ArithmeticalDSL.h"
#include "DGtal/geometry/curves/ArithmeticalDSSConvexHull.h"
#include "DGtal/geometry/curves/ArithmeticalDSS.h"
#include "DGtal/kernel/SpaceND.h"
#include "DGtal/kernel/NumberTraits.h"
#include "DGtal/arithmetic/LatticePolytope2D.h"
Go to the source code of this file.
Functions | |
template<typename DSL > | |
bool | basicTest (const DSL &aDSL) |
template<typename DSL > | |
bool | basicTest (typename DSL::Coordinate a, typename DSL::Coordinate b) |
bool | testWithoutLengthConstraint () |
template<typename DSL > | |
bool | comparisonLeftHull (typename DSL::Coordinate a, typename DSL::Coordinate b) |
bool | testWithLengthConstraint () |
template<typename DSL > | |
DSL | smartCHSubsegment (const DSL &aDSL, typename DSL::Position x, typename DSL::Position y) |
template<typename DSL > | |
DSL | trivialSubsegment (const DSL &aDSL, typename DSL::Position x, typename DSL::Position y) |
template<typename DSL > | |
bool | comparisonSubsegment (const DSL &aDSL, typename DSL::Position x, typename DSL::Position y) |
template<typename DSL > | |
bool | comparisonSubsegment (typename DSL::Coordinate a, typename DSL::Coordinate b) |
bool | testSubsegment () |
template<typename DSL > | |
bool | basicTest2 (const DSL &aDSL) |
template<typename DSL > | |
bool | basicTest2 (typename DSL::Coordinate a, typename DSL::Coordinate b) |
bool | testWithoutLengthConstraint2 () |
template<typename DSS > | |
DSS::DSL | reversedSmartCHSubsegment (const DSS &aDSS, typename DSS::Position aBound) |
template<typename DSS > | |
bool | comparisonSubsegment2 (const DSS &aDSS, typename DSS::Position aBound) |
template<typename DSL > | |
bool | comparisonSubsegment2 (typename DSL::Coordinate a, typename DSL::Coordinate b) |
bool | testSubsegment2 () |
int | main (int argc, char **argv) |
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.
Functions for testing class ArithmeticalDSSConvexHull.
This file is part of the DGtal library.
Definition in file testArithmeticalDSSConvexHull.cpp.
bool basicTest | ( | const DSL & | aDSL | ) |
Applies smartCH on a segment starting from (0,0) and contained in a given arithmetical DSL
aDSL | any DSL |
DSL | an arithmeticalDSS type (either naive or standard) |
Definition at line 61 of file testArithmeticalDSSConvexHull.cpp.
References DGtal::Trace::beginBlock(), DGtal::Trace::endBlock(), DGtal::Trace::info(), DGtal::functions::smartCH(), and DGtal::trace.
Referenced by basicTest(), main(), and testWithoutLengthConstraint().
bool basicTest | ( | typename DSL::Coordinate | a, |
typename DSL::Coordinate | b | ||
) |
Applies smartCH on a segment starting from (0,0) and contained in a naive DSL of slope a, b with various intercepts
a | numerator of the slope |
b | denominator of the slope |
DSL | an arithmeticalDSL type (either naive or standard) |
Definition at line 117 of file testArithmeticalDSSConvexHull.cpp.
References basicTest().
bool basicTest2 | ( | const DSL & | aDSL | ) |
Applies reversedSmartCH on a segment starting from (0,0) and contained in a given arithmetical DSL
aDSL | any DSL |
DSL | an arithmeticalDSL type (either naive or standard) |
Definition at line 499 of file testArithmeticalDSSConvexHull.cpp.
References DGtal::Trace::beginBlock(), DGtal::Trace::endBlock(), DGtal::Trace::info(), DGtal::functions::reversedSmartCH(), and DGtal::trace.
Referenced by basicTest2(), and testWithoutLengthConstraint2().
bool basicTest2 | ( | typename DSL::Coordinate | a, |
typename DSL::Coordinate | b | ||
) |
Applies reversedSmartCH on a segment starting from (0,0) and contained in a naive DSL of slope a, b with various intercepts
a | numerator of the slope |
b | denominator of the slope |
DSL | an arithmeticalDSL type (either naive or standard) |
Definition at line 554 of file testArithmeticalDSSConvexHull.cpp.
References basicTest2().
bool comparisonLeftHull | ( | typename DSL::Coordinate | a, |
typename DSL::Coordinate | b | ||
) |
Compares smartCH to the algorithm of Charrier and Buzer, implemented in LatticePolytope2D.
a | (positive) numerator of the slope |
b | (positive) denominator of the slope |
DSL | an arithmeticalDSL type (either naive or standard) |
Definition at line 196 of file testArithmeticalDSSConvexHull.cpp.
References DGtal::Trace::beginBlock(), DGtal::Trace::endBlock(), DGtal::Trace::info(), DGtal::functions::smartCH(), and DGtal::trace.
Referenced by testWithLengthConstraint().
bool comparisonSubsegment | ( | const DSL & | aDSL, |
typename DSL::Position | x, | ||
typename DSL::Position | y | ||
) |
Compares smartCH to the classical incremental recognition algorithm for one subgement of a given DSL
aDSL | DSL containing the subsegment |
x | minimal position |
y | maximal position |
DSL | an arithmetical DSL (either naive or standard) |
Definition at line 397 of file testArithmeticalDSSConvexHull.cpp.
References smartCHSubsegment(), and trivialSubsegment().
Referenced by comparisonSubsegment(), main(), and testSubsegment().
bool comparisonSubsegment | ( | typename DSL::Coordinate | a, |
typename DSL::Coordinate | b | ||
) |
Compares smartCH to the classical incremental recognition algorithm for various intercepts and lengths
a | numerator of the slope |
b | denominator of the slope |
DSL | an arithmetical DSL (either naive or standard) |
Definition at line 416 of file testArithmeticalDSSConvexHull.cpp.
References DGtal::Trace::beginBlock(), comparisonSubsegment(), DGtal::Trace::endBlock(), and DGtal::trace.
bool comparisonSubsegment2 | ( | const DSS & | aDSS, |
typename DSS::Position | aBound | ||
) |
Compares reversedSmartCH to the classical incremental recognition algorithm for one subgement of a greater DSS
aDSS | DSS containing the subsegment |
aBound | maximal position |
DSS | an arithmetical DSS (either naive or standard) |
Definition at line 664 of file testArithmeticalDSSConvexHull.cpp.
References reversedSmartCHSubsegment(), and trivialSubsegment().
Referenced by comparisonSubsegment2(), and testSubsegment2().
bool comparisonSubsegment2 | ( | typename DSL::Coordinate | a, |
typename DSL::Coordinate | b | ||
) |
Compares reversedSmartCH to the classical incremental recognition algorithm for various intercepts and lengths
a | numerator of the slope |
b | denominator of the slope |
DSL | an arithmetical DSL (either naive or standard) |
Definition at line 685 of file testArithmeticalDSSConvexHull.cpp.
References DGtal::Trace::beginBlock(), comparisonSubsegment2(), DGtal::Trace::endBlock(), DGtal::Trace::info(), and DGtal::trace.
int main | ( | int | argc, |
char ** | argv | ||
) |
Definition at line 773 of file testArithmeticalDSSConvexHull.cpp.
References basicTest(), DGtal::Trace::beginBlock(), comparisonSubsegment(), DGtal::Trace::emphase(), DGtal::Trace::endBlock(), DGtal::Trace::info(), testSubsegment(), testSubsegment2(), testWithLengthConstraint(), testWithoutLengthConstraint(), testWithoutLengthConstraint2(), and DGtal::trace.
DSS::DSL reversedSmartCHSubsegment | ( | const DSS & | aDSS, |
typename DSS::Position | aBound | ||
) |
Computes the minimal parameters of a subsegment with reversedSmartCH
aDSS | DSS containing the subsegment |
aBound | maximal position |
DSS | an arithmetical DSS (either naive or standard) |
Definition at line 629 of file testArithmeticalDSSConvexHull.cpp.
References DGtal::functions::reversedSmartCH().
Referenced by comparisonSubsegment2().
DSL smartCHSubsegment | ( | const DSL & | aDSL, |
typename DSL::Position | x, | ||
typename DSL::Position | y | ||
) |
Computes the minimal parameters of a subsegment with smartCH
aDSL | DSL containing the subsegment |
x | minimal position |
y | maximal position |
DSL | an arithmetical DSL (either naive or standard) |
Definition at line 318 of file testArithmeticalDSSConvexHull.cpp.
References DGtal::functions::smartCH().
Referenced by comparisonSubsegment().
bool testSubsegment | ( | ) |
Testing function.
Definition at line 448 of file testArithmeticalDSSConvexHull.cpp.
References DGtal::Trace::beginBlock(), comparisonSubsegment(), DGtal::Trace::endBlock(), and DGtal::trace.
Referenced by main().
bool testSubsegment2 | ( | ) |
Testing function.
Definition at line 730 of file testArithmeticalDSSConvexHull.cpp.
References DGtal::Trace::beginBlock(), comparisonSubsegment2(), DGtal::Trace::endBlock(), and DGtal::trace.
Referenced by main().
bool testWithLengthConstraint | ( | ) |
Testing function.
Definition at line 286 of file testArithmeticalDSSConvexHull.cpp.
References DGtal::Trace::beginBlock(), comparisonLeftHull(), DGtal::Trace::endBlock(), and DGtal::trace.
Referenced by main().
bool testWithoutLengthConstraint | ( | ) |
Testing function.
Definition at line 137 of file testArithmeticalDSSConvexHull.cpp.
References basicTest(), DGtal::Trace::beginBlock(), DGtal::Trace::endBlock(), and DGtal::trace.
Referenced by main().
bool testWithoutLengthConstraint2 | ( | ) |
Testing function.
Definition at line 574 of file testArithmeticalDSSConvexHull.cpp.
References basicTest2(), DGtal::Trace::beginBlock(), DGtal::Trace::endBlock(), and DGtal::trace.
Referenced by main().
DSL trivialSubsegment | ( | const DSL & | aDSL, |
typename DSL::Position | x, | ||
typename DSL::Position | y | ||
) |
Computes the minimal parameters of a subsegment with the classical recognition algorithm, implemented in ArithmeticalDSS.
aDSL | DSL containing the subsegment |
x | minimal position |
y | maximal position |
DSL | an arithmetical DSL (either naive or standard) |
Definition at line 356 of file testArithmeticalDSSConvexHull.cpp.
Referenced by comparisonSubsegment(), and comparisonSubsegment2().