apply method

void apply(
  1. double func(
    1. double
    ), [
  2. Float32x4 funcSIMD(
    1. Float32x4
    )?
])

Applies function func to each element (mutable)

Implementation

void apply(double Function(double) func,
    [Float32x4 Function(Float32x4)? funcSIMD]) {
  int start = 0;
  if (funcSIMD != null && nRows >= 4) {
    var full4 = nRows ~/ 4;
    for (int i = 0; i < full4; ++i) {
      columnData[i] = funcSIMD(columnData[i]);
    }
    start = full4 * 4;
  }
  if (start < nRows) {
    Float32List input = columnData.buffer.asFloat32List();
    for (int i = start; i < nRows; ++i) {
      input[i] = func(input[i]);
    }
  }
}