SCM

SCM Repository

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

Diff of /pkg/src/lsCMatrix.c

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

revision 1448, Sat Aug 26 03:29:36 2006 UTC revision 1517, Wed Sep 6 13:34:03 2006 UTC
# Line 28  Line 28 
28          return ScalarLogical(1);          return ScalarLogical(1);
29      }      }
30  }  }
   
 #if 0                           /* no longer used */  
 /**  
  * Transpose an lsCMatrix  
  *  
  * @param x Pointer to an lsCMatrix object  
  *  
  * @return the transpose of x.  It represents the same matrix but is  
  * stored in the opposite triangle.  
  */  
 SEXP lsCMatrix_trans(SEXP x)  
 {  
     SEXP Xi = GET_SLOT(x, Matrix_iSym),  
         xDim = GET_SLOT(x, Matrix_DimSym),  
         ans = PROTECT(NEW_OBJECT(MAKE_CLASS("lsCMatrix")));  
     int n = INTEGER(xDim)[0], nz = length(Xi);  
     int *xj = expand_cmprPt(n, INTEGER(GET_SLOT(x, Matrix_pSym)),  
                             Calloc(nz, int)),  
         *xi = Memcpy(Calloc(nz, int), Xi, nz);  
     int up = uplo_P(x)[0] == 'U';  
   
     SET_SLOT(ans, Matrix_DimSym, duplicate(xDim));  
     SET_SLOT(ans, Matrix_DimNamesSym,  
              duplicate(GET_SLOT(x, Matrix_DimNamesSym)));  
     SET_SLOT(ans, Matrix_uploSym, mkString(up ? "L" : "U"));  
     make_upper_triangular(up ? xj : xi, up ? xi : xj, nz);  
     triplet_to_col(n, n, nz, xi, xj, (double *) NULL,  
                    INTEGER(ALLOC_SLOT(ans, Matrix_pSym, INTSXP,  n + 1)),  
                    INTEGER(ALLOC_SLOT(ans, Matrix_iSym, INTSXP,  nz)),  
                    (double *) NULL);  
     Free(xj); Free(xi);  
     UNPROTECT(1);  
     return ans;  
 }  
 #endif  

Legend:
Removed from v.1448  
changed lines
  Added in v.1517

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