Changes in / [37:582c594ecd01:35:f8ddf1b1541a] in lemon-main
- Files:
-
- 9 deleted
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
.hgignore
r9 r3 6 6 *.o 7 7 .#.* 8 *.log9 *.lo10 *.tar.*11 8 Makefile.in 12 9 aclocal.m4 … … 23 20 lemon/stamp-h2 24 21 doc/Doxyfile 25 .dirstamp 26 .libs/* 27 .deps/* 22 lemon/.dirstamp 23 lemon/.libs/* 28 24 29 25 syntax: regexp 30 ^doc/html/.* 31 ^autom4te.cache/.* 32 ^build-aux/.* 33 ^objs.*/.* 34 ^test/[a-z_]*$ 26 html/.* 27 autom4te.cache/.* 28 build-aux/.* 29 objs.*/.* -
Makefile.am
r5 r1 5 5 6 6 EXTRA_DIST = \ 7 LICENSE \8 7 m4/lx_check_cplex.m4 \ 9 8 m4/lx_check_glpk.m4 \ -
configure.ac
r21 r1 7 7 m4_define([lemon_version_nano], []) 8 8 m4_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()])])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()])]) 11 11 12 12 AC_PREREQ([2.59]) -
lemon/Makefile.am
r32 r25 8 8 9 9 lemon_libemon_la_SOURCES = \ 10 lemon/base.cc \ 11 lemon/random.cc 12 10 lemon/base.cc 13 11 14 12 lemon_libemon_la_CXXFLAGS = $(GLPK_CFLAGS) $(CPLEX_CFLAGS) $(SOPLEX_CXXFLAGS) … … 16 14 17 15 lemon_HEADERS += \ 18 lemon/dim2.h \ 19 lemon/random.h \ 16 lemon/concept_check.h \ 20 17 lemon/list_graph.h \ 18 lemon/maps.h \ 21 19 lemon/tolerance.h 22 20 … … 25 23 lemon/bits/utility.h 26 24 27 concept_HEADERS += 25 concept_HEADERS += \ 26 lemon/concepts/maps.h -
lemon/bits/invalid.h
r13 r7 25 25 namespace lemon { 26 26 27 /// \brief Dummy type to make it easier to create invalid iterators.27 /// \brief Dummy type to make it easier to make invalid iterators. 28 28 /// 29 29 /// See \ref INVALID for the usage. … … 35 35 }; 36 36 37 /// \briefInvalid iterators.38 ///37 /// Invalid iterators. 38 39 39 /// \ref Invalid is a global type that converts to each iterator 40 40 /// in such a way that the value of the target iterator will be invalid. -
lemon/maps.h
r34 r26 45 45 class MapBase { 46 46 public: 47 /// The key type of the map.47 ///\e 48 48 typedef K Key; 49 /// The value type of the map. (The type of objects associated with the keys).49 ///\e 50 50 typedef T Value; 51 51 }; … … 53 53 /// Null map. (a.k.a. DoNothingMap) 54 54 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>... 59 58 template<typename K, typename T> 60 59 class NullMap : public MapBase<K, T> { … … 70 69 }; 71 70 72 ///Returns a \c NullMap class73 74 ///This function just returns a \c NullMap class.75 ///\relates NullMap76 71 template <typename K, typename V> 77 72 NullMap<K, V> nullMap() { … … 96 91 /// Default constructor 97 92 98 /// Default constructor.99 93 /// The value of the map will be uninitialized. 100 94 /// (More exactly it will be default constructed.) 101 95 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 /// 107 100 ConstMap(const T &_v) : v(_v) {} 108 101 … … 166 159 ///Map based on std::map 167 160 168 ///This is essentially a wrapper for \c std::map with addition that169 ///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() . 170 163 template <typename K, typename T, typename Compare = std::less<K> > 171 164 class StdMap { … … 250 243 }; 251 244 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 values245 /// \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 255 248 /// are stored in a \c std::vector<T> container. It can be used with 256 249 /// some data structures, for example \c UnionFind, \c BinHeap, when … … 329 322 /// @{ 330 323 331 /// \brief Identity map .332 /// 333 /// This map gives back the given key as value without any324 /// \brief Identity mapping. 325 /// 326 /// This mapping gives back the given key as value without any 334 327 /// modification. 335 328 template <typename T> … … 360 353 /// 361 354 ///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. 363 356 ///Its \c Key is inherited from \c M. 364 357 template <typename M, typename T> … … 372 365 ///Constructor 373 366 374 ///Constructor .375 ///\param _m is the underlying map .367 ///Constructor 368 ///\param _m is the underlying map 376 369 ConvertMap(const M &_m) : m(_m) {}; 377 370 … … 382 375 }; 383 376 384 ///Returns a \c ConvertMap class385 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. 387 380 ///\relates ConvertMap 388 381 template<typename T, typename M> … … 391 384 } 392 385 393 ///Simple wrapping of amap386 ///Simple wrapping of the map 394 387 395 388 ///This \c concepts::ReadMap "read only map" returns the simple … … 398 391 ///map to simple read map. 399 392 /// 400 ///\sa SimpleWriteMap 401 /// 402 /// \todo Revise the misleading name 393 /// \todo Revise the misleading name 403 394 template<typename M> 404 395 class SimpleMap : public MapBase<typename M::Key, typename M::Value> { … … 416 407 }; 417 408 418 ///Simple writ able wrapping of the map409 ///Simple writeable wrapping of the map 419 410 420 411 ///This \c concepts::WriteMap "write map" returns the simple … … 423 414 ///given map to simple read-write map. 424 415 /// 425 ///\sa SimpleMap426 ///427 416 /// \todo Revise the misleading name 428 417 template<typename M> … … 446 435 447 436 ///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. 450 438 ///The \c Key and \c Value of M2 must be convertible to those of \c M1. 439 451 440 template<typename M1, typename M2> 452 441 class AddMap : public MapBase<typename M1::Key, typename M1::Value> { … … 480 469 ///This \c concepts::ReadMap "read only map" returns the sum of the 481 470 ///given map and a constant value. 482 ///Its \c Key and \c Value areinherited from \c M.471 ///Its \c Key and \c Value is inherited from \c M. 483 472 /// 484 473 ///Actually, … … 486 475 /// ShiftMap<X> sh(x,v); 487 476 ///\endcode 488 ///is equivalent to477 ///is equivalent with 489 478 ///\code 490 479 /// ConstMap<X::Key, X::Value> c_tmp(v); 491 480 /// AddMap<X, ConstMap<X::Key, X::Value> > sh(x,v); 492 481 ///\endcode 493 ///494 ///\sa ShiftWriteMap495 482 template<typename M, typename C = typename M::Value> 496 483 class ShiftMap : public MapBase<typename M::Key, typename M::Value> { … … 504 491 ///Constructor 505 492 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 509 496 ShiftMap(const M &_m, const C &_v ) : m(_m), v(_v) {}; 510 497 ///\e … … 512 499 }; 513 500 514 ///Shift a map with a constant (ReadWrite version).501 ///Shift a map with a constant. This map is also writable. 515 502 516 503 ///This \c concepts::ReadWriteMap "read-write map" returns the sum of the 517 504 ///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 521 516 template<typename M, typename C = typename M::Value> 522 517 class ShiftWriteMap : public MapBase<typename M::Key, typename M::Value> { … … 530 525 ///Constructor 531 526 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 535 530 ShiftWriteMap(M &_m, const C &_v ) : m(_m), v(_v) {}; 536 531 /// \e … … 540 535 }; 541 536 542 ///Returns a \c ShiftMap class543 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. 545 540 ///\relates ShiftMap 546 541 template<typename M, typename C> … … 549 544 } 550 545 551 ///Returns a \c ShiftWriteMap class552 553 ///This function just returns a \c ShiftWriteMap class.554 ///\relates ShiftWriteMap555 546 template<typename M, typename C> 556 547 inline ShiftWriteMap<M, C> shiftMap(M &m,const C &v) { … … 561 552 562 553 ///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. 565 556 ///The \c Key and \c Value of \c M2 must be convertible to those of \c M1. 566 557 /// … … 594 585 595 586 ///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. 598 590 ///The \c Key and \c Value of \c M2 must be convertible to those of \c M1. 591 599 592 template<typename M1, typename M2> 600 593 class MulMap : public MapBase<typename M1::Key, typename M1::Value> { … … 621 614 } 622 615 623 ///Scales a map with a constant.616 ///Scales a maps with a constant. 624 617 625 618 ///This \c concepts::ReadMap "read only map" returns the value of the 626 619 ///given map multiplied from the left side with a constant value. 627 ///Its \c Key and \c Value areinherited from \c M.620 ///Its \c Key and \c Value is inherited from \c M. 628 621 /// 629 622 ///Actually, … … 631 624 /// ScaleMap<X> sc(x,v); 632 625 ///\endcode 633 ///is equivalent to626 ///is equivalent with 634 627 ///\code 635 628 /// ConstMap<X::Key, X::Value> c_tmp(v); 636 629 /// MulMap<X, ConstMap<X::Key, X::Value> > sc(x,v); 637 630 ///\endcode 638 ///639 ///\sa ScaleWriteMap640 631 template<typename M, typename C = typename M::Value> 641 632 class ScaleMap : public MapBase<typename M::Key, typename M::Value> { … … 649 640 ///Constructor 650 641 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 654 645 ScaleMap(const M &_m, const C &_v ) : m(_m), v(_v) {}; 655 646 /// \e … … 657 648 }; 658 649 659 ///Scales a map with a constant (ReadWrite version).650 ///Scales a maps with a constant (ReadWrite version). 660 651 661 652 ///This \c concepts::ReadWriteMap "read-write map" returns the value of the 662 653 ///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. 668 656 template<typename M, typename C = typename M::Value> 669 657 class ScaleWriteMap : public MapBase<typename M::Key, typename M::Value> { … … 677 665 ///Constructor 678 666 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 682 670 ScaleWriteMap(M &_m, const C &_v ) : m(_m), v(_v) {}; 683 671 /// \e … … 687 675 }; 688 676 689 ///Returns a \c ScaleMap class690 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. 692 680 ///\relates ScaleMap 693 681 template<typename M, typename C> … … 696 684 } 697 685 698 ///Returns a \c ScaleWriteMap class699 700 ///This function just returns a \c ScaleWriteMap class.701 ///\relates ScaleWriteMap702 686 template<typename M, typename C> 703 687 inline ScaleWriteMap<M, C> scaleMap(M &m,const C &v) { … … 708 692 709 693 ///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. 712 696 ///The \c Key and \c Value of \c M2 must be convertible to those of \c M1. 697 713 698 template<typename M1, typename M2> 714 699 class DivMap : public MapBase<typename M1::Key, typename M1::Value> { … … 738 723 739 724 ///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, 742 728 ///then for 743 729 ///\code 744 730 /// ComposeMap<M1, M2> cm(m1,m2); 745 731 ///\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. 753 737 ///\todo Check the requirements. 754 738 template <typename M1, typename M2> … … 774 758 operator[](Key k) const {return m1[m2[k]];} 775 759 }; 776 777 760 ///Returns a \c ComposeMap class 778 761 779 762 ///This function just returns a \c ComposeMap class. 763 /// 780 764 ///\relates ComposeMap 781 765 template <typename M1, typename M2> … … 784 768 } 785 769 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 /// 789 774 /// 790 775 ///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 792 778 ///given maps unsing the functor. 793 779 ///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 795 782 ///\code 796 /// CombineMap<M1, M2,F,V> cm(m1,m2,f);783 /// CombineMap<M1, M2,F,V> cm(m1,m2,f); 797 784 ///\endcode 798 785 /// <tt>cm[x]</tt> will be equal to <tt>f(m1[x],m2[x])</tt> 799 786 /// 800 787 ///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 corresponding788 ///The \c M2::Value and \c M1::Value must be convertible to the corresponding 802 789 ///input parameter of \c F and the return type of \c F must be convertible 803 790 ///to \c V. 804 ///805 ///\sa ComposeMap806 ///807 791 ///\todo Check the requirements. 808 792 template<typename M1, typename M2, typename F, … … 830 814 ///For example if \c m1 and \c m2 are both \c double valued maps, then 831 815 ///\code 832 ///combineMap (m1,m2,std::plus<double>())816 ///combineMap<double>(m1,m2,std::plus<double>()) 833 817 ///\endcode 834 ///is equivalent to818 ///is equivalent with 835 819 ///\code 836 820 ///addMap(m1,m2) … … 838 822 /// 839 823 ///This function is specialized for adaptable binary function 840 ///classes and C++ functions.824 ///classes and c++ functions. 841 825 /// 842 826 ///\relates CombineMap … … 862 846 863 847 ///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. 866 851 ///The unary \c - operator must be defined for \c Value, of course. 867 /// 868 ///\sa NegWriteMap 852 869 853 template<typename M> 870 854 class NegMap : public MapBase<typename M::Key, typename M::Value> { … … 884 868 885 869 ///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. 888 872 ///The unary \c - operator must be defined for \c Value, of course. 889 /// 890 /// \sa NegMap 873 891 874 template<typename M> 892 875 class NegWriteMap : public MapBase<typename M::Key, typename M::Value> { … … 914 897 } 915 898 916 ///Returns a \c NegWriteMap class917 918 ///This function just returns a \c NegWriteMap class.919 ///\relates NegWriteMap920 899 template <typename M> 921 900 inline NegWriteMap<M> negMap(M &m) { … … 926 905 927 906 ///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> 931 912 ///operator must be defined for it, of course. 913 /// 914 932 915 template<typename M> 933 916 class AbsMap : public MapBase<typename M::Key, typename M::Value> { … … 948 931 }; 949 932 950 ///Returns a n\c AbsMap class951 952 ///This function just returns a n\c AbsMap class.933 ///Returns a \c AbsMap class 934 935 ///This function just returns a \c AbsMap class. 953 936 ///\relates AbsMap 954 937 template<typename M> … … 960 943 961 944 ///This \c concepts::ReadMap "read only map" returns the value 962 ///of a given functor. 945 ///of a 946 ///given map. 963 947 /// 964 948 ///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. 968 951 /// 969 952 ///Parameter \c F is the type of the used functor. 970 ///971 ///\sa MapFunctor972 953 template<typename F, 973 954 typename K = typename F::argument_type, … … 991 972 /// 992 973 ///It is specialized for adaptable function classes and 993 /// C++ functions.974 ///c++ functions. 994 975 ///\relates FunctorMap 995 976 template<typename K, typename V, typename F> inline … … 1019 1000 ///a ususal \c concepts::ReadMap "readable map", 1020 1001 ///i.e. <tt>operator[]</tt> and the \c Key and \c Value typedefs also exist. 1021 ///1022 ///\sa FunctorMap1023 1002 template <typename M> 1024 1003 class MapFunctor : public MapBase<typename M::Key, typename M::Value> { … … 1055 1034 ///first map. This class is the just readable map type of the ForkWriteMap. 1056 1035 /// 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. 1058 1037 ///The \c Key and \c Value of M2 must be convertible from those of \c M1. 1059 ///1060 ///\sa ForkWriteMap1061 1038 /// 1062 1039 /// \todo Why is it needed? … … 1085 1062 ///corresponding values of \c M1. 1086 1063 /// 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. 1088 1065 ///The \c Key and \c Value of M2 must be convertible from those of \c M1. 1089 ///1090 ///\sa ForkMap1091 1066 template<typename M1, typename M2> 1092 1067 class ForkWriteMap : public MapBase<typename M1::Key, typename M1::Value> { … … 1106 1081 }; 1107 1082 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 /// 1111 1087 ///\relates ForkMap 1112 1088 template <typename M1, typename M2> … … 1115 1091 } 1116 1092 1117 ///Returns a \c ForkWriteMap class1118 1119 ///This function just returns a \c ForkWriteMap class.1120 ///\relates ForkWriteMap1121 1093 template <typename M1, typename M2> 1122 1094 inline ForkWriteMap<M1, M2> forkMap(M1 &m1, M2 &m2) { … … 1131 1103 1132 1104 ///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 NotWriteMap1105 ///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>. 1137 1109 template <typename M> 1138 1110 class NotMap : public MapBase<typename M::Key, bool> { … … 1152 1124 1153 1125 ///This bool \c concepts::ReadWriteMap "read-write map" returns the 1154 ///logical negation of thevalue returned by the given map. When it is set,1126 ///logical negation of value returned by the given map. When it is set, 1155 1127 ///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>. 1159 1130 template <typename M> 1160 1131 class NotWriteMap : public MapBase<typename M::Key, bool> { … … 1182 1153 } 1183 1154 1184 ///Returns a \c NotWriteMap class1185 1186 ///This function just returns a \c NotWriteMap class.1187 ///\relates NotWriteMap1188 1155 template <typename M> 1189 1156 inline NotWriteMap<M> notMap(M &m) { … … 1217 1184 1218 1185 1219 /// \brief Writable bool map for logging each \c true assigned element1220 /// 1221 /// Writable bool map for logging each \c true assigned element, i.e it1222 /// copies all the keys set to \ctrue 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. 1223 1190 /// 1224 1191 /// \note The container of the iterator should contain space … … 1241 1208 ///\endcode 1242 1209 /// 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. 1248 1211 template <typename _Iterator, 1249 1212 typename _Functor = … … 1273 1236 } 1274 1237 1275 /// The \c setfunction of the map1238 /// Setter function of the map 1276 1239 void set(const Key& key, Value value) const { 1277 1240 if (value) { … … 1286 1249 }; 1287 1250 1288 /// \brief Writable bool map for logging each \c true assigned elementin1289 /// a back insertable container .1290 /// 1291 /// Writable bool map for logging each \c true assigned elementby pushing1292 /// 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. 1293 1256 /// It can be used to retrieve the items into a standard 1294 1257 /// container. The next example shows how you can store the … … 1300 1263 /// prim(graph, cost, inserter_map); 1301 1264 ///\endcode 1302 ///1303 ///\sa StoreBoolMap1304 ///\sa FrontInserterBoolMap1305 ///\sa InserterBoolMap1306 1265 template <typename Container, 1307 1266 typename Functor = … … 1309 1268 class BackInserterBoolMap { 1310 1269 public: 1311 typedef typename Functor::argument_type Key;1270 typedef typename Container::value_type Key; 1312 1271 typedef bool Value; 1313 1272 … … 1317 1276 : container(_container), functor(_functor) {} 1318 1277 1319 /// The \c setfunction of the map1278 /// Setter function of the map 1320 1279 void set(const Key& key, Value value) { 1321 1280 if (value) { … … 1329 1288 }; 1330 1289 1331 /// \brief Writable bool map for logging each \c true assigned elementin1290 /// \brief Writable bool map for storing each true assignments in 1332 1291 /// a front insertable container. 1333 1292 /// 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. 1341 1296 template <typename Container, 1342 1297 typename Functor = … … 1344 1299 class FrontInserterBoolMap { 1345 1300 public: 1346 typedef typename Functor::argument_type Key;1301 typedef typename Container::value_type Key; 1347 1302 typedef bool Value; 1348 1303 … … 1352 1307 : container(_container), functor(_functor) {} 1353 1308 1354 /// The \c setfunction of the map1309 /// Setter function of the map 1355 1310 void set(const Key& key, Value value) { 1356 1311 if (value) { 1357 container.push_front( functor(key));1312 container.push_front(key); 1358 1313 } 1359 1314 } … … 1364 1319 }; 1365 1320 1366 /// \brief Writable bool map for storing each \c true assigned elementin1321 /// \brief Writable bool map for storing each true assigned elements in 1367 1322 /// an insertable container. 1368 1323 /// 1369 /// Writable bool map for storing each \c true assigned elementin an1324 /// Writable bool map for storing each true assigned elements in an 1370 1325 /// insertable container. It will insert all the keys set to \c true into 1371 1326 /// the container. … … 1379 1334 /// stronglyConnectedCutArcs(digraph, cost, inserter_map); 1380 1335 ///\endcode 1381 ///1382 ///\sa BackInserterBoolMap1383 ///\sa FrontInserterBoolMap1384 1336 template <typename Container, 1385 1337 typename Functor = … … 1390 1342 typedef bool Value; 1391 1343 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 1398 1345 InserterBoolMap(Container& _container, typename Container::iterator _it, 1399 1346 const Functor& _functor = Functor()) … … 1401 1348 1402 1349 /// 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.1408 1350 InserterBoolMap(Container& _container, const Functor& _functor = Functor()) 1409 1351 : container(_container), it(_container.end()), functor(_functor) {} 1410 1352 1411 /// The \c setfunction of the map1353 /// Setter function of the map 1412 1354 void set(const Key& key, Value value) { 1413 1355 if (value) { 1414 it = container.insert(it, functor(key));1356 it = container.insert(it, key); 1415 1357 ++it; 1416 1358 } … … 1423 1365 }; 1424 1366 1425 /// \brief Writable bool map for filling each \c true assigned element with a1426 /// given value.1427 /// 1428 /// Writable bool map for filling each \c true assigned element with a1429 /// given value. The value can setthe 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. 1430 1372 /// 1431 1373 /// The following code finds the connected components of a graph … … 1477 1419 } 1478 1420 1479 /// The \c set function of the map1421 /// Set function of the map 1480 1422 void set(const Key& key, Value value) { 1481 1423 if (value) { … … 1490 1432 1491 1433 1492 /// \brief Writable bool map for storingthe sequence number of1493 /// \ctrue assignments.1434 /// \brief Writable bool map which stores the sequence number of 1435 /// true assignments. 1494 1436 /// 1495 /// Writable bool map that stores for each \ctrue assigned elements1437 /// Writable bool map which stores for each true assigned elements 1496 1438 /// the sequence number of this setting. 1497 1439 /// It makes it easy to calculate the leaving -
lemon/tolerance.h
r16 r7 49 49 ///\sa Tolerance<long double> 50 50 ///\sa Tolerance<int> 51 #if defined __GNUC__ && !defined __STRICT_ANSI__52 51 ///\sa Tolerance<long long int> 53 #endif54 52 ///\sa Tolerance<unsigned int> 55 #if defined __GNUC__ && !defined __STRICT_ANSI__56 53 ///\sa Tolerance<unsigned long long int> 57 #endif58 54 59 55 template<class T> … … 135 131 bool negative(Value a) const { return -_epsilon>a; } 136 132 ///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); }; 138 134 139 135 ///@} … … 186 182 bool negative(Value a) const { return -_epsilon>a; } 187 183 ///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); }; 189 185 190 186 ///@} … … 237 233 bool negative(Value a) const { return -_epsilon>a; } 238 234 ///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); }; 240 236 241 237 ///@} … … 270 266 static bool negative(Value a) { return 0>a; } 271 267 ///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; }; 273 269 274 270 ///@} … … 303 299 static bool negative(Value) { return false; } 304 300 ///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; }; 306 302 307 303 ///@} … … 337 333 static bool negative(Value a) { return 0>a; } 338 334 ///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;}; 340 336 341 337 ///@} … … 370 366 static bool negative(Value) { return false; } 371 367 ///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;}; 373 369 374 370 ///@} … … 407 403 static bool negative(Value a) { return 0>a; } 408 404 ///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;}; 410 406 411 407 ///@} … … 442 438 static bool negative(Value) { return false; } 443 439 ///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;}; 445 441 446 442 ///@} -
test/Makefile.am
r32 r25 4 4 noinst_HEADERS += \ 5 5 test/test_tools.h 6 6 7 7 check_PROGRAMS += \ 8 test/dim_test \ 9 test/random_test \ 8 test/maps_test \ 10 9 test/test_tools_fail \ 11 10 test/test_tools_pass 12 11 13 12 TESTS += $(check_PROGRAMS) 14 13 XFAIL_TESTS += test/test_tools_fail$(EXEEXT) 15 14 16 test_dim_test_SOURCES = test/dim_test.cc 17 test_random_test_SOURCES = test/random_test.cc 15 test_maps_test_SOURCES = test/maps_test.cc 18 16 test_test_tools_fail_SOURCES = test/test_tools_fail.cc 19 17 test_test_tools_pass_SOURCES = test/test_tools_pass.cc
Note: See TracChangeset
for help on using the changeset viewer.