accumulateAdditive method

void accumulateAdditive(
  1. double weight
)

Accumulate data in the incoming region into 'add'.

If weight is 0 this does nothing.

Implementation

/// If weight is `0` this does nothing.
void accumulateAdditive(double weight) {
  final buffer = this.buffer,
      stride = valueSize,
      offset = stride * _addIndex;

  if (cumulativeWeightAdditive == 0) {
    // add = identity

    _setIdentity();
  }

  // add := add + incoming * weight

  _mixBufferRegionAdditive(buffer, offset, 0, weight, stride);
  cumulativeWeightAdditive += weight;
}