Esempio n. 1
0
        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];
        }
Esempio n. 2
0
        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];
            }
        }