COIN-OR::LEMON - Graph Library

Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • lemon/bfs.h

    r258 r252  
    231231
    232232    template <class T>
    233     struct SetPredMapTraits : public Traits {
     233    struct DefPredMapTraits : public Traits {
    234234      typedef T PredMap;
    235235      static PredMap *createPredMap(const Digraph &)
     
    244244    ///\ref PredMap type.
    245245    template <class T>
    246     struct SetPredMap : public Bfs< Digraph, SetPredMapTraits<T> > {
    247       typedef Bfs< Digraph, SetPredMapTraits<T> > Create;
     246    struct DefPredMap : public Bfs< Digraph, DefPredMapTraits<T> > {
     247      typedef Bfs< Digraph, DefPredMapTraits<T> > Create;
    248248    };
    249249
    250250    template <class T>
    251     struct SetDistMapTraits : public Traits {
     251    struct DefDistMapTraits : public Traits {
    252252      typedef T DistMap;
    253253      static DistMap *createDistMap(const Digraph &)
     
    262262    ///\ref DistMap type.
    263263    template <class T>
    264     struct SetDistMap : public Bfs< Digraph, SetDistMapTraits<T> > {
    265       typedef Bfs< Digraph, SetDistMapTraits<T> > Create;
     264    struct DefDistMap : public Bfs< Digraph, DefDistMapTraits<T> > {
     265      typedef Bfs< Digraph, DefDistMapTraits<T> > Create;
    266266    };
    267267
    268268    template <class T>
    269     struct SetReachedMapTraits : public Traits {
     269    struct DefReachedMapTraits : public Traits {
    270270      typedef T ReachedMap;
    271271      static ReachedMap *createReachedMap(const Digraph &)
     
    280280    ///\ref ReachedMap type.
    281281    template <class T>
    282     struct SetReachedMap : public Bfs< Digraph, SetReachedMapTraits<T> > {
    283       typedef Bfs< Digraph, SetReachedMapTraits<T> > Create;
     282    struct DefReachedMap : public Bfs< Digraph, DefReachedMapTraits<T> > {
     283      typedef Bfs< Digraph, DefReachedMapTraits<T> > Create;
    284284    };
    285285
    286286    template <class T>
    287     struct SetProcessedMapTraits : public Traits {
     287    struct DefProcessedMapTraits : public Traits {
    288288      typedef T ProcessedMap;
    289289      static ProcessedMap *createProcessedMap(const Digraph &)
     
    298298    ///\ref ProcessedMap type.
    299299    template <class T>
    300     struct SetProcessedMap : public Bfs< Digraph, SetProcessedMapTraits<T> > {
    301       typedef Bfs< Digraph, SetProcessedMapTraits<T> > Create;
    302     };
    303 
    304     struct SetStandardProcessedMapTraits : public Traits {
     300    struct DefProcessedMap : public Bfs< Digraph, DefProcessedMapTraits<T> > {
     301      typedef Bfs< Digraph, DefProcessedMapTraits<T> > Create;
     302    };
     303
     304    struct DefDigraphProcessedMapTraits : public Traits {
    305305      typedef typename Digraph::template NodeMap<bool> ProcessedMap;
    306306      static ProcessedMap *createProcessedMap(const Digraph &g)
     
    315315    ///\ref ProcessedMap type to be <tt>Digraph::NodeMap<bool></tt>.
    316316    ///If you don't set it explicitly, it will be automatically allocated.
    317     struct SetStandardProcessedMap :
    318       public Bfs< Digraph, SetStandardProcessedMapTraits > {
    319       typedef Bfs< Digraph, SetStandardProcessedMapTraits > Create;
     317    template <class T>
     318    struct DefProcessedMapToBeDefaultMap :
     319      public Bfs< Digraph, DefDigraphProcessedMapTraits> {
     320      typedef Bfs< Digraph, DefDigraphProcessedMapTraits> Create;
    320321    };
    321322
     
    10651066
    10661067    template<class T>
    1067     struct SetPredMapBase : public Base {
     1068    struct DefPredMapBase : public Base {
    10681069      typedef T PredMap;
    10691070      static PredMap *createPredMap(const Digraph &) { return 0; };
    1070       SetPredMapBase(const TR &b) : TR(b) {}
     1071      DefPredMapBase(const TR &b) : TR(b) {}
    10711072    };
    10721073    ///\brief \ref named-templ-param "Named parameter"
     
    10761077    ///for setting \ref PredMap object.
    10771078    template<class T>
    1078     BfsWizard<SetPredMapBase<T> > predMap(const T &t)
     1079    BfsWizard<DefPredMapBase<T> > predMap(const T &t)
    10791080    {
    10801081      Base::_pred=reinterpret_cast<void*>(const_cast<T*>(&t));
    1081       return BfsWizard<SetPredMapBase<T> >(*this);
     1082      return BfsWizard<DefPredMapBase<T> >(*this);
    10821083    }
    10831084
    10841085    template<class T>
    1085     struct SetReachedMapBase : public Base {
     1086    struct DefReachedMapBase : public Base {
    10861087      typedef T ReachedMap;
    10871088      static ReachedMap *createReachedMap(const Digraph &) { return 0; };
    1088       SetReachedMapBase(const TR &b) : TR(b) {}
     1089      DefReachedMapBase(const TR &b) : TR(b) {}
    10891090    };
    10901091    ///\brief \ref named-templ-param "Named parameter"
     
    10941095    ///for setting \ref ReachedMap object.
    10951096    template<class T>
    1096     BfsWizard<SetReachedMapBase<T> > reachedMap(const T &t)
     1097    BfsWizard<DefReachedMapBase<T> > reachedMap(const T &t)
    10971098    {
    10981099      Base::_reached=reinterpret_cast<void*>(const_cast<T*>(&t));
    1099       return BfsWizard<SetReachedMapBase<T> >(*this);
     1100      return BfsWizard<DefReachedMapBase<T> >(*this);
    11001101    }
    11011102
    11021103    template<class T>
    1103     struct SetProcessedMapBase : public Base {
     1104    struct DefProcessedMapBase : public Base {
    11041105      typedef T ProcessedMap;
    11051106      static ProcessedMap *createProcessedMap(const Digraph &) { return 0; };
    1106       SetProcessedMapBase(const TR &b) : TR(b) {}
     1107      DefProcessedMapBase(const TR &b) : TR(b) {}
    11071108    };
    11081109    ///\brief \ref named-templ-param "Named parameter"
     
    11121113    ///for setting \ref ProcessedMap object.
    11131114    template<class T>
    1114     BfsWizard<SetProcessedMapBase<T> > processedMap(const T &t)
     1115    BfsWizard<DefProcessedMapBase<T> > processedMap(const T &t)
    11151116    {
    11161117      Base::_processed=reinterpret_cast<void*>(const_cast<T*>(&t));
    1117       return BfsWizard<SetProcessedMapBase<T> >(*this);
     1118      return BfsWizard<DefProcessedMapBase<T> >(*this);
    11181119    }
    11191120
    11201121    template<class T>
    1121     struct SetDistMapBase : public Base {
     1122    struct DefDistMapBase : public Base {
    11221123      typedef T DistMap;
    11231124      static DistMap *createDistMap(const Digraph &) { return 0; };
    1124       SetDistMapBase(const TR &b) : TR(b) {}
     1125      DefDistMapBase(const TR &b) : TR(b) {}
    11251126    };
    11261127    ///\brief \ref named-templ-param "Named parameter"
     
    11301131    ///for setting \ref DistMap object.
    11311132    template<class T>
    1132     BfsWizard<SetDistMapBase<T> > distMap(const T &t)
     1133    BfsWizard<DefDistMapBase<T> > distMap(const T &t)
    11331134    {
    11341135      Base::_dist=reinterpret_cast<void*>(const_cast<T*>(&t));
    1135       return BfsWizard<SetDistMapBase<T> >(*this);
     1136      return BfsWizard<DefDistMapBase<T> >(*this);
    11361137    }
    11371138
     
    13541355    ///@{
    13551356    template <class T>
    1356     struct SetReachedMapTraits : public Traits {
     1357    struct DefReachedMapTraits : public Traits {
    13571358      typedef T ReachedMap;
    13581359      static ReachedMap *createReachedMap(const Digraph &digraph) {
     
    13651366    /// \ref named-templ-param "Named parameter" for setting ReachedMap type.
    13661367    template <class T>
    1367     struct SetReachedMap : public BfsVisit< Digraph, Visitor,
    1368                                             SetReachedMapTraits<T> > {
    1369       typedef BfsVisit< Digraph, Visitor, SetReachedMapTraits<T> > Create;
     1368    struct DefReachedMap : public BfsVisit< Digraph, Visitor,
     1369                                            DefReachedMapTraits<T> > {
     1370      typedef BfsVisit< Digraph, Visitor, DefReachedMapTraits<T> > Create;
    13701371    };
    13711372    ///@}
Note: See TracChangeset for help on using the changeset viewer.