SCM

SCM Repository

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

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

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

revision 479, Wed Feb 2 14:52:26 2005 UTC revision 488, Wed Feb 2 19:11:51 2005 UTC
# Line 1  Line 1 
1  #include "dpoMatrix.h"  #include "dpoMatrix.h"
2    
3    SEXP dpoMatrix_validate(SEXP obj)
4    {
5        int i, n = INTEGER(GET_SLOT(obj, Matrix_DimSym))[0];
6        int np1 = n + 1;
7        double *x = REAL(GET_SLOT(obj, Matrix_xSym));
8    
9        /* quick but nondefinitive check on positive definiteness */
10        for (i = 0; i < n; i++)
11            if (x[i * np1] < 0) return mkString("dpoMatrix is not positive definite");
12        return ScalarLogical(1);
13    }
14    
15  SEXP dpoMatrix_chol(SEXP x)  SEXP dpoMatrix_chol(SEXP x)
16  {  {
17      SEXP val = get_factors(x, "Cholesky"),      SEXP val = get_factors(x, "Cholesky"),

Legend:
Removed from v.479  
changed lines
  Added in v.488

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