SCM

SCM Repository

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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2586 - (view) (download) (as text)

1 : bates 825 \name{externalFormats}
2 : bates 853 \docType{genericFunction}
3 : bates 825 \alias{readHB}
4 :     \alias{readMM}
5 : bates 2049 % \alias{writeHB}
6 : bates 853 \alias{writeMM}
7 : bates 2049 \alias{writeMM,CsparseMatrix-method}
8 :     \alias{writeMM,TsparseMatrix-method}
9 : bates 825 \title{Read and write external matrix formats}
10 :     \description{
11 : bates 853 Read matrices stored in the Harwell-Boeing or MatrixMarket formats
12 :     or write sparseMatrix objects to one of these formats.
13 : bates 825 }
14 :     \usage{
15 : bates 853 readHB(file)
16 :     readMM(file)
17 :     writeMM(obj, file, ...)
18 : bates 825 }
19 :     \arguments{
20 : bates 853 \item{obj}{a real sparse matrix}
21 : bates 1620 \item{file}{for \code{writeMM} - the name of the file to be written.
22 :     For \code{readHB} and \code{readMM} the name of the file to read, as
23 :     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 : mmaechler 2311 \code{".mtx"}.
27 : bates 853
28 : bates 1620 Alternatively, \code{readHB} and \code{readMM} accept connection objects.}
29 : bates 853 \item{\dots}{optional additional arguments. Currently none are used in
30 :     any methods.}
31 : bates 825 }
32 :     \value{
33 : bates 853 The \code{readHB} and \code{readMM} functions return an object that
34 : mmaechler 2311 inherits from the \code{"\linkS4class{Matrix}"} class. Methods for the
35 : bates 1620 \code{writeMM} generic functions usually return
36 : mmaechler 2311 \code{\link{NULL}} and, as a side effect, the matrix \code{obj} is
37 :     written to \code{file} in the MatrixMarket format (writeMM).
38 : bates 825 }
39 : bates 1620 \note{
40 :     The Harwell-Boeing format is older and less flexible than the
41 : bates 2049 MatrixMarket format. The function \code{writeHB} was deprecated and
42 : mmaechler 2311 has now been removed. Please use \code{writeMM} instead.
43 : bates 1620 }
44 : bates 825 \references{
45 :     \url{http://math.nist.gov/MatrixMarket}
46 : bates 826
47 :     \url{http://www.cise.ufl.edu/research/sparse/matrices}
48 : bates 825 }
49 : bates 826 \examples{
50 : bates 835 str(pores <- readMM(system.file("external/pores_1.mtx",
51 :     package = "Matrix")))
52 :     str(utm <- readHB(system.file("external/utm300.rua",
53 :     package = "Matrix")))
54 :     str(lundA <- readMM(system.file("external/lund_a.mtx",
55 :     package = "Matrix")))
56 :     str(lundA <- readHB(system.file("external/lund_a.rsa",
57 :     package = "Matrix")))
58 : bates 853 \dontrun{
59 : maechler 856 ## NOTE: The following examples take quite some time
60 :     ## ---- even on a fast internet connection:
61 : mmaechler 2327 if(FALSE) # the URL has been corrected, but we need an un-tar step!
62 : bates 857 str(sm <-
63 : mmaechler 2327 readHB(gzcon(url("http://www.cise.ufl.edu/research/sparse/RB/Boeing/msc00726.tar.gz"))))
64 :    
65 : bates 853 str(jgl009 <-
66 :     readMM(gzcon(url("ftp://math.nist.gov/pub/MatrixMarket2/Harwell-Boeing/counterx/jgl009.mtx.gz"))))
67 : bates 826 }
68 : maechler 1228 data(KNex)
69 :     writeMM(KNex$mm, "mmMM.mtx")
70 : bates 853 }
71 : bates 825 \keyword{IO}
72 : bates 853 \keyword{array}
73 : bates 825 \keyword{algebra}
74 :    

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