()
| 20 | } |
| 21 | |
| 22 | func main() { |
| 23 | a := []float64{0., 2., 3.} |
| 24 | b := []float64{1., 3., 6.} |
| 25 | c := []float64{4., 5., 0.} |
| 26 | d := []float64{7., 5., 3.} |
| 27 | |
| 28 | fmt.Println("The system,") |
| 29 | fmt.Println("[1.0 4.0 0.0][x] = [7.0]") |
| 30 | fmt.Println("[2.0 3.0 5.0][y] = [5.0]") |
| 31 | fmt.Println("[0.0 3.0 6.0][z] = [3.0]") |
| 32 | fmt.Println("has the solution:") |
| 33 | solve := thomas(a, b, c, d) |
| 34 | for _, i := range solve { |
| 35 | fmt.Printf("[%f]\n", i) |
| 36 | } |
| 37 | } |