Commit cb5ae56f authored by Reinhard Furrer's avatar Reinhard Furrer

new version spam[64].2.1.2 material

parent 6a327d47
This diff is collapsed.
Package: spam
Version: 2.0-05
Date: 2016-11-19
Type: Package
Title: SPArse Matrix
Version: 2.1-2
Date: 2017-12-21
Authors@R: c(person("Reinhard", "Furrer", role = c("aut", "cre"),
email = "reihard.furrer@math.uzh.ch"),
person("Florian", "Gerber", role = "ctb",
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"),
person("Kaspar", "Moesinger", role = "ctb",
email = "kaspar.moesinger@gmail.com"))
Author: Reinhard Furrer [aut, cre], Florian Gerber [ctb], Kaspar Moesinger [ctb]
Maintainer: Reinhard Furrer <reinhard.furrer@math.uzh.ch>
email = "kaspar.moesinger@gmail.com"),
person("Youcef", "Saad", role = "ctb",
comment = "SPARSEKIT http://www-users.cs.umn.edu/~saad/software/SPARSKIT/"),
person(c("Esmond", "G."), "Ng", role = "ctb",
comment = "Fortran Cholesky routines"),
person(c("Barry", "W."), "Peyton", role = "ctb",
comment = "Fortran Cholesky routines"),
person(c("Joseph", "W.H."), "Liu", role = "ctb",
comment = "Fortran Cholesky routines"),
person(c("Alan", "D."), "George", role = "ctb",
comment = "Fortran Cholesky routines")
)
Depends:
R (>= 3.1),
dotCall64,
......@@ -24,13 +37,12 @@ Suggests:
truncdist
VignetteBuilder: R.rsp
Description: Set of functions for sparse matrix algebra.
Differences with SparseM/Matrix are:
Differences with other sparse matrix packages are:
(1) we only support (essentially) one sparse matrix format,
(2) based on transparent and simple structure(s),
(3) tailored for MCMC calculations within GMRF.
(4) S3 and S4 like-"compatible" ... and it is fast.
(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
Title: SPArse Matrix
URL: http://www.math.uzh.ch/furrer/software/spam/
\ No newline at end of file
URL: https://git.math.uzh.ch/reinhard.furrer/spam
useDynLib(spam)
useDynLib(spam, .registration = TRUE)
import(grid)
import("dotCall64")
......@@ -39,10 +39,14 @@ S3method("solve","spam")
S3method("subset","spam")
S3method("summary","spam")
S3method("summary","spam.chol.NgPeyton")
S3method("print","summary.spam")
S3method("print","summary.spam.chol.NgPeyton")
S3method("t","spam")
S3method("tail","spam")
S3method("update","spam.chol.NgPeyton")
S3method("cbind","spam")
S3method("rbind","spam")
# Generic functions
export(
......@@ -54,6 +58,10 @@ export(
"spam.Version",
"validate_spam",
"validspamobject", # __DEPRECATED__
"spam.options", # __DEPRECATED__
"spam.getOption", # __DEPRECATED__
"nearest.dist",
"spam_rdist",
......@@ -255,7 +263,6 @@ exportMethods(
"t",
"diag",
"diag<-",
"diag<-",
"upper.tri",
"lower.tri",
......
# This is file ../spam/R/apply.R
# This file is part of the spam package,
# http://www.math.uzh.ch/furrer/software/spam/
# by Reinhard Furrer [aut, cre], Florian Gerber [ctb]
# HEADER ####################################################
# This is file spam/R/apply.R. #
# It is part of the R package spam, #
# --> https://CRAN.R-project.org/package=spam #
# --> https://CRAN.R-project.org/package=spam64 #
# --> https://git.math.uzh.ch/reinhard.furrer/spam #
# by Reinhard Furrer [aut, cre], Florian Gerber [ctb], #
# Daniel Gerber [ctb], Kaspar Moesinger [ctb], #
# Youcef Saad [ctb] (SPARSEKIT), #
# Esmond G. Ng [ctb] (Fortran Cholesky routines), #
# Barry W. Peyton [ctb] (Fortran Cholesky routines), #
# Joseph W.H. Liu [ctb] (Fortran Cholesky routines), #
# Alan D. George [ctb] (Fortran Cholesky routines), #
# Esmond G. Ng [ctb] (Fortran Cholesky routines), #
# Barry W. Peyton [ctb] (Fortran Cholesky routines), #
# Joseph W.H. Liu [ctb] (Fortran Cholesky routines), #
# Alan D. George [ctb] (Fortran Cholesky routines) #
# HEADER END ################################################
# primitive apply function.
......
# This is file ../spam/R/constructors.R
# This file is part of the spam package,
# http://www.math.uzh.ch/furrer/software/spam/
# by Reinhard Furrer [aut, cre], Florian Gerber [ctb]
# HEADER ####################################################
# This is file spam/R/constructors.R. #
# It is part of the R package spam, #
# --> https://CRAN.R-project.org/package=spam #
# --> https://CRAN.R-project.org/package=spam64 #
# --> https://git.math.uzh.ch/reinhard.furrer/spam #
# by Reinhard Furrer [aut, cre], Florian Gerber [ctb], #
# Daniel Gerber [ctb], Kaspar Moesinger [ctb], #
# Youcef Saad [ctb] (SPARSEKIT), #
# Esmond G. Ng [ctb] (Fortran Cholesky routines), #
# Barry W. Peyton [ctb] (Fortran Cholesky routines), #
# Joseph W.H. Liu [ctb] (Fortran Cholesky routines), #
# Alan D. George [ctb] (Fortran Cholesky routines), #
# Esmond G. Ng [ctb] (Fortran Cholesky routines), #
# Barry W. Peyton [ctb] (Fortran Cholesky routines), #
# Joseph W.H. Liu [ctb] (Fortran Cholesky routines), #
# Alan D. George [ctb] (Fortran Cholesky routines) #
# HEADER END ################################################
"rowpointers<-" <- function(x, value) {
......
# This is file ../spam/R/covmat.R
# This file is part of the spam package,
# http://www.math.uzh.ch/furrer/software/spam/
# by Reinhard Furrer [aut, cre], Florian Gerber [ctb]
# HEADER ####################################################
# This is file spam/R/covmat.R. #
# It is part of the R package spam, #
# --> https://CRAN.R-project.org/package=spam #
# --> https://CRAN.R-project.org/package=spam64 #
# --> https://git.math.uzh.ch/reinhard.furrer/spam #
# by Reinhard Furrer [aut, cre], Florian Gerber [ctb], #
# Daniel Gerber [ctb], Kaspar Moesinger [ctb], #
# Youcef Saad [ctb] (SPARSEKIT), #
# Esmond G. Ng [ctb] (Fortran Cholesky routines), #
# Barry W. Peyton [ctb] (Fortran Cholesky routines), #
# Joseph W.H. Liu [ctb] (Fortran Cholesky routines), #
# Alan D. George [ctb] (Fortran Cholesky routines), #
# Esmond G. Ng [ctb] (Fortran Cholesky routines), #
# Barry W. Peyton [ctb] (Fortran Cholesky routines), #
# Joseph W.H. Liu [ctb] (Fortran Cholesky routines), #
# Alan D. George [ctb] (Fortran Cholesky routines) #
# HEADER END ################################################
# construct various precision matrices
......
This diff is collapsed.
# HEADER ####################################################
# This is file spam/R/deprecated.R. #
# It is part of the R package spam, #
# --> https://CRAN.R-project.org/package=spam #
# --> https://CRAN.R-project.org/package=spam64 #
# --> https://git.math.uzh.ch/reinhard.furrer/spam #
# by Reinhard Furrer [aut, cre], Florian Gerber [ctb], #
# Daniel Gerber [ctb], Kaspar Moesinger [ctb], #
# Youcef Saad [ctb] (SPARSEKIT), #
# Esmond G. Ng [ctb] (Fortran Cholesky routines), #
# Barry W. Peyton [ctb] (Fortran Cholesky routines), #
# Joseph W.H. Liu [ctb] (Fortran Cholesky routines), #
# Alan D. George [ctb] (Fortran Cholesky routines), #
# Esmond G. Ng [ctb] (Fortran Cholesky routines), #
# Barry W. Peyton [ctb] (Fortran Cholesky routines), #
# Joseph W.H. Liu [ctb] (Fortran Cholesky routines), #
# Alan D. George [ctb] (Fortran Cholesky routines) #
# HEADER END ################################################
validspamobject <- function( ...) {
# .Deprecated('validate_spam()')
message("`validspamobject()` is deprecated. Use `validate_spam()` directly")
validate_spam( ...)
}
spam.getOption <- function(...) {
# .Deprecated(msg="`spam.getOption( arg)` is deprecated.\n Use `getOption( spam.arg)` directly")
message("`spam.getOption( arg)` is deprecated. Use `getOption( spam.arg)` directly")
getOption(...)
}
spam.options <- function(...) {
# .Deprecated(msg="`spam.options( arg)` is deprecated.\n Use `options( spam.arg)` directly")
message("`spam.options( arg)` is deprecated. Use `options( spam.arg)` directly")
if (nargs() == 0) {
tmp <- names(options())
return(options()[ grep( "spam.", tmp)])
}
args <- list(...)
names(args) <- paste0("spam.", names(args))
do.call("options", args)
}
# This is file ../spam/R/diff.R
# This file is part of the spam package,
# http://www.math.uzh.ch/furrer/software/spam/
# by Reinhard Furrer [aut, cre], Florian Gerber [ctb]
# HEADER ####################################################
# This is file spam/R/diff.R. #
# It is part of the R package spam, #
# --> https://CRAN.R-project.org/package=spam #
# --> https://CRAN.R-project.org/package=spam64 #
# --> https://git.math.uzh.ch/reinhard.furrer/spam #
# by Reinhard Furrer [aut, cre], Florian Gerber [ctb], #
# Daniel Gerber [ctb], Kaspar Moesinger [ctb], #
# Youcef Saad [ctb] (SPARSEKIT), #
# Esmond G. Ng [ctb] (Fortran Cholesky routines), #
# Barry W. Peyton [ctb] (Fortran Cholesky routines), #
# Joseph W.H. Liu [ctb] (Fortran Cholesky routines), #
# Alan D. George [ctb] (Fortran Cholesky routines), #
# Esmond G. Ng [ctb] (Fortran Cholesky routines), #
# Barry W. Peyton [ctb] (Fortran Cholesky routines), #
# Joseph W.H. Liu [ctb] (Fortran Cholesky routines), #
# Alan D. George [ctb] (Fortran Cholesky routines) #
# HEADER END ################################################
......
# This is file ../spam/R/dim.R
# This file is part of the spam package,
# http://www.math.uzh.ch/furrer/software/spam/
# by Reinhard Furrer [aut, cre], Florian Gerber [ctb]
# HEADER ####################################################
# This is file spam/R/dim.R. #
# It is part of the R package spam, #
# --> https://CRAN.R-project.org/package=spam #
# --> https://CRAN.R-project.org/package=spam64 #
# --> https://git.math.uzh.ch/reinhard.furrer/spam #
# by Reinhard Furrer [aut, cre], Florian Gerber [ctb], #
# Daniel Gerber [ctb], Kaspar Moesinger [ctb], #
# Youcef Saad [ctb] (SPARSEKIT), #
# Esmond G. Ng [ctb] (Fortran Cholesky routines), #
# Barry W. Peyton [ctb] (Fortran Cholesky routines), #
# Joseph W.H. Liu [ctb] (Fortran Cholesky routines), #
# Alan D. George [ctb] (Fortran Cholesky routines), #
# Esmond G. Ng [ctb] (Fortran Cholesky routines), #
# Barry W. Peyton [ctb] (Fortran Cholesky routines), #
# Joseph W.H. Liu [ctb] (Fortran Cholesky routines), #
# Alan D. George [ctb] (Fortran Cholesky routines) #
# HEADER END ################################################
# This is the actual dim...
......@@ -46,56 +60,107 @@
# dim and derivatives
"pad<-.spam" <- function(x,value) {
if ( (min(value)<1 ) || any(!is.finite(value)))
stop("dims should be postive integers.")
if (!identical( length(value), 2L)) stop("dims should be of length 2.")
dimx <- x@dimension
last <- value[1]+1
force64 <- getOption("spam.force64")
# check if value is valid
if ( (min(value)<1 ) || any(!is.finite(value)))
stop("dims should be postive integers.")
if (!identical( length(value), 2L))
stop("dims should be of length 2.")
dimx <- x@dimension
last <- value[1]+1
# In three steps:
# 1) Address col truncation
# to safe time, we also take into account if we have fewer or equal rows
# 2) Augment rows
# 3) if fewer rows and more columns, truncate
# In any case, dimensions are fixed at the end.
# If fewer cols required, we run reducedim
if (dimx[2]>value[2]){
# subroutine reducedim(a,ja,ia,eps,bnrow,bncol,k,b,jb,ib)
z <- .Fortran("reducedim",
oldra=as.double(x@entries),
oldja=as.integer(x@colindices),
oldia=as.integer(x@rowpointers),
eps=as.double(getOption("spam.eps")),
as.integer(min(value[1],dimx[1])),as.integer(value[2]),
nz=1L,
entries=vector("double",length(x@entries)),
colindices=vector("integer",length(x@entries)),
rowpointers=vector("integer",last),
NAOK = getOption("spam.NAOK"), PACKAGE = "spam")
if (identical(z$nz,1L) )
return(new("spam",rowpointers=c(1L,rep.int(2L,as.integer(value[1]))),
dimension=as.integer(value)))
nz <- z$nz-1
slot(x,"entries",check=FALSE) <- z$entries[1:nz]
slot(x,"colindices",check=FALSE) <- z$colindices[1:nz]
slot(x,"rowpointers",check=FALSE) <- z$rowpointers[1:min(last,dimx[1]+1)]
if( force64 || .format.spam(x)$package == "spam64")
SS <- .format64()
else
SS <- .format32
z <- .C64("reducedim",
SIGNATURE=c("double", SS$signature, SS$signature,
"double", SS$signature, SS$signature, SS$signature,
"double", SS$signature, SS$signature),
oldra = x@entries,
oldja = x@colindices,
oldia = x@rowpointers,
eps = getOption("spam.eps"),
min(value[1],dimx[1]),
value[2],
nz = 1,
entries=vector_dc("double",length(x@entries)),
colindices=vector_dc(SS$type,length(x@entries)),
rowpointers=vector_dc(SS$type,last),
INTENT=c("r", "r", "r",
"r", "r", "r", "w",
"w", "w", "w"),
NAOK = getOption("spam.NAOK"),
PACKAGE = SS$package)
if (z$nz==1 ){ #was identical( z$nz,1L)
## print("2")
return(
.newSpam(
entries=x@entries,
colindices=x@colindices,
rowpointers=c(1,rep_len64(2,value[1])),
dimension=value,
force64=force64
)
)
}
nz <- z$nz-1
x <- .newSpam(
entries=z$entries[1:nz],
colindices=z$colindices[1:nz],
rowpointers=z$rowpointers[1:min(last,dimx[1]+1)],
dimension=value, #actually here dim 2 = value 2 but dim1 maybe not yet
force64=force64
)
}
# augment rows
# augment rows
if (dimx[1]<value[1]){
slot(x,"rowpointers",check=FALSE) <- c(x@rowpointers,rep.int(
x@rowpointers[length(x@rowpointers)],value[1]-dimx[1]))
## print("3")
x <- .newSpam(
entries=x@entries,
colindices=x@colindices,
rowpointers= c( x@rowpointers,
rep_len64( x@rowpointers[length(x@rowpointers)],value[1]-dimx[1])),
dimension=value,
force64=force64
)
}
# special case: fewer rows and more columns, truncate
if ((dimx[1]>value[1])&(dimx[2]<value[2])) {
lastelement <- (x@rowpointers[last]-1)
slot(x,"entries",check=FALSE) <- x@entries[1:lastelement]
slot(x,"colindices",check=FALSE) <- x@colindices[1:lastelement]
slot(x,"rowpointers",check=FALSE) <- x@rowpointers[1:last]
# special case: fewer rows and more columns, truncate
if((dimx[1]>=value[1])&(dimx[2]<=value[2])) { ## added =, think about it again
## print("4")
lastelement <- (x@rowpointers[last]-1)
x <- .newSpam(
entries= x@entries[1:lastelement],
colindices= x@colindices[1:lastelement],
rowpointers= x@rowpointers[1:last],
dimension=value,
force64=force64
)
}
slot(x,"dimension",check=FALSE) <- as.integer(value)
#before dim x = value x was here with slot option
return(x)
}
......
# HEADER ####################################################
# This is file spam/R/dist.R. #
# It is part of the R package spam, #
# --> https://CRAN.R-project.org/package=spam #
# --> https://CRAN.R-project.org/package=spam64 #
# --> https://git.math.uzh.ch/reinhard.furrer/spam #
# by Reinhard Furrer [aut, cre], Florian Gerber [ctb], #
# Daniel Gerber [ctb], Kaspar Moesinger [ctb], #
# Youcef Saad [ctb] (SPARSEKIT), #
# Esmond G. Ng [ctb] (Fortran Cholesky routines), #
# Barry W. Peyton [ctb] (Fortran Cholesky routines), #
# Joseph W.H. Liu [ctb] (Fortran Cholesky routines), #
# Alan D. George [ctb] (Fortran Cholesky routines), #
# Esmond G. Ng [ctb] (Fortran Cholesky routines), #
# Barry W. Peyton [ctb] (Fortran Cholesky routines), #
# Joseph W.H. Liu [ctb] (Fortran Cholesky routines), #
# Alan D. George [ctb] (Fortran Cholesky routines) #
# HEADER END ################################################
### in base:
# dist(x, method = "euclidean", diag = FALSE, upper = FALSE, p=2)
#
......@@ -96,15 +116,18 @@ nearest.dist <- function( x, y=NULL, method = "euclidean",
# EXPLICIT-STORAGE-FORMAT
if(max(n1,n2,nnz) > 2147483647 - 1 | getOption("spam.force64"))
SS <- .format64
SS <- .format64()
else
SS <- .format32
if(2147483647 < nnz) stop("Distance matrix is too dense (1)")
repeat {
d <- NULL # Free the memory allocated by a previous attemp
d <- .C64("closestdist",
## subroutine closestdist( ncol, x,nrowx, y, nrowy,
## & part, p, method,
## & eta, colindices, rowpointers, entries, nnz, iflag)
SIGNATURE=c(SS$signature, "double", SS$signature, "double", SS$signature,
SS$signature, "double", SS$signature, "double", SS$signature,
SS$signature, "double", SS$signature, SS$signature),
......@@ -127,11 +150,10 @@ nearest.dist <- function( x, y=NULL, method = "euclidean",
nnz=nnz,
iflag=0,
#TODO: Check the intents!
INTENT=c("rw", "rw", "rw", "rw",
"rw", "rw", "rw", "rw",
"rw", "rw", "rw", "rw",
"rw", "rw"),
INTENT = c("r", "r", "r", "r",
"r", "r", "rw", "r",
"r", "w", "w", "w",
"rw", "w"),
NAOK = getOption("spam.NAOK"),
PACKAGE=SS$package)
......@@ -140,7 +162,7 @@ nearest.dist <- function( x, y=NULL, method = "euclidean",
# EXPLICIT-STORAGE-FORMAT
if(max(n1,n2,nnz) > 2147483647 - 1 | getOption("spam.force64"))
SS <- .format64
SS <- .format64()
else
SS <- .format32
......
# This is file ../spam/R/foreign.R
# This file is part of the spam package,
# http://www.math.uzh.ch/furrer/software/spam/
# by Reinhard Furrer [aut, cre], Florian Gerber [ctb]
# HEADER ####################################################
# This is file spam/R/foreign.R. #
# It is part of the R package spam, #
# --> https://CRAN.R-project.org/package=spam #
# --> https://CRAN.R-project.org/package=spam64 #
# --> https://git.math.uzh.ch/reinhard.furrer/spam #
# by Reinhard Furrer [aut, cre], Florian Gerber [ctb], #
# Daniel Gerber [ctb], Kaspar Moesinger [ctb], #
# Youcef Saad [ctb] (SPARSEKIT), #
# Esmond G. Ng [ctb] (Fortran Cholesky routines), #
# Barry W. Peyton [ctb] (Fortran Cholesky routines), #
# Joseph W.H. Liu [ctb] (Fortran Cholesky routines), #
# Alan D. George [ctb] (Fortran Cholesky routines), #
# Esmond G. Ng [ctb] (Fortran Cholesky routines), #
# Barry W. Peyton [ctb] (Fortran Cholesky routines), #
# Joseph W.H. Liu [ctb] (Fortran Cholesky routines), #
# Alan D. George [ctb] (Fortran Cholesky routines) #
# HEADER END ################################################
......@@ -47,6 +60,9 @@ as.spam.matrix.csr <- function(x)
# 1b) spam <-> Matrix
as.dgRMatrix.spam <- function(x) {
if(.format.spam(x)$package != "spam"){
stop("dgRMatrix structure is not compatible with numeric/large integer type.")
}
if (requireNamespace("Matrix")) {
newx <- new(p=0:0,"dgRMatrix")
slot(newx,"x",check=FALSE) <- x@entries
......@@ -58,6 +74,9 @@ as.dgRMatrix.spam <- function(x) {
}
as.dgCMatrix.spam <- function(x) {
if(.format.spam(x)$package != "spam"){
stop("dgCMatrix structure is not compatible with numeric/large integer type.")
}
if (requireNamespace("Matrix")) {
dimx <- x@dimension
nz <- x@rowpointers[dimx[1] + 1] - 1
......@@ -67,6 +86,28 @@ as.dgCMatrix.spam <- function(x) {
rowpointers = vector("integer", dimx[2] + 1),
NAOK = getOption("spam.NAOK"),
PACKAGE = "spam")
## SS <- .format.spam(x)
## z <- .C64("transpose",
## SIGNATURE = c( SS$signature, SS$signature,
## "double", SS$signature, SS$signature,
## "double", SS$signature, SS$signature),
## n = dimx[1],
## m = dimx[2],
## a = x@entries,
## ja = x@colindices,
## ia = x@rowpointers,
## entries = vector_dc("double",nz),
## colindices = vector_dc(SS$type, nz),
## rowpointers = vector_dc(SS$type, dimx[2] + 1),
## INTENT = c("r", "r",
## "r", "r", "r",
## "w", "w", "w"),
## NAOK = getOption("spam.NAOK"),
## PACKAGE = SS$package)
newx <- new(p=0:0,"dgCMatrix")
slot(newx,"x",check=FALSE) <- z$entries
slot(newx,"i",check=FALSE) <- z$colindices-1L
......
# This is file ../spam/R/helper.R
# This file is part of the spam package,
# http://www.math.uzh.ch/furrer/software/spam/
# by Reinhard Furrer [aut, cre], Florian Gerber [ctb]
# HEADER ####################################################
# This is file spam/R/helper.R. #
# It is part of the R package spam, #
# --> https://CRAN.R-project.org/package=spam #
# --> https://CRAN.R-project.org/package=spam64 #
# --> https://git.math.uzh.ch/reinhard.furrer/spam #
# by Reinhard Furrer [aut, cre], Florian Gerber [ctb], #
# Daniel Gerber [ctb], Kaspar Moesinger [ctb], #
# Youcef Saad [ctb] (SPARSEKIT), #
# Esmond G. Ng [ctb] (Fortran Cholesky routines), #
# Barry W. Peyton [ctb] (Fortran Cholesky routines), #
# Joseph W.H. Liu [ctb] (Fortran Cholesky routines), #
# Alan D. George [ctb] (Fortran Cholesky routines), #
# Esmond G. Ng [ctb] (Fortran Cholesky routines), #
# Barry W. Peyton [ctb] (Fortran Cholesky routines), #
# Joseph W.H. Liu [ctb] (Fortran Cholesky routines), #
# Alan D. George [ctb] (Fortran Cholesky routines) #
# HEADER END ################################################
......@@ -12,19 +25,31 @@
bandwidth <- function(A) {
if (!is.spam(A)) {
warning("Matrix not 'spam' object. Coerced to one")
A <- as.spam(A)
}
ret <- .Fortran("getbwd",
as.integer(A@dimension[1]),
as.integer(A@colindices),
as.integer(A@rowpointers),
low=integer(1),
upp=integer(1),
NAOK = getOption("spam.NAOK"),
PACKAGE = "spam")
return(c(ret$low,ret$upp))
if (!is.spam(A)) {
warning("Matrix not 'spam' object. Coerced to one")
A <- as.spam(A)
}
if( getOption("spam.force64") )
SS <- .format64()
else
SS <- .format.spam(A)
ret <- .C64("getbwd",
SIGNATURE = c( SS$signature, SS$signature, SS$signature,
SS$signature, SS$signature),
A@dimension[1],
A@colindices,
A@rowpointers,
low = vector_dc(SS$type, 1),
upp = vector_dc(SS$type, 1),
INTENT = c("r", "r", "r",
"w", "w"),
NAOK = getOption("spam.NAOK"),
PACKAGE = SS$package)
return(c(ret$low,ret$upp))
}
......
# This is file ../spam/R/kronecker.R
# This file is part of the spam package,
# http://www.math.uzh.ch/furrer/software/spam/
# by Reinhard Furrer [aut, cre], Florian Gerber [ctb]
# HEADER ####################################################
# This is file spam/R/kronecker.R. #
# It is part of the R package spam, #
# --> https://CRAN.R-project.org/package=spam #
# --> https://CRAN.R-project.org/package=spam64 #
# --> https://git.math.uzh.ch/reinhard.furrer/spam #
# by Reinhard Furrer [aut, cre], Florian Gerber [ctb], #
# Daniel Gerber [ctb], Kaspar Moesinger [ctb], #
# Youcef Saad [ctb] (SPARSEKIT), #
# Esmond G. Ng [ctb] (Fortran Cholesky routines), #
# Barry W. Peyton [ctb] (Fortran Cholesky routines), #
# Joseph W.H. Liu [ctb] (Fortran Cholesky routines), #
# Alan D. George [ctb] (Fortran Cholesky routines), #
# Esmond G. Ng [ctb] (Fortran Cholesky routines), #
# Barry W. Peyton [ctb] (Fortran Cholesky routines), #
# Joseph W.H. Liu [ctb] (Fortran Cholesky routines), #
# Alan D. George [ctb] (Fortran Cholesky routines) #
# HEADER END ################################################
......@@ -14,6 +24,12 @@
kronecker.spam <- function(X,Y,FUN = "*", make.dimnames = FALSE, ...)
{
## print("1")
if(getOption("spam.force64"))
SS <- .format64()