DGtal 1.3.0
|
#include <iostream>
#include <cstdlib>
#include <ctime>
#include "DGtal/base/Common.h"
#include "DGtal/kernel/PointVector.h"
#include "DGtal/geometry/tools/determinant/C2x2DetComputer.h"
#include "DGtal/geometry/tools/determinant/Simple2x2DetComputer.h"
#include "DGtal/geometry/tools/determinant/SimpleIncremental2x2DetComputer.h"
#include "DGtal/geometry/tools/determinant/AvnaimEtAl2x2DetSignComputer.h"
#include "DGtal/geometry/tools/determinant/Filtered2x2DetComputer.h"
#include "DGtal/geometry/tools/determinant/COrientationFunctor2.h"
#include "DGtal/geometry/tools/determinant/InHalfPlaneBy2x2DetComputer.h"
#include "DGtal/geometry/tools/determinant/InHalfPlaneBySimple3x3Matrix.h"
Go to the source code of this file.
Functions | |
DGtal::int32_t | randomInt15 () |
DGtal::int32_t | randomInt26 () |
DGtal::int32_t | randomInt30 () |
DGtal::int64_t | randomInt52 () |
double | randomDouble52 () |
DGtal::int64_t | randomInt62 () |
DGtal::BigInteger | randomBigInt62 () |
DGtal::int32_t | signedRandomInt15 () |
DGtal::int32_t | signedRandomInt26 () |
DGtal::int32_t | signedRandomInt30 () |
DGtal::int64_t | signedRandomInt52 () |
double | signedRandomDouble52 () |
DGtal::int64_t | signedRandomInt62 () |
DGtal::BigInteger | signedRandomBigInt62 () |
template<typename OrientationFunctor , typename RandomFunctor > | |
bool | randomTest (OrientationFunctor f, RandomFunctor gen, const DGtal::int32_t n=1000000) |
template<typename OrientationFunctor , typename RandomFunctor > | |
bool | nullSameVectorsTest (OrientationFunctor f, RandomFunctor gen, const DGtal::int32_t n=1000000) |
template<typename OrientationFunctor , typename RandomFunctor > | |
bool | nullZeroVectorTest (OrientationFunctor f, RandomFunctor gen, const DGtal::int32_t n=1000000) |
template<typename OrientationFunctor , typename RandomFunctor > | |
bool | nullTest (OrientationFunctor f, RandomFunctor gen, const DGtal::int32_t n=1000000) |
template<typename OrientationFunctor , typename RandomFunctor > | |
bool | quasiNullTest (OrientationFunctor f, RandomFunctor gen, const DGtal::int32_t n=1000000) |
template<typename OrientationFunctor > | |
bool | incTest (OrientationFunctor f, const DGtal::int32_t n=1000000) |
bool | incTestComparison () |
bool | randomTest30All () |
bool | randomTest52All () |
bool | randomTest62All () |
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/.
This file is part of the DGtal library.
Definition in file testInHalfPlane-benchmark.cpp.
bool incTest | ( | OrientationFunctor | f, |
const DGtal::int32_t | n = 1000000 |
||
) |
Function that traces to the standard output the running time of a given orientation functor f for n computations. The orientation functor is initialized with 2 points given once for all. We then compute the orientation of a random sequence of adjacent points with respect to these two points.
f | a functor to run |
n | number of tries |
OrientationFunctor | a model of COrientationFunctor2 |
Definition at line 458 of file testInHalfPlane-benchmark.cpp.
References max().
Referenced by incTestComparison().
bool incTestComparison | ( | ) |
Function that traces to the standard output the running time of all available functors for random points whose coordinates are within [-2^30 ; 2^30[.
Definition at line 504 of file testInHalfPlane-benchmark.cpp.
References incTest(), and srand().
Referenced by main().
int main | ( | int | argc, |
char ** | argv | ||
) |
Definition at line 918 of file testInHalfPlane-benchmark.cpp.
References DGtal::Trace::beginBlock(), DGtal::Trace::emphase(), DGtal::Trace::endBlock(), incTestComparison(), DGtal::Trace::info(), randomTest30All(), randomTest52All(), randomTest62All(), and DGtal::trace.
bool nullSameVectorsTest | ( | OrientationFunctor | f, |
RandomFunctor | gen, | ||
const DGtal::int32_t | n = 1000000 |
||
) |
Function that traces to the standard output the running time of a given orientation functor f for n computations for three points P, Q, R such that Q = R. The coordinates of P and Q are randomly chosen by gen.
f | a functor to run |
gen | a generator providing random numbers |
n | number of tries |
OrientationFunctor | a model of COrientationFunctor2 |
Definition at line 273 of file testInHalfPlane-benchmark.cpp.
Referenced by randomTest30All(), randomTest52All(), and randomTest62All().
bool nullTest | ( | OrientationFunctor | f, |
RandomFunctor | gen, | ||
const DGtal::int32_t | n = 1000000 |
||
) |
Function that traces to the standard output the running time of a given orientation functor f for n computations for three collinear points P, Q, R such that Q-P = ku and R-P = lu. P is set to (0,0), the components of u, k and l are randomly chosen by gen.
f | a functor to run |
gen | a generator providing random numbers |
n | number of tries |
OrientationFunctor | a model of COrientationFunctor2 |
Definition at line 354 of file testInHalfPlane-benchmark.cpp.
Referenced by randomTest30All(), randomTest52All(), and randomTest62All().
bool nullZeroVectorTest | ( | OrientationFunctor | f, |
RandomFunctor | gen, | ||
const DGtal::int32_t | n = 1000000 |
||
) |
Function that traces to the standard output the running time of a given orientation functor f for n computations for three points P, Q, R such that R = P. The coordinates of P and R are randomly chosen by gen.
f | a functor to run |
gen | a generator providing random numbers |
n | number of tries |
OrientationFunctor | a model of COrientationFunctor2 |
Definition at line 313 of file testInHalfPlane-benchmark.cpp.
Referenced by randomTest30All(), randomTest52All(), and randomTest62All().
bool quasiNullTest | ( | OrientationFunctor | f, |
RandomFunctor | gen, | ||
const DGtal::int32_t | n = 1000000 |
||
) |
Function that traces to the standard output the running time of a given orientation functor f for n computations for three quasi-collinear points P, Q, R defined such that Q-P = ku + epsilon and R-P = lu + epsilon where espilon is a random integer between -2 and 2.
P is set to (0,0), the components of u, k and l are randomly chosen by gen.
f | a functor to run |
gen | a generator providing random numbers |
n | number of tries |
OrientationFunctor | a model of COrientationFunctor2 |
Definition at line 404 of file testInHalfPlane-benchmark.cpp.
Referenced by randomTest30All(), randomTest52All(), and randomTest62All().
DGtal::BigInteger randomBigInt62 | ( | ) |
Definition at line 132 of file testInHalfPlane-benchmark.cpp.
References randomInt30().
Referenced by signedRandomBigInt62().
double randomDouble52 | ( | ) |
Definition at line 102 of file testInHalfPlane-benchmark.cpp.
References randomInt15(), and randomInt30().
Referenced by signedRandomDouble52().
DGtal::int32_t randomInt15 | ( | ) |
Definition at line 59 of file testInHalfPlane-benchmark.cpp.
Referenced by randomDouble52(), randomInt26(), randomInt30(), randomInt52(), and signedRandomInt15().
DGtal::int32_t randomInt26 | ( | ) |
Definition at line 68 of file testInHalfPlane-benchmark.cpp.
References randomInt15().
Referenced by signedRandomInt26().
DGtal::int32_t randomInt30 | ( | ) |
Definition at line 78 of file testInHalfPlane-benchmark.cpp.
References randomInt15().
Referenced by randomBigInt62(), randomDouble52(), randomInt52(), randomInt62(), and signedRandomInt30().
DGtal::int64_t randomInt52 | ( | ) |
Definition at line 88 of file testInHalfPlane-benchmark.cpp.
References randomInt15(), and randomInt30().
Referenced by signedRandomInt52().
DGtal::int64_t randomInt62 | ( | ) |
Definition at line 116 of file testInHalfPlane-benchmark.cpp.
References randomInt30().
Referenced by signedRandomInt62().
bool randomTest | ( | OrientationFunctor | f, |
RandomFunctor | gen, | ||
const DGtal::int32_t | n = 1000000 |
||
) |
Function that traces to the standard output the running time of a given functor f for n computations over points whose coordinates are randomly chosen by gen.
f | a functor to run |
gen | a generator providing random numbers |
n | number of tries |
OrientationFunctor | a model of COrientationFunctor2 |
Definition at line 231 of file testInHalfPlane-benchmark.cpp.
Referenced by randomTest30All(), randomTest52All(), and randomTest62All().
bool randomTest30All | ( | ) |
Function that traces to the standard output the running time of all available functors for random points whose coordinates are within [-2^30 ; 2^30[.
Definition at line 564 of file testInHalfPlane-benchmark.cpp.
References nullSameVectorsTest(), nullTest(), nullZeroVectorTest(), quasiNullTest(), randomTest(), signedRandomInt15(), signedRandomInt30(), and srand().
Referenced by main().
bool randomTest52All | ( | ) |
Function that traces to the standard output the running time of all available functors for random points whose coordinates are within [-2^52 ; 2^52[.
BigInt cannot be constructed from a DGtal::int64_t
Definition at line 697 of file testInHalfPlane-benchmark.cpp.
References nullSameVectorsTest(), nullTest(), nullZeroVectorTest(), quasiNullTest(), randomTest(), signedRandomDouble52(), signedRandomInt26(), signedRandomInt52(), and srand().
Referenced by main().
bool randomTest62All | ( | ) |
Function that traces to the standard output the running time of all available functors for random points whose coordinates are within [-2^62 ; 2^62[.
BigInt cannot be constructed from a DGtal::int64_t
Definition at line 835 of file testInHalfPlane-benchmark.cpp.
References nullSameVectorsTest(), nullTest(), nullZeroVectorTest(), quasiNullTest(), randomTest(), signedRandomBigInt62(), signedRandomInt30(), signedRandomInt62(), and srand().
Referenced by main().
DGtal::BigInteger signedRandomBigInt62 | ( | ) |
Definition at line 208 of file testInHalfPlane-benchmark.cpp.
References randomBigInt62().
Referenced by randomTest62All().
double signedRandomDouble52 | ( | ) |
Definition at line 187 of file testInHalfPlane-benchmark.cpp.
References randomDouble52().
Referenced by randomTest52All().
DGtal::int32_t signedRandomInt15 | ( | ) |
Definition at line 147 of file testInHalfPlane-benchmark.cpp.
References randomInt15().
Referenced by randomTest30All().
DGtal::int32_t signedRandomInt26 | ( | ) |
Definition at line 157 of file testInHalfPlane-benchmark.cpp.
References randomInt26().
Referenced by randomTest52All().
DGtal::int32_t signedRandomInt30 | ( | ) |
Definition at line 167 of file testInHalfPlane-benchmark.cpp.
References randomInt30().
Referenced by randomTest30All(), and randomTest62All().
DGtal::int64_t signedRandomInt52 | ( | ) |
Definition at line 177 of file testInHalfPlane-benchmark.cpp.
References randomInt52().
Referenced by randomTest52All().
DGtal::int64_t signedRandomInt62 | ( | ) |
Definition at line 197 of file testInHalfPlane-benchmark.cpp.
References randomInt62().
Referenced by randomTest62All().