Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,29 @@
package main
import (
"fmt"
"gonum.org/v1/gonum/mat"
)
var m = mat.NewDense(4, 4, []float64{
2, -1, 5, 1,
3, 2, 2, -6,
1, 3, 3, -1,
5, -2, -3, 3,
})
var v = []float64{-3, -32, -47, 49}
func main() {
x := make([]float64, len(v))
b := make([]float64, len(v))
d := mat.Det(m)
for c := range v {
mat.Col(b, c, m)
m.SetCol(c, v)
x[c] = mat.Det(m) / d
m.SetCol(c, b)
}
fmt.Println(x)
}

View file

@ -0,0 +1,29 @@
package main
import (
"fmt"
"github.com/skelterjohn/go.matrix"
)
var m = matrix.MakeDenseMatrixStacked([][]float64{
{2, -1, 5, 1},
{3, 2, 2, -6},
{1, 3, 3, -1},
{5, -2, -3, 3},
})
var v = []float64{-3, -32, -47, 49}
func main() {
x := make([]float64, len(v))
b := make([]float64, len(v))
d := m.Det()
for c := range v {
m.BufferCol(c, b)
m.FillCol(c, v)
x[c] = m.Det() / d
m.FillCol(c, b)
}
fmt.Println(x)
}