Displaying 1 result from an estimated 1 matches for "do_matexp".
2008 Apr 05
2
Adding a Matrix Exponentiation Operator
....
Any feedback appreciated !
Thanks
Rory
<snip>
/* Convenience function */
static void copyMatrixData(SEXP a, SEXP b, int nrows, int ncols, int mode) {
for (int i=0; i < ncols; ++i)
for (int j=0; j < nrows; ++j)
REAL(b)[i * nrows + j] = REAL(a)[i * nrows + j];
}
SEXP do_matexp(SEXP call, SEXP op, SEXP args, SEXP rho)
{
int nrows, ncols;
SEXP matrix, tmp, dims, dims2;
SEXP x, y, x_, x__;
int i,j,e,mode;
// Still need to fix full complex support
mode = isComplex(CAR(args)) ? CPLXSXP : REALSXP;
SETCAR(args, coerceVector(CAR(args), mode));
x...