|
| struct | BoundedLatticePolytopeSpecializer |
| | Aim: It is just a helper class for BoundedLatticePolytope to add dimension specific static methods. More...
|
| struct | BoundedLatticePolytopeSpecializer< 3, TInteger > |
| | Aim: 3D specialization for BoundedLatticePolytope to add dimension specific static methods. More...
|
| struct | BoundedRationalPolytopeSpecializer |
| | Aim: It is just a helper class for BoundedRationalPolytope to add dimension specific static methods. More...
|
| struct | BoundedRationalPolytopeSpecializer< 3, TInteger > |
| | Aim: 3D specialization for BoundedRationalPolytope to add dimension specific static methods. More...
|
| struct | ComparatorAdapter |
| struct | ComparatorAdapter< Container, true, false, false > |
| | unordered set-like adapter. More...
|
| struct | ComparatorAdapter< Container, true, false, true > |
| | unordered map-like adapter. More...
|
| struct | ComparatorAdapter< Container, true, true, false > |
| | Set-like adapter. More...
|
| struct | ComparatorAdapter< Container, true, true, true > |
| | Map-like adapter. More...
|
| struct | ConvexityHelperInternalInteger |
| struct | ConvexityHelperInternalInteger< DGtal::BigInteger, safe > |
| struct | ConvexityHelperInternalInteger< DGtal::int32_t, false > |
| struct | ConvexityHelperInternalInteger< DGtal::int32_t, true > |
| struct | ConvexityHelperInternalInteger< DGtal::int64_t, false > |
| struct | ConvexityHelperInternalInteger< DGtal::int64_t, true > |
| struct | CurvatureFromDCA |
| struct | CurvatureFromDCA< false > |
| class | CurvatureFromDSSBaseEstimator |
| struct | CurvatureFromDSSLength |
| struct | CurvatureFromDSSLengthAndWidth |
| struct | DistanceFromDCA |
| class | DSSDecorator |
| | Aim: Abstract DSSDecorator for ArithmeticalDSSComputer. Has 2 virtual methods returning the first and last leaning point: More...
|
| class | DSSDecorator4ConcavePart |
| | Aim: adapter for TDSS used by FP in CONCAVE parts. Has 2 methods: More...
|
| class | DSSDecorator4ConvexPart |
| | Aim: adapter for TDSS used by FP in CONVEX parts. Has 2 methods: More...
|
| struct | EqualPredicateFromLessThanComparator |
| struct | EuclideanDivisionHelper |
| | Aim: Small stucture that provides a static method returning the Euclidean division of two integers. More...
|
| struct | EuclideanDivisionHelper< double > |
| struct | EuclideanDivisionHelper< float > |
| struct | EuclideanDivisionHelper< long double > |
| struct | FFTWComplexCast |
| | Facility to cast to the complex type used by fftw. More...
|
| struct | FFTWWrapper |
| | Wrapper to fftw functions depending on value type. More...
|
| struct | FFTWWrapper< double > |
| struct | FFTWWrapper< float > |
| struct | FFTWWrapper< long double > |
| class | GridPoint |
| | A grid point consists of a couple of nonnegative coordinates \( (x,y) \) and an integer index \( k \) that determines a point used as origin. For a triplet of vectors \( (m_k)_{0 \leq k \leq 2} \) and a point \( q \), a grid point is defined as: \( q - m_{k} + x m_{(k+1)\bmod 3} + y m_{(k+2)\bmod 3} \). \( q - m_{k} \), called base point, is used as origin. More...
|
| class | GridPointOnProbingRay |
| | Aim: Represents a grid point along a discrete ray defined on a grid. More...
|
| struct | HasNestedTypeCategory |
| | Aim: Checks whether type T has a nested type called 'Category' or not. NB: from en.wikipedia.org/wiki/Substitution_failure_is_not_an_error NB: to avoid various compiler issues, we use BOOST_STATIC_CONSTANT according to http://www.boost.org/development/int_const_guidelines.html. More...
|
| struct | HasNestedTypeType |
| | Aim: Checks whether type IC has a nested type called 'Type' or not. NB: from en.wikipedia.org/wiki/Substitution_failure_is_not_an_error NB: to avoid various compiler issues, we use BOOST_STATIC_CONSTANT according to http://www.boost.org/development/int_const_guidelines.html. More...
|
| struct | IsAssociativeContainerFromCategory |
| struct | IsCirculator |
| | Aim: Checks whether type IC is a circular or a classical iterator. Static value set to 'true' for a circulator, 'false' otherwise.
1) if type IC has no nested type 'Type', it is a classical iterator and 'false' is returned. 2) if type IC has a nested type 'Type', 'true' is returned is 'Type' is CirculatorType, 'false' otherwise. More...
|
| struct | IsCirculator< IC, true > |
| struct | IsCirculatorFromType |
| | Aim: In order to check whether type IC is a circular or a classical iterator, the nested type called 'Type' is read. More...
|
| struct | IsCirculatorFromType< IC, CirculatorType > |
| struct | IsContainerFromCategory |
| struct | IsMultipleAssociativeContainerFromCategory |
| struct | IsOrderedAssociativeContainerFromCategory |
| struct | IsPairAssociativeContainerFromCategory |
| struct | IsSequenceContainerFromCategory |
| struct | IsSimpleAssociativeContainerFromCategory |
| struct | IsUniqueAssociativeContainerFromCategory |
| struct | IsUnorderedAssociativeContainerFromCategory |
| struct | IteratorCirculatorTypeImpl |
| | Aim: Defines the Iterator or Circulator type as a nested type according to the value of b. More...
|
| struct | IteratorCirculatorTypeImpl< true > |
| struct | KeyComparatorForPairKeyData |
| struct | LabelledMapMemFunctor |
| struct | monomial_node |
| struct | NormalizedTangentVectorFromDSS |
| struct | NormalVectorFromDCA |
| class | PointOnProbingRay |
| | A ray consists of a permutation \( \sigma \) and an integer index \( \lambda \) (position on the ray). For a triplet of vectors \( (m_k)_{0 \leq k \leq 2} \) and a point \( q \), a point on the ray is defined as: \( q - m_{\sigma(0)} + m_{\sigma(1)} + \lambda m_{\sigma(2)} \). \( q - m_{\sigma(0)} + m_{\sigma(1)} \) is called the base point. More...
|
| class | PointValueCompare |
| | Aim: Small binary predicate to order candidates points according to their (absolute) distance value. More...
|
| class | PosDepScaleDepSCEstimator |
| class | PosDepScaleIndepSCEstimator |
| class | PosIndepScaleDepSCEstimator |
| class | PosIndepScaleIndepSCEstimator |
| struct | power_node |
| struct | RecursivePConvexity |
| struct | RecursivePConvexity< 1, TInteger > |
| struct | SetFunctionsImpl |
| | Aim: Specialize set operations (union, intersection, difference, symmetric_difference) according to the given type of container. It uses standard algorithms when containers are ordered, otherwise it provides a default implementation. More...
|
| struct | SetFunctionsImpl< Container, false, true > |
| struct | SetFunctionsImpl< Container, true, false > |
| struct | SetFunctionsImpl< Container, true, true > |
| struct | TangentAngleFromDSS |
| struct | TangentVectorFromDCA |
| struct | TangentVectorFromDSS |
| struct | toCoordinateImpl |
| | Aim: Define a simple functor that can cast a signed integer (possibly a DGtal::BigInteger) into another. More...
|
| struct | toCoordinateImpl< DGtal::BigInteger, DGtal::BigInteger > |
| struct | toCoordinateImpl< DGtal::BigInteger, TOutput > |
| struct | top_node |
| struct | ValueConverter |
| | Generic definition of a class for converting type X toward type Y. More...
|
| struct | ValueConverter< std::string, double > |
| | Specialized definitions of a class for converting type X toward type Y. More...
|
| struct | ValueConverter< std::string, float > |
| | Specialized definitions of a class for converting type X toward type Y. More...
|
| struct | ValueConverter< std::string, int > |
| | Specialized definitions of a class for converting type X toward type Y. More...
|
| struct | ValueConverter< X, std::string > |
| | Specialized definitions of a class for converting type X toward type Y. More...
|
|
| template<typename IC> |
| bool | isNotEmpty (const IC &itb, const IC &ite, IteratorType) |
| template<typename IC> |
| bool | isNotEmpty (const IC &c1, const IC &c2, CirculatorType) |
| template<typename IC> |
| void | advanceIterator (IC &ic, typename IteratorCirculatorTraits< IC >::Difference n, ForwardCategory) |
| template<typename IC> |
| void | advanceIterator (IC &ic, typename IteratorCirculatorTraits< IC >::Difference n, RandomAccessCategory) |
| template<typename I> |
| IteratorCirculatorTraits< I >::Difference | rangeSize (const I &itb, const I &ite, IteratorType, ForwardCategory) |
| template<typename C> |
| IteratorCirculatorTraits< C >::Difference | rangeSize (const C &cb, const C &ce, CirculatorType, ForwardCategory) |
| template<typename I> |
| IteratorCirculatorTraits< I >::Difference | rangeSize (const I &itb, const I &ite, IteratorType, RandomAccessCategory) |
| template<typename C> |
| IteratorCirculatorTraits< C >::Difference | rangeSize (const C &cb, const C &ce, CirculatorType, RandomAccessCategory) |
| template<typename I> |
| I | rangeMiddle (const I &itb, const I &ite, IteratorType, ForwardCategory) |
| template<typename C> |
| C | rangeMiddle (const C &cb, const C &ce, CirculatorType, ForwardCategory) |
| template<typename I> |
| I | rangeMiddle (const I &itb, const I &ite, IteratorType, BidirectionalCategory) |
| template<typename C> |
| C | rangeMiddle (const C &cb, const C &ce, CirculatorType, BidirectionalCategory) |
| template<typename I> |
| I | rangeMiddle (const I &itb, const I &ite, IteratorType, RandomAccessCategory) |
| template<typename C> |
| C | rangeMiddle (const C &cb, const C &ce, CirculatorType, RandomAccessCategory) |
| template<typename TData> |
| std::pair< unsigned int, unsigned int > | argminLabelledMapMemoryUsageForGeometricDistribution (unsigned int L, double prob_no_data, double prob_one_data) |
| template<typename Point> |
| Point::Coordinate | squaredNorm (Point const &aPoint) |
| template<int N, typename T> |
| T | determinant (const T aMatrix[N][N]) |
| template<typename Point> |
| Point::Coordinate | distToSphere (std::array< Point, 5 > const &aPoints) |
| template<typename Point> |
| bool | isBasisReduced (Point const &aU, Point const &aV) |
| template<typename Integer, typename Index> |
| std::ostream & | operator<< (std::ostream &aOs, PointOnProbingRay< Integer, Index > const &aRay) |
| template<typename Integer, typename Index> |
| std::ostream & | operator<< (std::ostream &aOs, GridPoint< Integer, Index > const &aGridPoint) |
| template<typename Point> |
| Point | center (const std::vector< Point > &points) |
| template<typename OutputValue, typename ForwardIterator, typename ConversionFct> |
| void | transform (std::vector< OutputValue > &output_values, std::vector< std::size_t > &input2output, std::vector< std::size_t > &output2input, ForwardIterator itb, ForwardIterator ite, const ConversionFct &F, bool remove_duplicates) |
detail namespace gathers internal classes and functions.
template<typename OutputValue, typename ForwardIterator, typename ConversionFct>
| void DGtal::detail::transform |
( |
std::vector< OutputValue > & | output_values, |
|
|
std::vector< std::size_t > & | input2output, |
|
|
std::vector< std::size_t > & | output2input, |
|
|
ForwardIterator | itb, |
|
|
ForwardIterator | ite, |
|
|
const ConversionFct & | F, |
|
|
bool | remove_duplicates ) |
Transform an input range of points into an output range with a conversion function, and possibly removes duplicates in the output range. Used as preprocessing of QuickHull algorithm.
- Template Parameters
-
| OutputValue | any value that is LessThanComparable, Assignable, CopyConstructible, DefaultConstructible. |
| ConversionFct | is a functor from input values to OutputValue. |
| ForwardIterator | is a forward iterator on some input values. |
- Parameters
-
| [out] | output_values | a range of points converted from the input range, with duplicates possibly removed according to remove_duplicates |
| [out] | input2output | the surjective mapping between the input range and the output range used for computation. |
| [out] | output2input | the injective mapping between the output range and the input range. |
| [in] | itb,ite | a range of values. |
| [in] | F | a function that may transform input values to output values |
| [in] | remove_duplicates | when 'true' remove duplicate values, otherwise, output_values.size() is equal to the size of the range itb,ite. |
Definition at line 109 of file QuickHullKernels.h.
115 {
116 typedef std::size_t
Size;
117 std::vector< OutputValue > input;
118 while ( itb != ite ) {
119 const auto ip = *itb++;
120 input.push_back( F( ip ) );
121 }
122 if ( ! remove_duplicates ) {
123 output_values.swap( input );
124 input2output.resize( input.size() );
125 output2input.resize( input.size() );
126 for (
Size i = 0; i < input.size(); ++i )
127 input2output[ i ] = output2input[ i ] = i;
128 }
129 else {
130 output_values.clear();
131 std::vector< std::size_t > i2c_sort( input.size() );
132 input2output.resize( input.size() );
133 for (
Size i = 0; i < input.size(); i++ ) i2c_sort[ i ] = i;
134
135 std::sort( i2c_sort.begin(), i2c_sort.end(),
136 [&input] (
Size i,
Size j ) { return input[ i ] < input[ j ]; } );
137 output_values.resize( input.size() );
138 output_values[ 0 ] = input[ i2c_sort[ 0 ] ];
139 input2output[ i2c_sort[ 0 ] ] = 0;
141 for (
Size i = 1; i < input.size(); i++ ) {
142 if ( input[ i2c_sort[ i-1 ] ] != input[ i2c_sort[ i ] ] )
143 output_values[ ++j ] = input[ i2c_sort[ i ] ];
144 input2output[ i2c_sort[ i ] ] = j;
145 }
146 output_values.resize( j+1 );
147 output2input.resize( output_values.size() );
148 for (
Size i = 0; i < input2output.size(); i++ )
149 output2input[ input2output[ i ] ] = i;
150 }
151 }
HalfEdgeDataStructure::Size Size
Referenced by DGtal::ConvexHullIntegralKernel< dim, Integer, InternalInteger >::makeInput(), DGtal::ConvexHullRationalKernel< dim, Integer, InternalInteger >::makeInput(), DGtal::DelaunayIntegralKernel< dim, Integer, InternalInteger >::makeInput(), and DGtal::DelaunayRationalKernel< dim, Integer, InternalInteger >::makeInput().