Scala Array Slicing with Tuple -
i try slice 1d array[double] using slice method. i've written method returns start , end index tuple (int,int).
def getslicerange(): (int,int) = { val start = ... val end = ... return (start,end) } how can use return value of getslicerange directly?
i tried:
myarray.slice.tupled(getslicerange()) but gives compile-error:
error:(162, 13) missing arguments method slice in trait indexedseqoptimized; follow method `_' if want treat partially applied function myarray.slice.tupled(getslicerange())
i think problem implicit conversion array arrayops (which gets slice gentraversablelike).
val doublearray = array(1d, 2, 3, 4) (doublearray.slice(_, _)).tupled function.tupled[int, int, array[double]](doublearray.slice) (doublearray.slice: (int, int) => array[double]).tupled
Comments
Post a Comment