SCM

SCM Repository

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

Diff of /pkg/src/dsyMatrix.c

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

revision 337, Fri Nov 12 21:13:59 2004 UTC revision 338, Fri Nov 12 21:17:36 2004 UTC
# Line 43  Line 43 
43  double set_rcond_sy(SEXP obj, char *typstr)  double set_rcond_sy(SEXP obj, char *typstr)
44  {  {
45      char typnm[] = {'\0', '\0'};      char typnm[] = {'\0', '\0'};
46      SEXP rcv = GET_SLOT(obj, install("rcond"));      SEXP rcv = GET_SLOT(obj, Matrix_rcondSym);
47      double rcond;      double rcond;
48    
49      typnm[0] = rcond_type(typstr);      typnm[0] = rcond_type(typstr);
# Line 61  Line 61 
61                           &anorm, &rcond,                           &anorm, &rcond,
62                           (double *) R_alloc(2*dims[0], sizeof(double)),                           (double *) R_alloc(2*dims[0], sizeof(double)),
63                           (int *) R_alloc(dims[0], sizeof(int)), &info);                           (int *) R_alloc(dims[0], sizeof(int)), &info);
64          SET_SLOT(obj, install("rcond"),          SET_SLOT(obj, Matrix_rcondSym,
65                   set_double_by_name(rcv, rcond, typnm));                   set_double_by_name(rcv, rcond, typnm));
66      }      }
67      return rcond;      return rcond;
# Line 110  Line 110 
110  SEXP syMatrix_as_geMatrix(SEXP from)  SEXP syMatrix_as_geMatrix(SEXP from)
111  {  {
112      SEXP val = PROTECT(NEW_OBJECT(MAKE_CLASS("geMatrix"))),      SEXP val = PROTECT(NEW_OBJECT(MAKE_CLASS("geMatrix"))),
113          rcondSym = install("rcond");          rcondSym = Matrix_rcondSym;
114    
115        SET_SLOT(val, Matrix_rcondSym, allocVector(REALSXP, 0));
116        SET_SLOT(val, Matrix_factorization, allocVector(VECSXP, 0));
117      SET_SLOT(val, rcondSym, duplicate(GET_SLOT(from, rcondSym)));      SET_SLOT(val, rcondSym, duplicate(GET_SLOT(from, rcondSym)));
118      SET_SLOT(val, Matrix_xSym, duplicate(GET_SLOT(from, Matrix_xSym)));      SET_SLOT(val, Matrix_xSym, duplicate(GET_SLOT(from, Matrix_xSym)));
119      SET_SLOT(val, Matrix_DimSym,      SET_SLOT(val, Matrix_DimSym,
# Line 147  Line 149 
149          error("Matrices are not conformable for multiplication");          error("Matrices are not conformable for multiplication");
150      if (m < 1 || n < 1 || k < 1)      if (m < 1 || n < 1 || k < 1)
151          error("Matrices with zero extents cannot be multiplied");          error("Matrices with zero extents cannot be multiplied");
152        SET_SLOT(val, Matrix_factorization, allocVector(VECSXP, 0));
153        SET_SLOT(val, Matrix_rcondSym, allocVector(REALSXP, 0));
154      SET_SLOT(val, Matrix_xSym, allocVector(REALSXP, m * n));      SET_SLOT(val, Matrix_xSym, allocVector(REALSXP, m * n));
155      SET_SLOT(val, Matrix_DimSym, allocVector(INTSXP, 2));      SET_SLOT(val, Matrix_DimSym, allocVector(INTSXP, 2));
156      cdims = INTEGER(GET_SLOT(val, Matrix_DimSym));      cdims = INTEGER(GET_SLOT(val, Matrix_DimSym));
# Line 173  Line 177 
177          error("Matrices are not conformable for multiplication");          error("Matrices are not conformable for multiplication");
178      if (m < 1 || n < 1 || k < 1)      if (m < 1 || n < 1 || k < 1)
179          error("Matrices with zero extents cannot be multiplied");          error("Matrices with zero extents cannot be multiplied");
180        SET_SLOT(val, Matrix_rcondSym, allocVector(REALSXP, 0));
181        SET_SLOT(val, Matrix_factorization, allocVector(VECSXP, 0));
182      SET_SLOT(val, Matrix_xSym, allocVector(REALSXP, m * n));      SET_SLOT(val, Matrix_xSym, allocVector(REALSXP, m * n));
183      SET_SLOT(val, Matrix_DimSym, allocVector(INTSXP, 2));      SET_SLOT(val, Matrix_DimSym, allocVector(INTSXP, 2));
184      cdims = INTEGER(GET_SLOT(val, Matrix_DimSym));      cdims = INTEGER(GET_SLOT(val, Matrix_DimSym));

Legend:
Removed from v.337  
changed lines
  Added in v.338

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