SCM

SCM Repository

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

Diff of /pkg/src/dsCMatrix.c

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

revision 587, Wed Mar 2 18:19:15 2005 UTC revision 614, Sat Mar 5 21:14:43 2005 UTC
# Line 2  Line 2 
2    
3  SEXP dsCMatrix_validate(SEXP obj)  SEXP dsCMatrix_validate(SEXP obj)
4  {  {
5      SEXP uplo = GET_SLOT(obj, Matrix_uploSym);      SEXP val = check_scalar_string(GET_SLOT(obj, Matrix_uploSym),
6                                       "LU", "uplo");
7      int *Dim = INTEGER(GET_SLOT(obj, Matrix_DimSym));      int *Dim = INTEGER(GET_SLOT(obj, Matrix_DimSym));
     char *val;  
8    
9      if (length(uplo) != 1)      if (isString(val)) return val;
         return mkString(_("uplo slot must have length 1"));  
     val = CHAR(STRING_ELT(uplo, 0));  
     if (strlen(val) != 1)  
         return mkString(_("uplo[1] must have string length 1"));  
     if (*val != 'U' && *val != 'L')  
         return mkString(_("uplo[1] must be \"U\" or \"L\""));  
10      if (Dim[0] != Dim[1])      if (Dim[0] != Dim[1])
11          return mkString(_("Symmetric matrix must be square"));          return mkString(_("Symmetric matrix must be square"));
12      csc_check_column_sorting(obj);      csc_check_column_sorting(obj);
# Line 145  Line 139 
139      adims[0] = xdims[1]; adims[1] = xdims[0];      adims[0] = xdims[1]; adims[1] = xdims[0];
140      if (CHAR(asChar(GET_SLOT(x, Matrix_uploSym)))[0] == 'U')      if (CHAR(asChar(GET_SLOT(x, Matrix_uploSym)))[0] == 'U')
141          SET_SLOT(ans, Matrix_uploSym, mkString("L"));          SET_SLOT(ans, Matrix_uploSym, mkString("L"));
142        else
143            SET_SLOT(ans, Matrix_uploSym, mkString("U"));
144      csc_compTr(xdims[0], xdims[1], nnz,      csc_compTr(xdims[0], xdims[1], nnz,
145                 INTEGER(GET_SLOT(x, Matrix_pSym)), INTEGER(islot),                 INTEGER(GET_SLOT(x, Matrix_pSym)), INTEGER(islot),
146                 REAL(GET_SLOT(x, Matrix_xSym)),                 REAL(GET_SLOT(x, Matrix_xSym)),

Legend:
Removed from v.587  
changed lines
  Added in v.614

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