- Source
- __.scala
Def
By range and indexes
By range and indexes
Creates a Permutation for the given range and indexes.
There are three rules which must be followed:
- Sizes must be equal = range.size == indexes.size
- Interval must not repeat
- Interval must be within range = indexes.stream.isEvery(range.contains)
Idx.Permutation(3 <> 6, Ints(6, 5, 4, 3)).tp
// Output
Permutation{range=3 <>> 7,(3,6)(4,5)(5,4)(6,3)}
- Source
- __.scala
No mappings
No mappings
Creates a Permutation for the given range, where all indexes are at their right places.
Applying this Permutation will bring no actions
- Source
- __.scala
By mappings
By mappings
Creates a Permutation by specifying a stream of mappings
Idx.Permutation.self(Stream((5, 7),(7, 5))).tp
// Output
Permutation{range=5 <>> 8,(5,7)(7,5)}
- Source
- __.scala
Ordering permutation
Ordering permutation
Creates a Permutation for the given index, which if applied, will be equivalent to doing sort
- Value Params
- fullRange
By default permutation range is limited to the range of change. If this is true, permutation range will be 0 <>> index.size, even though some indexes will not be mapped.
- Source
- __.scala