SCM

SCM Repository

[matrix] Diff of /pkg/Matrix/man/externalFormats.Rd
ViewVC logotype

Diff of /pkg/Matrix/man/externalFormats.Rd

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

pkg/man/externalFormats.Rd revision 825, Sun Aug 7 15:22:33 2005 UTC pkg/Matrix/man/externalFormats.Rd revision 2675, Sat Jun 11 15:11:24 2011 UTC
# Line 1  Line 1 
1  \name{externalFormats}  \name{externalFormats}
2  \alias{readHB}  \alias{readHB}
3  \alias{readMM}  \alias{readMM}
4    % \alias{writeHB}
5    \alias{writeMM}
6    \alias{writeMM,CsparseMatrix-method}
7    \alias{writeMM,TsparseMatrix-method}
8  \title{Read and write external matrix formats}  \title{Read and write external matrix formats}
9  \description{  \description{
10      Read matrices stored in the Harwell-Boeing or MatrixMarket formats.    Read matrices stored in the Harwell-Boeing or MatrixMarket formats
11      or write \code{\linkS4class{sparseMatrix}} objects to one of these
12      formats.
13  }  }
14  \usage{  \usage{
15  readHB(filename)  readHB(file)
16  readMM(filename)  readMM(file)
17    writeMM(obj, file, ...)
18  }  }
19  \arguments{  \arguments{
20    \item{filename}{the name of the file to read, as a character scalar.   \item{obj}{a real sparse matrix}
21      The names of files storing matrices in the Harwell-Boeing format   \item{file}{for \code{writeMM} - the name of the file to be written.
22      usually end in \code{".rua"} or \code{".rsa"}.  Those storing     For \code{readHB} and \code{readMM} the name of the file to read, as
23      matrices in the MatrixMarket format usually end in {".mtx"}.}     a character scalar.  The names of files storing matrices in the
24       Harwell-Boeing format usually end in \code{".rua"} or \code{".rsa"}.
25       Those storing matrices in the MatrixMarket format usually end in
26       \code{".mtx"}.
27    
28       Alternatively, \code{readHB} and \code{readMM} accept connection objects.}
29     \item{\dots}{optional additional arguments. Currently none are used in
30       any methods.}
31  }  }
32  \value{  \value{
33    An object that inherits from the \code{"Matrix"} class.    The \code{readHB} and \code{readMM} functions return an object that
34      inherits from the \code{"\linkS4class{Matrix}"} class.  Methods for the
35      \code{writeMM} generic functions usually return
36      \code{\link{NULL}} and, as a side effect, the matrix \code{obj} is
37      written to \code{file} in the MatrixMarket format (writeMM).
38    }
39    \note{
40      The Harwell-Boeing format is older and less flexible than the
41      MatrixMarket format.  The function \code{writeHB} was deprecated and
42      has now been removed.  Please use \code{writeMM} instead.
43    
44      A very simple way to export small sparse matrices \code{S}, is to use
45      \code{summary(S)} which returns a \code{\link{data.frame}} with
46      columns \code{i}, \code{j}, and possibly \code{x}, see \code{summary} in
47      \code{\link{sparseMatrix-class}}, and an example below.
48  }  }
49  \references{  \references{
50    \url{http://math.nist.gov/MatrixMarket}    \url{http://math.nist.gov/MatrixMarket}
51    
52      \url{http://www.cise.ufl.edu/research/sparse/matrices}
53    }
54    \examples{
55    str(pores <- readMM(system.file("external/pores_1.mtx",
56                                    package = "Matrix")))
57    str(utm <- readHB(system.file("external/utm300.rua",
58                                   package = "Matrix")))
59    str(lundA <- readMM(system.file("external/lund_a.mtx",
60                                    package = "Matrix")))
61    str(lundA <- readHB(system.file("external/lund_a.rsa",
62                                    package = "Matrix")))
63    \dontrun{
64    ## NOTE: The following examples take quite some time
65    ## ----  even on a fast internet connection:
66    if(FALSE) # the URL has been corrected, but we need an un-tar step!
67    str(sm <-
68     readHB(gzcon(url("http://www.cise.ufl.edu/research/sparse/RB/Boeing/msc00726.tar.gz"))))
69    
70    str(jgl009 <-
71     readMM(gzcon(url("ftp://math.nist.gov/pub/MatrixMarket2/Harwell-Boeing/counterx/jgl009.mtx.gz"))))
72    }
73    data(KNex)
74    writeMM(KNex$mm, "mmMM.mtx")
75    
76    ## very simple export - in triplet format - to text file:
77    s.CA <- summary(CAex)
78    message("writing to ", outf <- tempfile())
79    write.table(s.CA, file = outf, row.names=FALSE)
80  }  }
81  \keyword{IO}  \keyword{IO}
82    \keyword{array}
83  \keyword{algebra}  \keyword{algebra}
84    

Legend:
Removed from v.825  
changed lines
  Added in v.2675

root@r-forge.r-project.org
ViewVC Help
Powered by ViewVC 1.0.0  
Thanks to:
Vienna University of Economics and Business University of Wisconsin - Madison Powered By FusionForge