7 #ifndef INCLUDE_MOLASSEMBLER_TEMPLE_STRONG_INDEX_PERMUTATION_H
8 #define INCLUDE_MOLASSEMBLER_TEMPLE_STRONG_INDEX_PERMUTATION_H
13 namespace Molassembler {
16 template<
typename Key,
typename Value>
21 using value_type = Value;
24 using base_iterator = std::vector<unsigned>::const_iterator;
25 using iterator_category = base_iterator::iterator_category;
26 using value_type = std::pair<Key, Value>;
28 Iterator(base_iterator a, base_iterator b) : begin(std::move(a)), iter(std::move(b)) {}
30 value_type operator * ()
const {
32 Key {
static_cast<typename Key::value_type
>(iter - begin)},
49 return std::tie(iter);
68 template<typename T, std::enable_if_t<std::is_convertible<T, unsigned>::value,
int>* =
nullptr>
74 template<
typename Container>
77 std::is_convertible<Traits::getValueType<Container>,
unsigned>::value,
78 "Value type of container must be convertible to unsigned!"
80 Permutation::Sigma sigma;
82 sigma.emplace_back(static_cast<unsigned>(v));
90 Value at(
const Key i)
const {
91 return Value {permutation.at(i)};
94 Value operator() (
const Key i)
const {
95 return Value {permutation.at(i)};
98 Key indexOf(
const Value v)
const {
99 return Key {permutation.indexOf(v)};
102 unsigned size()
const {
103 return permutation.size();
110 template<
typename OtherValue>
121 return std::tie(permutation);
136 std::begin(permutation.sigma),
137 std::begin(permutation.sigma)
143 std::begin(permutation.sigma),
144 std::end(permutation.sigma)
Container-abstracted permutation.
Definition: Permutations.h:287
Generates all operators using a method returning a tuple.
Definition: OperatorSuppliers.h:78
Provides functionality related to permutations.
Definition: StrongIndexPermutation.h:17
Definition: StrongIndexPermutation.h:23