NAME
PDL::CCS::IO::PETSc - PETSc-compatible I/O for PDL::CCS::Nd
SYNOPSIS
use PDL;use PDL::CCS::Nd;use PDL::CCS::IO::PETSc;##-- sparse 2d matrix$ccs = PDL::CCS::Nd->newFromWhich($which,$nzvals);ccs_wpetsc($ccs,"ccs.petsc"); # write a sparse binary PETSc file$ccs2 = ccs_rpetsc("ccs.petsc"); # read a sparse binary PETSc file
I/O Utilities
ccs_wpetsc
Write a 2d PDL::CCS::Nd matrix in PETSc sparse binary format.
ccs_wpetsc($ccs,$filename_or_fh)ccs_wpetsc($ccs,$filename_or_fh,\%opts)
Options %opts:
class_id => $int, ##-- PETSc MAT_FILE_CLASSID (default=1211216; see petsc/include/petscmat.h)pack_int => $pack, ##-- pack template for PETSc integers (default='N')pack_val => $pack, ##-- pack template for PETSc values (default='d>')ioblock => $size, ##-- I/O block size (default=8192)
ccs_rpetsc
REad a 2d PDL::CCS::Nd matrix from PETSc sparse binary format.
$ccs = ccs_rpetsc($filename_or_fh)$ccs = ccs_rpetsc($filename_or_fh,\%opts)
Options %opts:
pack_int => $pack, ##-- pack template for PETSc integers (default='N')pack_val => $pack, ##-- pack template for PETSc values (default='d>')ioblock => $size, ##-- I/O block size (default=8192)type => $type, ##-- value type to return (default: double)sorted => $bool, ##-- assume input is lexicographically sorted (only if not transposted; default=do)flags => $flags, ##-- flags for new ccs object (default=$PDL::CCS::Nd::CCSND_FLAGS_DEFAULT)
ACKNOWLEDGEMENTS
Perl by Larry Wall.
PDL by Karl Glazebrook, Tuomas J. Lukka, Christian Soeller, and others.
AUTHOR
Bryan Jurish <[email protected]>
Copyright Policy
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::MatrixMarket, PDL::CCS::IO::LDAC, the PETSc binary matrix format definition at <http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Mat/MatLoad.html>, the PETSc homepage at <http://www.mcs.anl.gov/petsc/>. ...