SCM

SCM Repository

[matrix] Diff of /pkg/tests/dpoMatrix.Rout.save
ViewVC logotype

Diff of /pkg/tests/dpoMatrix.Rout.save

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 508, Fri Feb 4 18:22:28 2005 UTC revision 509, Fri Feb 4 23:34:01 2005 UTC
# Line 1  Line 1 
1    
2  R : Copyright 2005, The R Foundation for Statistical Computing  R : Copyright 2005, The R Foundation for Statistical Computing
3  Version 2.1.0 Under development (unstable) (2005-02-03), ISBN 3-900051-07-0  Version 2.1.0 Under development (unstable) (2005-02-04), ISBN 3-900051-07-0
4    
5  R is free software and comes with ABSOLUTELY NO WARRANTY.  R is free software and comes with ABSOLUTELY NO WARRANTY.
6  You are welcome to redistribute it under certain conditions.  You are welcome to redistribute it under certain conditions.
# Line 41  Line 41 
41    ..@ Dim    : int [1:2] 9 9    ..@ Dim    : int [1:2] 9 9
42  > ## h9 now has factorization  > ## h9 now has factorization
43  > stopifnot(names(h9@factors) == "Cholesky")  > stopifnot(names(h9@factors) == "Cholesky")
44  > rcond(h9)  > stopifnot(all.equal(rcond(h9), 9.0938e-13))
45  [1] 9.093822e-13  > stopifnot(all.equal(rcond(f9), 9.1272e-7, tol = 1e-6))# more precision fails
 > rcond(f9)  
 [1] 9.127209e-07  
46  > str(h9)# has 'rcond' and 'factors'  > str(h9)# has 'rcond' and 'factors'
47  Formal class 'dpoMatrix' [package "Matrix"] with 5 slots  Formal class 'dpoMatrix' [package "Matrix"] with 5 slots
48    ..@ uplo   : chr "U"    ..@ uplo   : chr "U"
# Line 61  Line 59 
59    ..@ x      : num [1:81] 1.000 0.500 0.333 0.250 0.200 ...    ..@ x      : num [1:81] 1.000 0.500 0.333 0.250 0.200 ...
60    ..@ Dim    : int [1:2] 9 9    ..@ Dim    : int [1:2] 9 9
61  > options(digits=4)  > options(digits=4)
62  > crossprod(f9)# looks the same as  > (cf9 <- crossprod(f9))# looks the same as  h9 :
63    9 x 9 Matrix of class 'dpoMatrix'
64          [,1]   [,2]    [,3]    [,4]    [,5]    [,6]    [,7]    [,8]    [,9]          [,1]   [,2]    [,3]    [,4]    [,5]    [,6]    [,7]    [,8]    [,9]
65   [1,] 1.0000 0.5000 0.33333 0.25000 0.20000 0.16667 0.14286 0.12500 0.11111   [1,] 1.0000 0.5000 0.33333 0.25000 0.20000 0.16667 0.14286 0.12500 0.11111
66   [2,] 0.5000 0.3333 0.25000 0.20000 0.16667 0.14286 0.12500 0.11111 0.10000   [2,] 0.5000 0.3333 0.25000 0.20000 0.16667 0.14286 0.12500 0.11111 0.10000
# Line 72  Line 71 
71   [7,] 0.1429 0.1250 0.11111 0.10000 0.09091 0.08333 0.07692 0.07143 0.06667   [7,] 0.1429 0.1250 0.11111 0.10000 0.09091 0.08333 0.07692 0.07143 0.06667
72   [8,] 0.1250 0.1111 0.10000 0.09091 0.08333 0.07692 0.07143 0.06667 0.06250   [8,] 0.1250 0.1111 0.10000 0.09091 0.08333 0.07692 0.07143 0.06667 0.06250
73   [9,] 0.1111 0.1000 0.09091 0.08333 0.07692 0.07143 0.06667 0.06250 0.05882   [9,] 0.1111 0.1000 0.09091 0.08333 0.07692 0.07143 0.06667 0.06250 0.05882
74  > h9 # but not internally!  > stopifnot(all.equal(as(h9, "matrix"),
75          [,1]   [,2]    [,3]    [,4]    [,5]    [,6]    [,7]    [,8]    [,9]  +                     as(cf9,"matrix"), tol= 1e-15))
76   [1,] 1.0000 0.5000 0.33333 0.25000 0.20000 0.16667 0.14286 0.12500 0.11111  >
  [2,] 0.5000 0.3333 0.25000 0.20000 0.16667 0.14286 0.12500 0.11111 0.10000  
  [3,] 0.3333 0.2500 0.20000 0.16667 0.14286 0.12500 0.11111 0.10000 0.09091  
  [4,] 0.2500 0.2000 0.16667 0.14286 0.12500 0.11111 0.10000 0.09091 0.08333  
  [5,] 0.2000 0.1667 0.14286 0.12500 0.11111 0.10000 0.09091 0.08333 0.07692  
  [6,] 0.1667 0.1429 0.12500 0.11111 0.10000 0.09091 0.08333 0.07692 0.07143  
  [7,] 0.1429 0.1250 0.11111 0.10000 0.09091 0.08333 0.07692 0.07143 0.06667  
  [8,] 0.1250 0.1111 0.10000 0.09091 0.08333 0.07692 0.07143 0.06667 0.06250  
  [9,] 0.1111 0.1000 0.09091 0.08333 0.07692 0.07143 0.06667 0.06250 0.05882  
 > ##   i.e. this is all wrong : all.equal(h9, crossprod(f9))  
77  >  >

Legend:
Removed from v.508  
changed lines
  Added in v.509

root@r-forge.r-project.org
ViewVC Help
Powered by ViewVC 1.0.0  
Thanks to:
Vienna University of Economics and Business Powered By FusionForge