mirror of
https://github.com/gonum/gonum.git
synced 2025-11-02 21:24:03 +08:00
mat: rename NewDiagonal to NewDiagDense
This commit is contained in:
@@ -73,10 +73,10 @@ type DiagDense struct {
|
||||
mat blas64.Vector
|
||||
}
|
||||
|
||||
// NewDiagonal creates a new Diagonal matrix with n rows and n columns.
|
||||
// The length of data must be n or data must be nil, otherwise NewDiagonal
|
||||
// will panic. NewDiagonal will panic if n is zero.
|
||||
func NewDiagonal(n int, data []float64) *DiagDense {
|
||||
// NewDiagDense creates a new Diagonal matrix with n rows and n columns.
|
||||
// The length of data must be n or data must be nil, otherwise NewDiagDense
|
||||
// will panic. NewDiagDense will panic if n is zero.
|
||||
func NewDiagDense(n int, data []float64) *DiagDense {
|
||||
if n <= 0 {
|
||||
if n == 0 {
|
||||
panic(ErrZeroLength)
|
||||
|
||||
Reference in New Issue
Block a user