Example #1
0
	// !!!
	SEXP set_cachesizeMb_R(SEXP s, SEXP SizeMB)
	{
		//testDbg << "set_cachesizeMb_R"<<endl;
		AbstractMatrix * p = getAbstractMatrixFromSEXP(s);
		if (p == NULL) {
			error_R("pointer is NULL\n");
			return R_NilValue;
		}
		unsigned long sizeMb = (unsigned long) INTEGER(SizeMB)[0];
		try {
			p->setCacheSizeInMb( sizeMb );
		} catch (int errcode) {
			error_R("cannot reset cache size\n");
			return R_NilValue;
		}

		SEXP ret;PROTECT(ret = allocVector(LGLSXP, 1));LOGICAL(ret)[0] = TRUE;UNPROTECT(1);
		return ret;

	}
Example #2
0
// !!!
SEXP set_cachesizeMb_R(SEXP s, SEXP SizeMB) {
	CHECK_PTR(s);
	AbstractMatrix * p = (AbstractMatrix*) R_ExternalPtrAddr(s);
	if (p == NULL) {
		error_R("pointer is NULL\n");
		return R_NilValue;
	}
	unsigned long int sizeMb = (unsigned long int) INTEGER(SizeMB)[0];
	try {
		p->setCacheSizeInMb(sizeMb);
	} catch (int errcode) {
		error_R("cannot reset cache size\n");
		return R_NilValue;
	}

	SEXP ret;
	PROTECT(ret = allocVector(LGLSXP, 1));
	LOGICAL(ret)[0] = TRUE;
	UNPROTECT(1);
	return ret;

}