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 895, Sat Sep 3 21:56:35 2005 UTC revision 919, Fri Sep 16 17:27:06 2005 UTC
# Line 216  Line 216 
216      return ans;      return ans;
217  }  }
218    
219    SEXP compressed_non_0_ij(SEXP x, SEXP colP)
220    {
221        int col = asLogical(colP); /* 1 if "C"olumn compressed;  0 if "R"ow */
222        SEXP ans, indSym = col ? Matrix_iSym : Matrix_jSym;
223        SEXP indP = GET_SLOT(x, indSym),
224            pP = GET_SLOT(x, Matrix_pSym);
225        int n_el = length(indP), i, *ij;
226    
227        ij = INTEGER(ans = PROTECT(allocMatrix(INTSXP, n_el, 2)));
228        /* expand the compressed margin to 'i' or 'j' : */
229        expand_cmprPt(length(pP) - 1, INTEGER(pP), &ij[col ? n_el : 0]);
230        /* and copy the other one: */
231        if (col)
232            for(i = 0; i < n_el; i++)
233                ij[i] = INTEGER(indP)[i];
234        else /* row compressed */
235            for(i = 0; i < n_el; i++)
236                ij[i + n_el] = INTEGER(indP)[i];
237    
238        UNPROTECT(1);
239        return ans;
240    }
241    
242  SEXP csc_to_matrix(SEXP x)  SEXP csc_to_matrix(SEXP x)
243  {  {
244      SEXP ans, pslot = GET_SLOT(x, Matrix_pSym);      SEXP ans, pslot = GET_SLOT(x, Matrix_pSym);

Legend:
Removed from v.895  
changed lines
  Added in v.919

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