TTK
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Protected Attributes | List of all members
ttk::PDBarycenter Class Reference

#include <PDBarycenter.h>

Inheritance diagram for ttk::PDBarycenter:
ttk::Debug ttk::BaseClass

Public Types

using KDT = PersistenceDiagramAuction::KDT
 
using KDTreePair = std::pair< typename KDT::KDTreeRoot, typename KDT::KDTreeMap >
 

Public Member Functions

 PDBarycenter ()
 
 ~PDBarycenter () override=default
 
std::vector< std::vector< MatchingType > > execute (DiagramType &barycenter)
 
std::vector< std::vector< MatchingType > > executeMunkresBarycenter (DiagramType &barycenter)
 
std::vector< std::vector< MatchingType > > executeAuctionBarycenter (DiagramType &barycenter)
 
std::vector< std::vector< MatchingType > > executePartialBiddingBarycenter (DiagramType &barycenter)
 
void setBidderDiagrams ()
 
double enrichCurrentBidderDiagrams (double previous_min_persistence, double min_persistence, std::vector< double > &initial_diagonal_prices, std::vector< double > &initial_off_diagonal_prices, int min_points_to_add, bool add_points_to_barycenter=true)
 
void setInitialBarycenter (double min_persistence)
 
double getMaxPersistence ()
 
double getLowestPersistence ()
 
double getMinimalPrice (int i)
 
KDTreePair getKDTree () const
 
void runMatching (double *total_cost, double epsilon, std::vector< int > &sizes, KDT &kdt, std::vector< KDT * > &correspondence_kdt_map, std::vector< double > *min_diag_price, std::vector< double > *min_price, std::vector< std::vector< MatchingType > > *all_matchings, bool use_kdt, bool actual_distance)
 
void runMatchingAuction (double *total_cost, std::vector< int > &sizes, KDT &kdt, std::vector< KDT * > &correspondence_kdt_map, std::vector< double > *min_diag_price, std::vector< std::vector< MatchingType > > *all_matchings, bool use_kdt, bool actual_distance)
 
double updateBarycenter (std::vector< std::vector< MatchingType > > &matchings)
 
double computeRealCost ()
 
bool isPrecisionObjectiveMet (double, int)
 
bool hasBarycenterConverged (std::vector< std::vector< MatchingType > > &matchings, std::vector< std::vector< MatchingType > > &previous_matchings)
 
std::vector< std::vector< MatchingType > > correctMatchings (std::vector< std::vector< MatchingType > > &previous_matchings)
 
bool is_matching_stable ()
 
double getEpsilon (double rho)
 
double getRho (double epsilon)
 
void setDeterministic (const bool deterministic)
 
void setMethod (const int &method)
 
int setDiagrams (std::vector< DiagramType > *data)
 
int setNumberOfInputs (int numberOfInputs)
 
void setWasserstein (const int &wasserstein)
 
void setUseProgressive (const bool use_progressive)
 
void setGeometricalFactor (const double geometrical_factor)
 
void setLambda (const double lambda)
 
void setCurrentBidders (std::vector< BidderDiagram > &diagrams)
 
void setCurrentBarycenter (std::vector< GoodDiagram > &barycenters)
 
std::vector< BidderDiagram > & getCurrentBidders ()
 
std::vector< GoodDiagram > & getCurrentBarycenter ()
 
void setReinitPrices (const bool reinit_prices)
 
void setEpsilonDecreases (const bool epsilon_decreases)
 
void setEarlyStoppage (const bool early_stoppage)
 
void setDiagramType (const int &diagramType)
 
void setNonMatchingWeight (double nonMatchingWeight)
 
double getCost ()
 
void setDeltaLim (double delta_lim)
 
- 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)
 

Protected Attributes

std::vector< double > precision_
 
double delta_lim_ {0.01}
 
bool deterministic_ {false}
 
std::string method_ {"Partial Bidding"}
 
int wasserstein_ {2}
 
double nonMatchingWeight_ = 1.0
 
double geometrical_factor_ {1.0}
 
double lambda_
 
int diagramType_
 
ttk::CriticalType nt1_
 
ttk::CriticalType nt2_
 
double cost_
 
int numberOfInputs_
 
bool use_progressive_ {true}
 
double epsilon_min_ {1e-5}
 
std::vector< DiagramType > * inputDiagrams_
 
int points_added_
 
int points_deleted_
 
std::vector< std::vector< double > > all_matchings_
 
std::vector< std::vector< double > > all_old_matchings_
 
std::vector< BidderDiagrambidder_diagrams_
 
std::vector< BidderDiagramcurrent_bidder_diagrams_
 
std::vector< std::vector< int > > current_bidder_ids_
 
std::vector< GoodDiagrambarycenter_goods_
 
bool reinit_prices_ {true}
 
bool epsilon_decreases_ {true}
 
bool early_stoppage_ {true}
 
- 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_
 

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)
 
- Static Protected Attributes inherited from ttk::Debug
static COMMON_EXPORTS debug::LineMode lastLineMode = ttk::debug::LineMode::NEW
 

Detailed Description

Author
Jules Vidal jules.nosp@m..vid.nosp@m.al@li.nosp@m.p6.f.nosp@m.r
Joseph Budin josep.nosp@m.h.bu.nosp@m.din@p.nosp@m.olyt.nosp@m.echni.nosp@m.que..nosp@m.edu
Date
September 2019

Related publication
"Progressive Wasserstein Barycenters of Persistence Diagrams"
Jules Vidal, Joseph Budin and Julien Tierny
Proc. of IEEE VIS 2019.
IEEE Transactions on Visualization and Computer Graphics, 2019.

See also
PersistenceDiagramClustering

Definition at line 25 of file PDBarycenter.h.

Member Typedef Documentation

◆ KDT

Definition at line 56 of file PDBarycenter.h.

◆ KDTreePair

using ttk::PDBarycenter::KDTreePair = std::pair<typename KDT::KDTreeRoot, typename KDT::KDTreeMap>

Definition at line 57 of file PDBarycenter.h.

Constructor & Destructor Documentation

◆ PDBarycenter()

ttk::PDBarycenter::PDBarycenter ( )
inline

Definition at line 28 of file PDBarycenter.h.

◆ ~PDBarycenter()

ttk::PDBarycenter::~PDBarycenter ( )
overridedefault

Member Function Documentation

◆ computeRealCost()

double ttk::PDBarycenter::computeRealCost ( )

Definition at line 718 of file PDBarycenter.cpp.

◆ correctMatchings()

std::vector< std::vector< ttk::MatchingType > > ttk::PDBarycenter::correctMatchings ( std::vector< std::vector< MatchingType > > &  previous_matchings)

Definition at line 135 of file PDBarycenter.cpp.

◆ enrichCurrentBidderDiagrams()

double ttk::PDBarycenter::enrichCurrentBidderDiagrams ( double  previous_min_persistence,
double  min_persistence,
std::vector< double > &  initial_diagonal_prices,
std::vector< double > &  initial_off_diagonal_prices,
int  min_points_to_add,
bool  add_points_to_barycenter = true 
)

Definition at line 395 of file PDBarycenter.cpp.

◆ execute()

std::vector< std::vector< ttk::MatchingType > > ttk::PDBarycenter::execute ( DiagramType barycenter)

Definition at line 22 of file PDBarycenter.cpp.

◆ executeAuctionBarycenter()

std::vector< std::vector< ttk::MatchingType > > ttk::PDBarycenter::executeAuctionBarycenter ( DiagramType barycenter)

Definition at line 608 of file PDBarycenter.cpp.

◆ executeMunkresBarycenter()

std::vector< std::vector< MatchingType > > ttk::PDBarycenter::executeMunkresBarycenter ( DiagramType barycenter)

◆ executePartialBiddingBarycenter()

std::vector< std::vector< MatchingType > > ttk::PDBarycenter::executePartialBiddingBarycenter ( DiagramType barycenter)

◆ getCost()

double ttk::PDBarycenter::getCost ( )
inline

Definition at line 186 of file PDBarycenter.h.

◆ getCurrentBarycenter()

std::vector< GoodDiagram > & ttk::PDBarycenter::getCurrentBarycenter ( )
inline

Definition at line 152 of file PDBarycenter.h.

◆ getCurrentBidders()

std::vector< BidderDiagram > & ttk::PDBarycenter::getCurrentBidders ( )
inline

Definition at line 148 of file PDBarycenter.h.

◆ getEpsilon()

double ttk::PDBarycenter::getEpsilon ( double  rho)

Definition at line 364 of file PDBarycenter.cpp.

◆ getKDTree()

ttk::PDBarycenter::KDTreePair ttk::PDBarycenter::getKDTree ( ) const

Definition at line 569 of file PDBarycenter.cpp.

◆ getLowestPersistence()

double ttk::PDBarycenter::getLowestPersistence ( )

Definition at line 519 of file PDBarycenter.cpp.

◆ getMaxPersistence()

double ttk::PDBarycenter::getMaxPersistence ( )

Definition at line 483 of file PDBarycenter.cpp.

◆ getMinimalPrice()

double ttk::PDBarycenter::getMinimalPrice ( int  i)

Definition at line 499 of file PDBarycenter.cpp.

◆ getRho()

double ttk::PDBarycenter::getRho ( double  epsilon)

Definition at line 368 of file PDBarycenter.cpp.

◆ hasBarycenterConverged()

bool ttk::PDBarycenter::hasBarycenterConverged ( std::vector< std::vector< MatchingType > > &  matchings,
std::vector< std::vector< MatchingType > > &  previous_matchings 
)

Definition at line 114 of file PDBarycenter.cpp.

◆ is_matching_stable()

bool ttk::PDBarycenter::is_matching_stable ( )

◆ isPrecisionObjectiveMet()

bool ttk::PDBarycenter::isPrecisionObjectiveMet ( double  precision_objective,
int  mode 
)

Definition at line 733 of file PDBarycenter.cpp.

◆ runMatching()

void ttk::PDBarycenter::runMatching ( double *  total_cost,
double  epsilon,
std::vector< int > &  sizes,
KDT kdt,
std::vector< KDT * > &  correspondence_kdt_map,
std::vector< double > *  min_diag_price,
std::vector< double > *  min_price,
std::vector< std::vector< MatchingType > > *  all_matchings,
bool  use_kdt,
bool  actual_distance 
)

Definition at line 26 of file PDBarycenter.cpp.

◆ runMatchingAuction()

void ttk::PDBarycenter::runMatchingAuction ( double *  total_cost,
std::vector< int > &  sizes,
KDT kdt,
std::vector< KDT * > &  correspondence_kdt_map,
std::vector< double > *  min_diag_price,
std::vector< std::vector< MatchingType > > *  all_matchings,
bool  use_kdt,
bool  actual_distance 
)

Definition at line 79 of file PDBarycenter.cpp.

◆ setBidderDiagrams()

void ttk::PDBarycenter::setBidderDiagrams ( )

Definition at line 372 of file PDBarycenter.cpp.

◆ setCurrentBarycenter()

void ttk::PDBarycenter::setCurrentBarycenter ( std::vector< GoodDiagram > &  barycenters)
inline

Definition at line 144 of file PDBarycenter.h.

◆ setCurrentBidders()

void ttk::PDBarycenter::setCurrentBidders ( std::vector< BidderDiagram > &  diagrams)
inline

Definition at line 140 of file PDBarycenter.h.

◆ setDeltaLim()

void ttk::PDBarycenter::setDeltaLim ( double  delta_lim)
inline

Definition at line 190 of file PDBarycenter.h.

◆ setDeterministic()

void ttk::PDBarycenter::setDeterministic ( const bool  deterministic)
inline

Definition at line 97 of file PDBarycenter.h.

◆ setDiagrams()

int ttk::PDBarycenter::setDiagrams ( std::vector< DiagramType > *  data)
inline

Definition at line 112 of file PDBarycenter.h.

◆ setDiagramType()

void ttk::PDBarycenter::setDiagramType ( const int &  diagramType)
inline

Definition at line 168 of file PDBarycenter.h.

◆ setEarlyStoppage()

void ttk::PDBarycenter::setEarlyStoppage ( const bool  early_stoppage)
inline

Definition at line 164 of file PDBarycenter.h.

◆ setEpsilonDecreases()

void ttk::PDBarycenter::setEpsilonDecreases ( const bool  epsilon_decreases)
inline

Definition at line 160 of file PDBarycenter.h.

◆ setGeometricalFactor()

void ttk::PDBarycenter::setGeometricalFactor ( const double  geometrical_factor)
inline

Definition at line 132 of file PDBarycenter.h.

◆ setInitialBarycenter()

void ttk::PDBarycenter::setInitialBarycenter ( double  min_persistence)

Definition at line 538 of file PDBarycenter.cpp.

◆ setLambda()

void ttk::PDBarycenter::setLambda ( const double  lambda)
inline

Definition at line 136 of file PDBarycenter.h.

◆ setMethod()

void ttk::PDBarycenter::setMethod ( const int &  method)
inline

Definition at line 101 of file PDBarycenter.h.

◆ setNonMatchingWeight()

void ttk::PDBarycenter::setNonMatchingWeight ( double  nonMatchingWeight)
inline

Definition at line 182 of file PDBarycenter.h.

◆ setNumberOfInputs()

int ttk::PDBarycenter::setNumberOfInputs ( int  numberOfInputs)
inline

Definition at line 117 of file PDBarycenter.h.

◆ setReinitPrices()

void ttk::PDBarycenter::setReinitPrices ( const bool  reinit_prices)
inline

Definition at line 156 of file PDBarycenter.h.

◆ setUseProgressive()

void ttk::PDBarycenter::setUseProgressive ( const bool  use_progressive)
inline

Definition at line 128 of file PDBarycenter.h.

◆ setWasserstein()

void ttk::PDBarycenter::setWasserstein ( const int &  wasserstein)
inline

Definition at line 124 of file PDBarycenter.h.

◆ updateBarycenter()

double ttk::PDBarycenter::updateBarycenter ( std::vector< std::vector< MatchingType > > &  matchings)

Definition at line 163 of file PDBarycenter.cpp.

Member Data Documentation

◆ all_matchings_

std::vector<std::vector<double> > ttk::PDBarycenter::all_matchings_
protected

Definition at line 228 of file PDBarycenter.h.

◆ all_old_matchings_

std::vector<std::vector<double> > ttk::PDBarycenter::all_old_matchings_
protected

Definition at line 229 of file PDBarycenter.h.

◆ barycenter_goods_

std::vector<GoodDiagram> ttk::PDBarycenter::barycenter_goods_
protected

Definition at line 233 of file PDBarycenter.h.

◆ bidder_diagrams_

std::vector<BidderDiagram> ttk::PDBarycenter::bidder_diagrams_
protected

Definition at line 230 of file PDBarycenter.h.

◆ cost_

double ttk::PDBarycenter::cost_
protected

Definition at line 219 of file PDBarycenter.h.

◆ current_bidder_diagrams_

std::vector<BidderDiagram> ttk::PDBarycenter::current_bidder_diagrams_
protected

Definition at line 231 of file PDBarycenter.h.

◆ current_bidder_ids_

std::vector<std::vector<int> > ttk::PDBarycenter::current_bidder_ids_
protected

Definition at line 232 of file PDBarycenter.h.

◆ delta_lim_

double ttk::PDBarycenter::delta_lim_ {0.01}
protected

Definition at line 198 of file PDBarycenter.h.

◆ deterministic_

bool ttk::PDBarycenter::deterministic_ {false}
protected

Definition at line 201 of file PDBarycenter.h.

◆ diagramType_

int ttk::PDBarycenter::diagramType_
protected

Definition at line 216 of file PDBarycenter.h.

◆ early_stoppage_

bool ttk::PDBarycenter::early_stoppage_ {true}
protected

Definition at line 237 of file PDBarycenter.h.

◆ epsilon_decreases_

bool ttk::PDBarycenter::epsilon_decreases_ {true}
protected

Definition at line 236 of file PDBarycenter.h.

◆ epsilon_min_

double ttk::PDBarycenter::epsilon_min_ {1e-5}
protected

Definition at line 222 of file PDBarycenter.h.

◆ geometrical_factor_

double ttk::PDBarycenter::geometrical_factor_ {1.0}
protected

Definition at line 207 of file PDBarycenter.h.

◆ inputDiagrams_

std::vector<DiagramType>* ttk::PDBarycenter::inputDiagrams_
protected

Definition at line 223 of file PDBarycenter.h.

◆ lambda_

double ttk::PDBarycenter::lambda_
protected

Definition at line 214 of file PDBarycenter.h.

◆ method_

std::string ttk::PDBarycenter::method_ {"Partial Bidding"}
protected

Definition at line 203 of file PDBarycenter.h.

◆ nonMatchingWeight_

double ttk::PDBarycenter::nonMatchingWeight_ = 1.0
protected

Definition at line 205 of file PDBarycenter.h.

◆ nt1_

ttk::CriticalType ttk::PDBarycenter::nt1_
protected

Definition at line 217 of file PDBarycenter.h.

◆ nt2_

ttk::CriticalType ttk::PDBarycenter::nt2_
protected

Definition at line 218 of file PDBarycenter.h.

◆ numberOfInputs_

int ttk::PDBarycenter::numberOfInputs_
protected

Definition at line 220 of file PDBarycenter.h.

◆ points_added_

int ttk::PDBarycenter::points_added_
protected

Definition at line 225 of file PDBarycenter.h.

◆ points_deleted_

int ttk::PDBarycenter::points_deleted_
protected

Definition at line 226 of file PDBarycenter.h.

◆ precision_

std::vector<double> ttk::PDBarycenter::precision_
protected

Definition at line 196 of file PDBarycenter.h.

◆ reinit_prices_

bool ttk::PDBarycenter::reinit_prices_ {true}
protected

Definition at line 235 of file PDBarycenter.h.

◆ use_progressive_

bool ttk::PDBarycenter::use_progressive_ {true}
protected

Definition at line 221 of file PDBarycenter.h.

◆ wasserstein_

int ttk::PDBarycenter::wasserstein_ {2}
protected

Definition at line 204 of file PDBarycenter.h.


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