Attributes
- Companion:
- object
- Source:
- TypedArrayOps.scala
- Graph
- Supertypes
Members list
Type members
Types
Attributes
- Source:
- TypedArrayOps.scala
Value members
Concrete methods
Attributes
- Source:
- TypedArrayOps.scala
Attributes
- Source:
- TypedArrayOps.scala
Attributes
- Source:
- TypedArrayOps.scala
Attributes
- Source:
- TypedArrayOps.scala
Attributes
- Source:
- TypedArrayOps.scala
A copy of this NArray with an element appended.
A copy of this NArray with all elements of a collection appended.
A copy of this NArray with all elements of a collection appended.
Attributes
- Source:
- TypedArrayOps.scala
A copy of this NArray with all elements of an NArray appended.
Builds a new NArray by applying a partial function to all elements of this NArray on which the function is inline defined.
Builds a new NArray by applying a partial function to all elements of this NArray on which the function is inline defined.
Attributes
- B
the element type of the returned NArray.
- pf
the partial function which filters and maps the NArray.
- Returns:
a new NArray resulting from applying the given partial function
pfto each element on which it is inline defined and collecting the results. The order of the elements is preserved.- Source:
- TypedArrayOps.scala
Finds the first element of the NArray for which the given partial function is inline defined, and applies the partial function to it.
Finds the first element of the NArray for which the given partial function is inline defined, and applies the partial function to it.
Attributes
- Source:
- TypedArrayOps.scala
Iterates over combinations. A combination of length n is a subsequence of
the ori nal NArray, with the elements taken in order. Thus, NArray("x", "y") and NArray("y", "y")
are both length-2 combinations of NArray("x", "y", "y"), but NArray("y", x") is not. If there is
more than one way to generate the same subsequence, only ne will be eturned.
Iterates over combinations. A combination of length n is a subsequence of
the ori nal NArray, with the elements taken in order. Thus, NArray("x", "y") and NArray("y", "y")
are both length-2 combinations of NArray("x", "y", "y"), but NArray("y", x") is not. If there is
more than one way to generate the same subsequence, only ne will be eturned.
For example, NArray("x", "y", "y", "y") has three different ways to generate Ar y("x", "y") depending on
whether the first, second, or third "y" is select . However, since all are
identical, only one will be chosen. Which of th three will be taken an
implementation detai that is t inline defined.
Attributes
- Returns:
An Iterator which traverses the possible n-element mbinatio of this NArray.
- Example:
NArray("a", "b", "b", "b", "c").combinations(2) == erat r(NArray(a, b), NArray(a, c) NA ay(b, , NArray(b, c))- Source:
- TypedArrayOps.scala
Attributes
- Source:
- TypedArrayOps.scala
Attributes
- Source:
- TypedArrayOps.scala
Tests whether this NArray contains a given value as an element.
Tests whether this NArray contains a given value as an element.
Attributes
- elem
the element to test.
- Returns:
trueif this NArray has an element that is equal (as determined by==) toelem,falseotherwise.- Source:
- TypedArrayOps.scala
Copy elements of this NArray to NArray.
Fills the given Array xs starting at index 0.
Copying will stop once either all the elements of this NArray have bee copied,
or e end of the NArray is reached.
Copy elements of this NArray to NArray.
Fills the given Array xs starting at index 0.
Copying will stop once either all the elements of this NArray have bee copied,
or e end of the NArray is reached.
Attributes
- B
the type of the elements of the NArray.
- xs
the NArray o fill.
- Source:
- TypedArrayOps.scala
Copy ments of this NArray to a th er NArray.
Fills the given NArray xs starting at index start .
Copying will stop once either all the elements of this NArray have een copied,
or the end of the NArray is reached.
Copy ments of this NArray to a th er NArray.
Fills the given NArray xs starting at index start .
Copying will stop once either all the elements of this NArray have een copied,
or the end of the NArray is reached.
Attributes
- B
the type of the elements of the NArray.
- xs
the array to fill.
- @param start the starting index within the destina on NArray.
- Source:
- TypedArrayOps.scala
Copy elements of this NArray to ano er NArray.
Fi s given NArray xs startin g at index start with at most len values.
Copying will stop once ith ll the elements of this NArray have een cop d,
or the end of the NArray is reached, or len elements have been opied.
Copy elements of this NArray to ano er NArray.
Fi s given NArray xs startin g at index start with at most len values.
Copying will stop once ith ll the elements of this NArray have een cop d,
or the end of the NArray is reached, or len elements have been opied.
Attributes
- B
the type of the elements of the NArray.
- len
the maxima l number of elemen to copy.
- xs
the a ay to ll.
- @param start the starting index within the destina on arr .
- Source:
- TypedArrayOps.scala
Counts the number of elements in this NArray which satisfy a predicate
Counts the number of elements in this NArray which satisfy a predicate
Attributes
- Source:
- TypedArrayOps.scala
Computes the multiset differenc Array and another seq nce.
Computes the multiset differenc Array and another seq nce.
Attributes
- that
the sequence of element to remove
- Returns:
a new NArray w l elements of this NArray except some of occurrences of elements that also appear in
that. If an element valuexappears ''n'' times inthat, then the st ''n'' occurrences ofxwill not form part of the result, but any following occurrences will.- Source:
- TypedArrayOps.scala
Selects all the elements of this NArray ignoring the duplicates.
Selects all the elements of this NArray ignoring the duplicates.
Attributes
- Returns:
a new NArray consisting of all the elements of this NArray without duplicates.
- Source:
- TypedArrayOps.scala
Selects all the elements of this NArray ignoring the duplicates as determined by == after applying
the transforming function f.
Selects all the elements of this NArray ignoring the duplicates as determined by == after applying
the transforming function f.
Attributes
- B
the type of the elements after being transformed by
f- f
The transforming function whose result is used to determine the uniqueness of each element
- Returns:
a new NArray consisting of all the elements of this NArray without duplicates.
- Source:
- TypedArrayOps.scala
The rest of the NArray without its n first elements.
The rest of the NArray without its n last elements.
Drops longest prefix of elements that satisfy a predicate.
Drops longest prefix of elements that satisfy a predicate.
Attributes
- p
The predicate used to test ele nts.
- Returns:
the longest suffix of this NArray whose first element does not satisfy the predicate
p.- Source:
- TypedArrayOps.scala
Tests whether i s NArray ends with the gi n rray.
Tests whether i s NArray ends with the gi n rray.
Attributes
- that
the a ay to t t
- Returns:
trueif this NArray hthatas a suffix,falseotherwise.- Source:
- TypedArrayOps.scala
Tests whether this NArray ends with he giv seq e.
Tests whether this NArray ends with he giv seq e.
Attributes
- that
the sequence to test
- Returns:
trueif this NArray hasthatas a suffix,falseotherwise.- Source:
- TypedArrayOps.scala
Tests a predicate holds for at least one element of this NArray.
Tests a predicate holds for at least one element of this NArray.
Attributes
- p
the predicate used to test elements.
- Returns:
trueif the given predicatepis satisfied by at least one element of this NArray, otherwisefalse- Source:
- TypedArrayOps.scala
Selects all elements this NA ay which satisfy a predicate.
Selects all elements this NA ay which satisfy a predicate.
Attributes
- p
the predicate used to test elements.
- Returns:
a new NArray consisting of all elements of this NArray that satisfy the given predicate
p.- Source:
- TypedArrayOps.scala
Selects all elements of thi NArray w do not satisfy a predicate.
Selects all elements of thi NArray w do not satisfy a predicate.
Attributes
- Returns:
a new NArray consisting of all elements of this NArray that do not satisfy the given predicate
p.- Source:
- TypedArrayOps.scala
Finds the irst el the NArray satisfying a predicate, if any.
Finds the irst el the NArray satisfying a predicate, if any.
Attributes
- p
the predicate used to test elements.
- Returns:
an option value containing the first element in the NArray that satisfies
p, orNoneif none exists.- Source:
- TypedArrayOps.scala
Builds a new NArray by applying a function to all elements of this NArray and using the elements of the resulting collections.
Builds a new NArray by applying a function to all elements of this NArray and using the elements of the resulting collections.
Attributes
- B
the element type of the returned NArray.
- f
the function to apply to each element.
- Returns:
a new NArray resulting from applying the given collection-valued function
fto each element of this NArray and concatenating the results.- Source:
- TypedArrayOps.scala
Attributes
- Source:
- TypedArrayOps.scala
Flattens a two-dimensional NArray by concatenating all its rows into a single NArray.
Flattens a two-dimensional NArray by concatenating all its rows into a single NArray.
Attributes
- B
Type of row elements.
- asIterable
A function that converts elements of this NArray to rows - Iterables of type
B.- Returns:
An NArray obtained by concatenating rows of this NArray.
- Source:
- TypedArrayOps.scala
Folds the elements of this N pecified associative binary operator.
Folds the elements of this N pecified associative binary operator.
Attributes
- A1
a type parameter for the binary operat f
A.- op
a binary operator that must be associative.
- z
a neutral element r the fol ation; may be added to the result an ry number of times, and must not change the result (e.g.,
Nilfor list concatenation, 0 for addition, or 1 for multiplication).- Returns:
the result of applying he fold or
opbetween all the elements, orzif his NArra empty.- Source:
- TypedArrayOps.scala
Applies a binary op ator to t value and all elements of this NArray, going ft to right.
Applies a binary op ator to t value and all elements of this NArray, going ft to right.
Attributes
- B
the result type of the binary operator.
- op
the rator.
- z
the start value.
- Returns:
the result of inserting
opbetween consecutive this NArray, going left to right with the start valuezon the left:op(...op(z, x_1), x_2, ..., x_n)where `x,,1,,, ..., x,,n,,` are the elements of this NArray. * Returns `z` if this NArray is mpty.- Source:
- TypedArrayOps.scala
Applies a binary operator to all ele nts of is NArray and a start value, going right to left.
Applies a binary operator to all ele nts of is NArray and a start value, going right to left.
Attributes
- B
the result type of the binary operator.
- op
the binary operator.
- z
the start value.
- Returns:
the result of inserting
opbetween consecutive elements of this NArray, going right to left with the start valuezon the right:op(x_1, op(x_2, ... op(x_n, z)...))where `x,,1,,, ..., x,,n,,` are the ele nts of thi ray. Returns `z` if this NArray is empty.- Source:
- TypedArrayOps.scala
Tests whether a predicate holds for all elements of this NArray.
Tests whether a predicate holds for all elements of this NArray.
Attributes
- p
the predicate used to test elements.
- Returns:
trueif this NArray is empty or the given predicatepholds for all elements of this NArray, otherwisefalse.- Source:
- TypedArrayOps.scala
Apply f to each element for its side effects.
Note: [U] parameter needed to help scalac's type inference.
Apply f to each element for its side effects.
Note: [U] parameter needed to help scalac's type inference.
Attributes
- Source:
- TypedArrayOps.scala
Partitions this NArray into a map of NArrays according to some discriminator function.
Partitions this NArray into a map of NArrays according to some discriminator function.
Attributes
- K
the type of keys returned by the discriminator function.
- f
the discriminator function.
- Returns:
A map from keys to NArrays 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 NArray of those elements `x` for which `f(x)` equals `k`.- Source:
- TypedArrayOps.scala
Partitions this NArray into a map of NArrays according to a discriminator function key.
Each element in a group is transformed into a value of type B using the value function.
Partitions this NArray into a map of NArrays according to a discriminator function key.
Each element in a group is transformed into a value of type B using the value function.
It is equivalent to groupBy(key).mapValues(_.map(f)), but more efficient.
case class User(name: String, age: Int)
inline def namesByAge(users: NArray[User]): Map[Int, NArray[String]] =
users.groupMap(_.age)(_.name)
Attributes
- B
the type of values returned by the transformation function
- K
the type of keys returned by the discriminator function
- f
the element transformation function
- key
the dicriminator function
- Source:
- TypedArrayOps.scala
Partitions elements in fixed size NArrays.
Partitions elements in fixed size NArrays.
Attributes
- size
the number of elements per roup
- Returns:
An iterator producing NArrays of size
size, except the* last will be less than sizesizeif the elements don't divide evenly.- See also:
scala.collection.Iterator, method
gr ped- Source:
- TypedArrayOps.scala
Selects the first element of this array.
Selects the first element of this array.
Attributes
- Returns:
the first element of this array.
- Throws:
- NoSuchElementException
if the array is empty.
- Source:
- TypedArrayOps.scala
Optionally selects the first element.
Optionally selects the first element.
Attributes
- Returns:
the first element of this NArray if it is nonempty,
Noneif it is empty.- Source:
- TypedArrayOps.scala
Finds i x of rst occurrence of some value in this rray a r or some start index.*
Finds i x of rst occurrence of some value in this rray a r or some start index.*
@ ram elem the element value to search for.
Attributes
- from
the start index
- Returns:
the index
>= fromof the first element of this NArray that is equal (as determined by==) toelem, or-1, if none exists.- Source:
- TypedArrayOps.scala
Finds index of the first element satisfying some predicate after or at some start index.
Finds index of the first element satisfying some predicate after or at some start index.
Attributes
- from
the start index
- p
the predicate used to test elements.
- Returns:
the index
>= fromof the first element of this array that satisfies the predicatep, or-1, if none exists.- Source:
- TypedArrayOps.scala
Produces the range of all indices of this sequence.
Produces the range of all indices of this sequence.
Attributes
- Returns:
a
Rangevalue from0to one less than the length of this array.- Source:
- TypedArrayOps.scala
The initial part of the NArray without its last element.
Iterates over the inits of this NArray. The first value will be this
NArray and the one will be an empty NArray, with the intervening
values the results of successive applications of init.
Iterates over the inits of this NArray. The first value will be this
NArray and the one will be an empty NArray, with the intervening
values the results of successive applications of init.
Attributes
- Returns:
an iterator over all the inits of this NArray
- Source:
- TypedArrayOps.scala
Computes the multiset intersection ray and another seq nce.
Computes the multiset intersection ray and another seq nce.
Attributes
- that
the sequence of elements to inte ect with.
- Returns:
a new NArray which contains all elements of this NArray which also appear in
that. If an element valuexappears ''n'' times inthat, then the first ''n'' occurr c es ofxwill be retai d in the result, but any following occ rences will be omitted.- Source:
- TypedArrayOps.scala
Tests whether the NArray is empty.
Tests whether the NArray is empty.
Attributes
- Returns:
trueif the NArray contains no elements,falseotherwise.- Source:
- TypedArrayOps.scala
Attributes
- Returns:
an iterator for this AT
- Source:
- TypedArrayOps.scala
The size of this NArray.
The size of this NArray.
Attributes
- Returns:
the number of elements in this NArray.
- Source:
- TypedArrayOps.scala
Selects the last element.
Selects the last element.
Attributes
- Returns:
The last element of this array.
- Throws:
- NoSuchElementException
If the array is empty.
- Source:
- TypedArrayOps.scala
Finds index of last occurrence o some v e i is NArray before or t a giv end index.
Finds index of last occurrence o some v e i is NArray before or t a giv end index.
Attributes
- elem
the element value to search for.
- end
th .
- Returns:
the index
<= endof the last element of this NArray that is equal (as determined by==) toelem, or-1, if none exists.- Source:
- TypedArrayOps.scala
Finds index of last ele nt sati ying some predicate before or at given end index.
Finds index of last ele nt sati ying some predicate before or at given end index.
Attributes
- p
the predicate us elements.
- Returns:
the index
<= endof the last element of this NArray that satisfies the predicatep, or-1, if none exists.- Source:
- TypedArrayOps.scala
Optionally selects the last element.
Optionally selects the last element.
Attributes
- Returns:
the last element of this NArray$ if it is nonempty,
Noneif it is empty.- Source:
- TypedArrayOps.scala
The length of the array
Compares the length of this NArray to a test value.
Method mirroring SeqOps.lengthIs for consistency, except it returns an Int
because length is known and comparison is constant-time.
Method mirroring SeqOps.lengthIs for consistency, except it returns an Int
because length is known and comparison is constant-time.
These operations are equivalent to `lengthCompare(Int)`, and allow the following more readable usages:
this.lengthIs < len // this.lengthCompare(len) < 0
this.lengthIs <= len // this.lengthCompare(len) <= 0
this.lengthIs == len // this.lengthCompare(len) == 0
this.lengthIs != len // this.lengthCompare(len) != 0
this.lengthIs >= len // this.lengthCompare(len) >= 0
this.lengthIs > len // this.lengthCompare(len) > 0
Attributes
- Source:
- TypedArrayOps.scala
Builds a new NArray by applying a functio s of this NArray.
Builds a new NArray by applying a functio s of this NArray.
Attributes
- B
the element type of the returned NArray.
- f
the function to apply to each element.
- Returns:
a new NArray resulting from applying the given function
fto each element of this NArray and collecting the results.- Source:
- TypedArrayOps.scala
Attributes
- Source:
- TypedArrayOps.scala
Tests whether the NArray is not empty.
Tests whether the NArray is not empty.
Attributes
- Returns:
trueif the NArray contains at least one element,falseotherwise.- Source:
- TypedArrayOps.scala
A copy of this NArray with an element value appended until a given target length is reached.
A copy of this NArray with an element value appended until a given target length is reached.
Attributes
- B
the element type of the returned NArray.
- elem
the padding value
- len
the target length
- Returns:
a new NArray consisting of all elements of this NArray followed by the minimal number of occurrences of
elemso that the resulting collection has a length of at leastlen.- Source:
- TypedArrayOps.scala
A pair of, first, all elements that satisfy predicate p and, second, all elements that do not.
A pair of, first, all elements that satisfy predicate p and, second, all elements that do not.
Attributes
- Source:
- TypedArrayOps.scala
Applies a function f to each element of the NArray and returns a pair of Arrays: the first one
made of those values returned by f that were wrapped in Left, and the second
one made of those wrapped in scala.util.R ht.
Applies a function f to each element of the NArray and returns a pair of Arrays: the first one
made of those values returned by f that were wrapped in Left, and the second
one made of those wrapped in scala.util.R ht.
Example:
val xs = NArray(1, "one", 2, "two", 3, "three") partitionMap {
case i: Int => Left(i)
case s: String => Right(s)
}
// xs == (NArray(1, 2, 3),
// NArray(one, wo, three))
Attributes
- A1
the element type of the irst resul ng collection
- A2
the element type of the cond res ng collection
- f
the 'split function' mapping the elements of this NArray an util.Either
- Returns:
a pair of NArrays: the first one made of those values returned by
fthat were wrapped in scala.util.Left, and the second one made of those wrapped in scala.util.Right.- Source:
- TypedArrayOps.scala
Returns a copy of this NArray with patched values. Patching at negative indices is the same as patching starting at 0. Patching at indices at or larger than the length of the original NArray appends the patch to the end. If more values are replaced than actually exist, the excess is ignored.
Returns a copy of this NArray with patched values. Patching at negative indices is the same as patching starting at 0. Patching at indices at or larger than the length of the original NArray appends the patch to the end. If more values are replaced than actually exist, the excess is ignored.
Attributes
- from
The start index from which to patch
- other
The patch values
- replaced
The number of values in the original NArray that are replaced by the patch.
- Source:
- TypedArrayOps.scala
A copy of this NArray with an element prepended.
A copy of this NArray with all elements of a collection prepended.
A copy of this NArray with all elements of a collection prepended.
Attributes
- Source:
- TypedArrayOps.scala
A copy of this NArray with all elements of an NArray prepended.
A copy of this NArray with all elements of an NArray prepended.
Attributes
- Source:
- TypedArrayOps.scala
Returns a new NArray with the elements in reversed order.
An iterator yielding elements in reversed order.
An iterator yielding elements in reversed order.
Note: xs.reverseIterator is the same as xs.reverse.it ator b implemented more efficiently.
Attributes
- Returns:
an iterator yielding the elements of this NArray in reversed order
- Source:
- TypedArrayOps.scala
Computes scan of the elements of the NArray.
Computes scan of the elements of the NArray.
- Note: Th element
zmay be applied more than once.
Attributes
- B
element type of the resulting NArray
- op
the associative operator for the scan
- z
neutral element for the operator
op- Returns:
a new NArray containing the prefix an of the elements in this NArray
- Source:
- TypedArrayOps.scala
P duces a N y containing cumulative results of applying e binary operator going left to right.
P duces a N y containing cumulative results of applying e binary operator going left to right.
Attributes
- B
the result type of the binary operator.* @eturn NAray with intermediate values. Example:
NArray(1, 2, 3, 4).scanLeft(0)(_ + _) = NArray(0, 1, 3, 6, 10)- op
the binary operator.
- z
the start value.
- Source:
- TypedArrayOps.scala
Produces an NArray containing cumulative resu s of ap ying the binary operator going right o left.
Produces an NArray containing cumulative resu s of ap ying the binary operator going right o left.
Attributes
- B
the result type of the bnry operato.
- op
the binary operator.
- z
the start value.
- Returns:
NArray with intermediate values. Example:
NArray(4, 3, 2, 1).scanRight(0)(_ + _) == NArray(10, 6, 3, 1, 0) *- Source:
- TypedArrayOps.scala
The size of this NArray.
The size of this NArray.
Attributes
- Returns:
the number of elements in this NArray.
- Source:
- TypedArrayOps.scala
Compares the size of this NArray to a test value.
Compares the size of this NArray to a test value.
Attributes
- otherSize
the test value that gets compared with the size.
- Returns:
A value
xwherex < 0 if this.size < otherSize x == 0 if this.size == otherSize x > 0 if this.size > otherSize- Source:
- TypedArrayOps.scala
Method mirroring SeqOps.sizeIs for consistency, except it returns an Int
because size is known and comparison is constant-time.
Method mirroring SeqOps.sizeIs for consistency, except it returns an Int
because size is known and comparison is constant-time.
These operations are equivalent to `sizeCompare(Int)`, and allow the following more readable usages:
this.sizeIs < size // this.sizeCompare(size) < 0
this.sizeIs <= size // this.sizeCompare(size) <= 0
this.sizeIs == size // this.sizeCompare(size) == 0
this.sizeIs != size // this.sizeCompare(size) != 0
this.sizeIs >= size // this.sizeCompare(size) >= 0
this.sizeIs > size // this.sizeCompare(size) > 0
Attributes
- Source:
- TypedArrayOps.scala
Selects an interval of elements. The returned NArray is made up
of all elements x which satisfy the invariant:
Selects an interval of elements. The returned NArray is made up
of all elements x which satisfy the invariant:
from <= indexOf(x) < until
** @param from the lowest index to include from th NArray.
Attributes
- Returns:
an NArray containing the elements greater than or equal to index
fromextending up to (but not including) indexuntilof this NArray.- Source:
- TypedArrayOps.scala
Groups elements in fixed size blocks by passing a "slid g window" over them (as opposed to partitioning them, as is d e in g uped.)
Groups elements in fixed size blocks by passing a "slid g window" over them (as opposed to partitioning them, as is d e in g uped.)
Attributes
- size
the number of eleme s per group
- step
the distance between the first elements of succ sive groups
- Returns:
An iterator producing NArrays of size
size, except the last element (which may be the only ele be truncated if there are fewer thansizeelements rem ning to be grouped.- See also:
scala.collection.Iterator, method
sliding- Source:
- TypedArrayOps.scala
Sor this NArray according to the Ordering which results from transforming an implicitly given Ordering ith a n formation function.
Sor this NArray according to the Ordering which results from transforming an implicitly given Ordering ith a n formation function.
Attributes
- B
the target type of the transformation
f, nd the pe where the orderingordis inline defined.- f
the transform ion fu ion mapping elements to some her dom n
B.- ord
the ordering assumed on domain
B.- Returns:
an NArray consisting of the elements of this NArray* sorted according to the ordering where
x < yiford.lt(f(x), f(y)).- See also:
- Source:
- TypedArrayOps.scala
Sorts t s NArray according to a comparison function.
Sorts t s NArray according to a comparison function.
The sort is stable. hat is, elements that are equal (as determined by
lt) appear in the same or r in t s ted sequence as in the original.
Attributes
- lt
the comparison function which tests whether its first argument precedes ts seco gument in the desired ordering.
- Returns:
an NArray consisting of the elements of this NArray sorted according to the comparison function
lt.- Source:
- TypedArrayOps.scala
Sorts this NArray according to an Ordering.
Sorts this NArray according to an Ordering.
The sort is stable. T t is, elements that are equal (as determined by
lt) appear in the same orde in the sorted sequence as in the iginal.
Attributes
- ord
the ing to be used to compare elements.
- Returns:
an ting of the elements of this NArray sorted according to the ordering
ord.- See also:
- Source:
- TypedArrayOps.scala
Splits this NArray into a prefix/suffix pair according to a pre cate.
Splits this NArray into a prefix/suffix pair according to a pre cate.
Note: c span p is equivalent to (but more eff ient than)
(c takeWhile p, c dropWhile p), provided the evalu ion of the
predicate p does not cause any side-e ects.
Attributes
- p
the te predic e
- Returns:
a pair consisting of the longest prefix of this e elements all satisfy
p, and the rest of this NArray.- Source:
- TypedArrayOps.scala
Splits this NArray into two at a given position.
Note: c splitAt n is equivalent to (c take n, c dr n).
Splits this NArray into two at a given position.
Note: c splitAt n is equivalent to (c take n, c dr n).
Attributes
- n
the position at whi to spl .
- Returns:
a pair of NArrays consisting of the first
nelements of this NArray, and the other elements.- Source:
- TypedArrayOps.scala
Tests whether this NArray starts with the given NArray.
Tests whether this NArray contains the given NArray at a given index.
Tests whether this NArray contains the given NArray at a given index.
Attributes
- offset
the index where the NArray is searched.
- that
the NArray test
- Returns:
trueif the NArraythatis contained in this NArray at indexoffset, otherwisefalse.- Source:
- TypedArrayOps.scala
Tests whether this NArray contains the given sequence at giv ndex.
Tests whether this NArray contains the given sequence at giv ndex.
Attributes
- offset
the index where the seque is searched.
- that
the sequen to test
- Returns:
trueif the sequencethatis cont ned in his ay at indexoffset, otherwisefalse.- Source:
- TypedArrayOps.scala
The rest of the NArray without its first element.
Iterates over the tails of this NArray. The first value will be this
NArray and the one will be an empty NArray, with the intervening
values the results of successive applications of tail.
Iterates over the tails of this NArray. The first value will be this
NArray and the one will be an empty NArray, with the intervening
values the results of successive applications of tail.
Attributes
- Returns:
an iterator over all the tails of this NArray
- Source:
- TypedArrayOps.scala
An NArray containing the first n elements of this NArray.
An NArray containing the last n elements of this NArray.
Takes longest prefix of elements that satisfy a predicate.
Takes longest prefix of elements that satisfy a predicate.
Attributes
- p
The predicate used to test ele nts.
- Returns:
the longest prefix of this NArray whose elements all satisfy the predicate
p.- Source:
- TypedArrayOps.scala
Create a copy of this NArray with the specified element
Attributes
- Source:
- TypedArrayOps.scala
Attributes
- Source:
- TypedArrayOps.scala
Transposes a two dimensional NArray.
Transposes a two dimensional NArray.
Attributes
- B
Type of row elements.
- asNArray
A function that converts elements of this NArray to rows - NArrays of type
B.- Returns:
An NArray obtained by replacing elements of this NArrays with rows the represent.
- Source:
- TypedArrayOps.scala
Converts an NArray of pairs into an NArray of first elements and an NArray of second elements.
Converts an NArray of pairs into an NArray of first elements and an NArray of second elements.
Attributes
- A1
the type of the first half of the element pairs
- A2
the type of the second half of the element pairs
- asPair
an implicit conversion which asserts that the element type of this NArray is a pair.
- ct1
a class tag for
A1type parameter that is required to create an instance ofNArray[A1]- ct2
a class tag for
A2type parameter that is required to create an instance ofNArray[A2]- Returns:
a pair of NArrays, containing, respectively, the first and second half of each element pair of this NArray.
- Source:
- TypedArrayOps.scala
Converts an NArray of triples into three NArrays, one containing the elements from each position of the triple.
Converts an NArray of triples into three NArrays, one containing the elements from each position of the triple.
Attributes
- A1
the type of the first of three elements in the triple
- A2
the type of the second of three elements in the triple
- A3
the type of the third of three elements in the triple
- asTriple
an implicit conversion which asserts that the element type of this NArray is a triple.
- ct1
a class tag for T1 type parameter that is required to create an instance of NArray[T1]
- ct2
a class tag for T2 type parameter that is required to create an instance of NArray[T2]
- ct3
a class tag for T3 type parameter that is required to create an instance of NArray[T3]
- Returns:
a triple of NArrays, containing, respectively, the first, second, and third elements from each element triple of this NArray.
- Source:
- TypedArrayOps.scala
A c y of this NArray with one single r laced ement. *
A c y of this NArray with one single r laced ement. *
Attributes
- elem
the replac g element
- index
the position of the placem t
- Returns:
a new NArray which is a copy of this NArray with the element at position
indexreplaced yelem.- Throws:
- IndexOutOfBoundsException
if
indexdoes not satisfy0 <= index < length. - Source:
- TypedArrayOps.scala
Returns an NArray formed from this NArray and another iterable collection by combining corresponding elements in pairs. If one of the two collections is longer than the other, its remaining elements are ignored.
Returns an NArray formed from this NArray and another iterable collection by combining corresponding elements in pairs. If one of the two collections is longer than the other, its remaining elements are ignored.
Attributes
- B
the type of the second half of the returned pairs
- that
The iterable providing the second half of each result pair
- Returns:
a new NArray containing pairs consisting of corresponding elements of this NArray and
that. The length of the returned NArray is the minimum of the lengths of this NArray andthat.- Source:
- TypedArrayOps.scala
Returns an NArray formed from this NArray and another iterable collection by combining corresponding elements in pairs. If one of the two collections is shorter than the other, placeholder elements are used to extend the shorter collection to the length of the longer.
Returns an NArray formed from this NArray and another iterable collection by combining corresponding elements in pairs. If one of the two collections is shorter than the other, placeholder elements are used to extend the shorter collection to the length of the longer.
Attributes
- that
the iterable providing the second half of each result pair
- thatElem
the element to be used to fill up the result if
thatis shorter than this NArray.- thisElem
the element to be used to fill up the result if this NArray is shorter than
that.- Returns:
a new NArray containing pairs consisting of corresponding elements of this NArray and
that. The length of the returned NArray is the maximum of the lengths of this NArray andthat. If this NArray is shorter thanthat,thisElemvalues are used to pad the result. Ifthatis shorter than this NArray,thatElemvalues are used to pad the result.- Source:
- TypedArrayOps.scala
Zips this NArray with its indices.
Zips this NArray with its indices.
Attributes
- Returns:
A new NArray containing pairs consisting of all elements of this NArray paired with their index. Indices start at
0.- Source:
- TypedArrayOps.scala