LU decomposition: Difference between revisions
m
→Library gonum/matrix: library churn
m (→{{header|REXX}}: added/changed statements, comments, and whitespace, used templates for the output sections.) |
m (→Library gonum/matrix: library churn) |
||
Line 1,261:
Output is same as from 2D solution.
===Library gonum/
<lang go>package main
Line 1,267:
"fmt"
"
)
func main() {
showLU(
1, 3, 5,
2, 4, 7,
Line 1,277:
}))
fmt.Println()
showLU(
11, 9, 24, 2,
1, 5, 2, 6,
Line 1,285:
}
func showLU(a *
fmt.Printf("a: %v\n\n",
var lu
lu.Factorize(a)
fmt.Printf("
▲ fmt.Printf("u: %.5f\n\n", mat64.Formatted(&u, mat64.Prefix(" ")))
fmt.Println("p:", lu.Pivot(nil))
}</lang>
|