public ReadOnlyVector Add(ReadOnlyVector other)
 {
     return(new ReadOnlyVector(X + other.X, Y + other.Y));
 }
Beispiel #2
0
 public ReadOnlyVector Add(ReadOnlyVector vector)
 {
     return(new ReadOnlyVector(X + vector.X, Y + vector.Y));
 }
Beispiel #3
0
 public ReadOnlyVector Add(ReadOnlyVector other) =>
 new ReadOnlyVector(X + other.X, Y + other.Y);
Beispiel #4
0
 ///<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));
 }
Beispiel #5
0
 ///<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));
 }
Beispiel #6
0
 /// <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));
 }
Beispiel #7
0
 /// <summary>
 ///   Creates an instance of LockedVector over given vector
 /// </summary>
 public LockedVector(ReadOnlyVector vector)
 {
     this.vector = vector;
     Elem = vector.Elem;
 }