public void Add(VectorD other) { if (this._Values.Length != other._Values.Length) throw new ArgumentException("Incompatible dimensions " + _Values.Length + " -> " + other._Values.Length); int imax = this._Values.Length; for (int i = 0; i < imax; i++) this._Values[i] += other._Values[i]; }
public void Subtract(VectorD other) { if (this._Values.Length != other._Values.Length) { throw new ArgumentException("Incompatible dimensions " + _Values.Length + " -> " + other._Values.Length); } int imax = this._Values.Length; for (int i = 0; i < imax; i++) { this._Values[i] -= other._Values[i]; } }