SegmentBuilder

class SegmentBuilder<T : DType, V>(dimensionIndex: Int)(source)

Builder for configuring a single dimension slice within a segment { } block.

This class provides the methods available within each segment { } block for defining how that particular dimension should be sliced.

Parameters

T

the data type constraint extending DType

V

the actual value type

dimensionIndex

the index of the dimension being configured (for error reporting)

Constructors

Link copied to clipboard
constructor(dimensionIndex: Int)

Functions

Link copied to clipboard
fun all(): Slice<T, V>

Selects all indices in this dimension.

Link copied to clipboard
fun at(index: Int): Slice<T, V>

Selects a single index, reducing the dimensionality by 1.

Link copied to clipboard
fun range(start: Int, end: Int): Slice<T, V>

Selects a range of indices from start (inclusive) to end (exclusive).

Link copied to clipboard
fun step(start: Int, end: Int, step: Int): Slice<T, V>

Selects indices from start to end with a specified step size.

Link copied to clipboard
operator fun IntRange.unaryMinus(): Slice<T, V>

Creates a range slice using Kotlin's until operator.

Link copied to clipboard
operator fun IntRange.unaryPlus(): Slice<T, V>

Creates a range slice using Kotlin's range operator.