SCM Repository

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

Diff of /pkg/R/MatrixFactorization.R

revision 1444, Fri Aug 25 14:39:45 2006 UTC revision 2157, Tue Mar 25 15:00:01 2008 UTC
# Line 6  Line 6
6
7  setMethod("show", "MatrixFactorization",  setMethod("show", "MatrixFactorization",
8            function(object) { ## cheap one -- can have better for sub-classes            function(object) { ## cheap one -- can have better for sub-classes
9                cl <- class(object)                ## cl <- class(object)
10                cat(sprintf("'MatrixFactorization' of class \"%s\"\n", cl))                ## cat(sprintf("'MatrixFactorization' of class \"%s\"\n", cl))
11                  cat("'MatrixFactorization' of ")
12                str(object)                str(object)
13                })                })
14    setMethod("show", "BunchKaufman",
15              function(object) {
16                  cat("'Bunch-Kaufman' factorization of ")
17                  str(object)
18              })
19    setMethod("show", "pBunchKaufman",
20              function(object) {
21                  cat("packed 'Bunch-Kaufman' factorization of ")
22                  str(object)
23              })
24
25    setMethod("dim", "MatrixFactorization", function(x) x@Dim)
26
27    ## e.g., for (CHMfactor, <num>):
28    setMethod("solve", signature(a = "MatrixFactorization", b = "numeric"),
29              function(a, b, ...) callGeneric(a, Matrix(b)))
30    ## catch others, otherwise base::solve is.
31    setMethod("solve", signature(a = "MatrixFactorization", b = "ANY"),
32              function(a, b, ...) .bail.out.2("solve", class(a), class(b)))
33    setMethod("solve", signature(a = "MatrixFactorization", b = "missing"),
34              function(a, b, ...) .bail.out.1("solve", class(a)))

Legend:
 Removed from v.1444 changed lines Added in v.2157