Esempio n. 1
0
        /// <summary>
        /// Multiply vector component by component.
        /// </summary>
        /// <param name="vector"></param>
        /// <returns></returns>
        public QsVector MultiplyVector(QsVector vector)
        {
            if (this.Count != vector.Count)
            {
                throw new QsException("Vectors are not equal");
            }

            QsVector v = QsVector.CopyVector(this);

            for (int ix = 0; ix < this.Count; ix++)
            {
                v[ix] = v[ix].MultiplyScalar(vector[ix]);
            }

            return(v);
        }
Esempio n. 2
0
        /// <summary>
        /// Subtract two vectors
        /// </summary>
        /// <param name="v1"></param>
        /// <param name="v2"></param>
        /// <returns></returns>
        public QsVector SubtractVector(QsVector vector)
        {
            if (this.Count != vector.Count)
            {
                throw new QsException("Vectors are not equal");
            }

            QsVector v = QsVector.CopyVector(this);

            for (int ix = 0; ix < this.Count; ix++)
            {
                v[ix] = v[ix] - vector[ix];
            }

            return(v);
        }
Esempio n. 3
0
        private QsValue ModuloVector(QsVector vector)
        {
            if (this.Count != vector.Count)
            {
                throw new QsException("Vectors are not equal");
            }


            QsVector v = QsVector.CopyVector(this);

            for (int ix = 0; ix < this.Count; ix++)
            {
                v[ix] = v[ix] % vector[ix];
            }

            return(v);
        }