Skip to content

cummax

builtin · libnexusinterp/corefcn/max-proprietary.cc

: m = cummax (x)
: m = cummax (x, dim)
: [m, im] = cummax (…)
: … = cummax (…, "forward")
: … = cummax (…, "reverse")
: … = cummax (…, "omitnan")
: … = cummax (…, "includenan")

Return the running maximum along a dimension.

Element k of the result along dim (default: the first dimension that is not of length one) is the largest of the first k elements. im gives the position where each running maximum was found, taking the first occurrence on ties. Direction is "forward" (default) or "reverse". NaN values are skipped by default ("omitnan" / "omitmissing"); "includenan" / "includemissing" make a NaN stick.