The R Project SVN R-packages

Rev

Rev 4529 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 4529 Rev 4560
Line 110... Line 110...
110
    int *bdims = INTEGER(GET_SLOT(val, Matrix_DimSym));
110
    int *bdims = INTEGER(GET_SLOT(val, Matrix_DimSym));
111
    int i, ione = 1, n = bdims[0], nrhs = bdims[1];
111
    int i, ione = 1, n = bdims[0], nrhs = bdims[1];
112
    const char *uplo = uplo_P(a);
112
    const char *uplo = uplo_P(a);
113
    double *ax = REAL(GET_SLOT(a, Matrix_xSym)), one = 1., zero = 0.,
113
    double *ax = REAL(GET_SLOT(a, Matrix_xSym)), one = 1., zero = 0.,
114
	*vx = REAL(GET_SLOT(val, Matrix_xSym));
114
	*vx = REAL(GET_SLOT(val, Matrix_xSym));
115
    double *bx = Memcpy(Calloc(n * nrhs, double), vx, n * nrhs);
115
    double *bx = Alloca(n * nrhs, double);
-
 
116
    R_CheckStack();
116
 
117
 
-
 
118
    Memcpy(bx, vx, n * nrhs);
117
    if (bdims[0] != n)
119
    if (bdims[0] != n)
118
	error(_("Matrices are not conformable for multiplication"));
120
	error(_("Matrices are not conformable for multiplication"));
119
    if (nrhs < 1 || n < 1)
121
    if (nrhs < 1 || n < 1)
120
	error(_("Matrices with zero extents cannot be multiplied"));
122
	error(_("Matrices with zero extents cannot be multiplied"));
121
    for (i = 0; i < nrhs; i++)
123
    for (i = 0; i < nrhs; i++)
122
	F77_CALL(dspmv)(uplo, &n, &one, ax, bx + i * n, &ione,
124
	F77_CALL(dspmv)(uplo, &n, &one, ax, bx + i * n, &ione,
123
			&zero, vx + i * n, &ione);
125
			&zero, vx + i * n, &ione);
124
    Free(bx);
-
 
125
    UNPROTECT(1);
126
    UNPROTECT(1);
126
    return val;
127
    return val;
127
}
128
}
128
 
129
 
129
SEXP dspMatrix_trf(SEXP x)
130
SEXP dspMatrix_trf(SEXP x)