MathNet.Numerics.LinearAlgebra.Single.DenseMatrix.OfDiagonalVector C# (CSharp) Method

OfDiagonalVector() public static method

Create a new dense matrix with the diagonal as a copy of the given vector. This new matrix will be independent from the vector. A new memory block will be allocated for storing the matrix.
public static OfDiagonalVector ( Vector diagonal ) : DenseMatrix
diagonal Vector
return DenseMatrix
        public static DenseMatrix OfDiagonalVector(Vector<float> diagonal)
        {
            var m = new DenseMatrix(diagonal.Count, diagonal.Count);
            m.SetDiagonal(diagonal);
            return m;
        }

Same methods

DenseMatrix::OfDiagonalVector ( int rows, int columns, Vector diagonal ) : DenseMatrix