Read External Matrix Formats
import.Rd
Read matrices stored in the Harwell-Boeing or MatrixMarket formats.
Details
The names of files storing matrices in the
Harwell-Boeing format usually end in ".rua"
or ".rsa"
.
Those storing matrices in the MatrixMarket format usually end in
".mtx"
.
Currently, only real assembled Harwell-Boeing can be read with
read.HB
. Reading MatrixMarket formats is more flexible.
However, as entries of spam
matrices are of mode double
,
integers matrices are coerced to doubles, patterns lead to matrices
containing ones and complex are coerced to the real part thereof. In
these aforementioned cases, a warning is issued.
MatrixMarket also defines an array format, in which case a (possibly)
dense spam
object is return (retaining only elements which are
larger than options('spam.eps')
. A warning is issued.
Note
The functions are based on readHB
and readMM
from
the library Matrix
to build the connection and read the raw
data.
At present, read.MM
is more flexible than readMM
.
Author
Reinhard Furrer based on Matrix
functions by
Douglas Bates bates@stat.wisc.edu and Martin Maechler maechler@stat.math.ethz.ch
Examples
if (FALSE) { # \dontrun{
image(read.MM(gzcon(url(
"ftp://math.nist.gov/pub/MatrixMarket2/Harwell-Boeing/bcspwr/bcspwr01.mtx.gz"))))
} # }
if (FALSE) { # \dontrun{
## Datasets supplied within Matrix
str(read.MM(system.file("external/pores_1.mtx",package = "Matrix")))
str(read.HB(system.file("external/utm300.rua", package = "Matrix")))
str(read.MM(system.file("external/lund_a.mtx", package = "Matrix")))
str(read.HB(system.file("external/lund_a.rsa", package = "Matrix")))
} # }