Nice solution.

I think the extra "qsort" on the end is a no-op, though, since "uniq"  
already sorts the elements.


On Sep 30, 2010, at 6:36 AM, Benjamin Schuster-Boeckler wrote:

> Hi Anders,
>
> $a->append($b)->uniq->qsort
>
> will do what you want.
>
> Ben
>
> On 30 Sep 2010, at 14:04, Anders Hartman wrote:
>
>> Hello,
>>
>> I'm trying to find a method to concatenate two 1D-piddles into a  
>> new one
>> containing all the values (unique) of the input piddles. Example
>>
>> $a = pdl( 0,2,4,6 )
>> $b = pdl( 1,2,3,4,5 )
>>
>> $result      [ 0 1 2 3 4 5 6 ]
>>
>> setops($a,'OR',$b) should do it, but blows me away if $a and $b don't
>> have the same # of elements.
>> ----------------------
>> PDL:  PDL::Ops::assgn(a,b): Parameter 'b'
>> PDL:  Mismatched implicit thread dimension 0: should be 5, is 4
>> ----------------------
>> Suggestions?
>>
>> /Anders Hartman
>>
>>
>> _______________________________________________
>> Perldl mailing list
>> [email protected]
>> http://mailman.jach.hawaii.edu/mailman/listinfo/perldl
>
> --
> Benjamin Schuster-Böckler
> Frundsbergstrasse 23a
> 82064 Strasslach
> Deutschland
>
>
>
> _______________________________________________
> Perldl mailing list
> [email protected]
> http://mailman.jach.hawaii.edu/mailman/listinfo/perldl
>


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

Reply via email to