Rev 976 | Rev 997 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed
# Ensure that the methods package is available.onLoad <- function(lib, pkg) {require("methods", character = TRUE, quietly = TRUE)}# Virtual class of all Matrix objectssetClass("Matrix", representation(Dim = "integer"),validity = function(object) {Dim <- object@Dimif (length(Dim) != 2)return("Dim slot must be of length 2")if (any(Dim < 0))return("Dim slot must contain non-negative values")TRUE})# Virtual class of numeric matricessetClass("dMatrix",representation(x = "numeric"),contains = "Matrix")# Virtual class of integer matricessetClass("iMatrix",representation(x = "integer"),contains = "Matrix")# Virtual class of logical matricessetClass("lMatrix",representation(x = "logical"),contains = "Matrix")# Virtual class of complex matricessetClass("zMatrix", # letter 'z' is as in the names of Lapack subroutinesrepresentation(x = "complex"),contains = "Matrix")# Virtual class of dense, numeric matricessetClass("ddenseMatrix",representation(rcond = "numeric", factors = "list"),contains = "dMatrix")# numeric, dense, general matricessetClass("dgeMatrix", contains = "ddenseMatrix",validity = function(object) { ## dgeMatrix checks the length of x is prod(Dim).Call("dgeMatrix_validate", object)})# numeric, dense, non-packed, triangular matricessetClass("dtrMatrix",representation(uplo = "character", diag = "character"),contains = "dgeMatrix",prototype = prototype(uplo = "U", diag = "N"),validity = function(object) {.Call("dtrMatrix_validate", object)})# numeric, dense, packed, triangular matricessetClass("dtpMatrix",representation(uplo = "character", diag = "character"),contains = "ddenseMatrix",prototype = prototype(uplo = "U", diag = "N"),validity = function(object) {.Call("dtpMatrix_validate", object)})# numeric, dense, non-packed symmetric matricessetClass("dsyMatrix",representation(uplo = "character"),prototype = prototype(uplo = "U"),contains = "dgeMatrix",validity = function(object) .Call("dsyMatrix_validate", object))# numeric, dense, non-packed symmetric matricessetClass("dspMatrix",representation(uplo = "character"),prototype = prototype(uplo = "U"),contains = "dgeMatrix",validity = function(object) .Call("dspMatrix_validate", object))# numeric, dense, non-packed, postive-definite, symmetric matricessetClass("dpoMatrix", contains = "dsyMatrix",validity = function(object) .Call("dpoMatrix_validate", object))# numeric, dense, packed, postive-definite, symmetric matricessetClass("dppMatrix", contains = "dspMatrix",validity = function(object) .Call("dppMatrix_validate", object))# numeric, sparse, triplet general matricessetClass("dgTMatrix",representation(i = "integer", j = "integer", factors = "list"),contains = "dMatrix",validity = function(object) .Call("dgTMatrix_validate", object))# numeric, sparse, triplet triangular matricessetClass("dtTMatrix",representation(uplo = "character", diag = "character"),contains = "dgTMatrix",validity = function(object) .Call("dtTMatrix_validate", object))# numeric, sparse, triplet symmetric matricessetClass("dsTMatrix",representation(uplo = "character"),contains = "dgTMatrix",validity = function(object) .Call("dsTMatrix_validate", object))# numeric, sparse, sorted compressed sparse column-oriented general matricessetClass("dgCMatrix",representation(i = "integer", p = "integer", factors = "list"),contains = "dMatrix",validity = function(object) .Call("dgCMatrix_validate", object))# numeric, sparse, sorted compressed sparse column-oriented triangular matricessetClass("dtCMatrix",representation(uplo = "character", diag = "character"),contains = "dgCMatrix",validity = function(object) .Call("dtCMatrix_validate", object))# numeric, sparse, sorted compressed sparse column-oriented symmetric matricessetClass("dsCMatrix",representation(uplo = "character"),contains = "dgCMatrix",validity = function(object) .Call("dsCMatrix_validate", object))# numeric, sparse, sorted compressed sparse row-oriented general matricessetClass("dgRMatrix",representation(j = "integer", p = "integer", factors = "list"),contains = "dMatrix",validity = function(object) .Call("dgRMatrix_validate", object))# numeric, sparse, sorted compressed sparse row-oriented triangular matricessetClass("dtRMatrix",representation(uplo = "character", diag = "character"),contains = "dgRMatrix",validity = function(object) .Call("dtRMatrix_validate", object))# numeric, sparse, sorted compressed sparse row-oriented symmetric matricessetClass("dsRMatrix",representation(uplo = "character"),contains = "dgRMatrix",validity = function(object) .Call("dsRMatrix_validate", object))## Compressed sparse column matrix in blockssetClass("dgBCMatrix", representation(p = "integer", i = "integer", x = "array"))setClass("determinant",representation(modulus ="numeric",logarithm = "logical",sign = "integer",call = "call"))setClass("LU", representation(x = "numeric",pivot = "integer"),validity = function(object).Call("LU_validate", object))setClass("Cholesky", contains = "dtrMatrix")setClass("dCholCMatrix",representation = representation(perm = "integer", Parent = "integer",D = "numeric"),contains = "dtCMatrix",validity = function(object).Call("dCholCMatrix_validate", object))setClass("sscCrosstab", representation =representation(Gp = "integer", perm = "integer"),contains = "dsCMatrix",validity = function(object).Call("sscCrosstab_validate", object))setClass("ssclme", representation =representation(D = "numeric", # Diagonal of D in LDL'DIsqrt = "numeric", # inverse square root of DDim = "integer", # Dimensions of Z'Z and LDL'Gp = "integer", # Pointers to groups of columns of ZLi = "integer", # Row indices of LLp = "integer", # Column pointers of LLx = "numeric", # Non-zero, off-diagonals of LOmega = "list", # List of symmetric matricesParent = "integer", # Elimination tree of LRXX = "matrix", # Augmented RXX component or inverseRZX = "matrix", # Augmented RZX component or inverseXtX = "matrix", # Original X'X matrixZtX = "matrix", # Original Z'X matrixbVar = "list", # Diagonal blocks on (Z'Z+W)^{-1}deviance = "numeric", # Current deviance (ML and REML)devComp = "numeric", # Components of deviancei = "integer", # Row indices of Z'Znc = "integer", # number of columns in model matricesp = "integer", # Pointers to columns of Z'Zstatus = "logical", # record if factored, if invertedx = "numeric" # Non-zeroes in upper triangle of Z'Z),validity = function(object).Call("ssclme_validate", object))# positive-definite symmetric matrices as matricessetClass("pdmatrix", contains="matrix")# factors of positive-definite symmetric matricessetClass("pdfactor", representation("matrix", logDet = "numeric"))# correlation matrices and standard deviationssetClass("corrmatrix", representation("matrix", stdDev = "numeric"))