Click or drag to resize
Accord.NET (logo)

MatrixAddToDiagonal Method (Double, Double, Boolean)

Note: This API is now obsolete.

Adds a scalar to the diagonal of a matrix.

Namespace:  Accord.Math
Assembly:  Accord.Math (in Accord.Math.dll) Version: 3.5.0
[ObsoleteAttribute("Please use the Elementwise class instead.")]
public static double[,] AddToDiagonal(
	double[,] matrix,
	double scalar,
	bool inPlace = false
Request Example View Source


Type: SystemDouble
A matrix.
Type: SystemDouble
A scalar.
inPlace (Optional)
Type: SystemBoolean
True to perform the operation in-place, overwriting the original matrix; false to return a new matrix.

Return Value

Type: Double
See Also