SCM

SCM Repository

[matrix] Diff of /pkg/Matrix/src/sparseQR.c
ViewVC logotype

Diff of /pkg/Matrix/src/sparseQR.c

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

revision 2860, Mon Dec 31 14:35:37 2012 UTC revision 2868, Sat Feb 2 19:38:06 2013 UTC
# Line 107  Line 107 
107                     asLogical(trans),                     asLogical(trans),
108                     REAL(GET_SLOT(ans, Matrix_xSym)), ydims);                     REAL(GET_SLOT(ans, Matrix_xSym)), ydims);
109  #define EXIT_sparseQR_                                                  \  #define EXIT_sparseQR_                                                  \
110      if(rank_def) { /* remove the extra rows from ans */                 \      /* remove the extra rows from ans */                                \
111          d_a[0] = m;/* -> @Dim is ok;  @Dimnames (i.e. colnames) still are */ \          d_a[0] = m;/* -> @Dim is ok;  @Dimnames (i.e. colnames) still are */ \
112          double *yy = REAL( GET_SLOT(ans, Matrix_xSym)); /* is  M  x n */ \          double *yy = REAL( GET_SLOT(ans, Matrix_xSym)); /* is  M  x n */ \
113          double *xx = REAL(ALLOC_SLOT(aa, Matrix_xSym, REALSXP, m * n)); \          double *xx = REAL(ALLOC_SLOT(aa, Matrix_xSym, REALSXP, m * n)); \
# Line 115  Line 115 
115              Memcpy(xx + j*m, yy + j*M, m); /* copy    x[ 1:m, j ] := yy[,j] */ \              Memcpy(xx + j*m, yy + j*M, m); /* copy    x[ 1:m, j ] := yy[,j] */ \
116          }                                                               \          }                                                               \
117          ans = duplicate(aa); /*  m x n  finally */                      \          ans = duplicate(aa); /*  m x n  finally */                      \
118          UNPROTECT(1);                                                   \          UNPROTECT(1)
     }  
119    
120      EXIT_sparseQR_      if(rank_def) {
121            warning(_("%s(): structurally rank deficient case: possibly WRONG zeros"),
122                    "sparseQR_qty");
123            EXIT_sparseQR_;
124        }
125    
126      UNPROTECT(1);      UNPROTECT(1);
127      return ans;      return ans;
# Line 152  Line 155 
155          }          }
156      }      }
157    
158      EXIT_sparseQR_      if(rank_def) {
159            warning(_("%s(): structurally rank deficient case: possibly WRONG zeros"),
160                    "sparseQR_coef");
161            EXIT_sparseQR_;
162        }
163    
164      UNPROTECT(1);      UNPROTECT(1);
165      return ans;      return ans;
# Line 184  Line 191 
191      /* multiply by Q and apply inverse row permutation */      /* multiply by Q and apply inverse row permutation */
192      sparseQR_Qmult(V, beta, p, /* trans = */ FALSE, ax, ydims);      sparseQR_Qmult(V, beta, p, /* trans = */ FALSE, ax, ydims);
193    
194      EXIT_sparseQR_      if(rank_def) {
195            warning(_("%s(): structurally rank deficient case: possibly WRONG zeros"),
196                    "sparseQR_resid_fitted");
197            EXIT_sparseQR_;
198        }
199    
200      UNPROTECT(1);      UNPROTECT(1);
201      return ans;      return ans;

Legend:
Removed from v.2860  
changed lines
  Added in v.2868

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