/// Lance le traceur. void OuvrirTraceur() { // erreurs et debug debug = fopen(nomFichierDebug, "w") ; traceurDebug = new rlog::StdioNode(fileno(debug)) ; traceurDebug->subscribeTo( rlog::GetGlobalChannel( "warning" )); traceurDebug->subscribeTo( rlog::GetGlobalChannel( "error" )); traceurDebug->subscribeTo( rlog::GetGlobalChannel( "debug" )); // sortie sortie = fopen(nomFichierSortie, "w") ; traceurSortie = new rlog::StdioNode(fileno(sortie)) ; // on se définit notre propre channel de sortie DEF_CHANNEL("compilateur", rlog::Log_Info) ; traceurSortie->subscribeTo( rlog::GetGlobalChannel( "compilateur" )); }
#include <utilities/log.h> #ifdef LOGGING static rlog::RLogChannel* rlTranspositions = DEF_CHANNEL("topology/persistence/transpositions", rlog::Log_Debug); #endif // LOGGING #ifdef COUNTERS static Counter* cTransposition = GetCounter("persistence/transposition"); static Counter* cTranspositionDiffDim = GetCounter("persistence/transposition/diffdim"); static Counter* cTranspositionCase12 = GetCounter("persistence/transposition/case/1/2"); static Counter* cTranspositionCase12s = GetCounter("persistence/transposition/case/1/2/special"); static Counter* cTranspositionCase112 = GetCounter("persistence/transposition/case/1/1/2"); static Counter* cTranspositionCase111 = GetCounter("persistence/transposition/case/1/1/1"); static Counter* cTranspositionCase22 = GetCounter("persistence/transposition/case/2/2"); static Counter* cTranspositionCase212 = GetCounter("persistence/transposition/case/2/1/2"); static Counter* cTranspositionCase211 = GetCounter("persistence/transposition/case/2/1/1"); static Counter* cTranspositionCase32 = GetCounter("persistence/transposition/case/3/2"); static Counter* cTranspositionCase31 = GetCounter("persistence/transposition/case/3/1"); static Counter* cTranspositionCase4 = GetCounter("persistence/transposition/case/4"); #endif // COUNTERS /* Trails */ template<class D, class CT, class OT, class E, class Cmp, class CCmp> DynamicPersistenceTrails<D,CT,OT,E,Cmp,CCmp>:: DynamicPersistenceTrails(): ccmp_(consistent_order()) {} template<class D, class CT, class OT, class E, class Cmp, class CCmp>
/* Implementations */ #ifdef LOGGING static rlog::RLogChannel* rlOrderList = DEF_CHANNEL("utilities/orderlist", rlog::Log_Debug); #endif // LOGGING // This cannot be in the header file to conform to the C++ standard template<class T> const float OrderList<T>::density_threshold = 1.2; template<class T> void OrderList<T>:: swap(iterator i, iterator j) { typename Parent::iterator i_base = i.get_base(); typename Parent::iterator j_base = j.get_base(); std::swap(i_base->tag, j_base->tag); // Exchange the actual elements in the list --- so that iterators behave as expected typename Parent::iterator after_j = boost::next(j_base); Parent::splice(i_base, *this, j_base); Parent::splice(after_j, *this, i_base); } template<class T> template<class BinaryPredicate> void OrderList<T>:: sort(BinaryPredicate cmp) {
#include "utilities/log.h" #include "utilities/counter.h" #ifdef LOGGING static rlog::RLogChannel* rlSimulator = DEF_CHANNEL("geometry/simulator", rlog::Log_Debug); #endif // LOGGING #ifdef COUNTERS static Counter* cSimulatorProcess = GetCounter("simulator/process"); #endif // COUNTERS template<class FuncKernel_, template<class Event> class EventComparison_> template<class Event_> typename Simulator<FuncKernel_, EventComparison_>::Key Simulator<FuncKernel_, EventComparison_>:: add(const Event_& e) { Event* ee = new Event_(e); return queue_.push(ee); } template<class FuncKernel_, template<class Event> class EventComparison_> template<class Event_> typename Simulator<FuncKernel_, EventComparison_>::Key Simulator<FuncKernel_, EventComparison_>:: add(const Function& f, const Event_& e) { Event* ee = new Event_(e); rLog(rlSimulator, "Solving: %s", tostring(f).c_str());
/* Implementations */ #include <fstream> #include <sstream> #include "utilities/log.h" #ifdef LOGGING static rlog::RLogChannel* rlVineyard = DEF_CHANNEL("topology/vineyard", rlog::Log_Debug); #endif // LOGGING template<class I, class It, class E> void Vineyard<I,It,E>:: start_vines(Iterator bg, Iterator end) { AssertMsg(evaluator != 0, "Cannot start vines with a null evaluator"); for (Iterator cur = bg; cur != end; ++cur) { if (!cur->sign()) continue; Dimension dim = evaluator->dimension(cur); if (dim >= vines.size()) { AssertMsg(dim == vines.size(), "New dimension has to be contiguous"); vines.push_back(VineList()); vines_vector.push_back(boost::prior(vines.end())); } start_vine(cur); record_knee(cur);
#include <utilities/log.h> #include <utilities/containers.h> #include <utilities/property-maps.h> #include <boost/utility/enable_if.hpp> #include <boost/utility.hpp> #include <boost/foreach.hpp> #include <boost/foreach.hpp> #ifdef LOGGING static rlog::RLogChannel* rlPersistence = DEF_CHANNEL("topology/persistence", rlog::Log_Debug); #endif // LOGGING #ifdef COUNTERS static Counter* cPersistencePair = GetCounter("persistence/pair"); static Counter* cPersistencePairBoundaries = GetCounter("persistence/pair/boundaries"); static Counter* cPersistencePairCycleLength = GetCounter("persistence/pair/cyclelength"); #endif // COUNTERS template<class D, class CT, class OT, class E, class Cmp> template<class Filtration> void StaticPersistence<D, CT, OT, E, Cmp>:: initialize(const Filtration& filtration) { order_.assign(filtration.size(), OrderElement()); rLog(rlPersistence, "Initializing persistence"); OffsetMap<typename Filtration::Index, iterator> om(filtration.begin(), begin()); for (typename Filtration::Index cur = filtration.begin(); cur != filtration.end(); ++cur)