api / koma.matrix / Matrix / mapRowsToList

mapRowsToList

open fun <U> mapRowsToList(f: (Matrix<T>) ->U):List<U>

Takes each row in a matrix, passes them through f, and puts the outputs into a List. In contrast to this#mapRows, the usage of a list as the output container allows for arbitrary output types, such as taking a double matrix and returning a list of strings.

Parameters

f - A function that takes in a 1xN row and returns a 1xM row. Note that all output rows must be the same length.