func (d *DiagDense) Diag() int {
	return d.mat.N
}
Diag returns the dimension of the receiver.
package mat
import (
	"gonum.org/v1/gonum/blas"
	"gonum.org/v1/gonum/blas/blas64"
)
var (
	diagDense *DiagDense
	_         Matrix          = diagDense
	_         Diagonal        = diagDense
	_         MutableDiagonal = diagDense
	_         Triangular      = diagDense
	_         TriBanded       = diagDense
	_         Symmetric       = diagDense
	_         SymBanded       = diagDense
	_         Banded          = diagDense
	_         RawBander       = diagDense
	_         RawSymBander    = diagDense
	diag Diagonal
	_    Matrix     = diag
	_    Diagonal   = diag
	_    Triangular = diag
	_    TriBanded  = diag
	_    Symmetric  = diag
	_    SymBanded  = diag
	_    Banded     = diag
)
type Diagonal interface {
	Matrix
	Diag() int
	Bandwidth() (kl, ku int)
	TBand() Banded
	Triangle() (int, TriKind)
	TTri() Triangular
	Symmetric() int
	SymBand() (n, k int)
	TriBand() (n, k int, kind TriKind)
	TTriBand() TriBanded
}
type MutableDiagonal interface {
	Diagonal
	SetDiag(i int, v float64)
}
type DiagDense struct {
	mat blas64.Vector
}
func NewDiagDense(n int, data []float64) *DiagDense {
	if n <= 0 {
		if n == 0 {
			panic(ErrZeroLength)
		}
		panic("mat: negative dimension")
	}
	if data == nil {
		data = make([]float64, n)
	}
	if len(data) != n {
		panic(ErrShape)
	}
	return &DiagDense{
		mat: blas64.Vector{N: n, Data: data, Inc: 1},
	}
}