|
|
|
@ -810,21 +810,11 @@ namespace MathNet.Numerics.LinearAlgebra.Generic |
|
|
|
/// <exception cref="ArgumentNullException">If <paramref name="leftSide"/> or <paramref name="rightSide"/> is <see langword="null" />.</exception>
|
|
|
|
public static Vector<T> operator +(Vector<T> leftSide, Vector<T> rightSide) |
|
|
|
{ |
|
|
|
if (rightSide == null) |
|
|
|
{ |
|
|
|
throw new ArgumentNullException("rightSide"); |
|
|
|
} |
|
|
|
|
|
|
|
if (leftSide == null) |
|
|
|
{ |
|
|
|
throw new ArgumentNullException("leftSide"); |
|
|
|
} |
|
|
|
|
|
|
|
if (leftSide.Count != rightSide.Count) |
|
|
|
{ |
|
|
|
throw new ArgumentException(Resources.ArgumentVectorsSameLength, "rightSide"); |
|
|
|
} |
|
|
|
|
|
|
|
return leftSide.Add(rightSide); |
|
|
|
} |
|
|
|
|
|
|
|
@ -854,21 +844,11 @@ namespace MathNet.Numerics.LinearAlgebra.Generic |
|
|
|
/// <exception cref="ArgumentNullException">If <paramref name="leftSide"/> or <paramref name="rightSide"/> is <see langword="null" />.</exception>
|
|
|
|
public static Vector<T> operator -(Vector<T> leftSide, Vector<T> rightSide) |
|
|
|
{ |
|
|
|
if (rightSide == null) |
|
|
|
{ |
|
|
|
throw new ArgumentNullException("rightSide"); |
|
|
|
} |
|
|
|
|
|
|
|
if (leftSide == null) |
|
|
|
{ |
|
|
|
throw new ArgumentNullException("leftSide"); |
|
|
|
} |
|
|
|
|
|
|
|
if (leftSide.Count != rightSide.Count) |
|
|
|
{ |
|
|
|
throw new ArgumentException(Resources.ArgumentVectorsSameLength, "rightSide"); |
|
|
|
} |
|
|
|
|
|
|
|
return leftSide.Subtract(rightSide); |
|
|
|
} |
|
|
|
|
|
|
|
@ -916,21 +896,11 @@ namespace MathNet.Numerics.LinearAlgebra.Generic |
|
|
|
/// <exception cref="ArgumentNullException">If <paramref name="leftSide"/> or <paramref name="rightSide"/> is <see langword="null" />.</exception>
|
|
|
|
public static T operator *(Vector<T> leftSide, Vector<T> rightSide) |
|
|
|
{ |
|
|
|
if (rightSide == null) |
|
|
|
{ |
|
|
|
throw new ArgumentNullException("rightSide"); |
|
|
|
} |
|
|
|
|
|
|
|
if (leftSide == null) |
|
|
|
{ |
|
|
|
throw new ArgumentNullException("leftSide"); |
|
|
|
} |
|
|
|
|
|
|
|
if (leftSide.Count != rightSide.Count) |
|
|
|
{ |
|
|
|
throw new ArgumentException(Resources.ArgumentVectorsSameLength, "rightSide"); |
|
|
|
} |
|
|
|
|
|
|
|
return leftSide.DotProduct(rightSide); |
|
|
|
} |
|
|
|
|
|
|
|
|