SCM

SCM Repository

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

Diff of /pkg/Matrix/src/dtCMatrix.c

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

revision 1661, Thu Nov 2 13:10:50 2006 UTC revision 1710, Tue Dec 26 15:57:06 2006 UTC
# Line 2  Line 2 
2  #include "dtCMatrix.h"  #include "dtCMatrix.h"
3  #include "cs_utils.h"  #include "cs_utils.h"
4    
5    /* This should be use for *BOTH* triangular and symmetric Csparse: */
6    SEXP tCMatrix_validate(SEXP x)
7    {
8        SEXP val = xCMatrix_validate(x);/* checks x slot */
9        if(isString(val))
10            return(val);
11        else {
12            SEXP
13                islot = GET_SLOT(x, Matrix_iSym),
14                pslot = GET_SLOT(x, Matrix_pSym);
15            int uploT = (*uplo_P(x) == 'U'),
16                k, nnz = length(islot),
17                *xi = INTEGER(islot),
18                *xj = INTEGER(PROTECT(allocVector(INTSXP, nnz)));
19    
20    #define RETURN(_CH_)   UNPROTECT(1); return (_CH_);
21    
22            expand_cmprPt(length(pslot) - 1, INTEGER(pslot), xj);
23    
24            /* Maybe FIXME: ">" should be ">="      for diag = 'U' (uplo = 'U') */
25            if(uploT) {
26                for (k = 0; k < nnz; k++)
27                    if(xi[k] > xj[k]) {
28                        RETURN(mkString(_("uplo='U' must not have sparse entries in lower diagonal")));
29                    }
30            }
31            else {
32                for (k = 0; k < nnz; k++)
33                    if(xi[k] < xj[k]) {
34                        RETURN(mkString(_("uplo='L' must not have sparse entries in upper diagonal")));
35                    }
36            }
37    
38            RETURN(ScalarLogical(1));
39        }
40    }
41    #undef RETURN
42    
43  /**  /**
44   * Derive the column pointer vector for the inverse of L from the parent array   * Derive the column pointer vector for the inverse of L from the parent array
45   *   *

Legend:
Removed from v.1661  
changed lines
  Added in v.1710

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