You can get interesting combinations of failures and successes:
print pdl([(0)x13], zeroes 9); # fails
print pdl([(0)x13], zeroes 1); # kind of succeeds
print pdl([(0)x11], zeroes 10); # fails
print pdl(zeroes(11),[(0)x10]); # succeeds
print pdl([(0)x9], zeroes 10); # succeeds
print pdl(zeroes(99),zeroes(98)); # fails
print pdl(zeroes(98),zeroes(99)); # succeeds
print pdl(zeroes(6),[(0)x5]); # succeeds
At least that's for i386, ubuntu, glibc 2.3.6
David's test program should have given him about 990 unwanted zero vectors.
On 7/17/06, Karl Glazebrook <[EMAIL PROTECTED]> wrote:
This line
$x = pdl($x,$tmpx)->flat;
when I run your script $x has 1000 elements and $tmpx has 10. I am
not sure pdl() has
a defined behaviour in this case. The docs don't even mention the two
piddle args case.
Perhaps what you want is -
$x = append($x, $tmpx);
Karl
On Jul 17, 2006, at 5:21 PM, David Whysong wrote:
> Hi all,
>
> I'm having a problem with part of a script that does monte-carlo
> statistics. I'm trying to generate a sample of randomly oriented unit
> vectors (in 3D space) which has a total number $npoints which is
> evenly divisible by $n after excluding some of the sample, based on
> orientation.
>
> (For those astronomers on the list: I'm trying to model radio galaxies
> in the unified model, excluding quasars, using a 40 degree opening
> angle for the obscuring torus.)
>
> I'm seeing errors of this sort:
> *** glibc detected *** /usr/bin/perl: free(): invalid pointer:
> 0x09124568 ***
> (or, sometimes)
> *** glibc detected *** malloc(): memory corruption: 0x094da180 ***
>
> A simplified version of my script which demonstrates the problem is
> attached. I'm not sure if I'm doing something stupid of if this is a
> bug in PDL.
>
> Any suggestions as to how I can make this work would be greatly
> appreciated.
>
> --
> David Whysong
> <test.pl>
> _______________________________________________
> 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
--
Bill Coffman
~~~_\\\|/
~~~-(@ @)
=oOO=(_)==OOo===
_______________________________________________ Perldl mailing list [email protected] http://mailman.jach.hawaii.edu/mailman/listinfo/perldl
