Very nice with the threading!  At any rate,
the syntax of the original query seems more
like it should be something along the lines
of:

   $that($thisi) += 1

and not an addition to the index value
directly...

I've constructed some indaddND() routines
that wrap around calls to the underlying
indadd().  Part of the motivation of the
forall() construct is to more clearly and
simply support such constructs.

--Chris

Craig DeForest wrote:
> In fact, you can even just say
> 
>     indadd(1, $this, $that)
> 
> and the 1 is automatically promoted to PDL and then threaded over.
> 
> Again, nicely done, Chris.
> 
> On Jul 1, 2009, at 9:57 PM, Chris Marshall wrote:
> 
>> Does this do what you want?
>>
>> perldl> $this=pdl(3,4,5,5,5,5,5,5,5,5)
>>
>> perldl> p $this
>> [3 4 5 5 5 5 5 5 5 5]
>> perldl> $that = sequence(11)
>>
>> perldl> p $this
>> [3 4 5 5 5 5 5 5 5 5]
>> perldl> p $that
>> [0 1 2 3 4 5 6 7 8 9 10]
>> perldl> indadd($this->ones,$this,$that)
>>
>> perldl> p $that
>> [0 1 2 4 5 13 6 7 8 9 10]
>>
>> Hyer, Dr. Edward wrote:
>>> Hi PDL Wizards,
>>>
>>> perldl> $this=pdl(3,4,5,5,5,5,5,5,5,5)
>>> perldl> $that=pdl(0..10)
>>> perldl> $thisi=index($that,$this)
>>> perldl> $thisi += 1
>>> perldl> p $that
>>> [0 1 2 4 5 6 6 7 8 9 10]
>>>
>>> I was hoping for
>>> [0 1 2 4 5 13 6 7 8 9 10]
>>>
>>> Any suggestions for how I get this result?
>>>
>>> Thanks,
>>>
>>> --Edward H.

_______________________________________________
Perldl mailing list
[email protected]
http://mailman.jach.hawaii.edu/mailman/listinfo/perldl

Reply via email to