Methods should have a consistent I/O
Closed this issue · 1 comments
wall0159 commented
I'm new to Dart (looking at this package for numerical analysis)
It looks like some of the methods (eg. reshape) accept and return a List whereas others (slice) require a List<List> so that the output of one method can't be passed to another
wall0159 commented
I'm not certain I'm doing this correctly :-), but this will reproduce
var list = [
[1, 2],
[1, 2],
[8, 5]
];
var list2 = [
[9, 2],
[9, 2]
];
var concat = m2d.concatenate(list,list2);
print('concatenated: $res');
concat.reshape(3, 4);
// List<List> ress = m2d.reshape(concat,3, 4); // consistency with other methods would suggest this approach
print('reshaped: $concat');
print('res shape: ${concat.shape}');
var sliceOfConcat = m2d.slice(concat, [2], [3]); // wrong input type
print('slice: $sliceOfConcat');