Vector.fromList constructor

Vector.fromList(
  1. List<num> src
)

Construct from an iterable of numbers, coercing each to double.

Implementation

factory Vector.fromList(List<num> src) {
  final buf = Float32List(src.length);
  for (var i = 0; i < src.length; i++) {
    buf[i] = src[i].toDouble();
  }
  return Vector(buf);
}