DOKK / manpages / debian 12 / libpdl-ccs-perl / PDL::CCS::IO::MatrixMarket.3pm.en
MatrixMarket(3pm) User Contributed Perl Documentation MatrixMarket(3pm)

PDL::CCS::IO::MatrixMarket - Matrix Market Exchange Format text I/O for PDL::CCS::Nd

 use PDL;
 use PDL::CCS::Nd;
 use PDL::CCS::IO::MatrixMarket;
 $ccs = PDL::CCS::Nd->newFromWhich($which,$nzvals);
 ccs_writemm($ccs,"ccs.mm");     # write a sparse matrix market text file
 $ccs2 = ccs_readmm("ccs.mm");   # read a sparse matrix market text file
 $dense = random(10,10);         # ... also supported for dense piddles
 writemm($dense, "file.mm");     # write a dense matrix market text file
 $dense2 = readmm("file.mm");    # read a dense matrix market text file

Write a PDL::CCS::Nd object as a MatrixMarket sparse coordinate text file.

 ccs_writemm($ccs,$filename_or_fh)
 ccs_writemm($ccs,$filename_or_fh,\%opts)

Options %opts:

 start  => $i,      ##-- index of first element (like perl $[); default=1 for MatrixMarket compatibility
 header => $bool,   ##-- write embedded PDL::CCS::Nd header? (default=do)

Write a dense PDL as a MatrixMarket array text file.

 writemm($pdl,$filename_or_handle)
 writemm($pdl,$filename_or_handle,\%opts)

Options %opts: (none yet)

Read a Matrix Market sparse coordinate text file as a PDL::CCS::Nd object using PDL::IO::Misc::rcols().

 $ccs = ccs_readmm($filename_or_fh)
 $ccs = ccs_readmm($filename_or_fh,\%opts)

Options %opts:

 start  => $i,      ##-- index of first element (like perl $[); default=1 for MatrixMarket compatibility
 header => $bool,   ##-- attempt to read embedded CCS header from file (default=do)
 sorted => $bool,   ##-- assume input data is sorted (default=0)
 nomagic => $bool,  ##-- don't check for matrix market magic header (default:do)

Read a Matrix Market dense array text file as a dense pdl using PDL::IO::Misc::rcols().

 $pdl = readmm($fname)
 $pdl = readmm($fname,\%opts)

Options %opts:

 nomagic => $bool,  ##-- don't check for matrix market magic header (default:do)

Perl by Larry Wall.

PDL by Karl Glazebrook, Tuomas J. Lukka, Christian Soeller, and others.

Bryan Jurish <moocow@cpan.org>

Copyright (C) 2015-2022, Bryan Jurish. All rights reserved.

This package is free software, and entirely without warranty. You may redistribute it and/or modify it under the same terms as Perl itself.

perl, PDL, PDL::CCS::Nd, PDL::CCS::IO::FastRaw, PDL::CCS::IO::FITS, PDL::CCS::IO::LDAC, the matrix market format documentation at <http://math.nist.gov/MatrixMarket/formats.html> ...

2022-12-02 perl v5.36.0