<commit_before>lib.ParticleSystem = ParticleSystem;
function ParticleSystem(count, iterations) {
  this.positions = new Float32Array(count * 3);
  this.positionsPrev = new Float32Array(count * 3);
  this.accumulatedForces = new Float32Array(count * 3);
  this.constraintIterations = iterations || 1;

  this._count = count;
  this._globalConstraints = [];
  this._localConstraints = [];
  this._forces = [];
}

ParticleSystem.prototype.setPosition = function (i, x, y, z) {
  var p0 = this.positions;
  var p1 = this.positionsPrev;
  var ix = i * 3;
  var iy = ix + 1;
  var iz = ix + 2;

  p0[ix] = p1[ix] = x;
  p0[iy] = p1[iy] = y;
  p0[iz] = p1[iz] = z;
};<commit_msg>Enable passing an array to ParticleSystem<commit_after>lib.ParticleSystem = ParticleSystem;
function ParticleSystem(particles, iterations) {
  var isCount = typeof particles === 'number';
  var length = isCount ? particles * 3 : particles.length;
  var positions = isCount ? length : particles;

  this.positions = new Float32Array(positions);
  this.positionsPrev = new Float32Array(positions);
  this.accumulatedForces = new Float32Array(length);
  this.constraintIterations = iterations || 1;

  this._count = length / 3;
  this._globalConstraints = [];
  this._localConstraints = [];
  this._forces = [];
}

ParticleSystem.prototype.setPosition = function (i, x, y, z) {
  var p0 = this.positions;
  var p1 = this.positionsPrev;
  var ix = i * 3;
  var iy = ix + 1;
  var iz = ix + 2;

  p0[ix] = p1[ix] = x;
  p0[iy] = p1[iy] = y;
  p0[iz] = p1[iz] = z;
};
{'fraction_non_alphanumeric': 0.13894324853228962, 'fraction_numerical': 0.02674494455316373, 'mean_word_length': 3.8544303797468356, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1337350', 'n_tokens_mistral': 581, 'n_tokens_neox': 532, 'n_words': 135}