SCM

SCM Repository

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

Diff of /pkg/src/dgCMatrix.c

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

revision 2386, Wed May 27 20:54:45 2009 UTC revision 2387, Fri May 29 12:50:34 2009 UTC
# Line 221  Line 221 
221      int *dims = INTEGER(ALLOC_SLOT(ans, Matrix_DimSym, INTSXP, 2));      int *dims = INTEGER(ALLOC_SLOT(ans, Matrix_DimSym, INTSXP, 2));
222      R_CheckStack();      R_CheckStack();
223    
224      if (m < n) error("A must have # rows >= # columns") ;      if (m < n) error(_("A must have #{rows} >= #{columns}")) ;
225      dims[0] = m; dims[1] = n;      dims[0] = m; dims[1] = n;
226      S = cs_sqr(ord, A, 1);      /* symbolic QR ordering & analysis*/      S = cs_sqr(ord, A, 1);      /* symbolic QR ordering & analysis*/
227      if (!S) error("cs_sqr failed");      if (!S) error(_("cs_sqr failed"));
228      N = cs_qr(A, S);            /* numeric QR factorization */      N = cs_qr(A, S);            /* numeric QR factorization */
229      if (!N) error("cs_qr failed") ;      if (!N) error(_("cs_qr failed")) ;
230      cs_dropzeros(N->L);         /* drop zeros from V and sort */      cs_dropzeros(N->L);         /* drop zeros from V and sort */
231      D = cs_transpose(N->L, 1);      D = cs_transpose(N->L, 1);
232      cs_spfree(N->L);      cs_spfree(N->L);
# Line 346  Line 346 
346      if (ans != R_NilValue) return ans;      if (ans != R_NilValue) return ans;
347      n = A->n;      n = A->n;
348      if (A->m != n)      if (A->m != n)
349          error("LU decomposition applies only to square matrices");          error(_("LU decomposition applies only to square matrices"));
350      if (order) {                /* not using natural order */      if (order) {                /* not using natural order */
351          order = (tol == 1) ? 2  /* amd(S'*S) w/dense rows or I */          order = (tol == 1) ? 2  /* amd(S'*S) w/dense rows or I */
352              : 1;                /* amd (A+A'), or natural */              : 1;                /* amd (A+A'), or natural */
# Line 354  Line 354 
354      S = cs_sqr (order, A, 0) ;  /* symbolic ordering, no QR bound */      S = cs_sqr (order, A, 0) ;  /* symbolic ordering, no QR bound */
355      N = cs_lu (A, S, tol) ;     /* numeric factorization */      N = cs_lu (A, S, tol) ;     /* numeric factorization */
356      if (!N) {      if (!N) {
357          error ("cs_lu(A) failed: near-singular A (or out of memory)");          error (_("cs_lu(A) failed: near-singular A (or out of memory)"));
358          return R_NilValue; /*-Wall*/          return R_NilValue; /*-Wall*/
359      }      }
360      cs_dropzeros (N->L) ;       /* drop zeros from L and sort it */      cs_dropzeros (N->L) ;       /* drop zeros from L and sort it */

Legend:
Removed from v.2386  
changed lines
  Added in v.2387

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