Matrix.AddScaled Method

Definition

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

Overload List

AddScaled<T>(Matrix<T>, T, Matrix<T>) Adds a multiple of a matrix to this instance and returns the result.
AddScaled<T>(Matrix<T>, T, Vector<T>, Dimension) Adds a multiple of a vector broadcast along the specified dimension to a matrix and returns the result.
AddScaled<T>(Matrix<T>, TransposeOperation, T, Matrix<T>, TransposeOperation) Adds a multiple of a matrix to another matrix and returns the result.

AddScaled<T>(Matrix<T>, T, Matrix<T>)

Adds a multiple of a matrix to this instance and returns the result.
C#
public static Matrix<T> AddScaled<T>(
	Matrix<T> left,
	T factor,
	Matrix<T> right
)

Parameters

left  Matrix<T>
The left operand of the addition.
factor  T
Multiplier for the matrix right.
right  Matrix<T>
A Matrix<T>.

Type Parameters

T

Return Value

Matrix<T>
A Matrix<T> that is the sum of the specified form of this matrix and the matrix right.

Remarks

This method does not change this instance. The dimensions of the two matrices must be compatible. Otherwise an exception of type DimensionMismatchException is thrown.

Exceptions

ArgumentNullExceptionright is null.
DimensionMismatchExceptionThe dimensions of this instance and the matrix right are not compatible for the specified operation.

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

Adds a multiple of a vector broadcast along the specified dimension to a matrix and returns the result.
C#
public static Matrix<T> AddScaled<T>(
	Matrix<T> left,
	T factor,
	Vector<T> right,
	Dimension broadcastDimension
)

Parameters

left  Matrix<T>
The left operand of the addition.
factor  T
Multiplier for the vector right.
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<T> that is the sum of the specified form of this matrix and the vector right broadcast in the dimension specified by broadcastDimension.

Remarks

The dimensions of the matrix and the length of the vector must be compatible. Otherwise an exception of type DimensionMismatchException is thrown.

Exceptions

ArgumentNullExceptionright is null.
DimensionMismatchExceptionThe dimensions of this instance and the matrix right are not compatible for the specified operation.

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

Adds a multiple of a matrix to another matrix and returns the result.
C#
public static Matrix<T> AddScaled<T>(
	Matrix<T> left,
	TransposeOperation leftOperation,
	T factor,
	Matrix<T> right,
	TransposeOperation rightOperation
)

Parameters

left  Matrix<T>
The left operand of the addition.
leftOperation  TransposeOperation
A TransposeOperation value that indicates which operation, if any, should be performed on this instance before adding.
factor  T
Multiplier for the matrix right.
right  Matrix<T>
A Matrix<T>.
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<T> that is the sum of the specified form of this matrix and the matrix right.

Remarks

This method does not change this instance. The dimensions of the two matrices must be compatible. Otherwise an exception of type DimensionMismatchException is thrown.

Exceptions

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

See Also