COIN-OR::LEMON - Graph Library

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


Ignore:
Files:
9 added
8 edited

Legend:

Unmodified
Added
Removed
  • .hgignore

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

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

    r1 r21  
    77m4_define([lemon_version_nano], [])
    88m4_define([lemon_version_tag], [hg])
    9 m4_define([lemon_hg_revision], [m4_normalize(esyscmd([hg tip |grep ^changeset |cut -d ':' -f 3]))])
    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 id -i]))])
     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

    r25 r32  
    88
    99lemon_libemon_la_SOURCES = \
    10         lemon/base.cc
     10        lemon/base.cc \
     11        lemon/random.cc
     12
    1113
    1214lemon_libemon_la_CXXFLAGS = $(GLPK_CFLAGS) $(CPLEX_CFLAGS) $(SOPLEX_CXXFLAGS)
     
    1416
    1517lemon_HEADERS += \
    16         lemon/concept_check.h \
     18        lemon/dim2.h \
     19        lemon/random.h \
    1720        lemon/list_graph.h \
    18         lemon/maps.h \
    1921        lemon/tolerance.h
    2022
     
    2325        lemon/bits/utility.h
    2426
    25 concept_HEADERS += \
    26         lemon/concepts/maps.h
     27concept_HEADERS +=
  • lemon/bits/invalid.h

    r7 r13  
    2525namespace lemon {
    2626
    27   /// \brief Dummy type to make it easier to make invalid iterators.
     27  /// \brief Dummy type to make it easier to create invalid iterators.
    2828  ///
    2929  /// See \ref INVALID for the usage.
     
    3535  };
    3636 
    37   /// Invalid iterators.
    38  
     37  /// \brief 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

    r26 r34  
    4545  class MapBase {
    4646  public:
    47     ///\e
     47    /// The key type of the map.
    4848    typedef K Key;
    49     ///\e
     49    /// The value type of the map. (The type of objects associated with the keys).
    5050    typedef T Value;
    5151  };
     
    5353  /// Null map. (a.k.a. DoNothingMap)
    5454
    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>...
     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>).
    5859  template<typename K, typename T>
    5960  class NullMap : public MapBase<K, T> {
     
    6970  };
    7071
     72  ///Returns a \c NullMap class
     73
     74  ///This function just returns a \c NullMap class.
     75  ///\relates NullMap
    7176  template <typename K, typename V>
    7277  NullMap<K, V> nullMap() {
     
    9196    /// Default constructor
    9297
     98    /// Default constructor.
    9399    /// The value of the map will be uninitialized.
    94100    /// (More exactly it will be default constructed.)
    95101    ConstMap() {}
    96     ///\e
    97 
    98     /// \param _v The initial value of the map.
    99     ///
     102   
     103    /// Constructor with specified initial value
     104
     105    /// Constructor with specified initial value.
     106    /// \param _v is the initial value of the map.
    100107    ConstMap(const T &_v) : v(_v) {}
    101108   
     
    159166  ///Map based on std::map
    160167
    161   ///This is essentially a wrapper for \c std::map. With addition that
    162   ///you can specify a default value different from \c Value() .
     168  ///This is essentially a wrapper for \c std::map with addition that
     169  ///you can specify a default value different from \c Value().
    163170  template <typename K, typename T, typename Compare = std::less<K> >
    164171  class StdMap {
     
    243250  };
    244251
    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
     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
    248255  /// are stored in a \c std::vector<T>  container. It can be used with
    249256  /// some data structures, for example \c UnionFind, \c BinHeap, when
     
    322329  /// @{
    323330
    324   /// \brief Identity mapping.
    325   ///
    326   /// This mapping gives back the given key as value without any
     331  /// \brief Identity map.
     332  ///
     333  /// This map gives back the given key as value without any
    327334  /// modification.
    328335  template <typename T>
     
    353360  ///
    354361  ///This \c concepts::ReadMap "read only map"
    355   ///converts the \c Value of a maps to type \c T.
     362  ///converts the \c Value of a map to type \c T.
    356363  ///Its \c Key is inherited from \c M.
    357364  template <typename M, typename T>
     
    365372    ///Constructor
    366373
    367     ///Constructor
    368     ///\param _m is the underlying map
     374    ///Constructor.
     375    ///\param _m is the underlying map.
    369376    ConvertMap(const M &_m) : m(_m) {};
    370377
     
    375382  };
    376383 
    377   ///Returns an \c ConvertMap class
    378 
    379   ///This function just returns an \c ConvertMap class.
     384  ///Returns a \c ConvertMap class
     385
     386  ///This function just returns a \c ConvertMap class.
    380387  ///\relates ConvertMap
    381388  template<typename T, typename M>
     
    384391  }
    385392
    386   ///Simple wrapping of the map
     393  ///Simple wrapping of a map
    387394
    388395  ///This \c concepts::ReadMap "read only map" returns the simple
     
    391398  ///map to simple read map.
    392399  ///
    393   /// \todo Revise the misleading name
     400  ///\sa SimpleWriteMap
     401  ///
     402  /// \todo Revise the misleading name
    394403  template<typename M>
    395404  class SimpleMap : public MapBase<typename M::Key, typename M::Value> {
     
    407416  };
    408417
    409   ///Simple writeable wrapping of the map
     418  ///Simple writable wrapping of the map
    410419
    411420  ///This \c concepts::WriteMap "write map" returns the simple
     
    414423  ///given map to simple read-write map.
    415424  ///
     425  ///\sa SimpleMap
     426  ///
    416427  /// \todo Revise the misleading name
    417428  template<typename M>
     
    435446
    436447  ///This \c concepts::ReadMap "read only map" returns the sum of the two
    437   ///given maps. Its \c Key and \c Value will be inherited from \c M1.
     448  ///given maps.
     449  ///Its \c Key and \c Value are inherited from \c M1.
    438450  ///The \c Key and \c Value of M2 must be convertible to those of \c M1.
    439 
    440451  template<typename M1, typename M2>
    441452  class AddMap : public MapBase<typename M1::Key, typename M1::Value> {
     
    469480  ///This \c concepts::ReadMap "read only map" returns the sum of the
    470481  ///given map and a constant value.
    471   ///Its \c Key and \c Value is inherited from \c M.
     482  ///Its \c Key and \c Value are inherited from \c M.
    472483  ///
    473484  ///Actually,
     
    475486  ///  ShiftMap<X> sh(x,v);
    476487  ///\endcode
    477   ///is equivalent with
     488  ///is equivalent to
    478489  ///\code
    479490  ///  ConstMap<X::Key, X::Value> c_tmp(v);
    480491  ///  AddMap<X, ConstMap<X::Key, X::Value> > sh(x,v);
    481492  ///\endcode
     493  ///
     494  ///\sa ShiftWriteMap
    482495  template<typename M, typename C = typename M::Value>
    483496  class ShiftMap : public MapBase<typename M::Key, typename M::Value> {
     
    491504    ///Constructor
    492505
    493     ///Constructor
    494     ///\param _m is the undelying map
    495     ///\param _v is the shift value
     506    ///Constructor.
     507    ///\param _m is the undelying map.
     508    ///\param _v is the shift value.
    496509    ShiftMap(const M &_m, const C &_v ) : m(_m), v(_v) {};
    497510    ///\e
     
    499512  };
    500513
    501   ///Shift a map with a constant. This map is also writable.
     514  ///Shift a map with a constant (ReadWrite version).
    502515
    503516  ///This \c concepts::ReadWriteMap "read-write map" returns the sum of the
    504517  ///given map and a constant value. It makes also possible to write the map.
    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
     518  ///Its \c Key and \c Value are inherited from \c M.
     519  ///
     520  ///\sa ShiftMap
    516521  template<typename M, typename C = typename M::Value>
    517522  class ShiftWriteMap : public MapBase<typename M::Key, typename M::Value> {
     
    525530    ///Constructor
    526531
    527     ///Constructor
    528     ///\param _m is the undelying map
    529     ///\param _v is the shift value
     532    ///Constructor.
     533    ///\param _m is the undelying map.
     534    ///\param _v is the shift value.
    530535    ShiftWriteMap(M &_m, const C &_v ) : m(_m), v(_v) {};
    531536    /// \e
     
    535540  };
    536541 
    537   ///Returns an \c ShiftMap class
    538 
    539   ///This function just returns an \c ShiftMap class.
     542  ///Returns a \c ShiftMap class
     543
     544  ///This function just returns a \c ShiftMap class.
    540545  ///\relates ShiftMap
    541546  template<typename M, typename C>
     
    544549  }
    545550
     551  ///Returns a \c ShiftWriteMap class
     552
     553  ///This function just returns a \c ShiftWriteMap class.
     554  ///\relates ShiftWriteMap
    546555  template<typename M, typename C>
    547556  inline ShiftWriteMap<M, C> shiftMap(M &m,const C &v) {
     
    552561
    553562  ///This \c concepts::ReadMap "read only map" returns the difference
    554   ///of the values of the two
    555   ///given maps. Its \c Key and \c Value will be inherited from \c M1.
     563  ///of the values of the two given maps.
     564  ///Its \c Key and \c Value are inherited from \c M1.
    556565  ///The \c Key and \c Value of \c M2 must be convertible to those of \c M1.
    557566  ///
     
    585594
    586595  ///This \c concepts::ReadMap "read only map" returns the product of the
    587   ///values of the two
    588   ///given
    589   ///maps. Its \c Key and \c Value will be inherited from \c M1.
     596  ///values of the two given maps.
     597  ///Its \c Key and \c Value are inherited from \c M1.
    590598  ///The \c Key and \c Value of \c M2 must be convertible to those of \c M1.
    591 
    592599  template<typename M1, typename M2>
    593600  class MulMap : public MapBase<typename M1::Key, typename M1::Value> {
     
    614621  }
    615622 
    616   ///Scales a maps with a constant.
     623  ///Scales a map with a constant.
    617624
    618625  ///This \c concepts::ReadMap "read only map" returns the value of the
    619626  ///given map multiplied from the left side with a constant value.
    620   ///Its \c Key and \c Value is inherited from \c M.
     627  ///Its \c Key and \c Value are inherited from \c M.
    621628  ///
    622629  ///Actually,
     
    624631  ///  ScaleMap<X> sc(x,v);
    625632  ///\endcode
    626   ///is equivalent with
     633  ///is equivalent to
    627634  ///\code
    628635  ///  ConstMap<X::Key, X::Value> c_tmp(v);
    629636  ///  MulMap<X, ConstMap<X::Key, X::Value> > sc(x,v);
    630637  ///\endcode
     638  ///
     639  ///\sa ScaleWriteMap
    631640  template<typename M, typename C = typename M::Value>
    632641  class ScaleMap : public MapBase<typename M::Key, typename M::Value> {
     
    640649    ///Constructor
    641650
    642     ///Constructor
    643     ///\param _m is the undelying map
    644     ///\param _v is the scaling value
     651    ///Constructor.
     652    ///\param _m is the undelying map.
     653    ///\param _v is the scaling value.
    645654    ScaleMap(const M &_m, const C &_v ) : m(_m), v(_v) {};
    646655    /// \e
     
    648657  };
    649658
    650   ///Scales a maps with a constant (ReadWrite version).
     659  ///Scales a map with a constant (ReadWrite version).
    651660
    652661  ///This \c concepts::ReadWriteMap "read-write map" returns the value of the
    653662  ///given map multiplied from the left side with a constant value. It can
    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.
     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
    656668  template<typename M, typename C = typename M::Value>
    657669  class ScaleWriteMap : public MapBase<typename M::Key, typename M::Value> {
     
    665677    ///Constructor
    666678
    667     ///Constructor
    668     ///\param _m is the undelying map
    669     ///\param _v is the scaling value
     679    ///Constructor.
     680    ///\param _m is the undelying map.
     681    ///\param _v is the scaling value.
    670682    ScaleWriteMap(M &_m, const C &_v ) : m(_m), v(_v) {};
    671683    /// \e
     
    675687  };
    676688 
    677   ///Returns an \c ScaleMap class
    678 
    679   ///This function just returns an \c ScaleMap class.
     689  ///Returns a \c ScaleMap class
     690
     691  ///This function just returns a \c ScaleMap class.
    680692  ///\relates ScaleMap
    681693  template<typename M, typename C>
     
    684696  }
    685697
     698  ///Returns a \c ScaleWriteMap class
     699
     700  ///This function just returns a \c ScaleWriteMap class.
     701  ///\relates ScaleWriteMap
    686702  template<typename M, typename C>
    687703  inline ScaleWriteMap<M, C> scaleMap(M &m,const C &v) {
     
    692708
    693709  ///This \c concepts::ReadMap "read only map" returns the quotient of the
    694   ///values of the two
    695   ///given maps. Its \c Key and \c Value will be inherited from \c M1.
     710  ///values of the two given maps.
     711  ///Its \c Key and \c Value are inherited from \c M1.
    696712  ///The \c Key and \c Value of \c M2 must be convertible to those of \c M1.
    697 
    698713  template<typename M1, typename M2>
    699714  class DivMap : public MapBase<typename M1::Key, typename M1::Value> {
     
    723738
    724739  ///This \c concepts::ReadMap "read only map" returns the composition of
    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,
     740  ///two given maps.
     741  ///That is to say, if \c m1 is of type \c M1 and \c m2 is of \c M2,
    728742  ///then for
    729743  ///\code
    730744  ///  ComposeMap<M1, M2> cm(m1,m2);
    731745  ///\endcode
    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.
     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  ///
    737753  ///\todo Check the requirements.
    738754  template <typename M1, typename M2>
     
    758774    operator[](Key k) const {return m1[m2[k]];}
    759775  };
     776
    760777  ///Returns a \c ComposeMap class
    761778
    762779  ///This function just returns a \c ComposeMap class.
    763   ///
    764780  ///\relates ComposeMap
    765781  template <typename M1, typename M2>
     
    768784  }
    769785 
    770   ///Combines of two maps using an STL (binary) functor.
    771 
    772   ///Combines of two maps using an STL (binary) functor.
    773   ///
     786  ///Combine of two maps using an STL (binary) functor.
     787
     788  ///Combine of two maps using an STL (binary) functor.
    774789  ///
    775790  ///This \c concepts::ReadMap "read only map" takes two maps and a
    776   ///binary functor and returns the composition of
    777   ///the two
     791  ///binary functor and returns the composition of the two
    778792  ///given maps unsing the functor.
    779793  ///That is to say, if \c m1 and \c m2 is of type \c M1 and \c M2
    780   ///and \c f is of \c F,
    781   ///then for
     794  ///and \c f is of \c F, then for
    782795  ///\code
    783   ///  CombineMap<M1, M2,F,V> cm(m1,m2,f);
     796  ///  CombineMap<M1,M2,F,V> cm(m1,m2,f);
    784797  ///\endcode
    785798  /// <tt>cm[x]</tt> will be equal to <tt>f(m1[x],m2[x])</tt>
    786799  ///
    787800  ///Its \c Key is inherited from \c M1 and its \c Value is \c V.
    788   ///The \c M2::Value and \c M1::Value must be convertible to the corresponding
     801  ///\c M2::Value and \c M1::Value must be convertible to the corresponding
    789802  ///input parameter of \c F and the return type of \c F must be convertible
    790803  ///to \c V.
     804  ///
     805  ///\sa ComposeMap
     806  ///
    791807  ///\todo Check the requirements.
    792808  template<typename M1, typename M2, typename F,
     
    814830  ///For example if \c m1 and \c m2 are both \c double valued maps, then
    815831  ///\code
    816   ///combineMap<double>(m1,m2,std::plus<double>())
     832  ///combineMap(m1,m2,std::plus<double>())
    817833  ///\endcode
    818   ///is equivalent with
     834  ///is equivalent to
    819835  ///\code
    820836  ///addMap(m1,m2)
     
    822838  ///
    823839  ///This function is specialized for adaptable binary function
    824   ///classes and c++ functions.
     840  ///classes and C++ functions.
    825841  ///
    826842  ///\relates CombineMap
     
    846862
    847863  ///This \c concepts::ReadMap "read only map" returns the negative
    848   ///value of the
    849   ///value returned by the
    850   ///given map. Its \c Key and \c Value will be inherited from \c M.
     864  ///value of the value returned by the given map.
     865  ///Its \c Key and \c Value are inherited from \c M.
    851866  ///The unary \c - operator must be defined for \c Value, of course.
    852 
     867  ///
     868  ///\sa NegWriteMap
    853869  template<typename M>
    854870  class NegMap : public MapBase<typename M::Key, typename M::Value> {
     
    868884
    869885  ///This \c concepts::ReadWriteMap "read-write map" returns the negative
    870   ///value of the value returned by the
    871   ///given map. Its \c Key and \c Value will be inherited from \c M.
     886  ///value of the value returned by the given map.
     887  ///Its \c Key and \c Value are inherited from \c M.
    872888  ///The unary \c - operator must be defined for \c Value, of course.
    873 
     889  ///
     890  /// \sa NegMap
    874891  template<typename M>
    875892  class NegWriteMap : public MapBase<typename M::Key, typename M::Value> {
     
    897914  }
    898915
     916  ///Returns a \c NegWriteMap class
     917
     918  ///This function just returns a \c NegWriteMap class.
     919  ///\relates NegWriteMap
    899920  template <typename M>
    900921  inline NegWriteMap<M> negMap(M &m) {
     
    905926
    906927  ///This \c concepts::ReadMap "read only map" returns the absolute value
    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>
     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 -
    912931  ///operator must be defined for it, of course.
    913   ///
    914 
    915932  template<typename M>
    916933  class AbsMap : public MapBase<typename M::Key, typename M::Value> {
     
    931948  };
    932949 
    933   ///Returns a \c AbsMap class
    934 
    935   ///This function just returns a \c AbsMap class.
     950  ///Returns an \c AbsMap class
     951
     952  ///This function just returns an \c AbsMap class.
    936953  ///\relates AbsMap
    937954  template<typename M>
     
    943960
    944961  ///This \c concepts::ReadMap "read only map" returns the value
    945   ///of a
    946   ///given map.
     962  ///of a given functor.
    947963  ///
    948964  ///Template parameters \c K and \c V will become its
    949   ///\c Key and \c Value. They must be given explicitely
    950   ///because a functor does not provide such typedefs.
     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.
    951968  ///
    952969  ///Parameter \c F is the type of the used functor.
     970  ///
     971  ///\sa MapFunctor
    953972  template<typename F,
    954973           typename K = typename F::argument_type,
     
    972991  ///
    973992  ///It is specialized for adaptable function classes and
    974   ///c++ functions.
     993  ///C++ functions.
    975994  ///\relates FunctorMap
    976995  template<typename K, typename V, typename F> inline
     
    10001019  ///a ususal \c concepts::ReadMap "readable map",
    10011020  ///i.e. <tt>operator[]</tt> and the \c Key and \c Value typedefs also exist.
     1021  ///
     1022  ///\sa FunctorMap
    10021023  template <typename M>
    10031024  class MapFunctor : public MapBase<typename M::Key, typename M::Value> {
     
    10341055  ///first map. This class is the just readable map type of the ForkWriteMap.
    10351056  ///
    1036   ///The \c Key and \c Value will be inherited from \c M1.
     1057  ///The \c Key and \c Value are inherited from \c M1.
    10371058  ///The \c Key and \c Value of M2 must be convertible from those of \c M1.
     1059  ///
     1060  ///\sa ForkWriteMap
    10381061  ///
    10391062  /// \todo Why is it needed?
     
    10621085  ///corresponding values of \c M1.
    10631086  ///
    1064   ///The \c Key and \c Value will be inherited from \c M1.
     1087  ///The \c Key and \c Value are inherited from \c M1.
    10651088  ///The \c Key and \c Value of M2 must be convertible from those of \c M1.
     1089  ///
     1090  ///\sa ForkMap
    10661091  template<typename  M1, typename M2>
    10671092  class ForkWriteMap : public MapBase<typename M1::Key, typename M1::Value> {
     
    10811106  };
    10821107 
    1083   ///Returns an \c ForkMap class
    1084 
    1085   ///This function just returns an \c ForkMap class.
    1086   ///
     1108  ///Returns a \c ForkMap class
     1109
     1110  ///This function just returns a \c ForkMap class.
    10871111  ///\relates ForkMap
    10881112  template <typename M1, typename M2>
     
    10911115  }
    10921116
     1117  ///Returns a \c ForkWriteMap class
     1118
     1119  ///This function just returns a \c ForkWriteMap class.
     1120  ///\relates ForkWriteMap
    10931121  template <typename M1, typename M2>
    10941122  inline ForkWriteMap<M1, M2> forkMap(M1 &m1, M2 &m2) {
     
    11031131 
    11041132  ///This bool \c concepts::ReadMap "read only map" returns the
    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>.
     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
    11091137  template <typename M>
    11101138  class NotMap : public MapBase<typename M::Key, bool> {
     
    11241152 
    11251153  ///This bool \c concepts::ReadWriteMap "read-write map" returns the
    1126   ///logical negation of value returned by the given map. When it is set,
     1154  ///logical negation of the value returned by the given map. When it is set,
    11271155  ///the opposite value is set to the original map.
    1128   ///Its \c Key and will be inherited from \c M,
    1129   ///its Value is <tt>bool</tt>.
     1156  ///Its \c Key is inherited from \c M, its Value is \c bool.
     1157  ///
     1158  ///\sa NotMap
    11301159  template <typename M>
    11311160  class NotWriteMap : public MapBase<typename M::Key, bool> {
     
    11531182  }
    11541183 
     1184  ///Returns a \c NotWriteMap class
     1185 
     1186  ///This function just returns a \c NotWriteMap class.
     1187  ///\relates NotWriteMap
    11551188  template <typename M>
    11561189  inline NotWriteMap<M> notMap(M &m) {
     
    11841217 
    11851218
    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.
     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.
    11901223  ///
    11911224  /// \note The container of the iterator should contain space
     
    12081241  ///\endcode
    12091242  ///
    1210   ///\todo Revise the name of this class and the relates ones.
     1243  ///\sa BackInserterBoolMap
     1244  ///\sa FrontInserterBoolMap
     1245  ///\sa InserterBoolMap
     1246  ///
     1247  ///\todo Revise the name of this class and the related ones.
    12111248  template <typename _Iterator,
    12121249            typename _Functor =
     
    12361273    }
    12371274
    1238     /// Setter function of the map
     1275    /// The \c set function of the map
    12391276    void set(const Key& key, Value value) const {
    12401277      if (value) {
     
    12491286  };
    12501287
    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.
     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.
    12561293  /// It can be used to retrieve the items into a standard
    12571294  /// container. The next example shows how you can store the
     
    12631300  /// prim(graph, cost, inserter_map);
    12641301  ///\endcode
     1302  ///
     1303  ///\sa StoreBoolMap
     1304  ///\sa FrontInserterBoolMap
     1305  ///\sa InserterBoolMap
    12651306  template <typename Container,
    12661307            typename Functor =
     
    12681309  class BackInserterBoolMap {
    12691310  public:
    1270     typedef typename Container::value_type Key;
     1311    typedef typename Functor::argument_type Key;
    12711312    typedef bool Value;
    12721313
     
    12761317      : container(_container), functor(_functor) {}
    12771318
    1278     /// Setter function of the map
     1319    /// The \c set function of the map
    12791320    void set(const Key& key, Value value) {
    12801321      if (value) {
     
    12881329  };
    12891330
    1290   /// \brief Writable bool map for storing each true assignments in
     1331  /// \brief Writable bool map for logging each \c true assigned element in
    12911332  /// a front insertable container.
    12921333  ///
    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.
     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
    12961341  template <typename Container,
    12971342            typename Functor =
     
    12991344  class FrontInserterBoolMap {
    13001345  public:
    1301     typedef typename Container::value_type Key;
     1346    typedef typename Functor::argument_type Key;
    13021347    typedef bool Value;
    13031348
     
    13071352      : container(_container), functor(_functor) {}
    13081353
    1309     /// Setter function of the map
     1354    /// The \c set function of the map
    13101355    void set(const Key& key, Value value) {
    13111356      if (value) {
    1312         container.push_front(key);
     1357        container.push_front(functor(key));
    13131358      }
    13141359    }
     
    13191364  };
    13201365
    1321   /// \brief Writable bool map for storing each true assigned elements in
     1366  /// \brief Writable bool map for storing each \c true assigned element in
    13221367  /// an insertable container.
    13231368  ///
    1324   /// Writable bool map for storing each true assigned elements in an
     1369  /// Writable bool map for storing each \c true assigned element in an
    13251370  /// insertable container. It will insert all the keys set to \c true into
    13261371  /// the container.
     
    13341379  /// stronglyConnectedCutArcs(digraph, cost, inserter_map);
    13351380  ///\endcode
     1381  ///
     1382  ///\sa BackInserterBoolMap
     1383  ///\sa FrontInserterBoolMap
    13361384  template <typename Container,
    13371385            typename Functor =
     
    13421390    typedef bool Value;
    13431391
    1344     /// Constructor
     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.
    13451398    InserterBoolMap(Container& _container, typename Container::iterator _it,
    13461399                    const Functor& _functor = Functor())
     
    13481401
    13491402    /// 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.
    13501408    InserterBoolMap(Container& _container, const Functor& _functor = Functor())
    13511409      : container(_container), it(_container.end()), functor(_functor) {}
    13521410
    1353     /// Setter function of the map
     1411    /// The \c set function of the map
    13541412    void set(const Key& key, Value value) {
    13551413      if (value) {
    1356         it = container.insert(it, key);
     1414        it = container.insert(it, functor(key));
    13571415        ++it;
    13581416      }
     
    13651423  };
    13661424
    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.
     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.
    13721430  ///
    13731431  /// The following code finds the connected components of a graph
     
    14191477    }
    14201478
    1421     /// Set function of the map
     1479    /// The \c set function of the map
    14221480    void set(const Key& key, Value value) {
    14231481      if (value) {
     
    14321490
    14331491
    1434   /// \brief Writable bool map which stores the sequence number of
    1435   /// true assignments. 
     1492  /// \brief Writable bool map for storing the sequence number of
     1493  /// \c true assignments. 
    14361494  ///
    1437   /// Writable bool map which stores for each true assigned elements 
     1495  /// Writable bool map that stores for each \c true assigned elements 
    14381496  /// the sequence number of this setting.
    14391497  /// It makes it easy to calculate the leaving
  • lemon/tolerance.h

    r7 r16  
    4949  ///\sa Tolerance<long double>
    5050  ///\sa Tolerance<int>
     51#if defined __GNUC__ && !defined __STRICT_ANSI__ 
    5152  ///\sa Tolerance<long long int>
     53#endif
    5254  ///\sa Tolerance<unsigned int>
     55#if defined __GNUC__ && !defined __STRICT_ANSI__ 
    5356  ///\sa Tolerance<unsigned long long int>
     57#endif
    5458
    5559  template<class T>
     
    131135    bool negative(Value a) const { return -_epsilon>a; }
    132136    ///Returns \c true if \c a is \e surely non-zero
    133     bool nonZero(Value a) const { return positive(a)||negative(a); };
     137    bool nonZero(Value a) const { return positive(a)||negative(a); }
    134138
    135139    ///@}
     
    182186    bool negative(Value a) const { return -_epsilon>a; }
    183187    ///Returns \c true if \c a is \e surely non-zero
    184     bool nonZero(Value a) const { return positive(a)||negative(a); };
     188    bool nonZero(Value a) const { return positive(a)||negative(a); }
    185189
    186190    ///@}
     
    233237    bool negative(Value a) const { return -_epsilon>a; }
    234238    ///Returns \c true if \c a is \e surely non-zero
    235     bool nonZero(Value a) const { return positive(a)||negative(a); };
     239    bool nonZero(Value a) const { return positive(a)||negative(a); }
    236240
    237241    ///@}
     
    266270    static bool negative(Value a) { return 0>a; }
    267271    ///Returns \c true if \c a is \e surely non-zero
    268     static bool nonZero(Value a) { return a!=0; };
     272    static bool nonZero(Value a) { return a!=0; }
    269273
    270274    ///@}
     
    299303    static bool negative(Value) { return false; }
    300304    ///Returns \c true if \c a is \e surely non-zero
    301     static bool nonZero(Value a) { return a!=0; };
     305    static bool nonZero(Value a) { return a!=0; }
    302306
    303307    ///@}
     
    333337    static bool negative(Value a) { return 0>a; }
    334338    ///Returns \c true if \c a is \e surely non-zero
    335     static bool nonZero(Value a) { return a!=0;};
     339    static bool nonZero(Value a) { return a!=0;}
    336340
    337341    ///@}
     
    366370    static bool negative(Value) { return false; }
    367371    ///Returns \c true if \c a is \e surely non-zero
    368     static bool nonZero(Value a) { return a!=0;};
     372    static bool nonZero(Value a) { return a!=0;}
    369373
    370374    ///@}
     
    403407    static bool negative(Value a) { return 0>a; }
    404408    ///Returns \c true if \c a is \e surely non-zero
    405     static bool nonZero(Value a) { return a!=0;};
     409    static bool nonZero(Value a) { return a!=0;}
    406410
    407411    ///@}
     
    438442    static bool negative(Value) { return false; }
    439443    ///Returns \c true if \c a is \e surely non-zero
    440     static bool nonZero(Value a) { return a!=0;};
     444    static bool nonZero(Value a) { return a!=0;}
    441445
    442446    ///@}
  • test/Makefile.am

    r25 r32  
    44noinst_HEADERS += \
    55        test/test_tools.h
    6  
     6
    77check_PROGRAMS += \
    8         test/maps_test \
     8        test/dim_test \
     9        test/random_test \
    910        test/test_tools_fail \
    1011        test/test_tools_pass
    11  
     12
    1213TESTS += $(check_PROGRAMS)
    1314XFAIL_TESTS += test/test_tools_fail$(EXEEXT)
    1415
    15 test_maps_test_SOURCES = test/maps_test.cc
     16test_dim_test_SOURCES = test/dim_test.cc
     17test_random_test_SOURCES = test/random_test.cc
    1618test_test_tools_fail_SOURCES = test/test_tools_fail.cc
    1719test_test_tools_pass_SOURCES = test/test_tools_pass.cc
Note: See TracChangeset for help on using the changeset viewer.