weightedSum function

void weightedSum(
  1. Simplex ret,
  2. double w1,
  3. Simplex v1,
  4. double w2,
  5. Simplex v2,
)

Implementation

void weightedSum(Simplex ret, double w1, Simplex v1, double w2, Simplex v2) {
  for (var i = 0; i < ret.x.length; ++i) {
    ret.x[i] = w1 * v1.x[i] + w2 * v2.x[i];
  }
}