Returns a vector view of a diagonal of this matrix.

Namespace:  CenterSpace.NMath.Matrix
Assembly:  NMath (in NMath.dll) Version: 5.1.0.0

Syntax

C#
public DoubleVector Diagonal(
	int k
)
Visual Basic (Declaration)
Public Function Diagonal ( _
	k As Integer _
) As DoubleVector
Visual C++
public:
DoubleVector^ Diagonal(
	int k
)

Parameters

k
Type: System..::.Int32
A diagonal.

Return Value

A vector view of the specified diagonal.

Remarks

If k is zero, the main diagonal of the matrix is returned. If k is positive, the returned vector v satisfies:
CopyC#
v[i] = this[i,i+k]
If k is negative, the returned vector v satisfies:
CopyC#
v[i] = this[i-k,i]

See Also