ExpressiveDoubleMapper constructor

ExpressiveDoubleMapper(
  1. List<(double, double)> mappings
)

A mapper through the given (source, target) pairs.

Implementation

ExpressiveDoubleMapper(List<(double, double)> mappings) {
  _sourceValues = List.filled(mappings.length, 0);
  _targetValues = List.filled(mappings.length, 0);
  for (var i = 0; i < mappings.length; i++) {
    final pair = mappings[i];
    _sourceValues[i] = pair.$1;
    _targetValues[i] = pair.$2;
  }
  _validateProgress(_sourceValues);
  _validateProgress(_targetValues);
}