--- Comment #7 from 2011-03-24 15:07:40 PDT ---
The examples hopefully show how much useful are the new max/min.
This is part of the "pivoting" part of a LU decomposition algorithm:

T imax = mat[j][j];
int nrow = j;
foreach (i; j .. N) {
    if (mat[i][j] > imax) {
        imax = mat[i][j];
        nrow = i;

With the improved max() it becomes:

int nrow = max!((int i){ return mat[i][j]; })(iota(j, N));

That is similar to this Python code:

nrow = max(xrange(j, N), key=lambda i: mat[i][j])

Python designers have recognized this is a common pattern in code.

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to