TTK
Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
ttk::lts::LocalizedTopologicalSimplification Class Reference

#include <LocalizedTopologicalSimplification.h>

Inheritance diagram for ttk::lts::LocalizedTopologicalSimplification:
ttk::Debug ttk::BaseClass ttkTopologicalSimplificationByPersistence

Public Types

enum class  PAIR_TYPE { EXTREMUM_SADDLE = 0 , MINIMUM_SADDLE = 1 , MAXIMUM_SADDLE = 2 }
 

Public Member Functions

 LocalizedTopologicalSimplification ()
 
 ~LocalizedTopologicalSimplification () override=default
 
int preconditionTriangulation (ttk::AbstractTriangulation *triangulation) const
 
template<typename IT >
int allocateMemory (std::vector< IT > &segmentation, std::vector< IT > &queueMask, std::vector< IT > &localOrder, std::vector< Propagation< IT > * > &propagationMask, std::vector< std::tuple< IT, IT, IT > > &sortedIndices, const IT &nVertices) const
 
template<typename IT >
int initializeMemory (IT *segmentation, IT *queueMask, IT *localOrder, Propagation< IT > **propagationMask, const IT &nVertices) const
 
template<typename IT , class TT >
int initializePropagations (std::vector< Propagation< IT > > &propagations, IT *authorizationMask, IT *maximaBuffer, const IT *authorizedExtremaIndices, const IT &nAuthorizedExtremaIndices, const IT *order, const TT *triangulation) const
 
template<typename IT , typename TT >
int computeSimplePropagation (Propagation< IT > &propagation, Propagation< IT > **propagationMask, IT *segmentation, IT *queueMask, const TT *triangulation, const IT *order) const
 
template<typename IT , typename DT , typename TT >
int computePersistenceSensitivePropagation (Propagation< IT > &propagation, Propagation< IT > **propagationMask, IT *segmentation, IT *queueMask, const TT *triangulation, const IT *order, const DT *scalars, const DT persistenceThreshold) const
 
template<typename IT , class TT >
int computeSimplePropagations (std::vector< Propagation< IT > > &propagations, Propagation< IT > **propagationMask, IT *segmentation, IT *queueMask, const TT *triangulation, const IT *inputOrder) const
 
template<typename IT , typename DT , class TT >
int computePersistenceSensitivePropagations (std::vector< Propagation< IT > > &propagations, Propagation< IT > **propagationMask, IT *segmentation, IT *queueMask, const TT *triangulation, const IT *order, const DT *scalars, const DT persistenceThreshold) const
 
template<typename IT >
int finalizePropagations (std::vector< Propagation< IT > * > &parentPropagations, std::vector< Propagation< IT > > &propagations, const IT nVertices) const
 
template<typename IT , class TT >
int computeSegment (IT *segmentation, Propagation< IT > *propagation, const IT *order, const TT *triangulation) const
 
template<typename IT , class TT >
int computeSegments (IT *segmentation, std::vector< Propagation< IT > * > &propagations, const IT *order, const TT *triangulation) const
 This method computes the segments of a given list of propagations.
 
template<typename IT , class TT >
int computeLocalOrderOfSegmentIteration (IT *localOrder, IT *localVertexSequence, const bool &performSuperlevelSetPropagation, const TT *triangulation, const IT *segmentation, const IT &segmentId, const std::vector< IT > &boundary, const std::vector< IT > &segment, const IT &saddleIdx) const
 
template<typename IT , class TT >
int computeLocalOrderOfSegment (IT *localOrder, const Propagation< IT > *propagation, const TT *triangulation, const IT *segmentation, const IT *inputOrder) const
 
template<typename IT , class TT >
int computeLocalOrderOfSegments (IT *localOrder, const TT *triangulation, const IT *segmentation, const IT *inputOrder, const std::vector< Propagation< IT > * > &propagations) const
 
template<typename IT >
int flattenOrder (IT *outputOrder, const std::vector< Propagation< IT > * > &parentPropagations) const
 
template<typename DT , typename IT >
int flattenScalars (DT *scalars, const std::vector< Propagation< IT > > &propagationsA, const std::vector< Propagation< IT > > &propagationsB={}) const
 
template<typename IT >
int computeGlobalOrder (IT *order, const IT *localOrder, std::vector< std::tuple< IT, IT, IT > > &sortedIndices) const
 
template<typename DT , typename IT >
int computeNumericalPerturbation (DT *scalars, const std::vector< std::tuple< IT, IT, IT > > &sortedIndices, const bool descending=false) const
 
template<typename IT , class TT >
int detectAndRemoveUnauthorizedMaxima (IT *order, IT *segmentation, IT *queueMask, IT *localOrder, Propagation< IT > **propagationMask, std::vector< Propagation< IT > > &propagations, std::vector< std::tuple< IT, IT, IT > > &sortedIndices, const TT *triangulation, const IT *authorizedExtremaIndices, const IT &nAuthorizedExtremaIndices) const
 
template<typename IT , typename DT , class TT >
int detectAndRemoveNonPersistentMaxima (DT *scalars, IT *order, IT *segmentation, IT *queueMask, IT *localOrder, Propagation< IT > **propagationMask, std::vector< Propagation< IT > > &propagations, std::vector< std::tuple< IT, IT, IT > > &sortedIndices, const TT *triangulation, const DT persistenceThreshold) const
 
template<typename IT >
int invertOrder (IT *outputOrder, const IT &nVertices) const
 
template<typename DT , typename IT , class TT >
int removeUnauthorizedExtrema (DT *scalars, IT *order, const TT *triangulation, const IT *authorizedExtremaIndices, const IT &nAuthorizedExtremaIndices, const bool &computePerturbation) const
 
template<typename DT , typename IT , class TT >
int removeNonPersistentExtrema (DT *scalars, IT *order, const TT *triangulation, const DT persistenceThreshold, const bool &computePerturbation, const PAIR_TYPE &pairType=PAIR_TYPE::EXTREMUM_SADDLE) const
 
- Public Member Functions inherited from ttk::Debug
 Debug ()
 
 ~Debug () override
 
virtual int setDebugLevel (const int &debugLevel)
 
int setWrapper (const Wrapper *wrapper) override
 
int printMsg (const std::string &msg, const debug::Priority &priority=debug::Priority::INFO, const debug::LineMode &lineMode=debug::LineMode::NEW, std::ostream &stream=std::cout) const
 
int printMsg (const std::vector< std::string > &msgs, const debug::Priority &priority=debug::Priority::INFO, const debug::LineMode &lineMode=debug::LineMode::NEW, std::ostream &stream=std::cout) const
 
int printErr (const std::string &msg, const debug::LineMode &lineMode=debug::LineMode::NEW, std::ostream &stream=std::cerr) const
 
int printWrn (const std::string &msg, const debug::LineMode &lineMode=debug::LineMode::NEW, std::ostream &stream=std::cerr) const
 
int printMsg (const std::string &msg, const double &progress, const double &time, const int &threads, const double &memory, const debug::LineMode &lineMode=debug::LineMode::NEW, const debug::Priority &priority=debug::Priority::PERFORMANCE, std::ostream &stream=std::cout) const
 
int printMsg (const std::string &msg, const double &progress, const double &time, const debug::LineMode &lineMode=debug::LineMode::NEW, const debug::Priority &priority=debug::Priority::PERFORMANCE, std::ostream &stream=std::cout) const
 
int printMsg (const std::string &msg, const double &progress, const double &time, const int &threads, const debug::LineMode &lineMode=debug::LineMode::NEW, const debug::Priority &priority=debug::Priority::PERFORMANCE, std::ostream &stream=std::cout) const
 
int printMsg (const std::string &msg, const double &progress, const debug::LineMode &lineMode=debug::LineMode::NEW, const debug::Priority &priority=debug::Priority::PERFORMANCE, std::ostream &stream=std::cout) const
 
int printMsg (const std::string &msg, const double &progress, const debug::Priority &priority, const debug::LineMode &lineMode=debug::LineMode::NEW, std::ostream &stream=std::cout) const
 
int printMsg (const std::vector< std::vector< std::string > > &rows, const debug::Priority &priority=debug::Priority::INFO, const bool hasHeader=true, const debug::LineMode &lineMode=debug::LineMode::NEW, std::ostream &stream=std::cout) const
 
int printMsg (const debug::Separator &separator, const debug::LineMode &lineMode=debug::LineMode::NEW, const debug::Priority &priority=debug::Priority::INFO, std::ostream &stream=std::cout) const
 
int printMsg (const debug::Separator &separator, const debug::Priority &priority, const debug::LineMode &lineMode=debug::LineMode::NEW, std::ostream &stream=std::cout) const
 
int printMsg (const std::string &msg, const debug::Separator &separator, const debug::LineMode &lineMode=debug::LineMode::NEW, const debug::Priority &priority=debug::Priority::INFO, std::ostream &stream=std::cout) const
 
void setDebugMsgPrefix (const std::string &prefix)
 
- Public Member Functions inherited from ttk::BaseClass
 BaseClass ()
 
virtual ~BaseClass ()=default
 
int getThreadNumber () const
 
virtual int setThreadNumber (const int threadNumber)
 

Additional Inherited Members

- Protected Member Functions inherited from ttk::Debug
int printMsgInternal (const std::string &msg, const std::string &right, const std::string &filler, const debug::Priority &priority=debug::Priority::INFO, const debug::LineMode &lineMode=debug::LineMode::NEW, std::ostream &stream=std::cout) const
 
int printMsgInternal (const std::string &msg, const debug::Priority &priority, const debug::LineMode &lineMode, std::ostream &stream=std::cout) const
 
int welcomeMsg (std::ostream &stream)
 
- Protected Attributes inherited from ttk::Debug
int debugLevel_
 
std::string debugMsgPrefix_
 
std::string debugMsgNamePrefix_
 
- Protected Attributes inherited from ttk::BaseClass
bool lastObject_
 
int threadNumber_
 
Wrapperwrapper_
 
- Static Protected Attributes inherited from ttk::Debug
static COMMON_EXPORTS debug::LineMode lastLineMode = ttk::debug::LineMode::NEW
 

Detailed Description

Definition at line 45 of file LocalizedTopologicalSimplification.h.

Member Enumeration Documentation

◆ PAIR_TYPE

Enumerator
EXTREMUM_SADDLE 
MINIMUM_SADDLE 
MAXIMUM_SADDLE 

Definition at line 48 of file LocalizedTopologicalSimplification.h.

Constructor & Destructor Documentation

◆ LocalizedTopologicalSimplification()

ttk::lts::LocalizedTopologicalSimplification::LocalizedTopologicalSimplification ( )
inline

Definition at line 54 of file LocalizedTopologicalSimplification.h.

◆ ~LocalizedTopologicalSimplification()

ttk::lts::LocalizedTopologicalSimplification::~LocalizedTopologicalSimplification ( )
overridedefault

Member Function Documentation

◆ allocateMemory()

template<typename IT >
int ttk::lts::LocalizedTopologicalSimplification::allocateMemory ( std::vector< IT > &  segmentation,
std::vector< IT > &  queueMask,
std::vector< IT > &  localOrder,
std::vector< Propagation< IT > * > &  propagationMask,
std::vector< std::tuple< IT, IT, IT > > &  sortedIndices,
const IT &  nVertices 
) const
inline

This method allocates all temporary memory required for LTS procedures.

Definition at line 67 of file LocalizedTopologicalSimplification.h.

◆ computeGlobalOrder()

template<typename IT >
int ttk::lts::LocalizedTopologicalSimplification::computeGlobalOrder ( IT *  order,
const IT *  localOrder,
std::vector< std::tuple< IT, IT, IT > > &  sortedIndices 
) const
inline

Definition at line 1042 of file LocalizedTopologicalSimplification.h.

◆ computeLocalOrderOfSegment()

template<typename IT , class TT >
int ttk::lts::LocalizedTopologicalSimplification::computeLocalOrderOfSegment ( IT *  localOrder,
const Propagation< IT > *  propagation,
const TT *  triangulation,
const IT *  segmentation,
const IT *  inputOrder 
) const
inline

Definition at line 800 of file LocalizedTopologicalSimplification.h.

◆ computeLocalOrderOfSegmentIteration()

template<typename IT , class TT >
int ttk::lts::LocalizedTopologicalSimplification::computeLocalOrderOfSegmentIteration ( IT *  localOrder,
IT *  localVertexSequence,
const bool &  performSuperlevelSetPropagation,
const TT *  triangulation,
const IT *  segmentation,
const IT &  segmentId,
const std::vector< IT > &  boundary,
const std::vector< IT > &  segment,
const IT &  saddleIdx 
) const
inline

Definition at line 729 of file LocalizedTopologicalSimplification.h.

◆ computeLocalOrderOfSegments()

template<typename IT , class TT >
int ttk::lts::LocalizedTopologicalSimplification::computeLocalOrderOfSegments ( IT *  localOrder,
const TT *  triangulation,
const IT *  segmentation,
const IT *  inputOrder,
const std::vector< Propagation< IT > * > &  propagations 
) const
inline

Definition at line 904 of file LocalizedTopologicalSimplification.h.

◆ computeNumericalPerturbation()

template<typename DT , typename IT >
int ttk::lts::LocalizedTopologicalSimplification::computeNumericalPerturbation ( DT *  scalars,
const std::vector< std::tuple< IT, IT, IT > > &  sortedIndices,
const bool  descending = false 
) const
inline

Definition at line 1083 of file LocalizedTopologicalSimplification.h.

◆ computePersistenceSensitivePropagation()

template<typename IT , typename DT , typename TT >
int ttk::lts::LocalizedTopologicalSimplification::computePersistenceSensitivePropagation ( Propagation< IT > &  propagation,
Propagation< IT > **  propagationMask,
IT *  segmentation,
IT *  queueMask,
const TT *  triangulation,
const IT *  order,
const DT *  scalars,
const DT  persistenceThreshold 
) const
inline

Basically the same as the simple propagation procedure, except that a propagation keeps track of the persistence of the computed propagation. As soon as the persistence strictly exceeds the given threshold the propagation is aborted.

Definition at line 349 of file LocalizedTopologicalSimplification.h.

◆ computePersistenceSensitivePropagations()

template<typename IT , typename DT , class TT >
int ttk::lts::LocalizedTopologicalSimplification::computePersistenceSensitivePropagations ( std::vector< Propagation< IT > > &  propagations,
Propagation< IT > **  propagationMask,
IT *  segmentation,
IT *  queueMask,
const TT *  triangulation,
const IT *  order,
const DT *  scalars,
const DT  persistenceThreshold 
) const
inline

This method computes (optionally in parallel) a list of persistence-sensitive propagations.

Definition at line 519 of file LocalizedTopologicalSimplification.h.

◆ computeSegment()

template<typename IT , class TT >
int ttk::lts::LocalizedTopologicalSimplification::computeSegment ( IT *  segmentation,
Propagation< IT > *  propagation,
const IT *  order,
const TT *  triangulation 
) const
inline

This method computes the domain segment of a given propagation. To this end, it stores a list of all segment vertices on the propagation data structure, and adds labels to the segmentation array.

Definition at line 607 of file LocalizedTopologicalSimplification.h.

◆ computeSegments()

template<typename IT , class TT >
int ttk::lts::LocalizedTopologicalSimplification::computeSegments ( IT *  segmentation,
std::vector< Propagation< IT > * > &  propagations,
const IT *  order,
const TT *  triangulation 
) const
inline

This method computes the segments of a given list of propagations.

Definition at line 666 of file LocalizedTopologicalSimplification.h.

◆ computeSimplePropagation()

template<typename IT , typename TT >
int ttk::lts::LocalizedTopologicalSimplification::computeSimplePropagation ( Propagation< IT > &  propagation,
Propagation< IT > **  propagationMask,
IT *  segmentation,
IT *  queueMask,
const TT *  triangulation,
const IT *  order 
) const
inline

This is a simple superlevel set propagation procedure that just absorbs the largest neighbor of the current set until the propagation encounters a saddle. To gain additional speedup this procedure keeps track of vertices that have already been added to the Fibonacci heap via the queueMask (duplicate entries slow down the heap).

Definition at line 227 of file LocalizedTopologicalSimplification.h.

◆ computeSimplePropagations()

template<typename IT , class TT >
int ttk::lts::LocalizedTopologicalSimplification::computeSimplePropagations ( std::vector< Propagation< IT > > &  propagations,
Propagation< IT > **  propagationMask,
IT *  segmentation,
IT *  queueMask,
const TT *  triangulation,
const IT *  inputOrder 
) const
inline

This method computes (optionally in parallel) a list of simple propagations.

Definition at line 479 of file LocalizedTopologicalSimplification.h.

◆ detectAndRemoveNonPersistentMaxima()

template<typename IT , typename DT , class TT >
int ttk::lts::LocalizedTopologicalSimplification::detectAndRemoveNonPersistentMaxima ( DT *  scalars,
IT *  order,
IT *  segmentation,
IT *  queueMask,
IT *  localOrder,
Propagation< IT > **  propagationMask,
std::vector< Propagation< IT > > &  propagations,
std::vector< std::tuple< IT, IT, IT > > &  sortedIndices,
const TT *  triangulation,
const DT  persistenceThreshold 
) const
inline

Definition at line 1198 of file LocalizedTopologicalSimplification.h.

◆ detectAndRemoveUnauthorizedMaxima()

template<typename IT , class TT >
int ttk::lts::LocalizedTopologicalSimplification::detectAndRemoveUnauthorizedMaxima ( IT *  order,
IT *  segmentation,
IT *  queueMask,
IT *  localOrder,
Propagation< IT > **  propagationMask,
std::vector< Propagation< IT > > &  propagations,
std::vector< std::tuple< IT, IT, IT > > &  sortedIndices,
const TT *  triangulation,
const IT *  authorizedExtremaIndices,
const IT &  nAuthorizedExtremaIndices 
) const
inline

Definition at line 1115 of file LocalizedTopologicalSimplification.h.

◆ finalizePropagations()

template<typename IT >
int ttk::lts::LocalizedTopologicalSimplification::finalizePropagations ( std::vector< Propagation< IT > * > &  parentPropagations,
std::vector< Propagation< IT > > &  propagations,
const IT  nVertices 
) const
inline

This method identifies from a set of propagations so-called parent propagations, which are those propagations that either terminated at a saddle who has larger unvisited neighbors, or that were merged into a propagation that was aborted (during persistence-sensitive simplification).

Definition at line 567 of file LocalizedTopologicalSimplification.h.

◆ flattenOrder()

template<typename IT >
int ttk::lts::LocalizedTopologicalSimplification::flattenOrder ( IT *  outputOrder,
const std::vector< Propagation< IT > * > &  parentPropagations 
) const
inline

Definition at line 973 of file LocalizedTopologicalSimplification.h.

◆ flattenScalars()

template<typename DT , typename IT >
int ttk::lts::LocalizedTopologicalSimplification::flattenScalars ( DT *  scalars,
const std::vector< Propagation< IT > > &  propagationsA,
const std::vector< Propagation< IT > > &  propagationsB = {} 
) const
inline

Definition at line 1002 of file LocalizedTopologicalSimplification.h.

◆ initializeMemory()

template<typename IT >
int ttk::lts::LocalizedTopologicalSimplification::initializeMemory ( IT *  segmentation,
IT *  queueMask,
IT *  localOrder,
Propagation< IT > **  propagationMask,
const IT &  nVertices 
) const
inline

This method initializes all temporary memory for LTS procedures (assumes memory is already allocated).

Definition at line 94 of file LocalizedTopologicalSimplification.h.

◆ initializePropagations()

template<typename IT , class TT >
int ttk::lts::LocalizedTopologicalSimplification::initializePropagations ( std::vector< Propagation< IT > > &  propagations,
IT *  authorizationMask,
IT *  maximaBuffer,
const IT *  authorizedExtremaIndices,
const IT &  nAuthorizedExtremaIndices,
const IT *  order,
const TT *  triangulation 
) const
inline

This method iterates over an order array and detects all maxima, for which it will then initialize a propagation data structure. One can also pass a whitelist of authorized maxima that will be skipped. The maximaBuffer parameter needs to be big enough to fit all possible maxima indices (the buffer is explicitly exposed for memory reuse). Note, propagations are sorted in ascending order of their corresponding maxima.

Definition at line 129 of file LocalizedTopologicalSimplification.h.

◆ invertOrder()

template<typename IT >
int ttk::lts::LocalizedTopologicalSimplification::invertOrder ( IT *  outputOrder,
const IT &  nVertices 
) const
inline

Definition at line 1284 of file LocalizedTopologicalSimplification.h.

◆ preconditionTriangulation()

int ttk::lts::LocalizedTopologicalSimplification::preconditionTriangulation ( ttk::AbstractTriangulation triangulation) const
inline

Definition at line 59 of file LocalizedTopologicalSimplification.h.

◆ removeNonPersistentExtrema()

template<typename DT , typename IT , class TT >
int ttk::lts::LocalizedTopologicalSimplification::removeNonPersistentExtrema ( DT *  scalars,
IT *  order,
const TT *  triangulation,
const DT  persistenceThreshold,
const bool &  computePerturbation,
const PAIR_TYPE pairType = PAIR_TYPE::EXTREMUM_SADDLE 
) const
inline

Definition at line 1412 of file LocalizedTopologicalSimplification.h.

◆ removeUnauthorizedExtrema()

template<typename DT , typename IT , class TT >
int ttk::lts::LocalizedTopologicalSimplification::removeUnauthorizedExtrema ( DT *  scalars,
IT *  order,
const TT *  triangulation,
const IT *  authorizedExtremaIndices,
const IT &  nAuthorizedExtremaIndices,
const bool &  computePerturbation 
) const
inline

Definition at line 1304 of file LocalizedTopologicalSimplification.h.


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