SCM

SCM Repository

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

Diff of /pkg/src/dtpMatrix.c

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

revision 602, Fri Mar 4 12:48:40 2005 UTC revision 603, Fri Mar 4 12:53:01 2005 UTC
# Line 128  Line 128 
128          error(_("Dimensions of a (%d,%d) and b (%d,%d) do not conform"),          error(_("Dimensions of a (%d,%d) and b (%d,%d) do not conform"),
129                xDim[0], xDim[1], yDim[0], yDim[1]);                xDim[0], xDim[1], yDim[0], yDim[1]);
130      for (j = 0; j < yDim[1]; j++)      for (j = 0; j < yDim[1]; j++)
131          F77_CALL(dtpsv)(uplo, "N", diag, yDim, xx,          F77_CALL(dtpmv)(uplo, "N", diag, yDim, xx,
132                          vx + j * yDim[0], &ione);                          vx + j * yDim[0], &ione);
133      UNPROTECT(1);      UNPROTECT(1);
134      return val;      return val;
135  }  }
136    
137    SEXP dtpMatrix_matrix_mm(SEXP x, SEXP y)
138    {
139        SEXP val = PROTECT(duplicate(y));
140        int *xDim = INTEGER(GET_SLOT(x, Matrix_DimSym)),
141            *yDim = INTEGER(getAttrib(y, R_DimSymbol));
142        int ione = 1, j;
143        char *uplo = CHAR(STRING_ELT(GET_SLOT(x, Matrix_uploSym), 0)),
144            *diag = CHAR(STRING_ELT(GET_SLOT(x, Matrix_diagSym), 0));
145        double *xx = REAL(GET_SLOT(x, Matrix_xSym));
146    
147        if (yDim[0] != xDim[1])
148            error(_("Dimensions of a (%d,%d) and b (%d,%d) do not conform"),
149                  xDim[0], xDim[1], yDim[0], yDim[1]);
150        for (j = 0; j < yDim[1]; j++)
151            F77_CALL(dtpmv)(uplo, "N", diag, yDim, xx,
152                            REAL(val) + j * yDim[0], &ione);
153        UNPROTECT(1);
154        return val;
155    }
156    
157  SEXP dtpMatrix_as_dtrMatrix(SEXP from)  SEXP dtpMatrix_as_dtrMatrix(SEXP from)
158  {  {

Legend:
Removed from v.602  
changed lines
  Added in v.603

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