in reply to Re^2: upper or lower triangular matrix to full
in thread upper or lower triangular matrix to full
If it is, the approach I would take using PDL is to pre-allocate a correctly-sized disk-based ndarray (so that RAM is not a limitation) using PDL::IO::FastRaw (untested), from perldl:
It looks like currently PDL::IO::Misc (with rcols) and PDL::IO::CSV don't have a facility to read into an existing (possibly disk-based) ndarray. It would still be possible, albeit slow, to read the file line-by-line, probably using Text::CSV_XS, using slice to insert each row into the ndarray.use PDL::IO::FastRaw; $pdl = mapfraw('fname', {Creat => 1, Dims => [460_000, 460_000], Datat +ype => double()});
Once the ndarray exists, to copy one triangle into the other would be super-easy using PDL::LinearAlgebra::Real#tricpy.
|
|---|