Computes the cumulative maximum of a numeric array.