Hello,

I recently recoded some of my old scripts to use the PDL libraries instead
of some subroutines I had written myself.  These scripts were for doing
matrix inversion and matrix manipulation for medium sized matrices of
complex numbers (~350x350 max matrix size). These matrices are housed in
plain text files, and I have a parser that goes through and builds a piddle
out of the data in the file.  My old subroutines were slow to do the
processing, but were extremely fast for reading in the file and creating
the matrix.  The new subroutine, using PDL, is extremely fast to do the
processing, but now it is crazy slow for reading in the file and creating
the initial PDL.  My method for creating the PDL is shown below.  Can
anyone please let me know if there's a faster way to do this?  Almost all
of the time savings I've achieved by going to PDL have been consumed by the
slower file parsing and PDL building.  I've run the code through a
profiler, and it's definitely wasting a lot of cycles on the 3rd line in
the while loop where I'm creating the cplx data structure.

open (FILE, "$input_file") or die;
while($inline1=<FILE>){
chomp $inline1;
@data = split(/\s+/, $inline1);
$zmatrix_pre[$row][$column] = cplx($data[0]+$data[1]*i);
}

Thanks for any help!
-Ben
------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
_______________________________________________
pdl-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pdl-general

Reply via email to