func Identity(order int) *Matrix {
	m := New(order, order)
	for i := 0; i < order; i++ {
		m.Set(i, i, 1)
	}
	return m
}
Identity returns the identity matrix of a given order.
package matrix
import (
	"bytes"
	"errors"
	"fmt"
	"math"
)
const (
	DefaultEpsilon = 0.000001
)
var (
	ErrDimensionMismatch = errors.New("dimension mismatch")
	ErrSingularValue = errors.New("singular value")
)
func New(rows, cols int, values ...float64) *Matrix {
	if len(values) == 0 {
		return &Matrix{
			stride:   cols,
			epsilon:  DefaultEpsilon,
			elements: make([]float64, rows*cols),
		}
	}
	elems := make([]float64, rows*cols)
	copy(elems, values)
	return &Matrix{
		stride:   cols,
		epsilon:  DefaultEpsilon,
		elements: elems,
	}
}