DenseMatrix<T>.Add Method

Definition

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

Overload List

Add(T) Adds a constant to a matrix and returns the result.
Obsolete.
Add(DenseMatrix<T>, T, DenseMatrix<T>, DenseMatrix<T>) Adds two DenseMatrix<T> objects and stores the result in a third DenseMatrix<T>.

Add(DenseMatrix<T>, T, DenseMatrix<T>, DenseMatrix<T>)

Adds two DenseMatrix<T> objects and stores the result in a third DenseMatrix<T>.
C#
public static DenseMatrix<T> Add(
	DenseMatrix<T> matrix1,
	T factor,
	DenseMatrix<T> matrix2,
	DenseMatrix<T> resultMatrix
)

Parameters

matrix1  DenseMatrix<T>
The first DenseMatrix<T>.
factor  T
A number that specifies the multiplier for the second matrix.
matrix2  DenseMatrix<T>
The second DenseMatrix<T>.
resultMatrix  DenseMatrix<T>
A DenseMatrix<T> that is to receive the result of the multiplication.

Return Value

DenseMatrix<T>
A reference to resultMatrix.

Remarks

This method uses level 1 BLAS routines to perform the addition. It is the most efficient way to add matrices of type DenseMatrix<T>.

The dimensions of the three matrices must be the same. Otherwise, an exception of type DimensionMismatchException is thrown.

Exceptions

ArgumentNullExceptionmatrix1 is null

-or-

matrix2 is null

-or-

resultMatrix is null

DimensionMismatchException The dimensions of matrix2 does not equal the dimensions of matrix1.

-or-

The dimensions of resultMatrix does not equal the dimensions of matrix1.

See Also