DGtal 2.1.0
Loading...
Searching...
No Matches
DiagonalPriority< CubicalComplex > Struct Template Reference

Public Types

typedef CubicalComplex::KSpace KSpace
 
typedef CubicalComplex::Point Point
 
typedef CubicalComplex::Cell Cell
 
typedef CubicalComplex::CellMapIterator CellMapIterator
 

Public Member Functions

 DiagonalPriority (const CubicalComplex &complex)
 
bool operator() (const CellMapIterator &it1, const CellMapIterator &it2) const
 

Data Fields

const CubicalComplexmyComplex
 

Detailed Description

template<typename CubicalComplex>
struct DiagonalPriority< CubicalComplex >

The diagonal property induces that cells further away from the straight line (1,..,1)*x are removed first in a collapse operation. Could be used instead of giving values to each cell data.

Examples
topology/cubical-complex-collapse.cpp.

Definition at line 90 of file cubical-complex-collapse.cpp.

Member Typedef Documentation

◆ Cell

◆ CellMapIterator

◆ KSpace

◆ Point

Constructor & Destructor Documentation

◆ DiagonalPriority()

template<typename CubicalComplex >
DiagonalPriority< CubicalComplex >::DiagonalPriority ( const CubicalComplex complex)
inline

Definition at line 96 of file cubical-complex-collapse.cpp.

96: myComplex( complex ) {}
const CubicalComplex & myComplex

Member Function Documentation

◆ operator()()

template<typename CubicalComplex >
bool DiagonalPriority< CubicalComplex >::operator() ( const CellMapIterator it1,
const CellMapIterator it2 
) const
inline
Examples
topology/cubical-complex-collapse.cpp.

Definition at line 97 of file cubical-complex-collapse.cpp.

98 {
99 Point k1 = myComplex.space().uKCoords( it1->first );
100 Point k2 = myComplex.space().uKCoords( it2->first );
101 double d1 = Point::diagonal( 1 ).dot( k1 ) / sqrt( (double) KSpace::dimension );
102 double d2 = Point::diagonal( 1 ).dot( k2 ) / sqrt( (double) KSpace::dimension );;
103 RealPoint v1( k1[ 0 ] - d1 * k1[ 0 ], k1[ 1 ] - d1 * k1[ 1 ], k1[ 2 ] - d1 * k1[ 2 ] );
104 RealPoint v2( k2[ 0 ] - d2 * k2[ 0 ], k2[ 1 ] - d2 * k2[ 1 ], k2[ 2 ] - d2 * k2[ 2 ] );
105 double n1 = v1.dot( v1 );
106 double n2 = v2.dot( v2 );
107 return ( n1 < n2 ) || ( ( n1 == n2 ) && ( it1->first < it2->first ) );
108 }
const KSpace & space() const
static const constexpr Dimension dimension
auto dot(const PointVector< dim, OtherComponent, OtherStorage > &v) const -> decltype(DGtal::dotProduct(*this, v))
Dot product with a PointVector.
static Self diagonal(Component val=1)

References DGtal::PointVector< dim, Integer >::diagonal(), DGtal::KhalimskySpaceND< dim, TInteger >::dimension, DGtal::PointVector< dim, TEuclideanRing, TContainer >::dot(), DiagonalPriority< CubicalComplex >::myComplex, and DGtal::CubicalComplex< TKSpace, TCellContainer >::space().

Field Documentation

◆ myComplex


The documentation for this struct was generated from the following file: