Changeset 29:0cb4ba427bfd in lemon for lemon/maps.h
 Timestamp:
 01/04/08 08:08:50 (12 years ago)
 Branch:
 default
 Phase:
 public
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

lemon/maps.h
r26 r29 53 53 /// Null map. (a.k.a. DoNothingMap) 54 54 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>). 58 59 template<typename K, typename T> 59 60 class NullMap : public MapBase<K, T> { … … 69 70 }; 70 71 72 ///Returns a \c NullMap class 73 74 ///This function just returns a \c NullMap class. 75 ///\relates NullMap 71 76 template <typename K, typename V> 72 77 NullMap<K, V> nullMap() { … … 91 96 /// Default constructor 92 97 98 /// Default constructor. 93 99 /// The value of the map will be uninitialized. 94 100 /// (More exactly it will be default constructed.) 95 101 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. 100 107 ConstMap(const T &_v) : v(_v) {} 101 108 … … 159 166 ///Map based on std::map 160 167 161 ///This is essentially a wrapper for \c std::map . With addition that162 ///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(). 163 170 template <typename K, typename T, typename Compare = std::less<K> > 164 171 class StdMap { … … 322 329 /// @{ 323 330 324 /// \brief Identity map ping.325 /// 326 /// This map pinggives back the given key as value without any331 /// \brief Identity map. 332 /// 333 /// This map gives back the given key as value without any 327 334 /// modification. 328 335 template <typename T> … … 353 360 /// 354 361 ///This \c concepts::ReadMap "read only map" 355 ///converts the \c Value of a map sto type \c T.362 ///converts the \c Value of a map to type \c T. 356 363 ///Its \c Key is inherited from \c M. 357 364 template <typename M, typename T> … … 365 372 ///Constructor 366 373 367 ///Constructor 368 ///\param _m is the underlying map 374 ///Constructor. 375 ///\param _m is the underlying map. 369 376 ConvertMap(const M &_m) : m(_m) {}; 370 377 … … 375 382 }; 376 383 377 ///Returns a n\c ConvertMap class378 379 ///This function just returns a n\c ConvertMap class.384 ///Returns a \c ConvertMap class 385 386 ///This function just returns a \c ConvertMap class. 380 387 ///\relates ConvertMap 381 388 template<typename T, typename M> … … 384 391 } 385 392 386 ///Simple wrapping of themap393 ///Simple wrapping of a map 387 394 388 395 ///This \c concepts::ReadMap "read only map" returns the simple … … 391 398 ///map to simple read map. 392 399 /// 393 /// \todo Revise the misleading name 400 ///\sa SimpleWriteMap 401 /// 402 /// \todo Revise the misleading name 394 403 template<typename M> 395 404 class SimpleMap : public MapBase<typename M::Key, typename M::Value> { … … 407 416 }; 408 417 409 ///Simple writ eable wrapping of the map418 ///Simple writable wrapping of the map 410 419 411 420 ///This \c concepts::WriteMap "write map" returns the simple … … 414 423 ///given map to simple readwrite map. 415 424 /// 425 ///\sa SimpleMap 426 /// 416 427 /// \todo Revise the misleading name 417 428 template<typename M> … … 435 446 436 447 ///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. 438 450 ///The \c Key and \c Value of M2 must be convertible to those of \c M1. 439 440 451 template<typename M1, typename M2> 441 452 class AddMap : public MapBase<typename M1::Key, typename M1::Value> { … … 469 480 ///This \c concepts::ReadMap "read only map" returns the sum of the 470 481 ///given map and a constant value. 471 ///Its \c Key and \c Value isinherited from \c M.482 ///Its \c Key and \c Value are inherited from \c M. 472 483 /// 473 484 ///Actually, … … 475 486 /// ShiftMap<X> sh(x,v); 476 487 ///\endcode 477 ///is equivalent with488 ///is equivalent to 478 489 ///\code 479 490 /// ConstMap<X::Key, X::Value> c_tmp(v); 480 491 /// AddMap<X, ConstMap<X::Key, X::Value> > sh(x,v); 481 492 ///\endcode 493 /// 494 ///\sa ShiftWriteMap 482 495 template<typename M, typename C = typename M::Value> 483 496 class ShiftMap : public MapBase<typename M::Key, typename M::Value> { … … 491 504 ///Constructor 492 505 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. 496 509 ShiftMap(const M &_m, const C &_v ) : m(_m), v(_v) {}; 497 510 ///\e … … 499 512 }; 500 513 501 ///Shift a map with a constant . This map is also writable.514 ///Shift a map with a constant (ReadWrite version). 502 515 503 516 ///This \c concepts::ReadWriteMap "readwrite map" returns the sum of the 504 517 ///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 516 521 template<typename M, typename C = typename M::Value> 517 522 class ShiftWriteMap : public MapBase<typename M::Key, typename M::Value> { … … 525 530 ///Constructor 526 531 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. 530 535 ShiftWriteMap(M &_m, const C &_v ) : m(_m), v(_v) {}; 531 536 /// \e … … 535 540 }; 536 541 537 ///Returns a n\c ShiftMap class538 539 ///This function just returns a n\c ShiftMap class.542 ///Returns a \c ShiftMap class 543 544 ///This function just returns a \c ShiftMap class. 540 545 ///\relates ShiftMap 541 546 template<typename M, typename C> … … 544 549 } 545 550 551 ///Returns a \c ShiftWriteMap class 552 553 ///This function just returns a \c ShiftWriteMap class. 554 ///\relates ShiftWriteMap 546 555 template<typename M, typename C> 547 556 inline ShiftWriteMap<M, C> shiftMap(M &m,const C &v) { … … 552 561 553 562 ///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. 556 565 ///The \c Key and \c Value of \c M2 must be convertible to those of \c M1. 557 566 /// … … 585 594 586 595 ///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. 590 598 ///The \c Key and \c Value of \c M2 must be convertible to those of \c M1. 591 592 599 template<typename M1, typename M2> 593 600 class MulMap : public MapBase<typename M1::Key, typename M1::Value> { … … 614 621 } 615 622 616 ///Scales a map swith a constant.623 ///Scales a map with a constant. 617 624 618 625 ///This \c concepts::ReadMap "read only map" returns the value of the 619 626 ///given map multiplied from the left side with a constant value. 620 ///Its \c Key and \c Value isinherited from \c M.627 ///Its \c Key and \c Value are inherited from \c M. 621 628 /// 622 629 ///Actually, … … 624 631 /// ScaleMap<X> sc(x,v); 625 632 ///\endcode 626 ///is equivalent with633 ///is equivalent to 627 634 ///\code 628 635 /// ConstMap<X::Key, X::Value> c_tmp(v); 629 636 /// MulMap<X, ConstMap<X::Key, X::Value> > sc(x,v); 630 637 ///\endcode 638 /// 639 ///\sa ScaleWriteMap 631 640 template<typename M, typename C = typename M::Value> 632 641 class ScaleMap : public MapBase<typename M::Key, typename M::Value> { … … 640 649 ///Constructor 641 650 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. 645 654 ScaleMap(const M &_m, const C &_v ) : m(_m), v(_v) {}; 646 655 /// \e … … 648 657 }; 649 658 650 ///Scales a map swith a constant (ReadWrite version).659 ///Scales a map with a constant (ReadWrite version). 651 660 652 661 ///This \c concepts::ReadWriteMap "readwrite map" returns the value of the 653 662 ///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 656 668 template<typename M, typename C = typename M::Value> 657 669 class ScaleWriteMap : public MapBase<typename M::Key, typename M::Value> { … … 665 677 ///Constructor 666 678 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. 670 682 ScaleWriteMap(M &_m, const C &_v ) : m(_m), v(_v) {}; 671 683 /// \e … … 675 687 }; 676 688 677 ///Returns a n\c ScaleMap class678 679 ///This function just returns a n\c ScaleMap class.689 ///Returns a \c ScaleMap class 690 691 ///This function just returns a \c ScaleMap class. 680 692 ///\relates ScaleMap 681 693 template<typename M, typename C> … … 684 696 } 685 697 698 ///Returns a \c ScaleWriteMap class 699 700 ///This function just returns a \c ScaleWriteMap class. 701 ///\relates ScaleWriteMap 686 702 template<typename M, typename C> 687 703 inline ScaleWriteMap<M, C> scaleMap(M &m,const C &v) { … … 692 708 693 709 ///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. 696 712 ///The \c Key and \c Value of \c M2 must be convertible to those of \c M1. 697 698 713 template<typename M1, typename M2> 699 714 class DivMap : public MapBase<typename M1::Key, typename M1::Value> { … … 723 738 724 739 ///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, 728 742 ///then for 729 743 ///\code 730 744 /// ComposeMap<M1, M2> cm(m1,m2); 731 745 ///\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 /// 737 753 ///\todo Check the requirements. 738 754 template <typename M1, typename M2> … … 758 774 operator[](Key k) const {return m1[m2[k]];} 759 775 }; 776 760 777 ///Returns a \c ComposeMap class 761 778 762 779 ///This function just returns a \c ComposeMap class. 763 ///764 780 ///\relates ComposeMap 765 781 template <typename M1, typename M2> … … 768 784 } 769 785 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. 774 789 /// 775 790 ///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 778 792 ///given maps unsing the functor. 779 793 ///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 782 795 ///\code 783 /// CombineMap<M1, 796 /// CombineMap<M1,M2,F,V> cm(m1,m2,f); 784 797 ///\endcode 785 798 /// <tt>cm[x]</tt> will be equal to <tt>f(m1[x],m2[x])</tt> 786 799 /// 787 800 ///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 corresponding801 ///\c M2::Value and \c M1::Value must be convertible to the corresponding 789 802 ///input parameter of \c F and the return type of \c F must be convertible 790 803 ///to \c V. 804 /// 805 ///\sa ComposeMap 806 /// 791 807 ///\todo Check the requirements. 792 808 template<typename M1, typename M2, typename F, … … 816 832 ///combineMap<double>(m1,m2,std::plus<double>()) 817 833 ///\endcode 818 ///is equivalent with834 ///is equivalent to 819 835 ///\code 820 836 ///addMap(m1,m2) … … 822 838 /// 823 839 ///This function is specialized for adaptable binary function 824 ///classes and c++ functions.840 ///classes and C++ functions. 825 841 /// 826 842 ///\relates CombineMap … … 846 862 847 863 ///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. 851 866 ///The unary \c  operator must be defined for \c Value, of course. 852 867 /// 868 ///\sa NegWriteMap 853 869 template<typename M> 854 870 class NegMap : public MapBase<typename M::Key, typename M::Value> { … … 868 884 869 885 ///This \c concepts::ReadWriteMap "readwrite 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. 872 888 ///The unary \c  operator must be defined for \c Value, of course. 873 889 /// 890 /// \sa NegMap 874 891 template<typename M> 875 892 class NegWriteMap : public MapBase<typename M::Key, typename M::Value> { … … 897 914 } 898 915 916 ///Returns a \c NegWriteMap class 917 918 ///This function just returns a \c NegWriteMap class. 919 ///\relates NegWriteMap 899 920 template <typename M> 900 921 inline NegWriteMap<M> negMap(M &m) { … … 905 926 906 927 ///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  912 931 ///operator must be defined for it, of course. 913 ///914 915 932 template<typename M> 916 933 class AbsMap : public MapBase<typename M::Key, typename M::Value> { … … 931 948 }; 932 949 933 ///Returns a \c AbsMap class934 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. 936 953 ///\relates AbsMap 937 954 template<typename M> … … 943 960 944 961 ///This \c concepts::ReadMap "read only map" returns the value 945 ///of a 946 ///given map. 962 ///of a given functor. 947 963 /// 948 964 ///Template parameters \c K and \c V will become its 949 ///\c Key and \c Value. They must be given explicit ely965 ///\c Key and \c Value. They must be given explicitly 950 966 ///because a functor does not provide such typedefs. 951 967 /// 952 968 ///Parameter \c F is the type of the used functor. 969 /// 970 ///\sa MapFunctor 953 971 template<typename F, 954 972 typename K = typename F::argument_type, … … 972 990 /// 973 991 ///It is specialized for adaptable function classes and 974 /// c++ functions.992 ///C++ functions. 975 993 ///\relates FunctorMap 976 994 template<typename K, typename V, typename F> inline … … 1000 1018 ///a ususal \c concepts::ReadMap "readable map", 1001 1019 ///i.e. <tt>operator[]</tt> and the \c Key and \c Value typedefs also exist. 1020 /// 1021 ///\sa FunctorMap 1002 1022 template <typename M> 1003 1023 class MapFunctor : public MapBase<typename M::Key, typename M::Value> { … … 1034 1054 ///first map. This class is the just readable map type of the ForkWriteMap. 1035 1055 /// 1036 ///The \c Key and \c Value will be inherited from \c M1.1056 ///The \c Key and \c Value are inherited from \c M1. 1037 1057 ///The \c Key and \c Value of M2 must be convertible from those of \c M1. 1058 /// 1059 ///\sa ForkWriteMap 1038 1060 /// 1039 1061 /// \todo Why is it needed? … … 1062 1084 ///corresponding values of \c M1. 1063 1085 /// 1064 ///The \c Key and \c Value will be inherited from \c M1.1086 ///The \c Key and \c Value are inherited from \c M1. 1065 1087 ///The \c Key and \c Value of M2 must be convertible from those of \c M1. 1088 /// 1089 ///\sa ForkMap 1066 1090 template<typename M1, typename M2> 1067 1091 class ForkWriteMap : public MapBase<typename M1::Key, typename M1::Value> { … … 1081 1105 }; 1082 1106 1083 ///Returns an \c ForkMap class 1084 1085 ///This function just returns an \c ForkMap class. 1086 /// 1107 ///Returns a \c ForkMap class 1108 1109 ///This function just returns a \c ForkMap class. 1087 1110 ///\relates ForkMap 1088 1111 template <typename M1, typename M2> … … 1091 1114 } 1092 1115 1116 ///Returns a \c ForkWriteMap class 1117 1118 ///This function just returns a \c ForkWriteMap class. 1119 ///\relates ForkWriteMap 1093 1120 template <typename M1, typename M2> 1094 1121 inline ForkWriteMap<M1, M2> forkMap(M1 &m1, M2 &m2) { … … 1103 1130 1104 1131 ///This bool \c concepts::ReadMap "read only map" returns the 1105 ///logical negation of 1106 /// value returned by the1107 /// given map. Its \c Key and will be inherited from \c M,1108 /// its Value is <tt>bool</tt>.1132 ///logical negation of the value returned by the given map. 1133 ///Its \c Key is inherited from \c M, its Value is \c bool. 1134 /// 1135 ///\sa NotWriteMap 1109 1136 template <typename M> 1110 1137 class NotMap : public MapBase<typename M::Key, bool> { … … 1124 1151 1125 1152 ///This bool \c concepts::ReadWriteMap "readwrite map" returns the 1126 ///logical negation of value returned by the given map. When it is set,1153 ///logical negation of the value returned by the given map. When it is set, 1127 1154 ///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>. 1155 ///Its \c Key is inherited from \c M, its Value is \c bool. 1156 /// 1157 ///\sa NotMap 1130 1158 template <typename M> 1131 1159 class NotWriteMap : public MapBase<typename M::Key, bool> { … … 1153 1181 } 1154 1182 1183 ///Returns a \c NotWriteMap class 1184 1185 ///This function just returns a \c NotWriteMap class. 1186 ///\relates NotWriteMap 1155 1187 template <typename M> 1156 1188 inline NotWriteMap<M> notMap(M &m) { … … 1184 1216 1185 1217 1186 /// \brief Writable bool map for logging each true assigned elements1187 /// 1188 /// Writable bool map for logging each true assigned elements, i.e it1189 /// copies all the keys set to true to the given iterator.1218 /// \brief Writable bool map for logging each \c true assigned element 1219 /// 1220 /// Writable bool map for logging each \c true assigned element, i.e it 1221 /// copies all the keys set to \c true to the given iterator. 1190 1222 /// 1191 1223 /// \note The container of the iterator should contain space … … 1208 1240 ///\endcode 1209 1241 /// 1210 ///\todo Revise the name of this class and the relates ones. 1242 ///\sa BackInserterBoolMap 1243 /// 1244 ///\todo Revise the name of this class and the related ones. 1211 1245 template <typename _Iterator, 1212 1246 typename _Functor = … … 1236 1270 } 1237 1271 1238 /// Setterfunction of the map1272 /// The \c set function of the map 1239 1273 void set(const Key& key, Value value) const { 1240 1274 if (value) { … … 1249 1283 }; 1250 1284 1251 /// \brief Writable bool map for logging each true assigned elementsin1252 /// a back insertable container 1253 /// 1254 /// Writable bool map for logging each true assigned elementsby pushing1255 /// backthem into a back insertable container.1285 /// \brief Writable bool map for logging each \c true assigned element in 1286 /// a back insertable container. 1287 /// 1288 /// Writable bool map for logging each \c true assigned element by pushing 1289 /// them into a back insertable container. 1256 1290 /// It can be used to retrieve the items into a standard 1257 1291 /// container. The next example shows how you can store the … … 1263 1297 /// prim(graph, cost, inserter_map); 1264 1298 ///\endcode 1299 /// 1300 ///\sa StoreBoolMap 1301 ///\sa FrontInserterBoolMap 1302 ///\sa InserterBoolMap 1265 1303 template <typename Container, 1266 1304 typename Functor = … … 1276 1314 : container(_container), functor(_functor) {} 1277 1315 1278 /// Setterfunction of the map1316 /// The \c set function of the map 1279 1317 void set(const Key& key, Value value) { 1280 1318 if (value) { … … 1288 1326 }; 1289 1327 1290 /// \brief Writable bool map for storing each true assignmentsin1328 /// \brief Writable bool map for logging each \c true assigned element in 1291 1329 /// a front insertable container. 1292 1330 /// 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. 1331 /// Writable bool map for logging each \c true assigned element by pushing 1332 /// them into a front insertable container. 1333 /// It can be used to retrieve the items into a standard 1334 /// container. For example see \ref BackInserterBoolMap. 1335 /// 1336 ///\sa BackInserterBoolMap 1337 ///\sa InserterBoolMap 1296 1338 template <typename Container, 1297 1339 typename Functor = … … 1307 1349 : container(_container), functor(_functor) {} 1308 1350 1309 /// Setterfunction of the map1351 /// The \c set function of the map 1310 1352 void set(const Key& key, Value value) { 1311 1353 if (value) { … … 1319 1361 }; 1320 1362 1321 /// \brief Writable bool map for storing each true assigned elementsin1363 /// \brief Writable bool map for storing each \c true assigned element in 1322 1364 /// an insertable container. 1323 1365 /// 1324 /// Writable bool map for storing each true assigned elementsin an1366 /// Writable bool map for storing each \c true assigned element in an 1325 1367 /// insertable container. It will insert all the keys set to \c true into 1326 1368 /// the container. … … 1334 1376 /// stronglyConnectedCutArcs(digraph, cost, inserter_map); 1335 1377 ///\endcode 1378 /// 1379 ///\sa BackInserterBoolMap 1380 ///\sa FrontInserterBoolMap 1336 1381 template <typename Container, 1337 1382 typename Functor = … … 1342 1387 typedef bool Value; 1343 1388 1344 /// Constructor 1389 /// Constructor with specified iterator 1390 1391 /// Constructor with specified iterator. 1392 /// \param _container The container for storing the elements. 1393 /// \param _it The elements will be inserted before this iterator. 1394 /// \param _functor The functor that is used when an element is stored. 1345 1395 InserterBoolMap(Container& _container, typename Container::iterator _it, 1346 1396 const Functor& _functor = Functor()) … … 1348 1398 1349 1399 /// Constructor 1400 1401 /// Constructor without specified iterator. 1402 /// The elements will be inserted before <tt>_container.end()</tt>. 1403 /// \param _container The container for storing the elements. 1404 /// \param _functor The functor that is used when an element is stored. 1350 1405 InserterBoolMap(Container& _container, const Functor& _functor = Functor()) 1351 1406 : container(_container), it(_container.end()), functor(_functor) {} 1352 1407 1353 /// Setterfunction of the map1408 /// The \c set function of the map 1354 1409 void set(const Key& key, Value value) { 1355 1410 if (value) { … … 1365 1420 }; 1366 1421 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 set1371 /// the container.1422 /// \brief Writable bool map for filling each \c true assigned element with a 1423 /// given value. 1424 /// 1425 /// Writable bool map for filling each \c true assigned element with a 1426 /// given value. The value can set the container. 1372 1427 /// 1373 1428 /// The following code finds the connected components of a graph … … 1419 1474 } 1420 1475 1421 /// Set function of the map1476 /// The \c set function of the map 1422 1477 void set(const Key& key, Value value) { 1423 1478 if (value) { … … 1432 1487 1433 1488 1434 /// \brief Writable bool map which storesthe sequence number of1435 /// true assignments.1489 /// \brief Writable bool map for storing the sequence number of 1490 /// \c true assignments. 1436 1491 /// 1437 /// Writable bool map which stores for eachtrue assigned elements1492 /// Writable bool map that stores for each \c true assigned elements 1438 1493 /// the sequence number of this setting. 1439 1494 /// It makes it easy to calculate the leaving
Note: See TracChangeset
for help on using the changeset viewer.