| ... |
... |
@@ -634,469 +634,471 @@
|
| 634 |
634 |
tpath.first = tpath.last = 0;
|
| 635 |
635 |
}
|
| 636 |
636 |
|
| 637 |
637 |
/// \brief Splice a path to the front of the current path.
|
| 638 |
638 |
///
|
| 639 |
639 |
/// It splices \c tpath before the current path and \c tpath
|
| 640 |
640 |
/// becomes empty. The time complexity of this function
|
| 641 |
641 |
/// is O(1).
|
| 642 |
642 |
void spliceFront(ListPath& tpath) {
|
| 643 |
643 |
if (first) {
|
| 644 |
644 |
if (tpath.first) {
|
| 645 |
645 |
first->prev = tpath.last;
|
| 646 |
646 |
tpath.last->next = first;
|
| 647 |
647 |
first = tpath.first;
|
| 648 |
648 |
}
|
| 649 |
649 |
} else {
|
| 650 |
650 |
first = tpath.first;
|
| 651 |
651 |
last = tpath.last;
|
| 652 |
652 |
}
|
| 653 |
653 |
tpath.first = tpath.last = 0;
|
| 654 |
654 |
}
|
| 655 |
655 |
|
| 656 |
656 |
/// \brief Splice a path into the current path.
|
| 657 |
657 |
///
|
| 658 |
658 |
/// It splices the \c tpath into the current path before the
|
| 659 |
659 |
/// position of \c it iterator and \c tpath becomes empty. The
|
| 660 |
660 |
/// time complexity of this function is O(1). If the \c it is
|
| 661 |
661 |
/// \c INVALID then it will splice behind the current path.
|
| 662 |
662 |
void splice(ArcIt it, ListPath& tpath) {
|
| 663 |
663 |
if (it.node) {
|
| 664 |
664 |
if (tpath.first) {
|
| 665 |
665 |
tpath.first->prev = it.node->prev;
|
| 666 |
666 |
if (it.node->prev) {
|
| 667 |
667 |
it.node->prev->next = tpath.first;
|
| 668 |
668 |
} else {
|
| 669 |
669 |
first = tpath.first;
|
| 670 |
670 |
}
|
| 671 |
671 |
it.node->prev = tpath.last;
|
| 672 |
672 |
tpath.last->next = it.node;
|
| 673 |
673 |
}
|
| 674 |
674 |
} else {
|
| 675 |
675 |
if (first) {
|
| 676 |
676 |
if (tpath.first) {
|
| 677 |
677 |
last->next = tpath.first;
|
| 678 |
678 |
tpath.first->prev = last;
|
| 679 |
679 |
last = tpath.last;
|
| 680 |
680 |
}
|
| 681 |
681 |
} else {
|
| 682 |
682 |
first = tpath.first;
|
| 683 |
683 |
last = tpath.last;
|
| 684 |
684 |
}
|
| 685 |
685 |
}
|
| 686 |
686 |
tpath.first = tpath.last = 0;
|
| 687 |
687 |
}
|
| 688 |
688 |
|
| 689 |
689 |
/// \brief Split the current path.
|
| 690 |
690 |
///
|
| 691 |
691 |
/// It splits the current path into two parts. The part before
|
| 692 |
692 |
/// the iterator \c it will remain in the current path and the part
|
| 693 |
693 |
/// starting with
|
| 694 |
694 |
/// \c it will put into \c tpath. If \c tpath have arcs
|
| 695 |
695 |
/// before the operation they are removed first. The time
|
| 696 |
696 |
/// complexity of this function is O(1) plus the the time of emtying
|
| 697 |
697 |
/// \c tpath. If \c it is \c INVALID then it just clears \c tpath
|
| 698 |
698 |
void split(ArcIt it, ListPath& tpath) {
|
| 699 |
699 |
tpath.clear();
|
| 700 |
700 |
if (it.node) {
|
| 701 |
701 |
tpath.first = it.node;
|
| 702 |
702 |
tpath.last = last;
|
| 703 |
703 |
if (it.node->prev) {
|
| 704 |
704 |
last = it.node->prev;
|
| 705 |
705 |
last->next = 0;
|
| 706 |
706 |
} else {
|
| 707 |
707 |
first = last = 0;
|
| 708 |
708 |
}
|
| 709 |
709 |
it.node->prev = 0;
|
| 710 |
710 |
}
|
| 711 |
711 |
}
|
| 712 |
712 |
|
| 713 |
713 |
|
| 714 |
714 |
typedef True BuildTag;
|
| 715 |
715 |
|
| 716 |
716 |
template <typename CPath>
|
| 717 |
717 |
void build(const CPath& path) {
|
| 718 |
718 |
for (typename CPath::ArcIt it(path); it != INVALID; ++it) {
|
| 719 |
719 |
addBack(it);
|
| 720 |
720 |
}
|
| 721 |
721 |
}
|
| 722 |
722 |
|
| 723 |
723 |
template <typename CPath>
|
| 724 |
724 |
void buildRev(const CPath& path) {
|
| 725 |
725 |
for (typename CPath::RevArcIt it(path); it != INVALID; ++it) {
|
| 726 |
726 |
addFront(it);
|
| 727 |
727 |
}
|
| 728 |
728 |
}
|
| 729 |
729 |
|
| 730 |
730 |
};
|
| 731 |
731 |
|
| 732 |
732 |
/// \brief A structure for representing directed paths in a digraph.
|
| 733 |
733 |
///
|
| 734 |
734 |
/// A structure for representing directed path in a digraph.
|
| 735 |
735 |
/// \tparam GR The digraph type in which the path is.
|
| 736 |
736 |
///
|
| 737 |
737 |
/// In a sense, the path can be treated as a list of arcs. The
|
| 738 |
738 |
/// lemon path type stores just this list. As a consequence it
|
| 739 |
739 |
/// cannot enumerate the nodes in the path and the source node of
|
| 740 |
740 |
/// a zero length path is undefined.
|
| 741 |
741 |
///
|
| 742 |
742 |
/// This implementation is completly static, i.e. it can be copy constucted
|
| 743 |
743 |
/// or copy assigned from another path, but otherwise it cannot be
|
| 744 |
744 |
/// modified.
|
| 745 |
745 |
///
|
| 746 |
746 |
/// Being the the most memory efficient path type in LEMON,
|
| 747 |
747 |
/// it is intented to be
|
| 748 |
748 |
/// used when you want to store a large number of paths.
|
| 749 |
749 |
template <typename GR>
|
| 750 |
750 |
class StaticPath {
|
| 751 |
751 |
public:
|
| 752 |
752 |
|
| 753 |
753 |
typedef GR Digraph;
|
| 754 |
754 |
typedef typename Digraph::Arc Arc;
|
| 755 |
755 |
|
| 756 |
756 |
/// \brief Default constructor
|
| 757 |
757 |
///
|
| 758 |
758 |
/// Default constructor
|
| 759 |
759 |
StaticPath() : len(0), arcs(0) {}
|
| 760 |
760 |
|
| 761 |
761 |
/// \brief Template copy constructor
|
| 762 |
762 |
///
|
| 763 |
763 |
/// This path can be initialized from any other path type.
|
| 764 |
764 |
template <typename CPath>
|
| 765 |
765 |
StaticPath(const CPath& cpath) : arcs(0) {
|
| 766 |
766 |
copyPath(*this, cpath);
|
| 767 |
767 |
}
|
| 768 |
768 |
|
| 769 |
769 |
/// \brief Destructor of the path
|
| 770 |
770 |
///
|
| 771 |
771 |
/// Destructor of the path
|
| 772 |
772 |
~StaticPath() {
|
| 773 |
773 |
if (arcs) delete[] arcs;
|
| 774 |
774 |
}
|
| 775 |
775 |
|
| 776 |
776 |
/// \brief Template copy assignment
|
| 777 |
777 |
///
|
| 778 |
778 |
/// This path can be made equal to any other path type. It simply
|
| 779 |
779 |
/// makes a copy of the given path.
|
| 780 |
780 |
template <typename CPath>
|
| 781 |
781 |
StaticPath& operator=(const CPath& cpath) {
|
| 782 |
782 |
copyPath(*this, cpath);
|
| 783 |
783 |
return *this;
|
| 784 |
784 |
}
|
| 785 |
785 |
|
| 786 |
786 |
/// \brief Iterator class to iterate on the arcs of the paths
|
| 787 |
787 |
///
|
| 788 |
788 |
/// This class is used to iterate on the arcs of the paths
|
| 789 |
789 |
///
|
| 790 |
790 |
/// Of course it converts to Digraph::Arc
|
| 791 |
791 |
class ArcIt {
|
| 792 |
792 |
friend class StaticPath;
|
| 793 |
793 |
public:
|
| 794 |
794 |
/// Default constructor
|
| 795 |
795 |
ArcIt() {}
|
| 796 |
796 |
/// Invalid constructor
|
| 797 |
797 |
ArcIt(Invalid) : path(0), idx(-1) {}
|
| 798 |
798 |
/// Initializate the constructor to the first arc of path
|
| 799 |
799 |
ArcIt(const StaticPath &_path)
|
| 800 |
800 |
: path(&_path), idx(_path.empty() ? -1 : 0) {}
|
| 801 |
801 |
|
| 802 |
802 |
private:
|
| 803 |
803 |
|
| 804 |
804 |
/// Constructor with starting point
|
| 805 |
805 |
ArcIt(const StaticPath &_path, int _idx)
|
| 806 |
806 |
: idx(_idx), path(&_path) {}
|
| 807 |
807 |
|
| 808 |
808 |
public:
|
| 809 |
809 |
|
| 810 |
810 |
///Conversion to Digraph::Arc
|
| 811 |
811 |
operator const Arc&() const {
|
| 812 |
812 |
return path->nth(idx);
|
| 813 |
813 |
}
|
| 814 |
814 |
|
| 815 |
815 |
/// Next arc
|
| 816 |
816 |
ArcIt& operator++() {
|
| 817 |
817 |
++idx;
|
| 818 |
818 |
if (idx >= path->length()) idx = -1;
|
| 819 |
819 |
return *this;
|
| 820 |
820 |
}
|
| 821 |
821 |
|
| 822 |
822 |
/// Comparison operator
|
| 823 |
823 |
bool operator==(const ArcIt& e) const { return idx==e.idx; }
|
| 824 |
824 |
/// Comparison operator
|
| 825 |
825 |
bool operator!=(const ArcIt& e) const { return idx!=e.idx; }
|
| 826 |
826 |
/// Comparison operator
|
| 827 |
827 |
bool operator<(const ArcIt& e) const { return idx<e.idx; }
|
| 828 |
828 |
|
| 829 |
829 |
private:
|
| 830 |
830 |
const StaticPath *path;
|
| 831 |
831 |
int idx;
|
| 832 |
832 |
};
|
| 833 |
833 |
|
| 834 |
834 |
/// \brief The nth arc.
|
| 835 |
835 |
///
|
| 836 |
836 |
/// \pre \c n is in the <tt>[0..length() - 1]</tt> range.
|
| 837 |
837 |
const Arc& nth(int n) const {
|
| 838 |
838 |
return arcs[n];
|
| 839 |
839 |
}
|
| 840 |
840 |
|
| 841 |
841 |
/// \brief The arc iterator pointing to the nth arc.
|
| 842 |
842 |
ArcIt nthIt(int n) const {
|
| 843 |
843 |
return ArcIt(*this, n);
|
| 844 |
844 |
}
|
| 845 |
845 |
|
| 846 |
846 |
/// \brief The length of the path.
|
| 847 |
847 |
int length() const { return len; }
|
| 848 |
848 |
|
| 849 |
849 |
/// \brief Return true when the path is empty.
|
| 850 |
850 |
int empty() const { return len == 0; }
|
| 851 |
851 |
|
| 852 |
852 |
/// \brief Erase all arcs in the digraph.
|
| 853 |
853 |
void clear() {
|
| 854 |
854 |
len = 0;
|
| 855 |
855 |
if (arcs) delete[] arcs;
|
| 856 |
856 |
arcs = 0;
|
| 857 |
857 |
}
|
| 858 |
858 |
|
| 859 |
859 |
/// \brief The first arc of the path.
|
| 860 |
860 |
const Arc& front() const {
|
| 861 |
861 |
return arcs[0];
|
| 862 |
862 |
}
|
| 863 |
863 |
|
| 864 |
864 |
/// \brief The last arc of the path.
|
| 865 |
865 |
const Arc& back() const {
|
| 866 |
866 |
return arcs[len - 1];
|
| 867 |
867 |
}
|
| 868 |
868 |
|
| 869 |
869 |
|
| 870 |
870 |
typedef True BuildTag;
|
| 871 |
871 |
|
| 872 |
872 |
template <typename CPath>
|
| 873 |
873 |
void build(const CPath& path) {
|
| 874 |
874 |
len = path.length();
|
| 875 |
875 |
arcs = new Arc[len];
|
| 876 |
876 |
int index = 0;
|
| 877 |
877 |
for (typename CPath::ArcIt it(path); it != INVALID; ++it) {
|
| 878 |
878 |
arcs[index] = it;
|
| 879 |
879 |
++index;
|
| 880 |
880 |
}
|
| 881 |
881 |
}
|
| 882 |
882 |
|
| 883 |
883 |
template <typename CPath>
|
| 884 |
884 |
void buildRev(const CPath& path) {
|
| 885 |
885 |
len = path.length();
|
| 886 |
886 |
arcs = new Arc[len];
|
| 887 |
887 |
int index = len;
|
| 888 |
888 |
for (typename CPath::RevArcIt it(path); it != INVALID; ++it) {
|
| 889 |
889 |
--index;
|
| 890 |
890 |
arcs[index] = it;
|
| 891 |
891 |
}
|
| 892 |
892 |
}
|
| 893 |
893 |
|
| 894 |
894 |
private:
|
| 895 |
895 |
int len;
|
| 896 |
896 |
Arc* arcs;
|
| 897 |
897 |
};
|
| 898 |
898 |
|
| 899 |
899 |
///////////////////////////////////////////////////////////////////////
|
| 900 |
900 |
// Additional utilities
|
| 901 |
901 |
///////////////////////////////////////////////////////////////////////
|
| 902 |
902 |
|
| 903 |
903 |
namespace _path_bits {
|
| 904 |
904 |
|
| 905 |
905 |
template <typename Path, typename Enable = void>
|
| 906 |
906 |
struct RevPathTagIndicator {
|
| 907 |
907 |
static const bool value = false;
|
| 908 |
908 |
};
|
| 909 |
909 |
|
| 910 |
910 |
template <typename Path>
|
| 911 |
911 |
struct RevPathTagIndicator<
|
| 912 |
912 |
Path,
|
| 913 |
913 |
typename enable_if<typename Path::RevPathTag, void>::type
|
| 914 |
914 |
> {
|
| 915 |
915 |
static const bool value = true;
|
| 916 |
916 |
};
|
| 917 |
917 |
|
| 918 |
918 |
template <typename Path, typename Enable = void>
|
| 919 |
919 |
struct BuildTagIndicator {
|
| 920 |
920 |
static const bool value = false;
|
| 921 |
921 |
};
|
| 922 |
922 |
|
| 923 |
923 |
template <typename Path>
|
| 924 |
924 |
struct BuildTagIndicator<
|
| 925 |
925 |
Path,
|
| 926 |
926 |
typename enable_if<typename Path::BuildTag, void>::type
|
| 927 |
927 |
> {
|
| 928 |
928 |
static const bool value = true;
|
| 929 |
929 |
};
|
| 930 |
930 |
|
| 931 |
931 |
template <typename Target, typename Source,
|
| 932 |
932 |
bool buildEnable = BuildTagIndicator<Target>::value>
|
| 933 |
933 |
struct PathCopySelectorForward {
|
| 934 |
934 |
static void copy(Target& target, const Source& source) {
|
| 935 |
935 |
target.clear();
|
| 936 |
936 |
for (typename Source::ArcIt it(source); it != INVALID; ++it) {
|
| 937 |
937 |
target.addBack(it);
|
| 938 |
938 |
}
|
| 939 |
939 |
}
|
| 940 |
940 |
};
|
| 941 |
941 |
|
| 942 |
942 |
template <typename Target, typename Source>
|
| 943 |
943 |
struct PathCopySelectorForward<Target, Source, true> {
|
| 944 |
944 |
static void copy(Target& target, const Source& source) {
|
| 945 |
945 |
target.clear();
|
| 946 |
946 |
target.build(source);
|
| 947 |
947 |
}
|
| 948 |
948 |
};
|
| 949 |
949 |
|
| 950 |
950 |
template <typename Target, typename Source,
|
| 951 |
951 |
bool buildEnable = BuildTagIndicator<Target>::value>
|
| 952 |
952 |
struct PathCopySelectorBackward {
|
| 953 |
953 |
static void copy(Target& target, const Source& source) {
|
| 954 |
954 |
target.clear();
|
| 955 |
955 |
for (typename Source::RevArcIt it(source); it != INVALID; ++it) {
|
| 956 |
956 |
target.addFront(it);
|
| 957 |
957 |
}
|
| 958 |
958 |
}
|
| 959 |
959 |
};
|
| 960 |
960 |
|
| 961 |
961 |
template <typename Target, typename Source>
|
| 962 |
962 |
struct PathCopySelectorBackward<Target, Source, true> {
|
| 963 |
963 |
static void copy(Target& target, const Source& source) {
|
| 964 |
964 |
target.clear();
|
| 965 |
965 |
target.buildRev(source);
|
| 966 |
966 |
}
|
| 967 |
967 |
};
|
| 968 |
968 |
|
| 969 |
969 |
|
| 970 |
970 |
template <typename Target, typename Source,
|
| 971 |
971 |
bool revEnable = RevPathTagIndicator<Source>::value>
|
| 972 |
972 |
struct PathCopySelector {
|
| 973 |
973 |
static void copy(Target& target, const Source& source) {
|
| 974 |
974 |
PathCopySelectorForward<Target, Source>::copy(target, source);
|
| 975 |
975 |
}
|
| 976 |
976 |
};
|
| 977 |
977 |
|
| 978 |
978 |
template <typename Target, typename Source>
|
| 979 |
979 |
struct PathCopySelector<Target, Source, true> {
|
| 980 |
980 |
static void copy(Target& target, const Source& source) {
|
| 981 |
981 |
PathCopySelectorBackward<Target, Source>::copy(target, source);
|
| 982 |
982 |
}
|
| 983 |
983 |
};
|
| 984 |
984 |
|
| 985 |
985 |
}
|
| 986 |
986 |
|
| 987 |
987 |
|
| 988 |
988 |
/// \brief Make a copy of a path.
|
| 989 |
989 |
///
|
| 990 |
990 |
/// This function makes a copy of a path.
|
| 991 |
991 |
template <typename Target, typename Source>
|
| 992 |
992 |
void copyPath(Target& target, const Source& source) {
|
| 993 |
993 |
checkConcept<concepts::PathDumper<typename Source::Digraph>, Source>();
|
| 994 |
994 |
_path_bits::PathCopySelector<Target, Source>::copy(target, source);
|
| 995 |
995 |
}
|
| 996 |
996 |
|
| 997 |
997 |
/// \brief Check the consistency of a path.
|
| 998 |
998 |
///
|
| 999 |
999 |
/// This function checks that the target of each arc is the same
|
| 1000 |
1000 |
/// as the source of the next one.
|
| 1001 |
1001 |
///
|
| 1002 |
1002 |
template <typename Digraph, typename Path>
|
| 1003 |
1003 |
bool checkPath(const Digraph& digraph, const Path& path) {
|
| 1004 |
1004 |
typename Path::ArcIt it(path);
|
| 1005 |
1005 |
if (it == INVALID) return true;
|
| 1006 |
1006 |
typename Digraph::Node node = digraph.target(it);
|
| 1007 |
1007 |
++it;
|
| 1008 |
1008 |
while (it != INVALID) {
|
| 1009 |
1009 |
if (digraph.source(it) != node) return false;
|
| 1010 |
1010 |
node = digraph.target(it);
|
| 1011 |
1011 |
++it;
|
| 1012 |
1012 |
}
|
| 1013 |
1013 |
return true;
|
| 1014 |
1014 |
}
|
| 1015 |
1015 |
|
| 1016 |
1016 |
/// \brief The source of a path
|
| 1017 |
1017 |
///
|
| 1018 |
|
/// This function returns the source of the given path.
|
|
1018 |
/// This function returns the source node of the given path.
|
|
1019 |
/// If the path is empty, then it returns \c INVALID.
|
| 1019 |
1020 |
template <typename Digraph, typename Path>
|
| 1020 |
1021 |
typename Digraph::Node pathSource(const Digraph& digraph, const Path& path) {
|
| 1021 |
|
return digraph.source(path.front());
|
|
1022 |
return path.empty() ? INVALID : digraph.source(path.front());
|
| 1022 |
1023 |
}
|
| 1023 |
1024 |
|
| 1024 |
1025 |
/// \brief The target of a path
|
| 1025 |
1026 |
///
|
| 1026 |
|
/// This function returns the target of the given path.
|
|
1027 |
/// This function returns the target node of the given path.
|
|
1028 |
/// If the path is empty, then it returns \c INVALID.
|
| 1027 |
1029 |
template <typename Digraph, typename Path>
|
| 1028 |
1030 |
typename Digraph::Node pathTarget(const Digraph& digraph, const Path& path) {
|
| 1029 |
|
return digraph.target(path.back());
|
|
1031 |
return path.empty() ? INVALID : digraph.target(path.back());
|
| 1030 |
1032 |
}
|
| 1031 |
1033 |
|
| 1032 |
1034 |
/// \brief Class which helps to iterate through the nodes of a path
|
| 1033 |
1035 |
///
|
| 1034 |
1036 |
/// In a sense, the path can be treated as a list of arcs. The
|
| 1035 |
1037 |
/// lemon path type stores only this list. As a consequence, it
|
| 1036 |
1038 |
/// cannot enumerate the nodes in the path and the zero length paths
|
| 1037 |
1039 |
/// cannot have a source node.
|
| 1038 |
1040 |
///
|
| 1039 |
1041 |
/// This class implements the node iterator of a path structure. To
|
| 1040 |
1042 |
/// provide this feature, the underlying digraph should be passed to
|
| 1041 |
1043 |
/// the constructor of the iterator.
|
| 1042 |
1044 |
template <typename Path>
|
| 1043 |
1045 |
class PathNodeIt {
|
| 1044 |
1046 |
private:
|
| 1045 |
1047 |
const typename Path::Digraph *_digraph;
|
| 1046 |
1048 |
typename Path::ArcIt _it;
|
| 1047 |
1049 |
typename Path::Digraph::Node _nd;
|
| 1048 |
1050 |
|
| 1049 |
1051 |
public:
|
| 1050 |
1052 |
|
| 1051 |
1053 |
typedef typename Path::Digraph Digraph;
|
| 1052 |
1054 |
typedef typename Digraph::Node Node;
|
| 1053 |
1055 |
|
| 1054 |
1056 |
/// Default constructor
|
| 1055 |
1057 |
PathNodeIt() {}
|
| 1056 |
1058 |
/// Invalid constructor
|
| 1057 |
1059 |
PathNodeIt(Invalid)
|
| 1058 |
1060 |
: _digraph(0), _it(INVALID), _nd(INVALID) {}
|
| 1059 |
1061 |
/// Constructor
|
| 1060 |
1062 |
PathNodeIt(const Digraph& digraph, const Path& path)
|
| 1061 |
1063 |
: _digraph(&digraph), _it(path) {
|
| 1062 |
1064 |
_nd = (_it != INVALID ? _digraph->source(_it) : INVALID);
|
| 1063 |
1065 |
}
|
| 1064 |
1066 |
/// Constructor
|
| 1065 |
1067 |
PathNodeIt(const Digraph& digraph, const Path& path, const Node& src)
|
| 1066 |
1068 |
: _digraph(&digraph), _it(path), _nd(src) {}
|
| 1067 |
1069 |
|
| 1068 |
1070 |
///Conversion to Digraph::Node
|
| 1069 |
1071 |
operator Node() const {
|
| 1070 |
1072 |
return _nd;
|
| 1071 |
1073 |
}
|
| 1072 |
1074 |
|
| 1073 |
1075 |
/// Next node
|
| 1074 |
1076 |
PathNodeIt& operator++() {
|
| 1075 |
1077 |
if (_it == INVALID) _nd = INVALID;
|
| 1076 |
1078 |
else {
|
| 1077 |
1079 |
_nd = _digraph->target(_it);
|
| 1078 |
1080 |
++_it;
|
| 1079 |
1081 |
}
|
| 1080 |
1082 |
return *this;
|
| 1081 |
1083 |
}
|
| 1082 |
1084 |
|
| 1083 |
1085 |
/// Comparison operator
|
| 1084 |
1086 |
bool operator==(const PathNodeIt& n) const {
|
| 1085 |
1087 |
return _it == n._it && _nd == n._nd;
|
| 1086 |
1088 |
}
|
| 1087 |
1089 |
/// Comparison operator
|
| 1088 |
1090 |
bool operator!=(const PathNodeIt& n) const {
|
| 1089 |
1091 |
return _it != n._it || _nd != n._nd;
|
| 1090 |
1092 |
}
|
| 1091 |
1093 |
/// Comparison operator
|
| 1092 |
1094 |
bool operator<(const PathNodeIt& n) const {
|
| 1093 |
1095 |
return (_it < n._it && _nd != INVALID);
|
| 1094 |
1096 |
}
|
| 1095 |
1097 |
|
| 1096 |
1098 |
};
|
| 1097 |
1099 |
|
| 1098 |
1100 |
///@}
|
| 1099 |
1101 |
|
| 1100 |
1102 |
} // namespace lemon
|
| 1101 |
1103 |
|
| 1102 |
1104 |
#endif // LEMON_PATH_H
|