Re: hyper operators - appalling proposal

2002-07-15 Thread Christian Soeller
Trey Harris wrote: Yes. This is my fear of hyperoperation being the default for normal aggregates. Loops--and large, multiply-nested, potentially-infinite ones--can spring out of code that doesn't look loopy at all. Erm... you know what I mean. :-) Karl, do you have any objection to

Re: RFC 231 (v1) Data: Multi-dimensional arrays/hashes andslices

2000-09-21 Thread Christian Soeller
Karl Glazebrook wrote: Buddha Buck wrote: @x = 3 * $y[|i]; It's not as clean as @x = 3 * @y, but it is cleaner context-wise. And one could argue that: @x = map 3*^_, @y; is cleaner yet... PDL already allows $x = 3*$y why step backwards? Exactly. Those other

Re: RFC 225 (v1) Data: Superpositions

2000-09-14 Thread Christian Soeller
Damian Conway wrote: You can't, in serial implementation. But on a parallel architecture or, better still, on a quantum device, you can run all the computations in parallel. I see that. PDL has that as an experimental feature on any ufunc (in fact on any function that has a signature). It is

Re: reshape() (was Re: Fw: Wrapup time)

2000-09-13 Thread Christian Soeller
Jeremy Howard wrote: the maximum index of each dimension. A maximum index of '0' would mean that that dimension is 1 element wide. Therefore '0' can not be special in reshape(). Therefore we should use '-1'. -1 is the maximum index for any size in the usual fashion of perl array indexing.

Re: RFC 81 and broadcasting

2000-09-12 Thread Christian Soeller
Jeremy Howard wrote: To be honest, I don't really get the point of stuff like NumPy's "NewAxis", so I might be misunderstanding your proposal. But at least for your It's just another way to specify how implicit loops of a scalar operation are iterated over array elements (TIMTWTDI). Very

Re: logical ops on arrays and hashes

2000-09-12 Thread Christian Soeller
Jeremy Howard wrote: Removed -language x-post Wouldn't it be very useful if all of the applicable polymorphic methods of RFC 159 would be overloadable for nD arrays (arrays becoming effectively instances of array objects)? I am not sure if this has been discussed before but I could

RFC 81 and broadcasting

2000-09-12 Thread Christian Soeller
://numpy.sourceforge.net/numdoc/HTML/numdoc.html#pgfId-36371 -- Christian Soeller[EMAIL PROTECTED] x2770 Dept. of Physiology U. Auckland School of Medicine Auckland New Zealand

Re: logical ops on arrays and hashes

2000-09-12 Thread Christian Soeller
Jeremy Howard wrote: Of course they have reasonable meanings for arrays--element-wise operations (RFC 82): http://tmtowtdi.perl.org/rfc/82.html Any operation you can do on a scalar you should be able to do element-wise on a list, and certainly it's not hard to come up with situations

Re: $a in @b

2000-09-10 Thread Christian Soeller
Quantum::Superpositions provides this in a more flexible way by adding the 'any' and 'all' keywords. http://search.cpan.org/doc/DCONWAY/Quantum-Superpositions-1.03/lib/Quantum/ Superpositions.pm One of Damian Conway's many promised RFCs will cover

Re: n-dim matrices

2000-09-04 Thread Christian Soeller
Buddha Buck wrote: Tensor or Matrix Multidimensional list what should we call it? I'd vote for matrix myself. It's short and sweet Fine ;) Just have a section in the elusive overview RFC that defines what we mean by matrix, e.g. not only 2D objects of linear algebra. With all these

Re: Designing Perl 6 data crunching (was Re: n-dim matrices)

2000-08-31 Thread Christian Soeller
Jeremy Howard wrote: The 1st implementation of Perl 6 may not provide all the optimisations we've come to expect from our data crunching language of choice. For this reason maybe PDL will continue to exist independently in Perl 6 at least for a while, although a fair bit of rewriting will be

Re: n-dim matrices

2000-08-31 Thread Christian Soeller
Jeremy Howard wrote: I'd rather see the ';' be required, but the '(0..)' not be required, so you This is not good! There are a lot of routines where it is very useful to specify a slice as @a[0] that should work regardless how many dimensions @a really has. There are many instances in PDL

Re: n-dim matrices

2000-08-31 Thread Christian Soeller
Karl Glazebrook wrote: This also addresses one pain in current PDL which is the difficulty of multi-dim indexing. I like it, too ;) print $a[[0,0,0]];# literal ref list print $a[0;0;0]; # literal singleton ; list print $a[[$y,$y,$y]]; # variable-based ref list print

Re: Upcoming RFC's...

2000-08-31 Thread Christian Soeller
Buddha Buck wrote: RFC X+2: Retrieving Matrix dimensions Present @#matrix as analogous to $#array Discuss what $#matrix should return, as well as @#array What is @matrix in scaler context? (undef, anyone?) Number of elements? For sparse matrices number of non-zero elements? A

Re: n-dim matrices

2000-08-31 Thread Christian Soeller
Buddha Buck wrote: Would you go for: @a[$first;*]; @a[*;$last]; @a[$first;*;$last]? Say yes, and I'll add it tonight! Nice! I'd go as far as implying a trailing ';*' if omitted. I'm unsure if @a[*;$middle;*] has any reasonable interpretation. Probably just croak. Unless somebody

Re: Designing Perl 6 data crunching (was Re: n-dim matrices)

2000-08-30 Thread Christian Soeller
Jeremy Howard wrote: Baris wrote: First of all I know that perl syntax has limitations and I understand why the reasons of the new syntax proposals. And I think the syntax proposals are pretty good if you accept the syntax limitations. I don't think any of them do consider that if

Re: n-dim matrices

2000-08-30 Thread Christian Soeller
Jeremy Howard wrote: 14,17;...20,29). What if we created a new operator ';' that works within a list that creates a cartesian product?: (10:20:2; 11:30:3); # Cartesian product of 10:20:2 and 11:30:3 as a LOL A possible approach. Two issues: (1) others might argue that we should use a

Re: New variable type: matrix

2000-08-29 Thread Christian Soeller
Jeremy Howard wrote: Ditto. As I said yesterday, my current preferred option is that a list ref of list refs will also support a multidimensional indexing syntax. Furthermore, if it has a single basic data type and is declared ':compact' it should be stored in a contiguous block of memory.

Re: New variable type: matrix

2000-08-29 Thread Christian Soeller
Baris wrote: My motivation was to give more freedom to the developers of pdl so that they can freely create the syntax without worrying about the workarounds. Matlab, in my opinion, is much more natural to code than current pdl. It'd be interesting to hear what you dislike in particular.

Re: Access to the perl6 parser

2000-08-29 Thread Christian Soeller
Damian Conway wrote: Regardless, you can already do this in perl 5, and will undoubtedly be able to do it in perl 6, with source filters. (If Damian can write perl that looks like Latin or Klingon, then python ought to be simple... :) I have a module

Re: Access to the perl6 parser

2000-08-29 Thread Christian Soeller
Dan Sugalski wrote: Because source filters are: 1) Relatively new (5.005 IIRC, but I could be mis-remembering) 2) A bloody pain in the neck to write Lots of things could use 'em if they were easier to do. That's one of the goals of perl 6, I think. Are there any docs in perl 5.6

Re: New variable type: matrix

2000-08-28 Thread Christian Soeller
Doug Hunt wrote: What I meant to say (but failed, alas) was that I support the idea for a new perl variable type called compact array: $foo -- scalar @foo -- array %foo -- hash ^foo -- compact array (or whatever notation) I seem to remember that ^ was in the process of being

Re: RFC 148 (v1) Add reshape() for multi-dimensional array reshaping

2000-08-28 Thread Christian Soeller
Karl Glazebrook wrote: Consider @x[10:20, 20:40:2, 30:50] This ALMOST works in the current Perl. @x gives array context, then the , produces a list. I see a number of problems with the current (scalar) PDL objects being turned (essentially) into perl arrays in perl6. 1) How do you

Re: New variable type: matrix

2000-08-28 Thread Christian Soeller
Jeremy Howard wrote: Basically, I want to be able to create a list ref of list refs, specify a data type (eg 'int') and attributes of ':compact' or ':sparse', and have the As Dan Sugalski suggested it seems not a good idea to bring in the list of list ref into the proposal. Why does it have