SCM

SCM Repository

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

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

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

revision 10, Mon Mar 22 20:20:05 2004 UTC revision 582, Mon Feb 28 18:15:21 2005 UTC
# Line 14  Line 14 
14  {  {
15      return ScalarLogical(1);      return ScalarLogical(1);
16  }  }
17    
18    SEXP LU_expand(SEXP x)
19    {
20        char *nms[] = {"L", "U", ""};
21        SEXP L, U, val = PROTECT(Matrix_make_named(VECSXP, nms)),
22            lux = GET_SLOT(x, Matrix_xSym),
23            dd = GET_SLOT(x, Matrix_DimSym);
24    
25        SET_VECTOR_ELT(val, 0, NEW_OBJECT(MAKE_CLASS("dtrMatrix")));
26        L = VECTOR_ELT(val, 0);
27        SET_VECTOR_ELT(val, 1, NEW_OBJECT(MAKE_CLASS("dtrMatrix")));
28        U = VECTOR_ELT(val, 1);
29        SET_SLOT(L, Matrix_xSym, duplicate(lux));
30        SET_SLOT(L, Matrix_DimSym, dd);
31        SET_SLOT(L, Matrix_uploSym, mkString("L"));
32        SET_SLOT(L, Matrix_diagSym, mkString("U"));
33        make_array_triangular(REAL(GET_SLOT(L, Matrix_xSym)), L);
34        SET_SLOT(U, Matrix_xSym, duplicate(lux));
35        SET_SLOT(U, Matrix_DimSym, dd);
36        SET_SLOT(U, Matrix_uploSym, mkString("U"));
37        SET_SLOT(U, Matrix_diagSym, mkString("N"));
38        make_array_triangular(REAL(GET_SLOT(U, Matrix_xSym)), U);
39        UNPROTECT(1);
40        return val;
41    }

Legend:
Removed from v.10  
changed lines
  Added in v.582

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