【发布时间】:2022-08-15 18:19:33
【问题描述】:
在我的飞镖代码中,我有一个 2X2 矩阵,像这样
List<List<int>> a =
[
[10, 2],
[2, 2],
];
List<List<int>> b =
[
[1, 2],
[2, 2],
];
所以,我想在不使用任何预定义函数的情况下对这两个矩阵执行求和运算。
我想要的结果,像这样
List<List<int>> c =
[
[11, 4], // 10+1 2+2
[4, 4], // 2+2 2+2
];
-
不使用预定义函数的原因是什么?你对它的定义是什么?从技术上讲,
+也是我认为的预定义函数。至少size()或add()是。不使用函数是完全不可能的 -
当您有api.flutter.dev/flutter/vector_math/Matrix2-class.html 供您使用时,为什么要浪费脑细胞?