COIN-OR::LEMON - Graph Library

Changes in / [37:582c594ecd01:35:f8ddf1b1541a] in lemon-main


Ignore:
Files:
9 deleted
8 edited

Legend:

Unmodified
Added
Removed
  • .hgignore

    r9 r3  
    66*.o
    77.#.*
    8 *.log
    9 *.lo
    10 *.tar.*
    118Makefile.in
    129aclocal.m4
     
    2320lemon/stamp-h2
    2421doc/Doxyfile
    25 .dirstamp
    26 .libs/*
    27 .deps/*
     22lemon/.dirstamp
     23lemon/.libs/*
    2824
    2925syntax: regexp
    30 ^doc/html/.*
    31 ^autom4te.cache/.*
    32 ^build-aux/.*
    33 ^objs.*/.*
    34 ^test/[a-z_]*$
     26html/.*
     27autom4te.cache/.*
     28build-aux/.*
     29objs.*/.*
  • Makefile.am

    r5 r1  
    55
    66EXTRA_DIST = \
    7         LICENSE \
    87        m4/lx_check_cplex.m4 \
    98        m4/lx_check_glpk.m4 \
  • configure.ac

    r21 r1  
    77m4_define([lemon_version_nano], [])
    88m4_define([lemon_version_tag], [hg])
    9 m4_define([lemon_hg_revision], [m4_normalize(esyscmd([hg id -i]))])
    10 m4_define([lemon_version], [lemon_version_major().lemon_version_minor()ifelse(lemon_version_micro(), [], [], [.lemon_version_micro()])ifelse(lemon_version_nano(), [], [], [.lemon_version_nano()])ifelse(lemon_version_tag(), [], [], lemon_version_tag(), [hg], [[_]lemon_version_tag()[_]lemon_hg_revision()], [[_]lemon_version_tag()])])
     9m4_define([lemon_hg_revision], [m4_normalize(esyscmd([hg tip |grep ^changeset |cut -d ':' -f 3]))])
     10m4_define([lemon_version], [lemon_version_major().lemon_version_minor()ifelse(lemon_version_micro(), [], [], [.lemon_version_micro()])ifelse(lemon_version_nano(), [], [], [.lemon_version_nano()])ifelse(lemon_version_tag(), [], [], lemon_version_tag(), [hg], [[_]lemon_version_tag()[]lemon_hg_revision()], [[_]lemon_version_tag()])])
    1111
    1212AC_PREREQ([2.59])
  • lemon/Makefile.am

    r32 r25  
    88
    99lemon_libemon_la_SOURCES = \
    10         lemon/base.cc \
    11         lemon/random.cc
    12 
     10        lemon/base.cc
    1311
    1412lemon_libemon_la_CXXFLAGS = $(GLPK_CFLAGS) $(CPLEX_CFLAGS) $(SOPLEX_CXXFLAGS)
     
    1614
    1715lemon_HEADERS += \
    18         lemon/dim2.h \
    19         lemon/random.h \
     16        lemon/concept_check.h \
    2017        lemon/list_graph.h \
     18        lemon/maps.h \
    2119        lemon/tolerance.h
    2220
     
    2523        lemon/bits/utility.h
    2624
    27 concept_HEADERS +=
     25concept_HEADERS += \
     26        lemon/concepts/maps.h
  • lemon/bits/invalid.h

    r13 r7  
    2525namespace lemon {
    2626
    27   /// \brief Dummy type to make it easier to create invalid iterators.
     27  /// \brief Dummy type to make it easier to make invalid iterators.
    2828  ///
    2929  /// See \ref INVALID for the usage.
     
    3535  };
    3636 
    37   /// \brief Invalid iterators.
    38   ///
     37  /// Invalid iterators.
     38 
    3939  /// \ref Invalid is a global type that converts to each iterator
    4040  /// in such a way that the value of the target iterator will be invalid.
  • lemon/maps.h

    r34 r26  
    4545  class MapBase {
    4646  public:
    47     /// The key type of the map.
     47    ///\e
    4848    typedef K Key;
    49     /// The value type of the map. (The type of objects associated with the keys).
     49    ///\e
    5050    typedef T Value;
    5151  };
     
    5353  /// Null map. (a.k.a. DoNothingMap)
    5454
    55   /// This map can be used if you have to provide a map only for
    56   /// its type definitions, or if you have to provide a writable map,
    57   /// but data written to it is not required (i.e. it will be sent to
    58   /// <tt>/dev/null</tt>).
     55  /// If you have to provide a map only for its type definitions,
     56  /// or if you have to provide a writable map, but
     57  /// data written to it will sent to <tt>/dev/null</tt>...
    5958  template<typename K, typename T>
    6059  class NullMap : public MapBase<K, T> {
     
    7069  };
    7170
    72   ///Returns a \c NullMap class
    73 
    74   ///This function just returns a \c NullMap class.
    75   ///\relates NullMap
    7671  template <typename K, typename V>
    7772  NullMap<K, V> nullMap() {
     
    9691    /// Default constructor
    9792
    98     /// Default constructor.
    9993    /// The value of the map will be uninitialized.
    10094    /// (More exactly it will be default constructed.)
    10195    ConstMap() {}
    102    
    103     /// Constructor with specified initial value
    104 
    105     /// Constructor with specified initial value.
    106     /// \param _v is the initial value of the map.
     96    ///\e
     97
     98    /// \param _v The initial value of the map.
     99    ///
    107100    ConstMap(const T &_v) : v(_v) {}
    108101   
     
    166159  ///Map based on std::map
    167160
    168   ///This is essentially a wrapper for \c std::map with addition that
    169   ///you can specify a default value different from \c Value().
     161  ///This is essentially a wrapper for \c std::map. With addition that
     162  ///you can specify a default value different from \c Value() .
    170163  template <typename K, typename T, typename Compare = std::less<K> >
    171164  class StdMap {
     
    250243  };
    251244
    252   /// \brief Map for storing values for keys from the range <tt>[0..size-1]</tt>
    253   ///
    254   /// The current map has the <tt>[0..size-1]</tt> keyset and the values
     245  /// \brief Map for storing values for the range \c [0..size-1] range keys
     246  ///
     247  /// The current map has the \c [0..size-1] keyset and the values
    255248  /// are stored in a \c std::vector<T>  container. It can be used with
    256249  /// some data structures, for example \c UnionFind, \c BinHeap, when
     
    329322  /// @{
    330323
    331   /// \brief Identity map.
    332   ///
    333   /// This map gives back the given key as value without any
     324  /// \brief Identity mapping.
     325  ///
     326  /// This mapping gives back the given key as value without any
    334327  /// modification.
    335328  template <typename T>
     
    360353  ///
    361354  ///This \c concepts::ReadMap "read only map"
    362   ///converts the \c Value of a map to type \c T.
     355  ///converts the \c Value of a maps to type \c T.
    363356  ///Its \c Key is inherited from \c M.
    364357  template <typename M, typename T>
     
    372365    ///Constructor
    373366
    374     ///Constructor.
    375     ///\param _m is the underlying map.
     367    ///Constructor
     368    ///\param _m is the underlying map
    376369    ConvertMap(const M &_m) : m(_m) {};
    377370
     
    382375  };
    383376 
    384   ///Returns a \c ConvertMap class
    385 
    386   ///This function just returns a \c ConvertMap class.
     377  ///Returns an \c ConvertMap class
     378
     379  ///This function just returns an \c ConvertMap class.
    387380  ///\relates ConvertMap
    388381  template<typename T, typename M>
     
    391384  }
    392385
    393   ///Simple wrapping of a map
     386  ///Simple wrapping of the map
    394387
    395388  ///This \c concepts::ReadMap "read only map" returns the simple
     
    398391  ///map to simple read map.
    399392  ///
    400   ///\sa SimpleWriteMap
    401   ///
    402   /// \todo Revise the misleading name
     393  /// \todo Revise the misleading name
    403394  template<typename M>
    404395  class SimpleMap : public MapBase<typename M::Key, typename M::Value> {
     
    416407  };
    417408
    418   ///Simple writable wrapping of the map
     409  ///Simple writeable wrapping of the map
    419410
    420411  ///This \c concepts::WriteMap "write map" returns the simple
     
    423414  ///given map to simple read-write map.
    424415  ///
    425   ///\sa SimpleMap
    426   ///
    427416  /// \todo Revise the misleading name
    428417  template<typename M>
     
    446435
    447436  ///This \c concepts::ReadMap "read only map" returns the sum of the two
    448   ///given maps.
    449   ///Its \c Key and \c Value are inherited from \c M1.
     437  ///given maps. Its \c Key and \c Value will be inherited from \c M1.
    450438  ///The \c Key and \c Value of M2 must be convertible to those of \c M1.
     439
    451440  template<typename M1, typename M2>
    452441  class AddMap : public MapBase<typename M1::Key, typename M1::Value> {
     
    480469  ///This \c concepts::ReadMap "read only map" returns the sum of the
    481470  ///given map and a constant value.
    482   ///Its \c Key and \c Value are inherited from \c M.
     471  ///Its \c Key and \c Value is inherited from \c M.
    483472  ///
    484473  ///Actually,
     
    486475  ///  ShiftMap<X> sh(x,v);
    487476  ///\endcode
    488   ///is equivalent to
     477  ///is equivalent with
    489478  ///\code
    490479  ///  ConstMap<X::Key, X::Value> c_tmp(v);
    491480  ///  AddMap<X, ConstMap<X::Key, X::Value> > sh(x,v);
    492481  ///\endcode
    493   ///
    494   ///\sa ShiftWriteMap
    495482  template<typename M, typename C = typename M::Value>
    496483  class ShiftMap : public MapBase<typename M::Key, typename M::Value> {
     
    504491    ///Constructor
    505492
    506     ///Constructor.
    507     ///\param _m is the undelying map.
    508     ///\param _v is the shift value.
     493    ///Constructor
     494    ///\param _m is the undelying map
     495    ///\param _v is the shift value
    509496    ShiftMap(const M &_m, const C &_v ) : m(_m), v(_v) {};
    510497    ///\e
     
    512499  };
    513500
    514   ///Shift a map with a constant (ReadWrite version).
     501  ///Shift a map with a constant. This map is also writable.
    515502
    516503  ///This \c concepts::ReadWriteMap "read-write map" returns the sum of the
    517504  ///given map and a constant value. It makes also possible to write the map.
    518   ///Its \c Key and \c Value are inherited from \c M.
    519   ///
    520   ///\sa ShiftMap
     505  ///Its \c Key and \c Value is inherited from \c M.
     506  ///
     507  ///Actually,
     508  ///\code
     509  ///  ShiftMap<X> sh(x,v);
     510  ///\endcode
     511  ///is equivalent with
     512  ///\code
     513  ///  ConstMap<X::Key, X::Value> c_tmp(v);
     514  ///  AddMap<X, ConstMap<X::Key, X::Value> > sh(x,v);
     515  ///\endcode
    521516  template<typename M, typename C = typename M::Value>
    522517  class ShiftWriteMap : public MapBase<typename M::Key, typename M::Value> {
     
    530525    ///Constructor
    531526
    532     ///Constructor.
    533     ///\param _m is the undelying map.
    534     ///\param _v is the shift value.
     527    ///Constructor
     528    ///\param _m is the undelying map
     529    ///\param _v is the shift value
    535530    ShiftWriteMap(M &_m, const C &_v ) : m(_m), v(_v) {};
    536531    /// \e
     
    540535  };
    541536 
    542   ///Returns a \c ShiftMap class
    543 
    544   ///This function just returns a \c ShiftMap class.
     537  ///Returns an \c ShiftMap class
     538
     539  ///This function just returns an \c ShiftMap class.
    545540  ///\relates ShiftMap
    546541  template<typename M, typename C>
     
    549544  }
    550545
    551   ///Returns a \c ShiftWriteMap class
    552 
    553   ///This function just returns a \c ShiftWriteMap class.
    554   ///\relates ShiftWriteMap
    555546  template<typename M, typename C>
    556547  inline ShiftWriteMap<M, C> shiftMap(M &m,const C &v) {
     
    561552
    562553  ///This \c concepts::ReadMap "read only map" returns the difference
    563   ///of the values of the two given maps.
    564   ///Its \c Key and \c Value are inherited from \c M1.
     554  ///of the values of the two
     555  ///given maps. Its \c Key and \c Value will be inherited from \c M1.
    565556  ///The \c Key and \c Value of \c M2 must be convertible to those of \c M1.
    566557  ///
     
    594585
    595586  ///This \c concepts::ReadMap "read only map" returns the product of the
    596   ///values of the two given maps.
    597   ///Its \c Key and \c Value are inherited from \c M1.
     587  ///values of the two
     588  ///given
     589  ///maps. Its \c Key and \c Value will be inherited from \c M1.
    598590  ///The \c Key and \c Value of \c M2 must be convertible to those of \c M1.
     591
    599592  template<typename M1, typename M2>
    600593  class MulMap : public MapBase<typename M1::Key, typename M1::Value> {
     
    621614  }
    622615 
    623   ///Scales a map with a constant.
     616  ///Scales a maps with a constant.
    624617
    625618  ///This \c concepts::ReadMap "read only map" returns the value of the
    626619  ///given map multiplied from the left side with a constant value.
    627   ///Its \c Key and \c Value are inherited from \c M.
     620  ///Its \c Key and \c Value is inherited from \c M.
    628621  ///
    629622  ///Actually,
     
    631624  ///  ScaleMap<X> sc(x,v);
    632625  ///\endcode
    633   ///is equivalent to
     626  ///is equivalent with
    634627  ///\code
    635628  ///  ConstMap<X::Key, X::Value> c_tmp(v);
    636629  ///  MulMap<X, ConstMap<X::Key, X::Value> > sc(x,v);
    637630  ///\endcode
    638   ///
    639   ///\sa ScaleWriteMap
    640631  template<typename M, typename C = typename M::Value>
    641632  class ScaleMap : public MapBase<typename M::Key, typename M::Value> {
     
    649640    ///Constructor
    650641
    651     ///Constructor.
    652     ///\param _m is the undelying map.
    653     ///\param _v is the scaling value.
     642    ///Constructor
     643    ///\param _m is the undelying map
     644    ///\param _v is the scaling value
    654645    ScaleMap(const M &_m, const C &_v ) : m(_m), v(_v) {};
    655646    /// \e
     
    657648  };
    658649
    659   ///Scales a map with a constant (ReadWrite version).
     650  ///Scales a maps with a constant (ReadWrite version).
    660651
    661652  ///This \c concepts::ReadWriteMap "read-write map" returns the value of the
    662653  ///given map multiplied from the left side with a constant value. It can
    663   ///also be used as write map if the \c / operator is defined between
    664   ///\c Value and \c C and the given multiplier is not zero.
    665   ///Its \c Key and \c Value are inherited from \c M.
    666   ///
    667   ///\sa ScaleMap
     654  ///be used as write map also if the given multiplier is not zero.
     655  ///Its \c Key and \c Value is inherited from \c M.
    668656  template<typename M, typename C = typename M::Value>
    669657  class ScaleWriteMap : public MapBase<typename M::Key, typename M::Value> {
     
    677665    ///Constructor
    678666
    679     ///Constructor.
    680     ///\param _m is the undelying map.
    681     ///\param _v is the scaling value.
     667    ///Constructor
     668    ///\param _m is the undelying map
     669    ///\param _v is the scaling value
    682670    ScaleWriteMap(M &_m, const C &_v ) : m(_m), v(_v) {};
    683671    /// \e
     
    687675  };
    688676 
    689   ///Returns a \c ScaleMap class
    690 
    691   ///This function just returns a \c ScaleMap class.
     677  ///Returns an \c ScaleMap class
     678
     679  ///This function just returns an \c ScaleMap class.
    692680  ///\relates ScaleMap
    693681  template<typename M, typename C>
     
    696684  }
    697685
    698   ///Returns a \c ScaleWriteMap class
    699 
    700   ///This function just returns a \c ScaleWriteMap class.
    701   ///\relates ScaleWriteMap
    702686  template<typename M, typename C>
    703687  inline ScaleWriteMap<M, C> scaleMap(M &m,const C &v) {
     
    708692
    709693  ///This \c concepts::ReadMap "read only map" returns the quotient of the
    710   ///values of the two given maps.
    711   ///Its \c Key and \c Value are inherited from \c M1.
     694  ///values of the two
     695  ///given maps. Its \c Key and \c Value will be inherited from \c M1.
    712696  ///The \c Key and \c Value of \c M2 must be convertible to those of \c M1.
     697
    713698  template<typename M1, typename M2>
    714699  class DivMap : public MapBase<typename M1::Key, typename M1::Value> {
     
    738723
    739724  ///This \c concepts::ReadMap "read only map" returns the composition of
    740   ///two given maps.
    741   ///That is to say, if \c m1 is of type \c M1 and \c m2 is of \c M2,
     725  ///two
     726  ///given maps. That is to say, if \c m1 is of type \c M1 and \c m2 is
     727  ///of \c M2,
    742728  ///then for
    743729  ///\code
    744730  ///  ComposeMap<M1, M2> cm(m1,m2);
    745731  ///\endcode
    746   /// <tt>cm[x]</tt> will be equal to <tt>m1[m2[x]]</tt>.
    747   ///
    748   ///Its \c Key is inherited from \c M2 and its \c Value is from \c M1.
    749   ///\c M2::Value must be convertible to \c M1::Key.
    750   ///
    751   ///\sa CombineMap
    752   ///
     732  /// <tt>cm[x]</tt> will be equal to <tt>m1[m2[x]]</tt>
     733  ///
     734  ///Its \c Key is inherited from \c M2 and its \c Value is from
     735  ///\c M1.
     736  ///The \c M2::Value must be convertible to \c M1::Key.
    753737  ///\todo Check the requirements.
    754738  template <typename M1, typename M2>
     
    774758    operator[](Key k) const {return m1[m2[k]];}
    775759  };
    776 
    777760  ///Returns a \c ComposeMap class
    778761
    779762  ///This function just returns a \c ComposeMap class.
     763  ///
    780764  ///\relates ComposeMap
    781765  template <typename M1, typename M2>
     
    784768  }
    785769 
    786   ///Combine of two maps using an STL (binary) functor.
    787 
    788   ///Combine of two maps using an STL (binary) functor.
     770  ///Combines of two maps using an STL (binary) functor.
     771
     772  ///Combines of two maps using an STL (binary) functor.
     773  ///
    789774  ///
    790775  ///This \c concepts::ReadMap "read only map" takes two maps and a
    791   ///binary functor and returns the composition of the two
     776  ///binary functor and returns the composition of
     777  ///the two
    792778  ///given maps unsing the functor.
    793779  ///That is to say, if \c m1 and \c m2 is of type \c M1 and \c M2
    794   ///and \c f is of \c F, then for
     780  ///and \c f is of \c F,
     781  ///then for
    795782  ///\code
    796   ///  CombineMap<M1,M2,F,V> cm(m1,m2,f);
     783  ///  CombineMap<M1, M2,F,V> cm(m1,m2,f);
    797784  ///\endcode
    798785  /// <tt>cm[x]</tt> will be equal to <tt>f(m1[x],m2[x])</tt>
    799786  ///
    800787  ///Its \c Key is inherited from \c M1 and its \c Value is \c V.
    801   ///\c M2::Value and \c M1::Value must be convertible to the corresponding
     788  ///The \c M2::Value and \c M1::Value must be convertible to the corresponding
    802789  ///input parameter of \c F and the return type of \c F must be convertible
    803790  ///to \c V.
    804   ///
    805   ///\sa ComposeMap
    806   ///
    807791  ///\todo Check the requirements.
    808792  template<typename M1, typename M2, typename F,
     
    830814  ///For example if \c m1 and \c m2 are both \c double valued maps, then
    831815  ///\code
    832   ///combineMap(m1,m2,std::plus<double>())
     816  ///combineMap<double>(m1,m2,std::plus<double>())
    833817  ///\endcode
    834   ///is equivalent to
     818  ///is equivalent with
    835819  ///\code
    836820  ///addMap(m1,m2)
     
    838822  ///
    839823  ///This function is specialized for adaptable binary function
    840   ///classes and C++ functions.
     824  ///classes and c++ functions.
    841825  ///
    842826  ///\relates CombineMap
     
    862846
    863847  ///This \c concepts::ReadMap "read only map" returns the negative
    864   ///value of the value returned by the given map.
    865   ///Its \c Key and \c Value are inherited from \c M.
     848  ///value of the
     849  ///value returned by the
     850  ///given map. Its \c Key and \c Value will be inherited from \c M.
    866851  ///The unary \c - operator must be defined for \c Value, of course.
    867   ///
    868   ///\sa NegWriteMap
     852
    869853  template<typename M>
    870854  class NegMap : public MapBase<typename M::Key, typename M::Value> {
     
    884868
    885869  ///This \c concepts::ReadWriteMap "read-write map" returns the negative
    886   ///value of the value returned by the given map.
    887   ///Its \c Key and \c Value are inherited from \c M.
     870  ///value of the value returned by the
     871  ///given map. Its \c Key and \c Value will be inherited from \c M.
    888872  ///The unary \c - operator must be defined for \c Value, of course.
    889   ///
    890   /// \sa NegMap
     873
    891874  template<typename M>
    892875  class NegWriteMap : public MapBase<typename M::Key, typename M::Value> {
     
    914897  }
    915898
    916   ///Returns a \c NegWriteMap class
    917 
    918   ///This function just returns a \c NegWriteMap class.
    919   ///\relates NegWriteMap
    920899  template <typename M>
    921900  inline NegWriteMap<M> negMap(M &m) {
     
    926905
    927906  ///This \c concepts::ReadMap "read only map" returns the absolute value
    928   ///of the value returned by the given map.
    929   ///Its \c Key and \c Value are inherited from \c M.
    930   ///\c Value must be comparable to \c 0 and the unary \c -
     907  ///of the
     908  ///value returned by the
     909  ///given map. Its \c Key and \c Value will be inherited
     910  ///from <tt>M</tt>. <tt>Value</tt>
     911  ///must be comparable to <tt>0</tt> and the unary <tt>-</tt>
    931912  ///operator must be defined for it, of course.
     913  ///
     914
    932915  template<typename M>
    933916  class AbsMap : public MapBase<typename M::Key, typename M::Value> {
     
    948931  };
    949932 
    950   ///Returns an \c AbsMap class
    951 
    952   ///This function just returns an \c AbsMap class.
     933  ///Returns a \c AbsMap class
     934
     935  ///This function just returns a \c AbsMap class.
    953936  ///\relates AbsMap
    954937  template<typename M>
     
    960943
    961944  ///This \c concepts::ReadMap "read only map" returns the value
    962   ///of a given functor.
     945  ///of a
     946  ///given map.
    963947  ///
    964948  ///Template parameters \c K and \c V will become its
    965   ///\c Key and \c Value.
    966   ///In most cases they have to be given explicitly because a
    967   ///functor typically does not provide such typedefs.
     949  ///\c Key and \c Value. They must be given explicitely
     950  ///because a functor does not provide such typedefs.
    968951  ///
    969952  ///Parameter \c F is the type of the used functor.
    970   ///
    971   ///\sa MapFunctor
    972953  template<typename F,
    973954           typename K = typename F::argument_type,
     
    991972  ///
    992973  ///It is specialized for adaptable function classes and
    993   ///C++ functions.
     974  ///c++ functions.
    994975  ///\relates FunctorMap
    995976  template<typename K, typename V, typename F> inline
     
    10191000  ///a ususal \c concepts::ReadMap "readable map",
    10201001  ///i.e. <tt>operator[]</tt> and the \c Key and \c Value typedefs also exist.
    1021   ///
    1022   ///\sa FunctorMap
    10231002  template <typename M>
    10241003  class MapFunctor : public MapBase<typename M::Key, typename M::Value> {
     
    10551034  ///first map. This class is the just readable map type of the ForkWriteMap.
    10561035  ///
    1057   ///The \c Key and \c Value are inherited from \c M1.
     1036  ///The \c Key and \c Value will be inherited from \c M1.
    10581037  ///The \c Key and \c Value of M2 must be convertible from those of \c M1.
    1059   ///
    1060   ///\sa ForkWriteMap
    10611038  ///
    10621039  /// \todo Why is it needed?
     
    10851062  ///corresponding values of \c M1.
    10861063  ///
    1087   ///The \c Key and \c Value are inherited from \c M1.
     1064  ///The \c Key and \c Value will be inherited from \c M1.
    10881065  ///The \c Key and \c Value of M2 must be convertible from those of \c M1.
    1089   ///
    1090   ///\sa ForkMap
    10911066  template<typename  M1, typename M2>
    10921067  class ForkWriteMap : public MapBase<typename M1::Key, typename M1::Value> {
     
    11061081  };
    11071082 
    1108   ///Returns a \c ForkMap class
    1109 
    1110   ///This function just returns a \c ForkMap class.
     1083  ///Returns an \c ForkMap class
     1084
     1085  ///This function just returns an \c ForkMap class.
     1086  ///
    11111087  ///\relates ForkMap
    11121088  template <typename M1, typename M2>
     
    11151091  }
    11161092
    1117   ///Returns a \c ForkWriteMap class
    1118 
    1119   ///This function just returns a \c ForkWriteMap class.
    1120   ///\relates ForkWriteMap
    11211093  template <typename M1, typename M2>
    11221094  inline ForkWriteMap<M1, M2> forkMap(M1 &m1, M2 &m2) {
     
    11311103 
    11321104  ///This bool \c concepts::ReadMap "read only map" returns the
    1133   ///logical negation of the value returned by the given map.
    1134   ///Its \c Key is inherited from \c M, its Value is \c bool.
    1135   ///
    1136   ///\sa NotWriteMap
     1105  ///logical negation of
     1106  ///value returned by the
     1107  ///given map. Its \c Key and will be inherited from \c M,
     1108  ///its Value is <tt>bool</tt>.
    11371109  template <typename M>
    11381110  class NotMap : public MapBase<typename M::Key, bool> {
     
    11521124 
    11531125  ///This bool \c concepts::ReadWriteMap "read-write map" returns the
    1154   ///logical negation of the value returned by the given map. When it is set,
     1126  ///logical negation of value returned by the given map. When it is set,
    11551127  ///the opposite value is set to the original map.
    1156   ///Its \c Key is inherited from \c M, its Value is \c bool.
    1157   ///
    1158   ///\sa NotMap
     1128  ///Its \c Key and will be inherited from \c M,
     1129  ///its Value is <tt>bool</tt>.
    11591130  template <typename M>
    11601131  class NotWriteMap : public MapBase<typename M::Key, bool> {
     
    11821153  }
    11831154 
    1184   ///Returns a \c NotWriteMap class
    1185  
    1186   ///This function just returns a \c NotWriteMap class.
    1187   ///\relates NotWriteMap
    11881155  template <typename M>
    11891156  inline NotWriteMap<M> notMap(M &m) {
     
    12171184 
    12181185
    1219   /// \brief Writable bool map for logging each \c true assigned element
    1220   ///
    1221   /// Writable bool map for logging each \c true assigned element, i.e it
    1222   /// copies all the keys set to \c true to the given iterator.
     1186  /// \brief Writable bool map for logging each true assigned elements
     1187  ///
     1188  /// Writable bool map for logging each true assigned elements, i.e it
     1189  /// copies all the keys set to true to the given iterator.
    12231190  ///
    12241191  /// \note The container of the iterator should contain space
     
    12411208  ///\endcode
    12421209  ///
    1243   ///\sa BackInserterBoolMap
    1244   ///\sa FrontInserterBoolMap
    1245   ///\sa InserterBoolMap
    1246   ///
    1247   ///\todo Revise the name of this class and the related ones.
     1210  ///\todo Revise the name of this class and the relates ones.
    12481211  template <typename _Iterator,
    12491212            typename _Functor =
     
    12731236    }
    12741237
    1275     /// The \c set function of the map
     1238    /// Setter function of the map
    12761239    void set(const Key& key, Value value) const {
    12771240      if (value) {
     
    12861249  };
    12871250
    1288   /// \brief Writable bool map for logging each \c true assigned element in
    1289   /// a back insertable container.
    1290   ///
    1291   /// Writable bool map for logging each \c true assigned element by pushing
    1292   /// them into a back insertable container.
     1251  /// \brief Writable bool map for logging each true assigned elements in
     1252  /// a back insertable container
     1253  ///
     1254  /// Writable bool map for logging each true assigned elements by pushing
     1255  /// back them into a back insertable container.
    12931256  /// It can be used to retrieve the items into a standard
    12941257  /// container. The next example shows how you can store the
     
    13001263  /// prim(graph, cost, inserter_map);
    13011264  ///\endcode
    1302   ///
    1303   ///\sa StoreBoolMap
    1304   ///\sa FrontInserterBoolMap
    1305   ///\sa InserterBoolMap
    13061265  template <typename Container,
    13071266            typename Functor =
     
    13091268  class BackInserterBoolMap {
    13101269  public:
    1311     typedef typename Functor::argument_type Key;
     1270    typedef typename Container::value_type Key;
    13121271    typedef bool Value;
    13131272
     
    13171276      : container(_container), functor(_functor) {}
    13181277
    1319     /// The \c set function of the map
     1278    /// Setter function of the map
    13201279    void set(const Key& key, Value value) {
    13211280      if (value) {
     
    13291288  };
    13301289
    1331   /// \brief Writable bool map for logging each \c true assigned element in
     1290  /// \brief Writable bool map for storing each true assignments in
    13321291  /// a front insertable container.
    13331292  ///
    1334   /// Writable bool map for logging each \c true assigned element by pushing
    1335   /// them into a front insertable container.
    1336   /// It can be used to retrieve the items into a standard
    1337   /// container. For example see \ref BackInserterBoolMap.
    1338   ///
    1339   ///\sa BackInserterBoolMap
    1340   ///\sa InserterBoolMap
     1293  /// Writable bool map for storing each true assignment in a front
     1294  /// insertable container. It will push front all the keys set to \c true into
     1295  /// the container. For example see the BackInserterBoolMap.
    13411296  template <typename Container,
    13421297            typename Functor =
     
    13441299  class FrontInserterBoolMap {
    13451300  public:
    1346     typedef typename Functor::argument_type Key;
     1301    typedef typename Container::value_type Key;
    13471302    typedef bool Value;
    13481303
     
    13521307      : container(_container), functor(_functor) {}
    13531308
    1354     /// The \c set function of the map
     1309    /// Setter function of the map
    13551310    void set(const Key& key, Value value) {
    13561311      if (value) {
    1357         container.push_front(functor(key));
     1312        container.push_front(key);
    13581313      }
    13591314    }
     
    13641319  };
    13651320
    1366   /// \brief Writable bool map for storing each \c true assigned element in
     1321  /// \brief Writable bool map for storing each true assigned elements in
    13671322  /// an insertable container.
    13681323  ///
    1369   /// Writable bool map for storing each \c true assigned element in an
     1324  /// Writable bool map for storing each true assigned elements in an
    13701325  /// insertable container. It will insert all the keys set to \c true into
    13711326  /// the container.
     
    13791334  /// stronglyConnectedCutArcs(digraph, cost, inserter_map);
    13801335  ///\endcode
    1381   ///
    1382   ///\sa BackInserterBoolMap
    1383   ///\sa FrontInserterBoolMap
    13841336  template <typename Container,
    13851337            typename Functor =
     
    13901342    typedef bool Value;
    13911343
    1392     /// Constructor with specified iterator
    1393    
    1394     /// Constructor with specified iterator.
    1395     /// \param _container The container for storing the elements.
    1396     /// \param _it The elements will be inserted before this iterator.
    1397     /// \param _functor The functor that is used when an element is stored.
     1344    /// Constructor
    13981345    InserterBoolMap(Container& _container, typename Container::iterator _it,
    13991346                    const Functor& _functor = Functor())
     
    14011348
    14021349    /// Constructor
    1403 
    1404     /// Constructor without specified iterator.
    1405     /// The elements will be inserted before <tt>_container.end()</tt>.
    1406     /// \param _container The container for storing the elements.
    1407     /// \param _functor The functor that is used when an element is stored.
    14081350    InserterBoolMap(Container& _container, const Functor& _functor = Functor())
    14091351      : container(_container), it(_container.end()), functor(_functor) {}
    14101352
    1411     /// The \c set function of the map
     1353    /// Setter function of the map
    14121354    void set(const Key& key, Value value) {
    14131355      if (value) {
    1414         it = container.insert(it, functor(key));
     1356        it = container.insert(it, key);
    14151357        ++it;
    14161358      }
     
    14231365  };
    14241366
    1425   /// \brief Writable bool map for filling each \c true assigned element with a
    1426   /// given value.
    1427   ///
    1428   /// Writable bool map for filling each \c true assigned element with a
    1429   /// given value. The value can set the container.
     1367  /// \brief Fill the true set elements with a given value.
     1368  ///
     1369  /// Writable bool map to fill the elements set to \c true with a given value.
     1370  /// The value can set
     1371  /// the container.
    14301372  ///
    14311373  /// The following code finds the connected components of a graph
     
    14771419    }
    14781420
    1479     /// The \c set function of the map
     1421    /// Set function of the map
    14801422    void set(const Key& key, Value value) {
    14811423      if (value) {
     
    14901432
    14911433
    1492   /// \brief Writable bool map for storing the sequence number of
    1493   /// \c true assignments. 
     1434  /// \brief Writable bool map which stores the sequence number of
     1435  /// true assignments. 
    14941436  ///
    1495   /// Writable bool map that stores for each \c true assigned elements 
     1437  /// Writable bool map which stores for each true assigned elements 
    14961438  /// the sequence number of this setting.
    14971439  /// It makes it easy to calculate the leaving
  • lemon/tolerance.h

    r16 r7  
    4949  ///\sa Tolerance<long double>
    5050  ///\sa Tolerance<int>
    51 #if defined __GNUC__ && !defined __STRICT_ANSI__ 
    5251  ///\sa Tolerance<long long int>
    53 #endif
    5452  ///\sa Tolerance<unsigned int>
    55 #if defined __GNUC__ && !defined __STRICT_ANSI__ 
    5653  ///\sa Tolerance<unsigned long long int>
    57 #endif
    5854
    5955  template<class T>
     
    135131    bool negative(Value a) const { return -_epsilon>a; }
    136132    ///Returns \c true if \c a is \e surely non-zero
    137     bool nonZero(Value a) const { return positive(a)||negative(a); }
     133    bool nonZero(Value a) const { return positive(a)||negative(a); };
    138134
    139135    ///@}
     
    186182    bool negative(Value a) const { return -_epsilon>a; }
    187183    ///Returns \c true if \c a is \e surely non-zero
    188     bool nonZero(Value a) const { return positive(a)||negative(a); }
     184    bool nonZero(Value a) const { return positive(a)||negative(a); };
    189185
    190186    ///@}
     
    237233    bool negative(Value a) const { return -_epsilon>a; }
    238234    ///Returns \c true if \c a is \e surely non-zero
    239     bool nonZero(Value a) const { return positive(a)||negative(a); }
     235    bool nonZero(Value a) const { return positive(a)||negative(a); };
    240236
    241237    ///@}
     
    270266    static bool negative(Value a) { return 0>a; }
    271267    ///Returns \c true if \c a is \e surely non-zero
    272     static bool nonZero(Value a) { return a!=0; }
     268    static bool nonZero(Value a) { return a!=0; };
    273269
    274270    ///@}
     
    303299    static bool negative(Value) { return false; }
    304300    ///Returns \c true if \c a is \e surely non-zero
    305     static bool nonZero(Value a) { return a!=0; }
     301    static bool nonZero(Value a) { return a!=0; };
    306302
    307303    ///@}
     
    337333    static bool negative(Value a) { return 0>a; }
    338334    ///Returns \c true if \c a is \e surely non-zero
    339     static bool nonZero(Value a) { return a!=0;}
     335    static bool nonZero(Value a) { return a!=0;};
    340336
    341337    ///@}
     
    370366    static bool negative(Value) { return false; }
    371367    ///Returns \c true if \c a is \e surely non-zero
    372     static bool nonZero(Value a) { return a!=0;}
     368    static bool nonZero(Value a) { return a!=0;};
    373369
    374370    ///@}
     
    407403    static bool negative(Value a) { return 0>a; }
    408404    ///Returns \c true if \c a is \e surely non-zero
    409     static bool nonZero(Value a) { return a!=0;}
     405    static bool nonZero(Value a) { return a!=0;};
    410406
    411407    ///@}
     
    442438    static bool negative(Value) { return false; }
    443439    ///Returns \c true if \c a is \e surely non-zero
    444     static bool nonZero(Value a) { return a!=0;}
     440    static bool nonZero(Value a) { return a!=0;};
    445441
    446442    ///@}
  • test/Makefile.am

    r32 r25  
    44noinst_HEADERS += \
    55        test/test_tools.h
    6 
     6 
    77check_PROGRAMS += \
    8         test/dim_test \
    9         test/random_test \
     8        test/maps_test \
    109        test/test_tools_fail \
    1110        test/test_tools_pass
    12 
     11 
    1312TESTS += $(check_PROGRAMS)
    1413XFAIL_TESTS += test/test_tools_fail$(EXEEXT)
    1514
    16 test_dim_test_SOURCES = test/dim_test.cc
    17 test_random_test_SOURCES = test/random_test.cc
     15test_maps_test_SOURCES = test/maps_test.cc
    1816test_test_tools_fail_SOURCES = test/test_tools_fail.cc
    1917test_test_tools_pass_SOURCES = test/test_tools_pass.cc
Note: See TracChangeset for help on using the changeset viewer.