public ReadOnlyVector Add(ReadOnlyVector other) { return(new ReadOnlyVector(X + other.X, Y + other.Y)); }
public ReadOnlyVector Add(ReadOnlyVector vector) { return(new ReadOnlyVector(X + vector.X, Y + vector.Y)); }
public ReadOnlyVector Add(ReadOnlyVector other) => new ReadOnlyVector(X + other.X, Y + other.Y);
///<summary> /// Divide vector to argument componentwise ///</summary> ///<exception cref="Exception">Throw exception if vector's lengthes are not equal</exception> ///<exception cref="Exception">Throws exception if divisor is zero</exception> public void DivideComponentwiseTo(ReadOnlyVector arg) { CheckLengths(this, arg); for (int i = Count - 1; i >= 0; --i) SetElem(i, Elem(i)/arg.Elem(i)); }
///<summary> /// Subtract an argument from vector ///</summary> ///<exception cref="Exception">Throw exception if vector's lengthes are not equal</exception> public void SubtractTo(ReadOnlyVector arg) { CheckLengths(this, arg); for (int i = Count - 1; i >= 0; --i) SetElem(i, Elem(i) - arg.Elem(i)); }
/// <summary> /// Copies a components from given vector to this /// </summary> public void CopyFrom(ReadOnlyVector original) { CheckLengths(this, original); for (int i = Count - 1; i >= 0; --i) SetElem(i, original.Elem(i)); }
/// <summary> /// Creates an instance of LockedVector over given vector /// </summary> public LockedVector(ReadOnlyVector vector) { this.vector = vector; Elem = vector.Elem; }