/// <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); }
/// <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); }
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); }