@@ -733,6 +733,11 @@ class BipartitePermutation {
733
733
init ();
734
734
}
735
735
736
+ BipartitePermutation (Permutation&& p, index_type second_partition_size = 0 )
737
+ : base_(std::move(p)), second_size_(second_partition_size) {
738
+ init ();
739
+ }
740
+
736
741
BipartitePermutation (const Permutation& first, const Permutation& second)
737
742
: second_size_(second.size()) {
738
743
vector<index_type> base;
@@ -790,9 +795,14 @@ class BipartitePermutation {
790
795
}
791
796
792
797
// / \return reference to the first partition
793
- const Permutation& first () const { return first_; }
798
+ const Permutation& first () const & { return first_; }
799
+ // / \return reference to the second partition
800
+ const Permutation& second () const & { return second_; }
801
+
802
+ // / \return rvalue-reference to the first partition
803
+ Permutation&& first() && { return std::move (first_); }
794
804
// / \return reference to the second partition
795
- const Permutation& second () const { return second_; }
805
+ Permutation&& second() && { return std::move ( second_) ; }
796
806
797
807
// / \return the size of the first partition
798
808
index_type first_size () const { return this ->size () - second_size_; }
@@ -870,6 +880,8 @@ inline auto inner(const Permutation& p) {
870
880
// temporary
871
881
inline auto outer (const Permutation& p) { return p; }
872
882
883
+ inline Permutation&& outer(Permutation&& p) { return std::move (p); }
884
+
873
885
inline auto inner_size (const Permutation& p) {
874
886
abort ();
875
887
return 0 ;
@@ -879,8 +891,16 @@ inline auto outer_size(const Permutation& p) { return p.size(); }
879
891
880
892
inline auto inner (const BipartitePermutation& p) { return p.second (); }
881
893
894
+ inline Permutation&& inner(BipartitePermutation&& p) {
895
+ return std::move (p).second ();
896
+ }
897
+
882
898
inline auto outer (const BipartitePermutation& p) { return p.first (); }
883
899
900
+ inline Permutation&& outer(BipartitePermutation&& p) {
901
+ return std::move (p).first ();
902
+ }
903
+
884
904
inline auto inner_size (const BipartitePermutation& p) {
885
905
return p.second_size ();
886
906
}
0 commit comments