Luis -

I remember putting a lot of effort a few years ago into getting cat to do
the right thing for a number of scenarios, and to report the right error
when things failed. Over the course of this, I realized that you can use
pdl() to concatenate stuff in a way that more forgiving and which almost
always Does What You Mean. Because it is more relaxed, I recommend using it
instead of using cat unless you explicitly want the dimension checks that
cat is supposed to provide.

That said, ironing out these issues with cat is a Good Thing. :-)

David


On Sat, Mar 9, 2013 at 11:51 AM, Craig DeForest
<[email protected]>wrote:

> I would have to check, since I haven't used the complex code in donkey's
> years.  The current git should give the same answer as glue.  The
> constructor itself should do the Right thing - e.g. pdl(pdl(1),pdl(2*i)) -
> since it zero-pads short elements in its arg list.
>
> (Mobile)
>
>
> On Mar 9, 2013, at 10:38 AM, Luis Mochan <[email protected]> wrote:
>
> >> Thanks for the report -- fixed in git.
> > Thanks for fixing it so promptly!
> >
> > I haven't tried the new git version, but I found a related bug and a
> surprise:
> >    pdl> use PDL::Complex
> >    pdl> p cat(pdl(1),pdl(2*i))
> >    [1 2]
> > I guess this is the same bug as before.
> >    pdl> p cat(pdl(2*i), pdl(1))
> >    [0 +2i  1 +1i]
> > This may be suprising, as it might be expected that the real number
> > pdl(1) gets complexified to 1+0*i, but actually, the threading machine
> adds a
> > dummy dimension that converts pdl(1) to the vector [1,1] which is
> > interpreted as 1+1i. The relation between complex numbers and size 2
> > vectors has to be handled with care. What would the result of
> > cat(pdl(1),pdl(2*i)) using the current git version? [1+1i,0+2i] or
> > [1+0i,0,2i]?
> >
> > Best regards,
> > Luis
> >
> > _______________________________________________
> > 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
>



-- 
 "Debugging is twice as hard as writing the code in the first place.
  Therefore, if you write the code as cleverly as possible, you are,
  by definition, not smart enough to debug it." -- Brian Kernighan
_______________________________________________
Perldl mailing list
[email protected]
http://mailman.jach.hawaii.edu/mailman/listinfo/perldl

Reply via email to