# SCM Repository

[matrix] Diff of /pkg/R/sparseMatrix.R
 [matrix] / pkg / R / sparseMatrix.R

# Diff of /pkg/R/sparseMatrix.R

revision 2071, Tue Sep 25 15:08:27 2007 UTC revision 2072, Wed Sep 26 16:16:13 2007 UTC
# Line 467  Line 467
467                       stop("invalid 'type'"))                       stop("invalid 'type'"))
468            })            })
469

470  setMethod("rcond", signature(x = "sparseMatrix", type = "character"),  setMethod("rcond", signature(x = "sparseMatrix", type = "character"),
471            function(x, type, ...) {            function(x, type, ...) {
472            stop("There are no specialized rcond() methods for sparse ",                d <- dim(x)
473                 "matrices.\n Either use rcond(as(. , \"denseMatrix\"))\n",                rcond(if(d[1] == d[2]) {
474                 " or 1 / (norm(.) * norm(solve(.))).")                          warning("rcond(.) via  sparse -> dense  coercion")
475                            as(x, "denseMatrix")
476                        } else if(d[1] > d[2]) qr.R(qr(x)) else qr.R(qr(t(x))),
477                        type = type)
478                })                })
479
480
481  lm.fit.sparse <-  lm.fit.sparse <-
482  function(x, y, offset = NULL, method = c("qr", "cholesky"),  function(x, y, offset = NULL, method = c("qr", "cholesky"),
483           tol = 1e-7, singular.ok = TRUE, transpose = FALSE, ...)           tol = 1e-7, singular.ok = TRUE, transpose = FALSE, ...)

Legend:
 Removed from v.2071 changed lines Added in v.2072