Julia: scan! and scan functions

Created on 19 Jan 2016  路  12Comments  路  Source: JuliaLang/julia

I'm a little incredulous that we don't have a scan function generalizing cumsum and cumprod for an arbitrary reducer. But it seems that we don't, nor as far as I can tell do we have an issue for it.

help wanted

Most helpful comment

Let me grab this issue!

All 12 comments

Ah, yes. We should possibly steal all of those. Arguably it would be better to do these after Jeff's branch is merged since we can avoid the whole functor dance after that.

btw: Is there a clear definition of 'We'?

For this here, and for other topics it's not clear, what should be in julia Base and what is expected to be in a package (e.g. Very early there was a list of matlab functions which have/haven't julia counterparts. and it looked, like this should be available in julia Base)
Package has the advantage that it's an independent development, while at the same time it has the disadvantage of an independent development.

"We" refers to the Julia project / community as a whole. So no? It's a judgement call what should be in Base versus in a package, but scan is a pretty basic piece of functionality for a numerical language.

Yeah scan is a no-brainer.

Hmm, in the giant cleanup that was #16260, I may have unknowingly fixed this. Anyone should feel free to rename/repackage these functions to their heart's content.

Hmm. Since these are already implemented, perhaps we should do the rename before 0.5.

+1 to rename them. I just needed scanl recently (and wasn't aware of this issue), but thought it was not trivial enough to implement, if the type of the output array has to be inferred somehow (like map does). IIUC, @timholy, cumop! is like scan! but there is no cumop/scan yet? Also a version accepting an intitial value would be needed, in the case where the binary operator has args of different types.

-1 to adding new things to the milestone. If someone wants to rename, document, and independently test these go ahead, but it's not at all worth delaying the release for.

If it doesn't get done, we can just remove the milestone. The tag is useful for remembering things to do.

Let me grab this issue!

Closed by #18931

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dpsanders picture dpsanders  路  3Comments

iamed2 picture iamed2  路  3Comments

omus picture omus  路  3Comments

wilburtownsend picture wilburtownsend  路  3Comments

manor picture manor  路  3Comments