Idx.Permutation

Source
__.scala
class java.lang.Object
trait scala.Matchable
class Any

Def

def apply(r: Int.Range, positions: Int.Pack): Idx.Permutation

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
def pairs(s: (Int, Int)*): Idx.Permutation

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
def sorting[A](idx: Idx[A], full: Boolean)(using c: Ordering[A]): Idx.Permutation

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
@targetName("requestVoid") @scala.annotation.threadUnsafe
final lazy val void: Idx.Permutation
Inherited from
Setup
Source
Setup.scala

Implicit

implicit inline def implicitRequest(v: VOID): Idx.Permutation
Inherited from
Setup
Source
Setup.scala