github.com/goplus/llgo@v0.8.3/cl/_testpy/matrix/in.go (about)

     1  package main
     2  
     3  import (
     4  	"github.com/goplus/llgo/c"
     5  	"github.com/goplus/llgo/py"
     6  	"github.com/goplus/llgo/py/numpy"
     7  )
     8  
     9  func main() {
    10  	a := py.List(
    11  		py.List(1.0, 2.0, 3.0),
    12  		py.List(4.0, 5.0, 6.0),
    13  		py.List(7.0, 8.0, 9.0),
    14  	)
    15  	b := py.List(
    16  		py.List(9.0, 8.0, 7.0),
    17  		py.List(6.0, 5.0, 4.0),
    18  		py.List(3.0, 2.0, 1.0),
    19  	)
    20  	x := numpy.Add(a, b)
    21  	c.Printf(c.Str("a = %s\n"), a.Str().CStr())
    22  	c.Printf(c.Str("a = %s\n"), b.Str().CStr())
    23  	c.Printf(c.Str("a+b = %s\n"), x.Str().CStr())
    24  }