SCM

SCM Repository

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

Annotation of /pkg/src/factorizations.c

Parent Directory Parent Directory | Revision Log Revision Log


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

1 : bates 10 #include "factorizations.h"
2 :    
3 :     SEXP LU_validate(SEXP obj)
4 :     {
5 :     return ScalarLogical(1);
6 :     }
7 :    
8 : bates 631 SEXP BunchKaufman_validate(SEXP obj)
9 :     {
10 :     return ScalarLogical(1);
11 :     }
12 :    
13 : bates 10 SEXP Cholesky_validate(SEXP obj)
14 :     {
15 :     return ScalarLogical(1);
16 :     }
17 :    
18 :     SEXP SVD_validate(SEXP obj)
19 :     {
20 :     return ScalarLogical(1);
21 :     }
22 : bates 582
23 :     SEXP LU_expand(SEXP x)
24 :     {
25 :     char *nms[] = {"L", "U", ""};
26 :     SEXP L, U, val = PROTECT(Matrix_make_named(VECSXP, nms)),
27 :     lux = GET_SLOT(x, Matrix_xSym),
28 :     dd = GET_SLOT(x, Matrix_DimSym);
29 :    
30 :     SET_VECTOR_ELT(val, 0, NEW_OBJECT(MAKE_CLASS("dtrMatrix")));
31 :     L = VECTOR_ELT(val, 0);
32 :     SET_VECTOR_ELT(val, 1, NEW_OBJECT(MAKE_CLASS("dtrMatrix")));
33 :     U = VECTOR_ELT(val, 1);
34 :     SET_SLOT(L, Matrix_xSym, duplicate(lux));
35 :     SET_SLOT(L, Matrix_DimSym, dd);
36 :     SET_SLOT(L, Matrix_uploSym, mkString("L"));
37 :     SET_SLOT(L, Matrix_diagSym, mkString("U"));
38 :     make_array_triangular(REAL(GET_SLOT(L, Matrix_xSym)), L);
39 :     SET_SLOT(U, Matrix_xSym, duplicate(lux));
40 :     SET_SLOT(U, Matrix_DimSym, dd);
41 :     SET_SLOT(U, Matrix_uploSym, mkString("U"));
42 :     SET_SLOT(U, Matrix_diagSym, mkString("N"));
43 :     make_array_triangular(REAL(GET_SLOT(U, Matrix_xSym)), U);
44 :     UNPROTECT(1);
45 :     return val;
46 :     }

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