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 895, Sat Sep 3 21:56:35 2005 UTC revision 896, Sat Sep 3 21:57:18 2005 UTC
# Line 10  Line 10 
10   */   */
11  SEXP lsCMatrix_validate(SEXP x)  SEXP lsCMatrix_validate(SEXP x)
12  {  {
13      SEXP val = check_scalar_string(GET_SLOT(x, Matrix_uploSym),      SEXP val = symmetricMatrix_validate(x);
14                                     "LU", "uplo");      if(isString(val))
15      int *Dim = INTEGER(GET_SLOT(x, Matrix_DimSym));          return(val);
16        else {
17      if (isString(val)) return val;          /* FIXME needed? ltC* inherits from lgC* which does this in validate*/
18      if (Dim[0] != Dim[1])          SEXP pslot = GET_SLOT(x, Matrix_pSym),
19          return mkString(_("Symmetric matrix must be square"));              islot = GET_SLOT(x, Matrix_iSym);
20      csc_check_column_sorting(x);          int
21                ncol = length(pslot) - 1,
22                *xp = INTEGER(pslot),
23                *xi = INTEGER(islot);
24    
25            if (csc_unsorted_columns(ncol, xp, xi))
26                csc_sort_columns(ncol, xp, xi, (double *) NULL);
27    
28      return ScalarLogical(1);      return ScalarLogical(1);
29  }  }
30    }
31    
32  /**  /**
33   * Transpose an lsCMatrix   * Transpose an lsCMatrix

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

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