snapshot ahead of tests
This commit is contained in:
parent
db4dcecf1f
commit
f23b63bae4
39 changed files with 606 additions and 582 deletions
|
|
@ -292,7 +292,7 @@ func (m *Matrix) Copy() *Matrix {
|
|||
// DiagonalVector returns a vector from the diagonal of a matrix.
|
||||
func (m *Matrix) DiagonalVector() Vector {
|
||||
rows, cols := m.Size()
|
||||
rank := minInt(rows, cols)
|
||||
rank := Min(rows, cols)
|
||||
values := make([]float64, rank)
|
||||
|
||||
for index := 0; index < rank; index++ {
|
||||
|
|
@ -304,7 +304,7 @@ func (m *Matrix) DiagonalVector() Vector {
|
|||
// Diagonal returns a matrix from the diagonal of a matrix.
|
||||
func (m *Matrix) Diagonal() *Matrix {
|
||||
rows, cols := m.Size()
|
||||
rank := minInt(rows, cols)
|
||||
rank := Min(rows, cols)
|
||||
m2 := New(rank, rank)
|
||||
|
||||
for index := 0; index < rank; index++ {
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ import (
|
|||
"strconv"
|
||||
)
|
||||
|
||||
func minInt(values ...int) int {
|
||||
func Min(values ...int) int {
|
||||
min := math.MaxInt32
|
||||
|
||||
for x := 0; x < len(values); x++ {
|
||||
|
|
@ -16,7 +16,7 @@ func minInt(values ...int) int {
|
|||
return min
|
||||
}
|
||||
|
||||
func maxInt(values ...int) int {
|
||||
func Max(values ...int) int {
|
||||
max := math.MinInt32
|
||||
|
||||
for x := 0; x < len(values); x++ {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue