COIN-OR::LEMON - Graph Library

Changeset 258:0310c8984732 in lemon-1.0 for lemon/bfs.h


Ignore:
Timestamp:
09/09/08 21:52:45 (16 years ago)
Author:
Alpar Juttner <alpar@…>
Branch:
default
Parents:
257:8d76a7bf9961 (diff), 256:c760d691fe3c (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Phase:
public
Message:

Merge

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • lemon/bfs.h

    r252 r258  
    231231
    232232    template <class T>
    233     struct DefPredMapTraits : public Traits {
     233    struct SetPredMapTraits : public Traits {
    234234      typedef T PredMap;
    235235      static PredMap *createPredMap(const Digraph &)
     
    244244    ///\ref PredMap type.
    245245    template <class T>
    246     struct DefPredMap : public Bfs< Digraph, DefPredMapTraits<T> > {
    247       typedef Bfs< Digraph, DefPredMapTraits<T> > Create;
     246    struct SetPredMap : public Bfs< Digraph, SetPredMapTraits<T> > {
     247      typedef Bfs< Digraph, SetPredMapTraits<T> > Create;
    248248    };
    249249
    250250    template <class T>
    251     struct DefDistMapTraits : public Traits {
     251    struct SetDistMapTraits : public Traits {
    252252      typedef T DistMap;
    253253      static DistMap *createDistMap(const Digraph &)
     
    262262    ///\ref DistMap type.
    263263    template <class T>
    264     struct DefDistMap : public Bfs< Digraph, DefDistMapTraits<T> > {
    265       typedef Bfs< Digraph, DefDistMapTraits<T> > Create;
     264    struct SetDistMap : public Bfs< Digraph, SetDistMapTraits<T> > {
     265      typedef Bfs< Digraph, SetDistMapTraits<T> > Create;
    266266    };
    267267
    268268    template <class T>
    269     struct DefReachedMapTraits : public Traits {
     269    struct SetReachedMapTraits : public Traits {
    270270      typedef T ReachedMap;
    271271      static ReachedMap *createReachedMap(const Digraph &)
     
    280280    ///\ref ReachedMap type.
    281281    template <class T>
    282     struct DefReachedMap : public Bfs< Digraph, DefReachedMapTraits<T> > {
    283       typedef Bfs< Digraph, DefReachedMapTraits<T> > Create;
     282    struct SetReachedMap : public Bfs< Digraph, SetReachedMapTraits<T> > {
     283      typedef Bfs< Digraph, SetReachedMapTraits<T> > Create;
    284284    };
    285285
    286286    template <class T>
    287     struct DefProcessedMapTraits : public Traits {
     287    struct SetProcessedMapTraits : public Traits {
    288288      typedef T ProcessedMap;
    289289      static ProcessedMap *createProcessedMap(const Digraph &)
     
    298298    ///\ref ProcessedMap type.
    299299    template <class T>
    300     struct DefProcessedMap : public Bfs< Digraph, DefProcessedMapTraits<T> > {
    301       typedef Bfs< Digraph, DefProcessedMapTraits<T> > Create;
    302     };
    303 
    304     struct DefDigraphProcessedMapTraits : public Traits {
     300    struct SetProcessedMap : public Bfs< Digraph, SetProcessedMapTraits<T> > {
     301      typedef Bfs< Digraph, SetProcessedMapTraits<T> > Create;
     302    };
     303
     304    struct SetStandardProcessedMapTraits : 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     template <class T>
    318     struct DefProcessedMapToBeDefaultMap :
    319       public Bfs< Digraph, DefDigraphProcessedMapTraits> {
    320       typedef Bfs< Digraph, DefDigraphProcessedMapTraits> Create;
     317    struct SetStandardProcessedMap :
     318      public Bfs< Digraph, SetStandardProcessedMapTraits > {
     319      typedef Bfs< Digraph, SetStandardProcessedMapTraits > Create;
    321320    };
    322321
     
    10661065
    10671066    template<class T>
    1068     struct DefPredMapBase : public Base {
     1067    struct SetPredMapBase : public Base {
    10691068      typedef T PredMap;
    10701069      static PredMap *createPredMap(const Digraph &) { return 0; };
    1071       DefPredMapBase(const TR &b) : TR(b) {}
     1070      SetPredMapBase(const TR &b) : TR(b) {}
    10721071    };
    10731072    ///\brief \ref named-templ-param "Named parameter"
     
    10771076    ///for setting \ref PredMap object.
    10781077    template<class T>
    1079     BfsWizard<DefPredMapBase<T> > predMap(const T &t)
     1078    BfsWizard<SetPredMapBase<T> > predMap(const T &t)
    10801079    {
    10811080      Base::_pred=reinterpret_cast<void*>(const_cast<T*>(&t));
    1082       return BfsWizard<DefPredMapBase<T> >(*this);
     1081      return BfsWizard<SetPredMapBase<T> >(*this);
    10831082    }
    10841083
    10851084    template<class T>
    1086     struct DefReachedMapBase : public Base {
     1085    struct SetReachedMapBase : public Base {
    10871086      typedef T ReachedMap;
    10881087      static ReachedMap *createReachedMap(const Digraph &) { return 0; };
    1089       DefReachedMapBase(const TR &b) : TR(b) {}
     1088      SetReachedMapBase(const TR &b) : TR(b) {}
    10901089    };
    10911090    ///\brief \ref named-templ-param "Named parameter"
     
    10951094    ///for setting \ref ReachedMap object.
    10961095    template<class T>
    1097     BfsWizard<DefReachedMapBase<T> > reachedMap(const T &t)
     1096    BfsWizard<SetReachedMapBase<T> > reachedMap(const T &t)
    10981097    {
    10991098      Base::_reached=reinterpret_cast<void*>(const_cast<T*>(&t));
    1100       return BfsWizard<DefReachedMapBase<T> >(*this);
     1099      return BfsWizard<SetReachedMapBase<T> >(*this);
    11011100    }
    11021101
    11031102    template<class T>
    1104     struct DefProcessedMapBase : public Base {
     1103    struct SetProcessedMapBase : public Base {
    11051104      typedef T ProcessedMap;
    11061105      static ProcessedMap *createProcessedMap(const Digraph &) { return 0; };
    1107       DefProcessedMapBase(const TR &b) : TR(b) {}
     1106      SetProcessedMapBase(const TR &b) : TR(b) {}
    11081107    };
    11091108    ///\brief \ref named-templ-param "Named parameter"
     
    11131112    ///for setting \ref ProcessedMap object.
    11141113    template<class T>
    1115     BfsWizard<DefProcessedMapBase<T> > processedMap(const T &t)
     1114    BfsWizard<SetProcessedMapBase<T> > processedMap(const T &t)
    11161115    {
    11171116      Base::_processed=reinterpret_cast<void*>(const_cast<T*>(&t));
    1118       return BfsWizard<DefProcessedMapBase<T> >(*this);
     1117      return BfsWizard<SetProcessedMapBase<T> >(*this);
    11191118    }
    11201119
    11211120    template<class T>
    1122     struct DefDistMapBase : public Base {
     1121    struct SetDistMapBase : public Base {
    11231122      typedef T DistMap;
    11241123      static DistMap *createDistMap(const Digraph &) { return 0; };
    1125       DefDistMapBase(const TR &b) : TR(b) {}
     1124      SetDistMapBase(const TR &b) : TR(b) {}
    11261125    };
    11271126    ///\brief \ref named-templ-param "Named parameter"
     
    11311130    ///for setting \ref DistMap object.
    11321131    template<class T>
    1133     BfsWizard<DefDistMapBase<T> > distMap(const T &t)
     1132    BfsWizard<SetDistMapBase<T> > distMap(const T &t)
    11341133    {
    11351134      Base::_dist=reinterpret_cast<void*>(const_cast<T*>(&t));
    1136       return BfsWizard<DefDistMapBase<T> >(*this);
     1135      return BfsWizard<SetDistMapBase<T> >(*this);
    11371136    }
    11381137
     
    13551354    ///@{
    13561355    template <class T>
    1357     struct DefReachedMapTraits : public Traits {
     1356    struct SetReachedMapTraits : public Traits {
    13581357      typedef T ReachedMap;
    13591358      static ReachedMap *createReachedMap(const Digraph &digraph) {
     
    13661365    /// \ref named-templ-param "Named parameter" for setting ReachedMap type.
    13671366    template <class T>
    1368     struct DefReachedMap : public BfsVisit< Digraph, Visitor,
    1369                                             DefReachedMapTraits<T> > {
    1370       typedef BfsVisit< Digraph, Visitor, DefReachedMapTraits<T> > Create;
     1367    struct SetReachedMap : public BfsVisit< Digraph, Visitor,
     1368                                            SetReachedMapTraits<T> > {
     1369      typedef BfsVisit< Digraph, Visitor, SetReachedMapTraits<T> > Create;
    13711370    };
    13721371    ///@}
  • lemon/bfs.h

    r257 r258  
    12621262  /// the member functions of the \c Visitor class on every BFS event.
    12631263  ///
     1264  /// This interface of the BFS algorithm should be used in special cases
     1265  /// when extra actions have to be performed in connection with certain
     1266  /// events of the BFS algorithm. Otherwise consider to use Bfs or bfs()
     1267  /// instead.
     1268  ///
    12641269  /// \tparam _Digraph The type of the digraph the algorithm runs on.
    12651270  /// The default value is
Note: See TracChangeset for help on using the changeset viewer.