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 492, Thu Feb 3 14:24:03 2005 UTC revision 534, Tue Feb 8 08:59:31 2005 UTC
# Line 14  Line 14 
14    
15      nrow = dims[0];      nrow = dims[0];
16      if (length(islot) != length(xslot))      if (length(islot) != length(xslot))
17          return ScalarString(mkChar("lengths of slots i and x must match"));          return mkString("lengths of slots i and x must match");
18      if (length(pslot) <= 0)      if (length(pslot) <= 0)
19          return ScalarString(mkChar("slot p must have length > 0"));          return mkString("slot p must have length > 0");
20      if (xp[0] != 0)      if (xp[0] != 0)
21          return ScalarString(mkChar("first element of slot p must be zero"));          return mkString("first element of slot p must be zero");
22      if (length(islot) != xp[ncol])      if (length(islot) != xp[ncol])
23          return ScalarString(          return mkString("last element of slot p must match length of slots i and x");
             mkChar(  
                 "last element of slot p must match length of slots i and x"));  
24      for (j = 0; j < ncol; j++) {      for (j = 0; j < ncol; j++) {
25          if (xp[j] > xp[j+1])          if (xp[j] > xp[j+1])
26              return ScalarString(mkChar("slot p must be non-decreasing"));              return mkString("slot p must be non-decreasing");
27      }      }
28      for (j = 0; j < length(islot); j++) {      for (j = 0; j < length(islot); j++) {
29          if (xi[j] < 0 || xi[j] >= nrow)          if (xi[j] < 0 || xi[j] >= nrow)
30              return ScalarString(              return mkString("all row indices must be between 0 and nrow-1");
                 mkChar("all row indices must be between 0 and nrow-1"));  
31      }      }
32      if (csc_unsorted_columns(ncol, xp, xi)) {      if (csc_unsorted_columns(ncol, xp, xi)) {
33          csc_sort_columns(ncol, xp, xi, REAL(xslot));          csc_sort_columns(ncol, xp, xi, REAL(xslot));
# Line 152  Line 149 
149      triplet_to_col(nrow, nrow, ntrip, iVal, jVal, xVal,      triplet_to_col(nrow, nrow, ntrip, iVal, jVal, xVal,
150                     ansp, itmp, xtmp);                     ansp, itmp, xtmp);
151      nnz = ansp[nrow];      nnz = ansp[nrow];
152      SET_SLOT(ans, Matrix_uploSym, ScalarString(mkChar("L")));      SET_SLOT(ans, Matrix_uploSym, mkString("L"));
153      SET_SLOT(ans, Matrix_iSym, allocVector(INTSXP, nnz));      SET_SLOT(ans, Matrix_iSym, allocVector(INTSXP, nnz));
154      SET_SLOT(ans, Matrix_xSym, allocVector(REALSXP, nnz));      SET_SLOT(ans, Matrix_xSym, allocVector(REALSXP, nnz));
155      Memcpy(INTEGER(GET_SLOT(ans, Matrix_iSym)), itmp, nnz);      Memcpy(INTEGER(GET_SLOT(ans, Matrix_iSym)), itmp, nnz);

Legend:
Removed from v.492  
changed lines
  Added in v.534

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