columnMins method
Calculates the minimum value for each column in the matrix.
Returns a list of minimum values, one for each column.
Example usage:
final matrix = Matrix([
[1, 2],
[3, 4],
[5, 6]
]);
final mins = matrix.columnMins();
print(mins); // Output: [1, 2]
Implementation
List<Complex> columnMins() {
List<Complex> mins = List.filled(columnCount, Complex.infinity());
for (var row in _data) {
for (int j = 0; j < columnCount; j++) {
if (Complex(row[j]) < mins[j]) {
mins[j] = Complex(row[j]);
}
}
}
return mins;
}