min method
Functions, used to find the maximum value for any given array
axis is null by default to find min values of columns use zero and for rows use 1
Implementation
List min(List list, {int? axis}) {
try {
if (!_checkArray(list)) throw new Exception('Not 2d array');
var result = [];
if (axis == null) {
list = flatten(list);
return [utlArrMin(list)];
} else if (axis > 1 || axis < 0) {
//err
throw Exception('Only two axis 0 and 1');
} else {
if (axis == 1) {
for (var i = 0; i < list.length; i++) {
if (_isList(list[i])) {
result.add(utlArrMin(list[i]));
}
}
return result;
} else {
list = transpose(list);
for (var i = 0; i < list.length; i++) {
if (_isList(list[i])) {
result.add(utlArrMin(list[i]));
}
}
return result;
}
}
} catch (e) {
throw Exception('Only two axis 0 and 1');
}
}