The R Project SVN R

Rev

Rev 75515 | Rev 84211 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 75515 Rev 75934
Line 433... Line 433...
433
	    if(pt == R_NilValue) pt = t;
433
	    if(pt == R_NilValue) pt = t;
434
	}
434
	}
435
    }
435
    }
436
}
436
}
437
 
437
 
-
 
438
static R_INLINE SEXP VECTOR_ELT_LD(SEXP x, R_xlen_t i)
-
 
439
{
-
 
440
    return lazy_duplicate(VECTOR_ELT(x, i));
-
 
441
}
-
 
442
 
438
void copyMatrix(SEXP s, SEXP t, Rboolean byrow)
443
void copyMatrix(SEXP s, SEXP t, Rboolean byrow)
439
{
444
{
440
    int nr = nrows(s), nc = ncols(s);
445
    int nr = nrows(s), nc = ncols(s);
441
    R_xlen_t nt = XLENGTH(t);
446
    R_xlen_t nt = XLENGTH(t);
442
 
447
 
Line 463... Line 468...
463
		COMPLEX(s)[didx] = COMPLEX(t)[sidx];
468
		COMPLEX(s)[didx] = COMPLEX(t)[sidx];
464
	    break;
469
	    break;
465
	case EXPRSXP:
470
	case EXPRSXP:
466
	case VECSXP:
471
	case VECSXP:
467
	    FILL_MATRIX_BYROW_ITERATE(0, nr, nc, nt)
472
	    FILL_MATRIX_BYROW_ITERATE(0, nr, nc, nt)
468
		SET_VECTOR_ELT(s, didx, VECTOR_ELT(t, sidx));
473
		SET_VECTOR_ELT(s, didx, VECTOR_ELT_LD(t, sidx));
469
	    break;
474
	    break;
470
	case RAWSXP:
475
	case RAWSXP:
471
	    FILL_MATRIX_BYROW_ITERATE(0, nr, nc, nt)
476
	    FILL_MATRIX_BYROW_ITERATE(0, nr, nc, nt)
472
		RAW(s)[didx] = RAW(t)[sidx];
477
		RAW(s)[didx] = RAW(t)[sidx];
473
	    break;
478
	    break;
Line 532... Line 537...
532
	SETELT(dst, dstart + i, GETELT(src, sidx));	\
537
	SETELT(dst, dstart + i, GETELT(src, sidx));	\
533
    }							\
538
    }							\
534
}
539
}
535
 
540
 
536
COPY_ELT_WITH_RECYCLE(String, STRING_ELT, SET_STRING_ELT) /* xcopyStringWithRecycle */
541
COPY_ELT_WITH_RECYCLE(String, STRING_ELT, SET_STRING_ELT) /* xcopyStringWithRecycle */
537
COPY_ELT_WITH_RECYCLE(Vector, VECTOR_ELT, SET_VECTOR_ELT) /* xcopyVectorWithRecycle */
542
COPY_ELT_WITH_RECYCLE(Vector, VECTOR_ELT_LD, SET_VECTOR_ELT) /* xcopyVectorWithRecycle */
538
 
543
 
539
#define FILL_WITH_RECYCLE(VALTYPE, TNAME) \
544
#define FILL_WITH_RECYCLE(VALTYPE, TNAME) \
540
void attribute_hidden xfill##TNAME##MatrixWithRecycle(VALTYPE *dst, VALTYPE *src,	\
545
void attribute_hidden xfill##TNAME##MatrixWithRecycle(VALTYPE *dst, VALTYPE *src,	\
541
    R_xlen_t dstart, R_xlen_t drows, R_xlen_t srows,		\
546
    R_xlen_t dstart, R_xlen_t drows, R_xlen_t srows,		\
542
    R_xlen_t cols, R_xlen_t nsrc) {				\
547
    R_xlen_t cols, R_xlen_t nsrc) {				\