[Debug] Dart matrix2d Transpose debuging, "'double' is not a subtype of type


[Debug] Dart matrix2d Transpose debuging, "'double' is not a subtype of type

matrix2D를 사용하면서 이상한 타입 오류?를 발견했다.

바로 전치행렬로 변환하는 transpose 메서드이다. 사용 방법은 아래와 같다. import 'package:matrix2d/matrix2d.dart'; void main() { var list = [ [1, 2], [1, 2] ]; // transpose print(list.transpose); // [[1, 1], [2, 2]] } 정수가 들어 있는 List의 경우 문제가 발생하지 않는다.

하지만, List 안에 double의 숫자를 넣으면 아래와 같은 에러가 발생한다. 처음엔 이 라이브러리가 double형이 연산 속도 때문에 막아 놓은 줄 알았다.

그렇다면 연산량이 더 많은 division, dot 경우에 말이 안 된다. 그리고 연산 방식이 비슷한 reshape, concatenate는 double형을 지원하니 이상할 노릇이다. import 'package:matrix2d/matrix2d.dart'; void mai...


#dart #flutter #int #matrix2d #type #에러 #오류

원문링크 : [Debug] Dart matrix2d Transpose debuging, "'double' is not a subtype of type