Commit 6a5c1447 authored by Reinhard Furrer's avatar Reinhard Furrer

v2.2-0

parent f046e1cd
Package: spam
Type: Package
Title: SPArse Matrix
Version: 2.1-2
Date: 2017-12-21
Version: 2.2-0
Date: 2018-06-19
Authors@R: c(person("Reinhard", "Furrer", role = c("aut", "cre"),
email = "reinhard.furrer@math.uzh.ch"),
person("Florian", "Gerber", role = c("ctb"),
email = "florian.gerber@math.uzh.ch"),
person("Daniel", "Gerber", role = "ctb",
email = "daniel_gerber_2222@hotmail.com"),
email = "florian.gerber@math.uzh.ch"),
person("Roman", "Flury", role = c("ctb"),
email = "roman.flury@math.uzh.ch"),
person("Daniel", "Gerber", role = "ctb",
email = "daniel_gerber_2222@hotmail.com"),
person("Kaspar", "Moesinger", role = "ctb",
email = "kaspar.moesinger@gmail.com"),
email = "kaspar.moesinger@gmail.com"),
person("Youcef", "Saad", role = "ctb",
comment = "SPARSEKIT http://www-users.cs.umn.edu/~saad/software/SPARSKIT/"),
comment = "SPARSEKIT http://www-users.cs.umn.edu/~saad/software/SPARSKIT/"),
person(c("Esmond", "G."), "Ng", role = "ctb",
comment = "Fortran Cholesky routines"),
comment = "Fortran Cholesky routines"),
person(c("Barry", "W."), "Peyton", role = "ctb",
comment = "Fortran Cholesky routines"),
comment = "Fortran Cholesky routines"),
person(c("Joseph", "W.H."), "Liu", role = "ctb",
comment = "Fortran Cholesky routines"),
comment = "Fortran Cholesky routines"),
person(c("Alan", "D."), "George", role = "ctb",
comment = "Fortran Cholesky routines")
)
comment = "Fortran Cholesky routines"),
person(c("Lehoucq", "B."), "Rich", role = "ctb",
comment = "ARPACK"),
person(c("Maschhoff"), "Kristi", role = "ctb",
comment = "ARPACK"),
person(c("Sorensen", "C."), "Danny", role = "ctb",
comment = "ARPACK"),
person(c("Yang"), "Chao", role = "ctb",
comment = "ARPACK"))
Depends:
R (>= 3.1),
dotCall64,
......@@ -42,7 +51,6 @@ Description: Set of functions for sparse matrix algebra.
(2) based on transparent and simple structure(s),
(3) tailored for MCMC calculations within G(M)RF.
(4) and it is fast and scalable (with the extension package spam64).
LazyLoad: Yes
LazyData: Yes
License: LGPL-2
LazyData: true
License: LGPL-2 | BSD_3_clause + file LICENSE
URL: https://git.math.uzh.ch/reinhard.furrer/spam
......@@ -106,6 +106,7 @@ export(
"determinant.spam",
"determinant.spam.chol.NgPeyton",
"det",# << "identical" as base - but with correct determinant()
"chol.spam",
"solve.spam",
"forwardsolve.spam",
......@@ -174,7 +175,8 @@ export(
"bdiag.spam",
"var.spam",
"eigen.spam",
"eigen.spam",
"eigen_approx",
"bandwidth",
......
......@@ -369,7 +369,7 @@ setMethod("t","spam",t.spam)
stop("argument 'x' should be of mode 'numeric' (or 'spam')")
as.spam.spam <- function(x, eps = getOption("spam.eps")) {
force64 <- getOption("spam.force64")
force64 <- getOption("spam.force64")
if(force64)
SS <- .format64()
......@@ -396,7 +396,8 @@ as.spam.spam <- function(x, eps = getOption("spam.eps")) {
nz <- z$rowpointers[dimx[1]+1]-1
if(nz==0) {
return(.newSpam(
dimension=dimx
dimension=dimx,
force64 = force64
))
}
......@@ -466,7 +467,7 @@ as.spam.matrix <- function(x, eps = getOption("spam.eps")) {
"as.spam.numeric" <- function(x, eps = getOption("spam.eps")) {
if (eps<.Machine$double.eps) stop("'eps' should not be smaller than machine precision",call.=FALSE)
force64 = getOption("spam.force64")
force64 <- getOption("spam.force64")
poselements <- (abs(x)>eps)
if (any(!is.finite(x))) {
......@@ -479,7 +480,7 @@ as.spam.matrix <- function(x, eps = getOption("spam.eps")) {
if (identical(nz,0)){
return(
.newSpam(
rowpointers = c(1,rep_len64(2,lx)),
# rowpointers = c(1,rep_len64(2,lx)),
dimension = c(lx,1),
force64 = force64
)
......@@ -506,7 +507,9 @@ as.spam.dist <- function(x, eps = getOption("spam.eps")) {
dimx <- attr(x,"Size")
size <- dimx*(dimx-1)/2
if( getOption("spam.force64") || dimx^2 > 2147483647)
force64 <- getOption("spam.force64")
if(force64 || dimx^2 > 2147483647)
SS <- .format64()
else
SS <- .format32
......@@ -532,15 +535,18 @@ as.spam.dist <- function(x, eps = getOption("spam.eps")) {
PACKAGE = SS$package
)
nz <- z$rowpointers[dimx+1]-1
if(nz==0) return( .newSpam( rowpointers = c( 1, rep( 2, dimx)),
dimension = c( dimx, dimx)))
if(nz==0) return( .newSpam(
# rowpointers = c( 1, rep( 2, dimx)),
dimension = c( dimx, dimx),
force64 = force64))
return(.newSpam(
entries=z$entries[1:nz],
colindices=z$colindices[1:nz],
rowpointers=z$rowpointers[1:(dimx+1)],
dimension=c(dimx,dimx)
dimension=c(dimx,dimx),
force64 = force64
))
}
......@@ -622,7 +628,8 @@ spam.numeric <- function(x, nrow = 1, ncol = 1, eps = getOption("spam.eps")) {
return( .newSpam( entries = entries,
colindices = colindices,
rowpointers = rowpointers,
dimension = dimx))
dimension = dimx,
force64 = force64))
}
setOldClass(c("dist", "numeric"))
......@@ -1141,7 +1148,7 @@ function (x, rw, cl,value)
yrow,
ycol,
y,
y = vector_dc("double",nrow*ycol),
x@entries,
x@colindices,
......@@ -1241,51 +1248,46 @@ function (x, rw, cl,value)
if(nz==0){#trap zero matrix
z$entries <- 0
z$colindices <- 1
z$rowpointers <- c(1,rep(2,xn))
} else {
entries <- z$entries
colindices <- z$colindices
rowpointers <- z$rowpointers
z <- NULL
length(entries) <- nz
length(colindices) <- nz
z <- .C64("sortrows",
SIGNATURE=c(SS$signature, "double", SS$signature, SS$signature),
xn,
entries=entries,
colindices=colindices,
rowpointers=rowpointers,
INTENT=c("r", "rw", "rw", "rw"),
NAOK = getOption("spam.NAOK"),
PACKAGE = SS$package)
return(.newSpam(
dimension=c(xn,yl)
))
}
entries <- z$entries
colindices <- z$colindices
rowpointers <- z$rowpointers
z <- NULL
length(colindices) <- nz
entries <- z$entries
colindices <- z$colindices
rowpointers <- z$rowpointers
z <- NULL
length(entries) <- nz
length(colindices) <- nz
z <- .C64("sortrows",
SIGNATURE=c(SS$signature, "double", SS$signature, SS$signature),
xn,
entries=entries,
colindices=colindices,
rowpointers=rowpointers,
INTENT=c("r", "rw", "rw", "rw"),
NAOK = getOption("spam.NAOK"),
PACKAGE = SS$package)
return(.newSpam(
entries=entries,
colindices=colindices,
rowpointers=rowpointers,
entries=z$entries,
colindices=z$colindices,
rowpointers=z$rowpointers,
dimension=c(xn,yl)
))
}
.spam.matmul.vector <- function(x,y)
{
# --- CHANGED ---
# Refactored the function .spam.matmul into the functions
# .spam.matmul and .spam.matmul.vector
# if we have x*Y, we calculate t(t(Y)*x)
# Use "is.spam(y)" instead of "is.vector(x)" because the later might be
# misleading in case that x has any attributes attached.
......@@ -1297,26 +1299,26 @@ function (x, rw, cl,value)
b <- y
}
SS <- .format.spam(A)
nrow <- A@dimension[1]
ncol <- A@dimension[2]
if(length(b) != ncol) stop("not conformable for multiplication")
z <- .C64("amux",
NAOK = getOption("spam.NAOK"),
SIGNATURE=c(SS$signature, "double", "double", "double",
SS$signature, SS$signature),
nrow,
b,
y = vector_dc("double",nrow),
A@entries,
A@colindices,
A@rowpointers,
INTENT=c("r", "r", "w", "r", "r", "r"),
PACKAGE = SS$package)$y
if(is.spam(y))
dim(z) <- c(1,nrow)
else
......
......@@ -117,9 +117,9 @@
## print("2")
return(
.newSpam(
entries=x@entries,
colindices=x@colindices,
rowpointers=c(1,rep_len64(2,value[1])),
# entries=x@entries,
# colindices=x@colindices,
# rowpointers=c(1,rep_len64(2,value[1])),
dimension=value,
force64=force64
)
......
......@@ -66,6 +66,8 @@ nearest.dist <- function( x, y=NULL, method = "euclidean",
if (is.na(method)) stop("invalid distance method")
force64 <- getOption("spam.force64")
if (method == 4) {
if (is.null(R))
p <- ifelse( miles,3963.34,6378.388)
......@@ -115,7 +117,7 @@ nearest.dist <- function( x, y=NULL, method = "euclidean",
}
# EXPLICIT-STORAGE-FORMAT
if(max(n1,n2,nnz) > 2147483647 - 1 | getOption("spam.force64"))
if(max(n1,n2,nnz) > 2147483647 - 1 || force64)
SS <- .format64()
else
SS <- .format32
......@@ -161,7 +163,7 @@ nearest.dist <- function( x, y=NULL, method = "euclidean",
nnz <- nnz*getOption("spam.nearestdistincreasefactor")*n1/(d$iflag-1)
# EXPLICIT-STORAGE-FORMAT
if(max(n1,n2,nnz) > 2147483647 - 1 | getOption("spam.force64"))
if(max(n1,n2,nnz) > 2147483647 - 1 || force64)
SS <- .format64()
else
SS <- .format32
......@@ -180,11 +182,19 @@ nearest.dist <- function( x, y=NULL, method = "euclidean",
length(d$entries) <- d$nnz
length(d$colindices) <- d$nnz
if(d$nnz == 0) {
return(.newSpam(
dimension=c(n1,n2),
force64 = force64
))
}
return(.newSpam(
entries=d$entries,
colindices=d$colindices,
rowpointers=d$rowpointers,
dimension=c(n1,n2)
dimension=c(n1,n2),
force64 = force64
))
}
......
This diff is collapsed.
......@@ -157,15 +157,15 @@ map.landkreis <- function(data, col=NULL, zlim=range(data), add=FALSE, legendpos
germany.plot <- function(vect, col=NULL, zlim=range(vect), legend=TRUE,
main=NULL, cex.axis=1, add=FALSE, ... )
germany.plot <- function(vect, col=NULL, zlim=range(vect), legend=TRUE,
main=NULL, cex.axis=1, cex.main=1.5, add=FALSE, ... )
{
if (length(vect) != spam::germany.info$n)
if (length(vect) != spam::germany.info$n)
stop("data has wrong length")
if (!add) {
par(mai=c(.1,.1,.1,.3))
plot(0,0, xlim=spam::germany.info$xlim, ylim=spam::germany.info$ylim,
plot(0,0, xlim=spam::germany.info$xlim, ylim=spam::germany.info$ylim,
type = "n", axes = F, xlab = "", ylab = "")
}
if (is.null(col)) {
......@@ -173,22 +173,22 @@ germany.plot <- function(vect, col=NULL, zlim=range(vect), legend=TRUE,
col <- c("#F7FBFF", "#F4F9FE", "#F2F8FD", "#F0F7FD", "#EEF5FC", "#ECF4FB", "#EAF3FB", "#E8F1FA", "#E6F0F9", "#E4EFF9", "#E2EEF8", "#E0ECF7", "#DEEBF7", "#DCEAF6", "#DAE8F5", "#D8E7F5", "#D6E6F4", "#D5E5F4", "#D3E3F3", "#D1E2F2", "#CFE1F2", "#CDDFF1", "#CBDEF0", "#C9DDF0", "#C7DBEF", "#C5DAEE", "#C1D9ED", "#BED7EC", "#BBD6EB", "#B8D5EA", "#B5D3E9", "#B1D2E7", "#AED1E6", "#ABCFE5", "#A8CEE4", "#A4CCE3", "#A1CBE2", "#9ECAE1", "#9AC8E0", "#96C5DF", "#92C3DE", "#8EC1DD", "#89BEDC", "#85BCDB", "#81BADA", "#7DB8DA", "#79B5D9", "#75B3D8", "#71B1D7", "#6DAFD6", "#69ACD5", "#66AAD4", "#62A8D2", "#5FA6D1", "#5CA3D0", "#58A1CE", "#559FCD", "#529DCC", "#4E9ACB", "#4B98C9", "#4896C8", "#4493C7", "#4191C5", "#3E8EC4", "#3C8CC3", "#3989C1", "#3686C0", "#3484BE", "#3181BD", "#2E7EBC", "#2C7CBA", "#2979B9", "#2776B8", "#2474B6", "#2171B5", "#1F6FB3", "#1D6CB1", "#1B69AF", "#1967AD", "#1764AB", "#1562A9", "#135FA7", "#115CA5", "#0F5AA3", "#0D57A1", "#0B559F", "#09529D", "#084F9A", "#084D96", "#084A92", "#08478E", "#08458A", "#084286", "#083F82", "#083D7E", "#083A7A", "#083776", "#083572", "#08326E", "#08306B")
}
ncol <- length(col)
polycol <- (col)[round((((vect) - zlim[1])/diff(zlim) + 1e-06) *
polycol <- (col)[round((((vect) - zlim[1])/diff(zlim) + 1e-06) *
(ncol - 1)) + 1]
polygon( spam::germany.poly[17965L:1L,],
col = (polycol[spam::germany.info$polyid])[599L:1L], ...)
col = (polycol[spam::germany.info$polyid])[599L:1L], ...)
if (legend&&requireNamespace("fields", quietly = TRUE)){
legendpos <- c(0.845, 0.89, 0.05, 0.4)
fields::image.plot(as.matrix(vect), zlim = zlim, legend.only = TRUE,
fields::image.plot(as.matrix(vect), zlim = zlim, legend.only = TRUE,
smallplot = legendpos, axis.args=list(cex.axis=cex.axis,lwd=0, lwd.ticks=1.3),
col = col)
}
if(!is.null(main))
text( min(spam::germany.info$xlim), max(spam::germany.info$ylim), main, cex=1.5, adj=c(0,1))
text( min(spam::germany.info$xlim), max(spam::germany.info$ylim), main, cex=cex.main, adj=c(0,1))
invisible()
}
......
......@@ -17,13 +17,6 @@
# Alan D. George [ctb] (Fortran Cholesky routines) #
# HEADER END ################################################
eigen.spam <- function(x, ...) {
inefficiencywarning( "This 'eigen' operation may be inefficient", prod(dim(x)))
eigen(as.matrix(x), ...)
}
var.spam <- function(x, ...) {
inefficiencywarning( "This 'var' operation may be inefficient", prod(dim(x)))
var(as.matrix(x), ...)
......
......@@ -1098,6 +1098,11 @@ determinant.spam.chol.NgPeyton <- function(x, logarithm = TRUE,...)
setMethod("determinant","spam", determinant.spam)
setMethod("determinant","spam.chol.NgPeyton", determinant.spam.chol.NgPeyton)
## The ``Right Thing'' to do :
## base::det() calls [base::]determinant();
## our det() should call our determinant() :
det <- base::det
environment(det) <- environment()## == asNamespace("Matrix")
######################################################################
########################################################################
......
......@@ -74,8 +74,9 @@ spam.list <- function(x, nrow, ncol, eps = getOption("spam.eps")) {
if (nz == 0)
return(.newSpam(
rowpointers = c(1,rep_len64(2, nrow)),
dimension = c(nrow,ncol)))
# rowpointers = c(1,rep_len64(2, nrow)),
dimension = c(nrow,ncol),
force64 = force64))
if (any( ir <= 0) || any( jc <= 0))
stop("Indices need to be positive")
if (any(!is.finite(x[[elenr]]))) {
......@@ -130,8 +131,9 @@ spam.list <- function(x, nrow, ncol, eps = getOption("spam.eps")) {
## if (identical(z$nz, 0)){
## print("special case")
return(.newSpam(
rowpointers = c(1, rep_len64(2,nrow)),
dimension = c(nrow, ncol)))
# rowpointers = c(1, rep_len64(2,nrow)),
dimension = c(nrow, ncol),
force64 = force64))
## return(new("spam",rowpointers=c(1L,rep.int(2L,nrow)), dimension=c(nrow,ncol)))
}
......@@ -145,7 +147,8 @@ spam.list <- function(x, nrow, ncol, eps = getOption("spam.eps")) {
entries = z$entries[1:z$nz],
colindices = z$colindices[1:z$nz],
rowpointers = z$rowpointers,
dimension = c(nrow,ncol)))
dimension = c(nrow,ncol),
force64 = force64))
}
setMethod("as.spam", "list", as.spam.list) # { function(x,eps) spam.list(x,eps=eps)})
......
......@@ -25,7 +25,9 @@
{
if (!(is.vector(x)|is.list(x)) )
stop("'x' is not a vector or a list")
force64 <- getOption("spam.force64")
if( is.list(x)) {
if (!identical(length(x),2L))
stop("Argument 'x' needs to be a list with two elements")
......@@ -47,8 +49,9 @@
len <- as.integer(length( ind)[1]) # see ?length@value
if(identical(len,0))
return(.newSpam(
rowpointers = c(1, rep_len64(2, n)),
dimension = c(n, n)))
# rowpointers = c(1, rep_len64(2, n)),
dimension = c(n, n),
force64 = force64))
# subroutine circulant(nrow,len, x,j, a,ja,ia)
nz <- n*len
## z <- .Fortran("circulant",
......@@ -61,7 +64,7 @@
## rowpointers = vector("integer", n + 1),
## NAOK = getOption("spam.NAOK"),
## PACKAGE = "spam")
if( getOption("spam.force64") || nz > 2147483647 || n+1 > 2147483647)
if(force64 || nz > 2147483647 || n+1 > 2147483647)
SS <- .format64()
else
SS <- .format32
......@@ -94,12 +97,15 @@
entries = z$entries,
colindices = z$colindices,
rowpointers = z$rowpointers,
dimension = c(n,n)
dimension = c(n,n),
force64 = force64
))
}
toeplitz.spam <- function(x,y=NULL, eps = getOption("spam.eps"))
{
force64 <- getOption("spam.force64")
if (!is.vector(x))
stop("'x' is not a vector")
n <- length(x)
......@@ -121,8 +127,9 @@ toeplitz.spam <- function(x,y=NULL, eps = getOption("spam.eps"))
if(identical(len,0L)){
## print("degenerate")
return(.newSpam(
rowpointers = c(1, rep_len64(2, n)),
dimension = c(n, n)))
# rowpointers = c(1, rep_len64(2, n)),
dimension = c(n, n),
force64 = force64))
## return(new("spam", rowpointers = c(1L, rep.int(2L, n)),
## dimension = as.integer(c(n, n))))
}
......@@ -138,7 +145,7 @@ toeplitz.spam <- function(x,y=NULL, eps = getOption("spam.eps"))
## rowpointers = vector("integer", n + 1),
## nnz=as.integer(1),
## NAOK = getOption("spam.NAOK"), PACKAGE = "spam")
if(getOption("spam.force64") || n+1 > 2147483647 || nz > 2147483647 )
if(force64 || n+1 > 2147483647 || nz > 2147483647 )
SS <- .format64()
else
SS <- .format32
......@@ -173,5 +180,6 @@ toeplitz.spam <- function(x,y=NULL, eps = getOption("spam.eps"))
entries = z$entries[1:z$nnz],
colindices = z$colindices[1:z$nnz],
rowpointers = z$rowpointers,
dimension = c(n, n) ) )
dimension = c(n, n),
force64 = force64))
}
CHANGES IN VERSION 2.2-0
SIGNIFICANT USER-VISIBLE CHANGES
o Implementation of 'eigen.spam' and 'eigen_approx' to calculate
eigenvalues and eigenvectors for sparse matrices.
o 'germany.plot' has new argument 'cex.main'.
BUG FIXES
o 'NAOK=TRUE' did not properly dispatch in all matrix multiplications.
o '.newSpam()' was not always properly called, causing possible errors
when creating empty 'spam' objects.
INTERNAL CHANGES
o Code cleaning and coherence improvements.
CHANGES IN VERSION 2.1-2
SIGNIFICANT USER-VISIBLE CHANGES
......
......@@ -11,6 +11,7 @@
\alias{det,spam-method}
\alias{det,spam.chol.NgPeyton-method}
\alias{det.spam}
\alias{det}
\alias{determinant}
%\alias{determinant,spam.chol.NgPeyton-method}
\alias{determinant,spam-method}
......@@ -25,7 +26,7 @@
}
\usage{
# det(x, ...)
det(x, ...)
determinant(x, logarithm = TRUE, ...)
}
\arguments{
......
% This is file ../spam/eigen.Rd
% This file is part of the spam package,
% http://www.math.uzh.ch/furrer/software/spam/
% by Reinhard Furrer [aut, cre], Florian Gerber [ctb], Roman Flury [ctb]
\name{eigen}
\alias{eigen.spam}
\alias{eigen_approx}
\title{Eigenvalues for Sparse Matrices}
\description{
Functions to calculate eigenvalues and eigenvectors of \code{sparse} matrices.
It uses the value of \code{spam.options("inefficiencywarning")} to dispatch between \code{base::eigen()} or the Implicitly Restarted Arnoldi Process, using 'ARPACK'.
\code{eigen.spam} is a wrapper function of \code{eigen_approx} and transforms its output to \code{base::eigen} like.
}
\note{
For non symmetric matrices it can not be guaranteed, that the Fortran code is stable.
The user is advised to choose the \code{control} options carefully, see \sQuote{Details} for more information.
}
\usage{
eigen.spam(x, nev = 10, symmetric, only.values = FALSE, control = list())
eigen_approx(x, nev, ncv, nitr, mode, only.values = FALSE, verbose = FALSE, f_routine)
}
\arguments{
\item{x}{a matrix of class \code{spam} whose \code{nev} eigenvalues and eigenvectors are to be computed.}
\item{nev}{number of eigenvalues to calculate.}
\item{symmetric}{if TRUE, the matrix is assumed to be symmetric.}
\item{only.values}{if TRUE, only \code{nev} eigenvalues are computed and returned, otherwise \code{nev} eigenvalues and eigenvectors are returned.}
\item{control}{additional options, see \sQuote{Details}.}
\item{ncv}{see \sQuote{Details}, use the \code{control} option for \code{eigen.spam}.}
\item{nitr}{see \sQuote{Details}, use the \code{control} option for \code{eigen.spam}.}
\item{mode}{see \sQuote{Details}, use the \code{control} option for \code{eigen.spam}.}
\item{verbose}{see \sQuote{Details}, use the \code{control} option for \code{eigen.spam}.}
\item{f_routine}{only for \code{eigen_approx}, to call the Fortran routine for symmetric matrices set this option to "ds_eigen_f" and for non symmetric to "dn_eigen_f".}
}
\value{
A vector of the length corresponding to the dimension of the input matrix.
Containing the required \code{nev} eigenvalues.
If requested also the corresponding eigenvectors.
In the non symmetric case, the eigenvalues are returned in a matrix with a column containing the real parts and a column containing the imaginary parts of the eigenvalues.
The eigenvectors are then returned in two matrices.}
\details{
\describe{
\item{\code{mode = "LM"}:}{
there are different modes available for this function, each mode returns a different range of eigenvalues.
Also the available modes are dependent, whether the input matrix is symmetric or not:
\describe{
\item{\code{"LM"}:}{Eigenvalues with largest magnitude (sym, non sym), that is, largest eigenvalues in the Euclidean norm of complex numbers.}
\item{\code{"SM"}:}{Eigenvalues with smallest magnitude (sym, non sym), that is, smallest eigenvalues in the Euclidean norm of complex numbers.}
\item{\code{"LR"}:}{Eigenvalues with largest real part (non sym).}
\item{\code{"SR"}:}{Eigenvalues with smallest real part (non sym).}
\item{\code{"LI"}:}{Eigenvalues with largest imaginary part (non sym).}
\item{\code{"SI"}:}{Eigenvalues with smallest imaginary part (non sym).}
\item{\code{"LA"}:}{Eigenvalues with largest algebraic value (sym), that is, largest eigenvalues inclusive of any negative sign.}
\item{\code{"SA"}:}{Eigenvalues with smallest algebraic value (syn), that is, smallest eigenvalues inclusive of any negative sign.}
}% describe
}% item
\item{\code{ncv}:}{
the largest number of basis vectors that will be used in the Implicitly Restarted Arnoldi Process.
Work per major iteration is proportional to x@dimension[1]*ncv*ncv.
The default is set if \code{symmetric} to min(x@dimension[1] + 1, max(2 * nev + 1, 200)) or else to min(x@dimension[1] - 1, max(2 * nev + 1, 100)).
Note, this value should not be chosen arbitrary large, but slightly larger than \code{nev}.
Otherwise it could lead to memory allocation problems.}
\item{\code{nitr}:}{
the maximum number of iterations.
The default is set to \code{ncv + 1000}}
\item{\code{spamflag = FALSE}:}{
if TRUE, the Implicitly Restarted Arnoldi Process is used, independent of the dimension of the respective matrix.}
\item{\code{verbose = FALSE}:}{
print additional information.}
\item{\code{cmplxeps}:}{
threshold to determine whether a double value is zero, while transforming the ARPACK output to R class complex.
The default is set to \code{.Machine$double.eps}.}
}% describe
}% details
\references{Lehoucq, R. B. and Sorensen, D. C. and Yang, C. (1997) \emph{ARPACK Users Guide: Solution of Large Scale Eigenvalue Problems by Implicitly Restarted Arnoldi Methods}.}
\seealso{Option \code{"inefficiencywarning"} in \code{\link{spam.options}}.
}
\examples{
gmrf <- precmat.GMRFreglat(50, 50, c(.4,.3,.2,.1),'m2p4')
eigen.spam(gmrf, nev = 50, control = list(mode = "LM"))
}
\author{Roman Flury}
\keyword{algebra}
......@@ -19,7 +19,7 @@
over the administrative districts of Germany}
\usage{
germany.plot(vect, col=NULL, zlim=range(vect), legend=TRUE,
main=NULL, cex.axis=1, add=FALSE, ... )
main=NULL, cex.axis=1, cex.main=1.5, add=FALSE, ... )
}
\arguments{
\item{vect}{vector of length 544}
......@@ -28,7 +28,8 @@ germany.plot(vect, col=NULL, zlim=range(vect), legend=TRUE,
plotted, defaulting to the range of \code{data}.}
\item{legend}{Should the legend be added, see \sQuote{Details}.}
\item{main}{an overall title for the plot.}
\item{cex.axis}{label size of legend.}
\item{cex.axis}{label size of legend.}
\item{cex.main}{label size of overall plot title.}
\item{add}{logical, if true adds to current plot.}
\item{\dots}{additional arguments passed to \code{polygon}.}
}
......
......@@ -9,17 +9,14 @@
\name{s3only}
\alias{var.spam}
\alias{eigen.spam}
\title{Wappers for Sparse Matrices}
\description{
These functions are convenient wrappers for \code{spam} objects
to classical matrix operations.}
\usage{
var.spam(x, \dots)
eigen.spam(x, \dots)
\S3method{var}{spam}(x, \dots)
\S3method{eigen}{spam}(x, \dots)
}
\arguments{
\item{x}{matrix of class \code{spam}.}
......@@ -34,8 +31,5 @@ eigen.spam(x, \dots)
%\note{}
\seealso{Option \code{"inefficiencywarning"} in \code{\link{spam.options}}.
}
\examples{
eigen( diag.spam(3))
}
\author{Reinhard Furrer}
\keyword{algebra}
PKG_LIBS = $(LAPACK_LIBS) $(BLAS_LIBS) $(FLIBS)
# Fortran 77 flags:
# PKG_FCFLAGS = -fopenmp
# Fortran 9x flags:
# PKG_FFLAGS = -fopenmp
# C-Flags
# PKG_CFLAGS = -fopenmp
# PKG_LIBS = -fopenmp
# PKG_CFLAGS = -fopenmp
# PKG_LIBS = -fopenmp
\ No newline at end of file