SCM

SCM Repository

[matrix] Annotation of /pkg/src/LU.c
ViewVC logotype

Annotation of /pkg/src/LU.c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 10 - (view) (download) (as text)

1 : bates 10 #include "LU.h"
2 :    
3 :     SEXP LU_expand(SEXP x)
4 :     {
5 :     SEXP L = PROTECT(NEW_OBJECT(MAKE_CLASS("trMatrix"))),
6 :     U = PROTECT(NEW_OBJECT(MAKE_CLASS("trMatrix"))),
7 :     val = PROTECT(allocVector(VECSXP, 2)),
8 :     nms = PROTECT(allocVector(STRSXP, 2)),
9 :     lux = GET_SLOT(x, Matrix_xSym),
10 :     dd = GET_SLOT(x, Matrix_DimSym);
11 :    
12 :     SET_STRING_ELT(nms, 0, mkChar("L"));
13 :     SET_STRING_ELT(nms, 1, mkChar("U"));
14 :     setAttrib(val, R_NamesSymbol, nms);
15 :     SET_VECTOR_ELT(val, 0, L);
16 :     SET_VECTOR_ELT(val, 1, U);
17 :     SET_SLOT(L, Matrix_xSym, duplicate(lux));
18 :     SET_SLOT(L, Matrix_DimSym, dd);
19 :     SET_SLOT(L, Matrix_uploSym, ScalarString(mkChar("L")));
20 :     SET_SLOT(L, Matrix_diagSym, ScalarString(mkChar("U")));
21 :     make_array_triangular(REAL(GET_SLOT(L, Matrix_xSym)), L);
22 :     SET_SLOT(U, Matrix_xSym, duplicate(lux));
23 :     SET_SLOT(U, Matrix_DimSym, dd);
24 :     make_array_triangular(REAL(GET_SLOT(U, Matrix_xSym)), U);
25 :     UNPROTECT(4);
26 :     return val;
27 :     }
28 :    
29 :    
30 :    

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