map

abstract fun map(function: (Double) -> Double): T(source)

Applies a given function to each component of the vector and returns a new vector with the transformed components.

Return

A new vector of the same type with components transformed by the given function.

Parameters

function

A lambda function that takes a Double and returns a Double, applied to each component of the vector.