All Downloads are FREE. Search and download functionalities are using the official Maven repository.

scalismo.utils.ArrayUtils.scala Maven / Gradle / Ivy

There is a newer version: 1.0-RC1
Show newest version
package scalismo.utils

import scala.reflect.ClassTag

object ArrayUtils {
  def fastMap[In, Out: ClassTag](in: Array[In], f: In => Out): Array[Out] = {
    val length = in.length
    val out = Array.ofDim[Out](length)
    var index = 0
    while (index < length) {
      out(index) = f(in(index))
      index += 1
    }
    out
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy