Am 24.03.2019 um 16:52 schrieb Allin Cottrell:
On Sat, 23 Mar 2019, Sven Schreiber wrote:
> The thread then diverged towards my "BTW" remark. So getting back to the
> original question, should it go into 'extra'?
I don't have strong feelings either way. The "cheat sheet"
implementation of convolve is just a one-liner, which might suggest that
it's hardly worth adding a convolve function in its own right.
On the other hand the need for, and sizing of, the zero vector to be
appended to the first argument to filter() may not be transparent to
many users, so maybe it's worth hiding that.
Right, I think this is indeed the case. Note that in the general case
you don't know whether p or q is the shorter vector, and by how much.
This already makes it difficult to keep it a one-liner.
I would have suggested a new optional argument for filter() to request
the zero-padding, but filter() already has three optional args, so I
think that would be too confusing.
At the very least the convolve.inp sample script should point to the
cheat sheet solution or perhaps include it. This is of course something
I can easily do myself.
And BTW, slightly OT, to make one-liners like "r = filter(p |
zeros(rows(q)-1, 1), q)" more economical -and other code as well-
wouldn't it be good if the column number argument of zeros() became
optional with a default of 1, such that zeros(rows(q)-1) would be
equivalent to zeros(rows(q)-1, 1)?
(And the same for: ones(), mnormal(), muniform(), and possibly also