On Mon, Oct 22, 2012 at 8:45 AM, MARK BAKER <[email protected]> wrote:
> Thanks Clifford > > That may be very helpfull, I was looking at trying to enable > "PDL::BIGPDL" yet all all found in my "path search" was a cpan build > in a (hash.c) file does that mean that I have to build PDL > manually and change the (hash.c) file before I build it ??? > > Thanks > > -Mark > > No, there are no compiler options in PDL for higher precision. PDL's precision matches your machine's internal precision as exposed through the basic C data types, and nothing more. Arbitrary precision is possible in Perl with the Math::BigFloat <http://perldoc.perl.org/Math/BigFloat.html>, but this is not supported by PDL. To get arbitrary precision in PDL, you would either have to (1) create a PDL equivalent of Matlab's cell array<http://www.mathworks.com/help/matlab/cell-arrays.html>and then store Math::BigFloats in said cell arrays, or (2) write a derived PDL class that wraps a C arbitrary precision library. Neither of these are trivial, and they are left as an exercise to the enthusiastic reader. :-) Also, neither of these will play efficiently (if at all) with standard operations defined using PDL's threading engine, which is probably why none of the PDL core hackers have picked them up yet. In my mind, cell arrays are important and not terribly difficult to implement for somebody with strong knowledge of PDL::PP. It would involve creating a new PDL data type which might be called "pointer" to go alongside the seven other types including the familiar "byte", "long", "double", etc. Then one would have to create a method to call arbitrary Perl functions in a PDL fast-looping method on arbitrary collections of PDLs of type "pointer". This would be the tricky part. But it's doable and could be quite helpful. All of this, I think, would be useful not so much for the speed gain one might have (as that is likely to be trivial compared with a traditional Perl "map") but rather for the conciseness and automagic thread logic that could be had. Hope that helps. Sorry for the negative answer. David -- "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
