Matrix.Add Method

Definition

Namespace: Extreme.Mathematics
Assembly: Extreme.Numerics (in Extreme.Numerics.dll) Version: 8.1.23

Overload List

Add<T>(Matrix<T>, T) Adds a matrix and a scalar.
Add<T>(Matrix<T>, Matrix<T>) Adds two matrices.
Add<T>(T, Matrix<T>) Adds a matrix and a scalar.
Add<T>(Matrix<T>, Vector<T>, Dimension) Adds a matrix and a vector broadcast along the specified dimension.
Add<T>(Vector<T>, Dimension, Vector<T>) Adds two broadcast vectors to form a matrix.
Add<T>(Matrix<T>, TransposeOperation, Matrix<T>, TransposeOperation) Adds two matrices after applying the specified operation to the operands.

Add<T>(Matrix<T>, T)

Adds a matrix and a scalar.
C#
public static Matrix<T> Add<T>(
	Matrix<T> matrix,
	T value
)

Parameters

matrix  Matrix<T>
A matrix.
value  T
The constant.

Type Parameters

T

Return Value

Matrix<T>
A matrix whose elements are the sum of the corresponding elements of matrix and value.

Exceptions

ArgumentNullExceptionmatrix is null

Add<T>(Matrix<T>, Matrix<T>)

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

Parameters

left  Matrix<T>
The first matrix.
right  Matrix<T>
The second matrix.

Type Parameters

T

Return Value

Matrix<T>
A matrix whose elements are the sum of the corresponding elements of left and right.

Exceptions

ArgumentNullExceptionleft is null

-or-

right is null

DimensionMismatchExceptionleft and right do not have the same length.

Add<T>(T, Matrix<T>)

Adds a matrix and a scalar.
C#
public static Matrix<T> Add<T>(
	T value,
	Matrix<T> matrix
)

Parameters

value  T
The constant.
matrix  Matrix<T>
A matrix.

Type Parameters

T

Return Value

Matrix<T>
A matrix whose elements are the sum of the corresponding elements of matrix and value.

Exceptions

ArgumentNullExceptionmatrix is null

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

Adds a matrix and a vector broadcast along the specified dimension.
C#
public static Matrix<T> Add<T>(
	Matrix<T> left,
	Vector<T> right,
	Dimension broadcastDimension
)

Parameters

left  Matrix<T>
A matrix.
right  Vector<T>
A vector.
broadcastDimension  Dimension
A value that specifies whether the elements in right should be broadcast across rows or columns.

Type Parameters

T

Return Value

Matrix<T>
A matrix whose elements are the sum of the corresponding elements of left and right.

Exceptions

ArgumentNullExceptionleft is null

-or-

right is null

DimensionMismatchExceptionleft and right do not have the same dimension.

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

Adds two broadcast vectors to form a matrix.
C#
public static Matrix<T> Add<T>(
	Vector<T> left,
	Dimension leftBroadcastDimension,
	Vector<T> right
)

Parameters

left  Vector<T>
A matrix.
leftBroadcastDimension  Dimension
A value that specifies whether the elements in left should be broadcast across rows or columns.
right  Vector<T>
A vector.

Type Parameters

T

Return Value

Matrix<T>
A matrix whose elements are the sum of the corresponding elements of left and right.

Exceptions

ArgumentNullExceptionleft is null

-or-

right is null

Add<T>(Matrix<T>, TransposeOperation, Matrix<T>, TransposeOperation)

Adds two matrices after applying the specified operation to the operands.
C#
public static Matrix<T> Add<T>(
	Matrix<T> left,
	TransposeOperation leftOperation,
	Matrix<T> right,
	TransposeOperation rightOperation
)

Parameters

left  Matrix<T>
The first matrix.
leftOperation  TransposeOperation
A TransposeOperation value that indicates which operation, if any, should be performed on the matrix left before adding.
right  Matrix<T>
The second matrix.
rightOperation  TransposeOperation
A TransposeOperation value that indicates which operation, if any, should be performed on the matrix right before adding.

Type Parameters

T

Return Value

Matrix<T>
A matrix whose elements are the sum of the corresponding elements of left and right.

Exceptions

ArgumentNullExceptionleft is null

-or-

right is null

DimensionMismatchException THe dimensions of left and right as transformed by leftOperation and rightOperation, respectively, are not compatible.

See Also