#include <iostream>
#include <array>
#include "DGtal/base/Common.h"
#include "DGtal/helpers/StdDefs.h"
#include "DGtal/geometry/volumes/distance/PowerMap.h"
#include "DGtal/geometry/volumes/distance/ExactPredicateLpPowerSeparableMetric.h"
#include "DGtal/geometry/volumes/distance/ReverseDistanceTransformation.h"
#include "DGtal/kernel/sets/DigitalSetDomain.h"
#include "DGtal/images/ImageContainerBySTLMap.h"
#include "DGtal/images/ImageContainerBySTLVector.h"
#include "DGtal/kernel/sets/DigitalSetBySTLSet.h"
Go to the source code of this file.
Functions | |
template<std::size_t N> | |
std::array< bool, N > | getPeriodicityFromInteger (std::size_t anInteger) |
template<std::size_t N> | |
std::string | formatPeriodicity (std::array< bool, N > const &aPeriodicity) |
template<typename PowerMap > | |
bool | checkPowerMap (const PowerMap &aPowerMap) |
bool | testPowerMap (std::array< bool, 2 > const &aPeriodicity={{ false, false }}) |
bool | testCheckConcept () |
template<typename Set > | |
bool | testPowerMapFromSites (const Set &aSet) |
template<typename Set > | |
bool | testPowerMapFromSites (const Set &aSet, std::array< bool, Set::Space::dimension > const &periodicity) |
bool | testSimple2D () |
bool | testSimple3D () |
bool | testSimple4D () |
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/.
david.nosp@m..coe.nosp@m.urjol.nosp@m.ly@l.nosp@m.iris..nosp@m.cnrs.nosp@m..fr
) Laboratoire d'InfoRmatique en Image et Systèmes d'information - LIRIS (CNRS, UMR 5205), CNRS, FranceFunctions for testing class PowerMap.
This file is part of the DGtal library.
Definition in file testPowerMap.cpp.
Validates the PowerMap
Definition at line 91 of file testPowerMap.cpp.
References DGtal::DigitalSetBySTLSet< TDomain, TCompare >::begin(), dim, DGtal::PowerMap< TWeightImage, TPowerSeparableMetric, TImageContainer >::domain(), DGtal::DigitalSetBySTLSet< TDomain, TCompare >::end(), DGtal::Trace::error(), getPeriodicityFromInteger(), DGtal::DigitalSetBySTLSet< TDomain, TCompare >::insertNew(), DGtal::PowerMap< TWeightImage, TPowerSeparableMetric, TImageContainer >::isPeriodic(), DGtal::PowerMap< TWeightImage, TPowerSeparableMetric, TImageContainer >::metricPtr(), DGtal::PowerMap< TWeightImage, TPowerSeparableMetric, TImageContainer >::projectPoint(), DGtal::trace, and DGtal::PowerMap< TWeightImage, TPowerSeparableMetric, TImageContainer >::weightImagePtr().
Referenced by testPowerMapFromSites().
std::string formatPeriodicity | ( | std::array< bool, N > const & | aPeriodicity | ) |
Format a periodicity specification array as a string.
aPeriodicity | the periodicity specification array. |
Definition at line 79 of file testPowerMap.cpp.
Referenced by testSimple2D(), testSimple3D(), and testSimple4D().
std::array< bool, N > getPeriodicityFromInteger | ( | std::size_t | anInteger | ) |
Returns periodicity specification from an integer between 0 and 2^n - 1.
From an integer between 0 and 2^n-1, it returns a boolean array of size n whith value true at position i if the ith bit of the integer is set, false otherwise.
N | size of the periodicity specification array. |
anInteger | an integer between 0 and 2^N-1. |
Definition at line 63 of file testPowerMap.cpp.
Referenced by checkPowerMap(), testSimple2D(), testSimple3D(), and testSimple4D().
int main | ( | int | argc, |
char ** | argv ) |
Definition at line 428 of file testPowerMap.cpp.
References DGtal::Trace::beginBlock(), DGtal::Trace::emphase(), DGtal::Trace::endBlock(), DGtal::Trace::info(), testCheckConcept(), testPowerMap(), testSimple2D(), testSimple3D(), testSimple4D(), and DGtal::trace.
bool testCheckConcept | ( | ) |
Definition at line 277 of file testPowerMap.cpp.
Referenced by main().
bool testPowerMap | ( | std::array< bool, 2 > const & | aPeriodicity = {{ false, false }} | ) |
Example of a test. To be completed.
Definition at line 183 of file testPowerMap.cpp.
Referenced by main().
bool testPowerMapFromSites | ( | const Set & | aSet | ) |
Definition at line 289 of file testPowerMap.cpp.
References testPowerMapFromSites().
Referenced by testPowerMapFromSites(), testSimple2D(), testSimple3D(), and testSimple4D().
bool testPowerMapFromSites | ( | const Set & | aSet, |
std::array< bool, Set::Space::dimension > const & | periodicity ) |
Definition at line 297 of file testPowerMap.cpp.
References DGtal::Trace::beginBlock(), checkPowerMap(), DGtal::Trace::endBlock(), and DGtal::trace.
bool testSimple2D | ( | ) |
Definition at line 348 of file testPowerMap.cpp.
References DGtal::Trace::beginBlock(), domain, DGtal::Trace::endBlock(), formatPeriodicity(), getPeriodicityFromInteger(), DGtal::DigitalSetBySTLSet< TDomain, TCompare >::insertNew(), testPowerMapFromSites(), and DGtal::trace.
Referenced by main().
bool testSimple3D | ( | ) |
Definition at line 374 of file testPowerMap.cpp.
References DGtal::Trace::beginBlock(), domain, DGtal::Trace::endBlock(), formatPeriodicity(), getPeriodicityFromInteger(), DGtal::DigitalSetBySTLSet< TDomain, TCompare >::insertNew(), testPowerMapFromSites(), and DGtal::trace.
Referenced by main().
bool testSimple4D | ( | ) |
Definition at line 399 of file testPowerMap.cpp.
References DGtal::Trace::beginBlock(), domain, DGtal::Trace::endBlock(), formatPeriodicity(), getPeriodicityFromInteger(), DGtal::DigitalSetBySTLSet< TDomain, TCompare >::insertNew(), testPowerMapFromSites(), and DGtal::trace.
Referenced by main().