From 210cb64bc05586c8398d540e3e4a4bced187e301 Mon Sep 17 00:00:00 2001 From: xushiwei Date: Fri, 17 May 2024 16:50:38 +0800 Subject: [PATCH] pydemo: matrix --- testdata/_llgo/matrix/matrix.gop | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 testdata/_llgo/matrix/matrix.gop diff --git a/testdata/_llgo/matrix/matrix.gop b/testdata/_llgo/matrix/matrix.gop new file mode 100644 index 000000000..b16237f49 --- /dev/null +++ b/testdata/_llgo/matrix/matrix.gop @@ -0,0 +1,18 @@ +import ( + "c" + "py" + "py/numpy" +) + +a := py.list( + py.list(1.0, 2.0, 3.0), + py.list(4.0, 5.0, 6.0), + py.list(7.0, 8.0, 9.0), +) +b := py.list( + py.list(9.0, 8.0, 7.0), + py.list(6.0, 5.0, 4.0), + py.list(3.0, 2.0, 1.0), +) +x := numpy.add(a, b) +c.printf C"a+b = %s\n", x.str.cStr