On Fri, 11 Aug 2000, Nathan Wiger wrote:
> Let me make an observation, having done tons of matrix stuff: We're
> going to wind up with 200 functions, all of which essentially are doing
> special types of matrix operations.
>
> How about a matrix-like set of functions that interleaves and
> un-interleaves stuff however you like?
>
> matrix x2, @a, @b, @c; # interleave every 2
> unmatrix 3x2 @array; # 3x2 list groupings
>
> This would be able to handle any matrix construction with a "ROWSxCOLS"
> notation. If either ROWS or COLS was left out than a * (any number)
> would be used. Otherwise, the ROWSxCOLS would have to be fulfilled,
> with:
>
> 1. Less data than specified returning an error
>
> 2. More data than specified being discarded
>
> Not sure I like the names, or the syntax, but I'm sure we need a
> general-purpose mechanism here to do this.
>
> -Nate
>
I'm inclined to agree. We have `splice' for arrays and lists, which is
kind of like a swiss army knife, with `[un]shift', `pop', and `push' being
shortcuts to `splice' methods.
I'd imagine we can come up with a similar scheme for matrices and vectors
(not bit vectors, more like a slice of a matrix). How about `mop' (matrix
op), `swipe', and `wring'? :)
It's been a while since matrices for me to make any profound statements
here, other than to repeat what Nathan's already said: they need to be
flexible and usable for situations like the proposed `partition', `zip',
and `unzip'. If we're going to do "heavy" matrices (full support for
everything you find in Algebra II) we'd need functions for finding the
determinate, multiplying matrices, adding matrices, etc. It almost sounds
like it needs it's own struct type.
Between this an HOFN (higher-order function notation), it sounds like Perl
is starting to become much more math oriented! Maybe they'll start
teaching Perl 6 instead of Fortran for CS300, hmm?
--
Mike Pastore
[EMAIL PROTECTED]