toList method

List<double> toList()

Returns the sparse vector as a dense list of double values.

Implementation

List<double> toList() {
  var vec = List<double>.filled(dimensions, 0.0);
  for (var i = 0; i < indices.length; i++) {
    vec[indices[i]] = values[i];
  }
  return vec;
}