Vector.Add Method

Definition

Namespace: Numerics.NET
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 9.0.0

Overload List

Add<T>(Vector<T>, T) Adds a vector and a constant.
Add<T>(Vector<T>, Vector<T>) Adds two vectors.
Add<T>(T, Vector<T>) Adds a vector and a constant.

Add<T>(Vector<T>, T)

Adds a vector and a constant.
C#
public static Vector<T> Add<T>(
	Vector<T> vector,
	T value
)

Parameters

vector  Vector<T>
A vector.
value  T
The constant.

Type Parameters

T

Return Value

Vector<T>
A vector whose elements are the sum of the corresponding elements of vector and value.

Exceptions

ArgumentNullException

vector is null.

Add<T>(Vector<T>, Vector<T>)

Adds two vectors.
C#
public static Vector<T> Add<T>(
	Vector<T> left,
	Vector<T> right
)

Parameters

left  Vector<T>
The first vector.
right  Vector<T>
The second vector.

Type Parameters

T

Return Value

Vector<T>
A vector whose elements are the sum of the corresponding elements of left and right.

Exceptions

ArgumentNullException

left is null.

-or-

right is null.

DimensionMismatchException

left and right do not have the same length.

Add<T>(T, Vector<T>)

Adds a vector and a constant.
C#
public static Vector<T> Add<T>(
	T value,
	Vector<T> vector
)

Parameters

value  T
The constant.
vector  Vector<T>
A vector.

Type Parameters

T

Return Value

Vector<T>
A vector whose elements are the sum of the corresponding elements of vector and value.

Exceptions

ArgumentNullException

vector is null.

See Also