NArray

narr.native.`package`.NArray
object NArray

Attributes

Source
package.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
NArray.type

Members list

Value members

Concrete methods

def copyAs[T, B >: T](original: NArray[T], newLength: Int)(using ClassTag[B]): NArray[B]

Copy one array to another, truncating or padding with default values (if necessary) so the copy has the specified length. The new array can have a different type than the original one as long as the values are assignment-compatible. When copying between primitive and object arrays, boxing and unboxing are supported.

Copy one array to another, truncating or padding with default values (if necessary) so the copy has the specified length. The new array can have a different type than the original one as long as the values are assignment-compatible. When copying between primitive and object arrays, boxing and unboxing are supported.

Equivalent to Java's java.util.Arrays.copyOf(original, newLength, newType), except that this works for all combinations of primitive and object arrays in a single method.

Attributes

See also

java.util.Arrays#copyOf

Source
package.scala
inline def copyByteArray(src: ByteArray, dest: ByteArray, destPos: Int): Unit

Copy one array to another.

Copy one array to another.

Note that the passed-in dest array will be modified by this call.

Value parameters

dest

destination array.

destPos

starting position in the destination array.

src

the source array.

Attributes

See also

java.lang.System#arraycopy

Source
package.scala
inline def copyByteArray(src: ByteArray, srcPos: Int, dest: ByteArray, destPos: Int, length: Int): Unit

Copy one array to another. Shim for Java's System.arraycopy(src, srcPos, dest, destPos, length), except that this slices the sub array, temporarily duplicating data.

Copy one array to another. Shim for Java's System.arraycopy(src, srcPos, dest, destPos, length), except that this slices the sub array, temporarily duplicating data.

Note that the passed-in dest array will be modified by this call.

Value parameters

dest

destination array.

destPos

starting position in the destination array.

length

the number of array elements to be copied.

src

the source array.

srcPos

starting position in the source array.

Attributes

See also

java.lang.System#arraycopy

Source
package.scala
inline def copyDoubleArray(src: DoubleArray, dest: DoubleArray, destPos: Int): Unit

Attributes

Source
package.scala
inline def copyDoubleArray(src: DoubleArray, srcPos: Int, dest: DoubleArray, destPos: Int, length: Int): Unit

Attributes

Source
package.scala
inline def copyFloatArray(src: FloatArray, dest: FloatArray, destPos: Int): Unit

Attributes

Source
package.scala
inline def copyFloatArray(src: FloatArray, srcPos: Int, dest: FloatArray, destPos: Int, length: Int): Unit

Attributes

Source
package.scala
inline def copyIntArray(src: IntArray, dest: IntArray, destPos: Int): Unit

Attributes

Source
package.scala
inline def copyIntArray(src: IntArray, srcPos: Int, dest: IntArray, destPos: Int, length: Int): Unit

Attributes

Source
package.scala
inline def copyNativeArray[T](src: Array[T], dest: Array[T], destPos: Int): Unit

Attributes

Source
package.scala
inline def copyNativeArray[T](src: Array[T], srcPos: Int, dest: Array[T], destPos: Int, length: Int): Unit

Attributes

Source
package.scala
def copyOf[T : ClassTag](original: NArray[T], newLength: Int): NArray[T]

Copy one array to another, truncating or padding with default values (if necessary) so the copy has the specified length.

Copy one array to another, truncating or padding with default values (if necessary) so the copy has the specified length.

Equivalent to Java's java.util.Arrays.copyOf(original, newLength), except that this works for primitive and object arrays in a single method.

Attributes

See also

java.util.Arrays#copyOf

Source
package.scala
inline def copyShortArray(src: ShortArray, dest: ShortArray, destPos: Int): Unit

Attributes

Source
package.scala
inline def copyShortArray(src: ShortArray, srcPos: Int, dest: ShortArray, destPos: Int, length: Int): Unit

Attributes

Source
package.scala
def groupBy[T, K](a: NArray[T], f: T => K)(using ClassTag[T]): Map[K, NArray[T]]

Partitions this array into a map of arrays according to some discriminator function.

Partitions this array into a map of arrays according to some discriminator function.

Type parameters

K

the type of keys returned by the discriminator function.

Value parameters

f

the discriminator function.

Attributes

Returns

A map from keys to arrays such that the following invariant holds:

               (xs groupBy f)(k) = xs filter (x => f(x) == k)
     *               That is, every key `k` is bound to an array         nts `x`
         for which `f(x)` equals `k`.
Source
package.scala
def unzip[T, A1, A2](a: NArray[T])(using asPair: T => (A1, A2), ct1: ClassTag[A1], ct2: ClassTag[A2]): (NArray[A1], NArray[A2])

Converts an array of pairs into an array of first elements and an array of second elements.

Converts an array of pairs into an array of first elements and an array of second elements.

Type parameters

A1

the type of the first half of the element pairs

A2

the type of the second half of the element pairs

Value parameters

asPair

an implicit conversion which asserts that the element type of this Array is a pair.

ct1

a class tag for A1 type parameter that is required to create an instance of Array[A1]

ct2

a class tag for A2 type parameter that is required to create an instance of Array[A2]

Attributes

Returns

a pair of Arrays, containing, respectively, the first and second half of each element pair of this Array.

Source
package.scala