NAME

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

SYNOPSIS

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

I/O Utilities

ccs_writemm

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)

writemm

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)

ccs_readmm

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)

readmm

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)

ACKNOWLEDGEMENTS

Perl by Larry Wall.

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

AUTHOR

Bryan Jurish <moocow@cpan.org>

Copyright (C) 2015-2024, 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.

SEE ALSO

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 ...