DGtal 1.3.0
|
#include <iostream>
#include "DGtal/base/Common.h"
#include "DGtal/kernel/CPointPredicate.h"
#include "DGtal/base/CConstBidirectionalRange.h"
#include "DGtal/geometry/curves/ArithmeticalDSS.h"
#include "DGtal/geometry/curves/ArithmeticalDSSFactory.h"
#include "DGtal/geometry/curves/StabbingLineComputer.h"
Go to the source code of this file.
Functions | |
template<typename DSS > | |
bool | mainTest () |
template<typename DSS > | |
bool | rangeTest (const DSS &dss) |
template<typename DSS > | |
void | extensionTest (const DSS &dss, typename DSS::Point newPointToFront, typename DSS::Point newPointToBack, unsigned int &nbok, unsigned int &nb, const unsigned short int &code=0) |
template<typename DSS > | |
void | retractionTest (const DSS &dss, unsigned int &nbok, unsigned int &nb, bool res=true) |
template<typename DSS > | |
bool | updateTest () |
template<typename DSS > | |
bool | compatibleStepsTest (const DSS &dss) |
template<typename DSS > | |
bool | constructorsTest () |
template<typename DSS > | |
bool | comparisonSubsegment (const DSS &aDSS, typename DSS::Position x, typename DSS::Position y) |
template<typename DSL > | |
bool | comparisonSubsegment (typename DSL::Coordinate a, typename DSL::Coordinate b) |
bool | unionTest () |
int | max (int a, int b) |
template<typename TCoordinate , typename TInteger , unsigned short adjacency> | |
bool | unionComparisonTest (int modb, int modx, unsigned int nbtries) |
bool | createDSSTest () |
bool | testPatchCreatePattern () |
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 ArithmeticalDSS.
This file is part of the DGtal library.
Definition in file testArithmeticalDSS.cpp.
bool comparisonSubsegment | ( | const DSS & | aDSS, |
typename DSS::Position | x, | ||
typename DSS::Position | y | ||
) |
Compares smartCH and reversedSmartCH to the classical incremental recognition algorithm for one subgement of a greater DSS
aDSS | DSS containing the subsegment |
x | minimal position |
y | maximal position |
DSS | an arithmetical DSS (either naive or standard) |
Definition at line 812 of file testArithmeticalDSS.cpp.
Referenced by comparisonSubsegment(), and main().
bool comparisonSubsegment | ( | typename DSL::Coordinate | a, |
typename DSL::Coordinate | b | ||
) |
Compares smartCH and 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 833 of file testArithmeticalDSS.cpp.
References DGtal::Trace::beginBlock(), comparisonSubsegment(), DGtal::Trace::endBlock(), and DGtal::trace.
bool compatibleStepsTest | ( | const DSS & | dss | ) |
Test of the directional position and the checks of the steps
dss | an instance of DSS |
DSS | a model of arithmetical DSS, either naive or standard |
Definition at line 659 of file testArithmeticalDSS.cpp.
References DGtal::Trace::beginBlock(), DGtal::Trace::endBlock(), DGtal::Trace::info(), and DGtal::trace.
Referenced by main().
bool constructorsTest | ( | ) |
Test of the main constructors
DSS | a model of arithmetical DSS, either naive or standard |
Definition at line 740 of file testArithmeticalDSS.cpp.
References DGtal::Trace::beginBlock(), DGtal::Trace::endBlock(), DGtal::Trace::info(), and DGtal::trace.
Referenced by main().
bool createDSSTest | ( | ) |
Definition at line 1302 of file testArithmeticalDSS.cpp.
References DGtal::Trace::beginBlock(), DGtal::Trace::endBlock(), and DGtal::trace.
Referenced by main().
void extensionTest | ( | const DSS & | dss, |
typename DSS::Point | newPointToFront, | ||
typename DSS::Point | newPointToBack, | ||
unsigned int & | nbok, | ||
unsigned int & | nb, | ||
const unsigned short int & | code = 0 |
||
) |
Unit test of the extension service
dss | an instance of DSS |
DSS | a model of arithmetical DSS, either naive or standard |
newPointToFront | point to add to the dss front |
newPointToBack | point to add to the dss back |
nbok | (returned) number of passed tests |
nb | (returned) number of tests |
code | index of the tested configuration |
Definition at line 289 of file testArithmeticalDSS.cpp.
References DGtal::Trace::info(), and DGtal::trace.
Referenced by updateTest().
int main | ( | int | argc, |
char ** | argv | ||
) |
Definition at line 1359 of file testArithmeticalDSS.cpp.
References DGtal::Trace::beginBlock(), comparisonSubsegment(), compatibleStepsTest(), constructorsTest(), createDSSTest(), DGtal::Trace::emphase(), DGtal::Trace::endBlock(), DGtal::Trace::info(), mainTest(), rangeTest(), testPatchCreatePattern(), DGtal::trace, unionTest(), and updateTest().
bool mainTest | ( | ) |
Test of the main operators
DSS | a model of arithmetical DSS, either naive or standard |
Definition at line 52 of file testArithmeticalDSS.cpp.
References DGtal::Trace::beginBlock(), DGtal::Trace::endBlock(), DGtal::Trace::info(), and DGtal::trace.
Referenced by main().
int max | ( | int | a, |
int | b | ||
) |
Definition at line 1108 of file testArithmeticalDSS.cpp.
Referenced by DGtal::Shortcuts< TKSpace >::getColorMap(), DGtal::Shortcuts< TKSpace >::getZeroTickedColorMap(), incTest(), main(), maxDiameter(), and DGtal::RegularBinner< TQuantity >::RegularBinner().
bool rangeTest | ( | const DSS & | dss | ) |
Test of the range services
dss | an instance of DSS |
DSS | a model of arithmetical DSS, either naive or standard |
Definition at line 204 of file testArithmeticalDSS.cpp.
References DGtal::Trace::beginBlock(), DGtal::Trace::endBlock(), DGtal::Trace::info(), and DGtal::trace.
Referenced by main().
void retractionTest | ( | const DSS & | dss, |
unsigned int & | nbok, | ||
unsigned int & | nb, | ||
bool | res = true |
||
) |
Unit test of the retraction service
dss | an instance of DSS |
DSS | a model of arithmetical DSS, either naive or standard |
nbok | (returned) number of passed tests |
nb | (returned) number of tests |
res | result of the retraction: 'true' if done, 'false' otherwise |
Definition at line 360 of file testArithmeticalDSS.cpp.
References DGtal::Trace::info(), and DGtal::trace.
Referenced by updateTest().
bool testPatchCreatePattern | ( | ) |
Definition at line 1333 of file testArithmeticalDSS.cpp.
References DGtal::Trace::beginBlock(), DGtal::Trace::endBlock(), and DGtal::trace.
Referenced by main().
bool unionComparisonTest | ( | int | modb, |
int | modx, | ||
unsigned int | nbtries | ||
) |
Definition at line 1119 of file testArithmeticalDSS.cpp.
References DGtal::Trace::beginBlock(), DGtal::IntegerComputer< TInteger >::ceilDiv(), DGtal::IntegerComputer< TInteger >::dotProduct(), DGtal::Trace::emphase(), DGtal::Trace::endBlock(), DGtal::IntegerComputer< TInteger >::floorDiv(), DGtal::IntegerComputer< TInteger >::gcd(), DGtal::Trace::info(), and DGtal::trace.
bool unionTest | ( | ) |
Definition at line 880 of file testArithmeticalDSS.cpp.
References DGtal::Trace::beginBlock(), DGtal::Trace::endBlock(), DGtal::Trace::info(), and DGtal::trace.
Referenced by main().
bool updateTest | ( | ) |
Test of the update services
DSS | a model of arithmetical DSS, either naive or standard |
Definition at line 423 of file testArithmeticalDSS.cpp.
References DGtal::Trace::beginBlock(), DGtal::Trace::endBlock(), extensionTest(), DGtal::Trace::info(), retractionTest(), and DGtal::trace.
Referenced by main().