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