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

Popular posts from this blog

Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12:test (default-test) on project.Error occurred in starting fork -

windows - Debug iNetMgr.exe unhandle exception System.Management.Automation.CmdletInvocationException -

configurationsection - activeMq-5.13.3 setup configurations for wildfly 10.0.0 -