reshape function
Implementation
Matrix reshape(Matrix input, List<List<double>> fixedList) {
if (input.isEmpty) {
return Matrix.fromList(fixedList);
}
List<double> flat = input
.toList()
.reduce((value, element) => value.toList() + element.toList())
.toList();
return Matrix.fromFlattenedList(
flat, fixedList.length, fixedList.first.length);
}