DGtal
1.5.beta
|
#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 accuracyTest(), DGtal::NormalCycleFormula< TRealPoint, TRealVector >::anisotropicCurvatureH1(), DGtal::NormalCycleFormula< TRealPoint, TRealVector >::anisotropicCurvatureH2(), brut_force_voronoi_map_complete(), DGtal::detail::toCoordinateImpl< DGtal::BigInteger, TOutput >::cast(), DGtal::Color::clamp(), DGtal::TimeStampMemoizer< TKey, TValue >::cleanUp(), LibBoard::ShapeList::clear(), cmpTranslatedFFT(), DGtal::deprecated::DigitalShapesIntersection< ShapeA, ShapeB >::DigitalShapesIntersection(), DGtal::deprecated::DigitalShapesMinus< ShapeA, ShapeB >::DigitalShapesMinus(), DGtal::deprecated::DigitalShapesUnion< ShapeA, ShapeB >::DigitalShapesUnion(), DGtal::deprecated::EuclideanShapesIntersection< ShapeA, ShapeB >::EuclideanShapesIntersection(), DGtal::deprecated::EuclideanShapesMinus< ShapeA, ShapeB >::EuclideanShapesMinus(), DGtal::deprecated::EuclideanShapesUnion< ShapeA, ShapeB >::EuclideanShapesUnion(), DGtal::SymmetricConvexExpander< TKSpace, TPointPredicate >::expand(), DGtal::IntegralIntervals< TInteger >::extend(), DGtal::Shortcuts< TKSpace >::getColorMap(), DGtal::ATSolver2D< TKSpace, TLinearAlgebra >::getOutputScalarFieldV0(), DGtal::ShortcutsGeometry< TKSpace >::getScalarsNormLoo(), DGtal::Shortcuts< TKSpace >::getZeroTickedColorMap(), incTest(), DGtal::IntegralIntervals< TInteger >::insert(), DGtal::SphericalTriangle< TSpace >::interiorAngles(), DGtal::DigitalShapesCSG< ShapeA, ShapeB >::intersection(), DGtal::EuclideanShapesCSG< ShapeA, ShapeB >::intersection(), main(), DGtal::Shortcuts< TKSpace >::makeGrayScaleImage(), DGtal::details::NumberTraitsImplFundamental< T >::max(), maxDiameter(), LibBoard::ShapeList::minDepth(), DGtal::functors::Max< T >::operator()(), DGtal::QuickHull< TKernel >::pickInitialSimplex(), DGtal::DigitalShapesCSG< ShapeA, ShapeB >::plus(), DGtal::EuclideanShapesCSG< ShapeA, ShapeB >::plus(), DGtal::RegularBinner< TQuantity >::RegularBinner(), LibBoard::Board::saveFIG(), TEST_CASE(), testForwardBackwardFFT(), testInteger(), testSegmentationLarger(), testVisualTubularMesh(), and DGtal::NormalCycleFormula< TRealPoint, TRealVector >::twiceMeanCurvature().
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().