diff --git a/alib2algo/src/automaton/determinize/DeterminizeRHDPDAPart.cxx b/alib2algo/src/automaton/determinize/DeterminizeRHDPDAPart.cxx index 5a3de3026431567f6cb9f29471d36b1587aa173b..3e9f31915ec1f23d5aa5a762524200657a711730 100644 --- a/alib2algo/src/automaton/determinize/DeterminizeRHDPDAPart.cxx +++ b/alib2algo/src/automaton/determinize/DeterminizeRHDPDAPart.cxx @@ -226,7 +226,7 @@ automaton::RealTimeHeightDeterministicDPDA < > Determinize::determinize(const au for(const auto& stateSymbol : stateSymbols) { if ( common::GlobalData::verbose ) - std::clog << "Dirty state symbol: " << stateSymbol << std::endl; + common::Streams::log << "Dirty state symbol: " << stateSymbol << std::endl; ext::tuple<ext::set<ext::variant<DefaultEpsilonType, DefaultSymbolType>>, ext::set<ext::variant<DefaultEpsilonType, DefaultSymbolType>>, ext::set<ext::variant<DefaultEpsilonType, DefaultSymbolType>>> partitioning = getLocalCallRetPartitioning(n, stateSymbol.first); @@ -243,7 +243,7 @@ automaton::RealTimeHeightDeterministicDPDA < > Determinize::determinize(const au for(const auto& state : states) { if ( common::GlobalData::verbose ) - std::clog << "Dirty state: " << state << std::endl; + common::Streams::log << "Dirty state: " << state << std::endl; ext::tuple<ext::set<ext::variant<DefaultEpsilonType, DefaultSymbolType>>, ext::set<ext::variant<DefaultEpsilonType, DefaultSymbolType>>, ext::set<ext::variant<DefaultEpsilonType, DefaultSymbolType>>> partitioning = getLocalCallRetPartitioning(n, state); ext::set<ext::variant<DefaultEpsilonType, DefaultSymbolType>>& localPart = std::get<0>(partitioning); @@ -268,10 +268,10 @@ automaton::RealTimeHeightDeterministicDPDA < > Determinize::determinize(const au } if ( common::GlobalData::verbose ) { - std::clog << "Rubbish states: " << rubbishStates << std::endl; - std::clog << "Rubbish return transitions: " << rubbishReturnTransitions << std::endl; - std::clog << "Rubbish call transitions: " << rubbishCallTransitions << std::endl; - std::clog << "Rubbish local transitions:" << rubbishLocalTransitions << std::endl; + common::Streams::log << "Rubbish states: " << rubbishStates << std::endl; + common::Streams::log << "Rubbish return transitions: " << rubbishReturnTransitions << std::endl; + common::Streams::log << "Rubbish call transitions: " << rubbishCallTransitions << std::endl; + common::Streams::log << "Rubbish local transitions:" << rubbishLocalTransitions << std::endl; } return d; diff --git a/alib2algo/src/automaton/run/Run.h b/alib2algo/src/automaton/run/Run.h index 3b188422e1677b039b0ac3405a0209286cf3edeb..c3aef1a7dd5c073574288d3c55f0b73db6216106 100644 --- a/alib2algo/src/automaton/run/Run.h +++ b/alib2algo/src/automaton/run/Run.h @@ -74,7 +74,7 @@ ext::tuple < bool, StateType, ext::set < unsigned > > Run::calculateState ( cons occurrences.insert ( i ); if ( common::GlobalData::verbose ) - std::clog << state << std::endl; + common::Streams::log << state << std::endl; for ( const SymbolType & symbol : string.getContent ( ) ) { auto transition = automaton.getTransitions ( ).find ( ext::make_pair ( state, symbol ) ); @@ -91,7 +91,7 @@ ext::tuple < bool, StateType, ext::set < unsigned > > Run::calculateState ( cons occurrences.insert ( i ); if ( common::GlobalData::verbose ) - std::clog << state << std::endl; + common::Streams::log << state << std::endl; } return ext::make_tuple ( res, state, occurrences ); @@ -113,7 +113,7 @@ ext::tuple < bool, ext::set < StateType >, ext::set < unsigned > > Run::calculat occurrences.insert ( i ); if ( common::GlobalData::verbose ) - std::clog << states << std::endl; + common::Streams::log << states << std::endl; for ( const SymbolType & symbol : string.getContent ( ) ) { ext::set < StateType > next; @@ -134,7 +134,7 @@ ext::tuple < bool, ext::set < StateType >, ext::set < unsigned > > Run::calculat occurrences.insert ( i ); if ( common::GlobalData::verbose ) - std::clog << states << std::endl; + common::Streams::log << states << std::endl; } return ext::make_tuple ( res, states, occurrences ); @@ -173,7 +173,7 @@ ext::pair < bool, StateType > Run::calculateState ( const automaton::DFTA < Symb if ( automaton.getFinalStates ( ).count ( state ) ) occ.insert ( tmp ); if ( common::GlobalData::verbose ) - std::clog << state << std::endl; + common::Streams::log << state << std::endl; return ext::make_pair ( true, state ); } @@ -230,7 +230,7 @@ ext::pair < bool, ext::set < StateType > > Run::calculateStates ( const automato if ( automaton.getFinalStates ( ).count ( state ) ) occ.insert ( tmp ); if ( common::GlobalData::verbose ) - std::clog << states << std::endl; + common::Streams::log << states << std::endl; return ext::make_pair ( sign, states ); } @@ -276,7 +276,7 @@ ext::tuple < bool, StateType, ext::set < unsigned >, ext::deque < PushdownStoreS occ.insert ( i ); if ( common::GlobalData::verbose ) - std::clog << state << std::endl; + common::Streams::log << state << std::endl; for ( const InputSymbolType & symbol : string.getContent ( ) ) { auto transition = automaton.getTransitions ( ).find ( ext::make_pair ( state, symbol ) ); @@ -304,7 +304,7 @@ ext::tuple < bool, StateType, ext::set < unsigned >, ext::deque < PushdownStoreS occ.insert ( i ); if ( common::GlobalData::verbose ) - std::clog << state << std::endl; + common::Streams::log << state << std::endl; } return ext::make_tuple ( res, state, occ, pushdownStore ); @@ -326,7 +326,7 @@ ext::tuple < bool, StateType, ext::set < unsigned >, ext::deque < PushdownStoreS occ.insert ( i ); if ( common::GlobalData::verbose ) - std::clog << state << std::endl; + common::Streams::log << state << std::endl; for ( const InputSymbolType & symbol : string.getContent ( ) ) { if ( automaton.getCallInputAlphabet ( ).count ( symbol ) ) { @@ -370,7 +370,7 @@ ext::tuple < bool, StateType, ext::set < unsigned >, ext::deque < PushdownStoreS occ.insert ( i ); if ( common::GlobalData::verbose ) - std::clog << state << std::endl; + common::Streams::log << state << std::endl; } return ext::make_tuple ( res, state, occ, pushdownStore ); @@ -392,7 +392,7 @@ ext::tuple < bool, StateType, ext::set < unsigned >, ext::deque < PushdownStoreS occ.insert ( i ); if ( common::GlobalData::verbose ) - std::clog << state << std::endl; + common::Streams::log << state << std::endl; for ( auto symbolIter = string.getContent ( ).begin ( ); symbolIter != string.getContent ( ).end ( ); ) { @@ -450,7 +450,7 @@ ext::tuple < bool, StateType, ext::set < unsigned >, ext::deque < PushdownStoreS occ.insert ( i ); if ( common::GlobalData::verbose ) - std::clog << state << std::endl; + common::Streams::log << state << std::endl; if ( res == false ) break; @@ -475,8 +475,8 @@ ext::tuple < bool, StateType, ext::set < unsigned >, ext::deque < PushdownStoreS occ.insert ( i ); if ( common::GlobalData::verbose ) { - std::clog << "State : " << state << std::endl; - std::clog << "PushdownStore : " << pushdownStore << std::endl; + common::Streams::log << "State : " << state << std::endl; + common::Streams::log << "PushdownStore : " << pushdownStore << std::endl; } for ( auto symbolIter = string.getContent ( ).begin ( ); symbolIter != string.getContent ( ).end ( ); ) { @@ -495,7 +495,7 @@ ext::tuple < bool, StateType, ext::set < unsigned >, ext::deque < PushdownStoreS } if ( common::GlobalData::verbose ) - std::clog << "Transition: " << transition->first << " to " << transition->second << std::endl; + common::Streams::log << "Transition: " << transition->first << " to " << transition->second << std::endl; for ( unsigned j = 0; j < std::get < 2 > ( transition->first ).size ( ); j++ ) pushdownStore.pop_back ( ); @@ -512,8 +512,8 @@ ext::tuple < bool, StateType, ext::set < unsigned >, ext::deque < PushdownStoreS occ.insert ( i ); if ( common::GlobalData::verbose ) { - std::clog << "State: " << state << std::endl; - std::clog << "PushdownStore: " << pushdownStore << std::endl; + common::Streams::log << "State: " << state << std::endl; + common::Streams::log << "PushdownStore: " << pushdownStore << std::endl; } } diff --git a/alib2algo/src/automaton/simplify/Minimize.h b/alib2algo/src/automaton/simplify/Minimize.h index ad88400f65f0e3d4fb9aad5d4587dfcd463309c6..a05977a4a89687fb4b61db33d85b09b81b684515 100644 --- a/alib2algo/src/automaton/simplify/Minimize.h +++ b/alib2algo/src/automaton/simplify/Minimize.h @@ -139,7 +139,7 @@ automaton::DFA < SymbolType, StateType > Minimize::minimize(const automaton::DFA template < class SymbolType, class StateType > void Minimize::print_progress(const automaton::DFA < SymbolType, StateType >& dfa, const ext::map<std::pair<StateType, ext::set<std::pair<SymbolType, StateType> > >, ext::set<StateType> >& minimizedTransitionFunction, size_t iter) { - std::clog << "delta " << iter << std::endl; + common::Streams::log << "delta " << iter << std::endl; //ext::map<std::pair<StateType, ext::set<std::pair<SymbolType, StateType> > >, ext::set<StateType> > minimizedTransitionFunction; //mapped to the original state @@ -184,40 +184,40 @@ void Minimize::print_progress(const automaton::DFA < SymbolType, StateType >& df } } - std::clog << std::setw(stateWidth) << ""; - std::clog << " | "; - std::clog << std::setw(stateMapWidth) << ""; - std::clog << " | "; + common::Streams::log << std::setw(stateWidth) << ""; + common::Streams::log << " | "; + common::Streams::log << std::setw(stateMapWidth) << ""; + common::Streams::log << " | "; for(const SymbolType& symbol : dfa.getInputAlphabet()) { ss << symbol; - std::clog << std::setw(colWidths[symbol]) << ss.str() << " | "; + common::Streams::log << std::setw(colWidths[symbol]) << ss.str() << " | "; RESETSS(ss); } - std::clog << std::endl; + common::Streams::log << std::endl; for(const auto& kv : printMap) { ss << kv.first.first; - std::clog << std::setw(stateWidth) << ss.str() << " | "; + common::Streams::log << std::setw(stateWidth) << ss.str() << " | "; RESETSS(ss); ss << kv.first.second; - std::clog << std::setw(stateMapWidth) << ss.str() << " | "; + common::Streams::log << std::setw(stateMapWidth) << ss.str() << " | "; RESETSS(ss); for(const auto& symbol : dfa.getInputAlphabet()) { auto it = kv.second.find(symbol); if(it != kv.second.end()) { ss << it -> second; - std::clog << std::setw(colWidths[symbol]) << ss.str(); + common::Streams::log << std::setw(colWidths[symbol]) << ss.str(); RESETSS(ss); } else { - std::clog << std::setw(colWidths[symbol]) << ""; + common::Streams::log << std::setw(colWidths[symbol]) << ""; } - std::clog << " | "; + common::Streams::log << " | "; } - std::clog << std::endl; + common::Streams::log << std::endl; } - std::clog << std::endl; + common::Streams::log << std::endl; } template < class SymbolType, class RankType, class StateType > diff --git a/alib2algo/src/common/Permutation.hpp b/alib2algo/src/common/Permutation.hpp index d78ba8a4986a6c2209d246c0103e452e0af9b3d6..6078f72a7a37e2e88c0dde098b5e93376a86efba 100644 --- a/alib2algo/src/common/Permutation.hpp +++ b/alib2algo/src/common/Permutation.hpp @@ -32,7 +32,7 @@ public: } if(common::GlobalData::verbose) - std::clog << "permutation map: " << permutation << std::endl; + common::Streams::log << "permutation map: " << permutation << std::endl; return permutation; } diff --git a/alib2algo/src/grammar/generate/CockeYoungerKasami.h b/alib2algo/src/grammar/generate/CockeYoungerKasami.h index b3bb5eab3437b11bee0910290087441dd8a79821..456618cc94c32bf6877d8789202cba8bcfa123d8 100644 --- a/alib2algo/src/grammar/generate/CockeYoungerKasami.h +++ b/alib2algo/src/grammar/generate/CockeYoungerKasami.h @@ -82,9 +82,9 @@ bool CockeYoungerKasami::generate ( const grammar::CNF < SymbolType > & grammar, if ( common::GlobalData::verbose ) for ( const ext::vector < ext::set < SymbolType > > & row : data ) { for ( const ext::set < SymbolType > & element : row ) - std::clog << element << " "; + common::Streams::log << element << " "; - std::clog << std::endl; + common::Streams::log << std::endl; } return data[stringSize - 1][0].count ( grammar.getInitialSymbol ( ) ); diff --git a/alib2algo/src/regexp/convert/ToAutomatonGlushkov.cpp b/alib2algo/src/regexp/convert/ToAutomatonGlushkov.cpp index 176279891271c104ec8ef5720156444a92515407..22f67ae66d420aeba13d24a8077901bd168dfcb2 100644 --- a/alib2algo/src/regexp/convert/ToAutomatonGlushkov.cpp +++ b/alib2algo/src/regexp/convert/ToAutomatonGlushkov.cpp @@ -64,14 +64,14 @@ automaton::NFA < > ToAutomatonGlushkov::convert ( const regexp::UnboundedRegExp automaton.addFinalState ( q0 ); if ( common::GlobalData::verbose ) { - std::clog << "First:" << first << std::endl; - std::clog << "Last: " << last << std::endl; + common::Streams::log << "First:" << first << std::endl; + common::Streams::log << "Last: " << last << std::endl; if ( regexp::properties::RegExpEpsilon::languageContainsEpsilon ( regexp ) ) - std::clog << " q0 because #E in L(RE)" << std::endl; + common::Streams::log << " q0 because #E in L(RE)" << std::endl; for ( const ext::pair < DefaultSymbolType, int > & x : indexedRegExp.getAlphabet ( ) ) - std::clog << "Follow(" << x << ") = " << regexp::GlushkovFollow::follow ( indexedRegExp, UnboundedRegExpSymbol < ext::pair < DefaultSymbolType, int > > ( x ) ) << std::endl; + common::Streams::log << "Follow(" << x << ") = " << regexp::GlushkovFollow::follow ( indexedRegExp, UnboundedRegExpSymbol < ext::pair < DefaultSymbolType, int > > ( x ) ) << std::endl; } return automaton; diff --git a/alib2algo/src/stringology/indexing/ExactSuffixAutomaton.h b/alib2algo/src/stringology/indexing/ExactSuffixAutomaton.h index fa2ecfde362ebd2ad83b1031eb076d01f2deb8c8..b057bc747cd5ce82ce568b265b38fa4f2abf3832 100644 --- a/alib2algo/src/stringology/indexing/ExactSuffixAutomaton.h +++ b/alib2algo/src/stringology/indexing/ExactSuffixAutomaton.h @@ -35,11 +35,11 @@ automaton::DFA < SymbolType, unsigned > ExactSuffixAutomaton::construct ( const unsigned lastState = 0; if ( common::GlobalData::verbose ) - std::clog << "String size " << pattern.getContent ( ).size ( ) << std::endl; + common::Streams::log << "String size " << pattern.getContent ( ).size ( ) << std::endl; for ( const SymbolType & symbol : pattern.getContent ( ) ) { if ( common::GlobalData::verbose && lastState % 1000 == 0 ) - std::clog << "Progress " << lastState << std::endl; + common::Streams::log << "Progress " << lastState << std::endl; suffixAutomatonAddSymbol ( suffixAutomaton, symbol, suffixLinks, lastState ); } diff --git a/alib2algo/src/stringology/query/PositionHeapFactors.h b/alib2algo/src/stringology/query/PositionHeapFactors.h index 79e43aff2598ad2f6f4faf9804f3294c233a785c..f266b8b1d190f2b83fd4e02909965cf23bba497a 100644 --- a/alib2algo/src/stringology/query/PositionHeapFactors.h +++ b/alib2algo/src/stringology/query/PositionHeapFactors.h @@ -69,7 +69,7 @@ ext::set < unsigned > PositionHeapFactors::query ( const indexes::stringology::P for ( const SymbolType & symbol : string.getContent ( ) ) { if(common::GlobalData::verbose) - std::clog << "on path possible occ (raw, string index): (" << node->getData ( ) << ", " << indexedStringSize - node->getData ( ) << ")" << std::endl; + common::Streams::log << "on path possible occ (raw, string index): (" << node->getData ( ) << ", " << indexedStringSize - node->getData ( ) << ")" << std::endl; if ( checkOcc ( string, depth, positionHeap.getString ( ), indexedStringSize - node->getData ( ) ) ) res.insert ( indexedStringSize - node->getData ( ) ); diff --git a/alib2algo/src/tree/properties/BorderArrayNaive.h b/alib2algo/src/tree/properties/BorderArrayNaive.h index 5fc086c8b6b064486073b109f9fb521de61fb44e..df27589e5c5fb70465cb35c10ddde4f7fa0fc44c 100644 --- a/alib2algo/src/tree/properties/BorderArrayNaive.h +++ b/alib2algo/src/tree/properties/BorderArrayNaive.h @@ -90,7 +90,7 @@ ext::vector < size_t > BorderArrayNaive::ba ( const tree::PrefixRankedBarPattern } if ( common::GlobalData::verbose ) - std::clog << res << std::endl; + common::Streams::log << res << std::endl; return res; } @@ -136,7 +136,7 @@ ext::vector < size_t > BorderArrayNaive::ba ( const tree::PrefixRankedPattern < } if ( common::GlobalData::verbose ) - std::clog << res << std::endl; + common::Streams::log << res << std::endl; return res; } diff --git a/alib2algo/src/tree/properties/ExactSubtreeRepeats.h b/alib2algo/src/tree/properties/ExactSubtreeRepeats.h index 703dee6d5e85c782f8d104c68dff371a5d95ce83..c1569d5783161670dc29b8355945872e98dfc1d4 100644 --- a/alib2algo/src/tree/properties/ExactSubtreeRepeats.h +++ b/alib2algo/src/tree/properties/ExactSubtreeRepeats.h @@ -135,9 +135,9 @@ ExactSubtreeRepeats::ExactSubtreeRepeatsAux::ExactSubtreeRepeatsAux ( const ext: this->LA = ext::vector < std::queue < ext::tuple < ext::deque < unsigned >, unsigned, int > > > ( this->H.back ( ) + 1 ); if ( common::GlobalData::verbose ) { - std::clog << "Alphabet size set to " << alphabetSize << std::endl; - std::clog << "Tree size set to " << this->treeSize << std::endl; - std::clog << "Auxiliary structures computed ! " << std::endl; + common::Streams::log << "Alphabet size set to " << alphabetSize << std::endl; + common::Streams::log << "Tree size set to " << this->treeSize << std::endl; + common::Streams::log << "Auxiliary structures computed ! " << std::endl; } } @@ -162,14 +162,14 @@ void ExactSubtreeRepeats::ExactSubtreeRepeatsAux::buildMu ( const ext::vector < // Test mu_map if ( common::GlobalData::verbose ) { for ( auto it = mu_map.begin ( ); it != mu_map.end ( ); it++ ) - std::clog << "map: " << it->first << " -> " << it->second << std::endl; + common::Streams::log << "map: " << it->first << " -> " << it->second << std::endl; - std::clog << "mu : "; + common::Streams::log << "mu : "; for ( auto it : mu ) - std::clog << it << " "; + common::Streams::log << it << " "; - std::clog << std::endl; + common::Streams::log << std::endl; } } @@ -190,11 +190,11 @@ void ExactSubtreeRepeats::ExactSubtreeRepeatsAux::buildP ( const ext::vector < c // Test parents if ( common::GlobalData::verbose ) { - std::clog << " P : "; + common::Streams::log << " P : "; - for ( auto it = P.begin ( ); it != P.end ( ); it++ ) std::clog << * it << " "; + for ( auto it = P.begin ( ); it != P.end ( ); it++ ) common::Streams::log << * it << " "; - std::clog << std::endl; + common::Streams::log << std::endl; } } @@ -227,11 +227,11 @@ void ExactSubtreeRepeats::ExactSubtreeRepeatsAux::buildH ( const ext::vector < c // Test heights if ( common::GlobalData::verbose ) { - std::clog << " H : "; + common::Streams::log << " H : "; - for ( auto it = H.begin ( ); it != H.end ( ); it++ ) std::clog << * it << " "; + for ( auto it = H.begin ( ); it != H.end ( ); it++ ) common::Streams::log << * it << " "; - std::clog << std::endl; + common::Streams::log << std::endl; } } @@ -260,11 +260,11 @@ void ExactSubtreeRepeats::ExactSubtreeRepeatsAux::buildFC ( const ext::vector < // Test First child if ( common::GlobalData::verbose ) { - std::clog << "FC : "; + common::Streams::log << "FC : "; - for ( auto it = FC.begin ( ); it != FC.end ( ); it++ ) std::clog << * it << " "; + for ( auto it = FC.begin ( ); it != FC.end ( ); it++ ) common::Streams::log << * it << " "; - std::clog << std::endl; + common::Streams::log << std::endl; } } @@ -387,7 +387,7 @@ void ExactSubtreeRepeats::partition ( ext::tuple < ext::deque < unsigned >, unsi if ( ac == 0 ) { if ( common::GlobalData::verbose ) - std::clog << " ! Repeat : " << S << " " << l << std::endl; + common::Streams::log << " ! Repeat : " << S << " " << l << std::endl; aux.found_repeats.push_back ( ext::make_tuple ( S, l, ac ) ); aux.sc += 1; @@ -440,13 +440,13 @@ void ExactSubtreeRepeats::repeatsPostfixRanked ( const ext::vector < common::ran // Check As contents if ( common::GlobalData::verbose ) { - std::clog << "One node repeats (As): "; + common::Streams::log << "One node repeats (As): "; for ( unsigned i = 0; i < As.size ( ); ++i ) if ( !As[i].empty ( ) ) - std::clog << i << ":" << As[i] << " "; + common::Streams::log << i << ":" << As[i] << " "; - std::clog << std::endl; + common::Streams::log << std::endl; } while ( !Q5.empty ( ) ) { @@ -455,7 +455,7 @@ void ExactSubtreeRepeats::repeatsPostfixRanked ( const ext::vector < common::ran Bs[k] = 0; if ( common::GlobalData::verbose ) - std::clog << " ! Repeat : " << As[k] << " " << 1 << std::endl; + common::Streams::log << " ! Repeat : " << As[k] << " " << 1 << std::endl; aux.found_repeats.push_back ( ext::make_tuple ( As[k], 1, 0 ) ); unsigned l = 1; @@ -487,12 +487,12 @@ void ExactSubtreeRepeats::repeatsPostfixRanked ( const ext::vector < common::ran } if ( common::GlobalData::verbose ) { - std::clog << "Repeat postfix string : "; + common::Streams::log << "Repeat postfix string : "; for ( unsigned i = 0; i < post_repeats.size ( ); ++i ) - std::clog << post_repeats[i] << " "; + common::Streams::log << post_repeats[i] << " "; - std::clog << std::endl; + common::Streams::log << std::endl; } for ( unsigned i = 0; i < aux.treeSize; i++ )