Displaying 7 results from an estimated 7 matches for "xplusy".
2011 Apr 20
2
Include C++ DLL, error in ...: C symbol name not in load table
...rstand much C, however, I'll give it
a try). I am trying to include C++ code into an R routine, where
the C++ code looks:
#include <iostream>
using namespace std;
void foo (double* x, double* y, double* out)
{
out[0] = x[0] + y[0];
}
Back in R, the command
R CMD SHLIB --preclean -o xplusy
works fine resulting in two new files, xplusy.o and xplusy.so. The
wrapper in R is:
dyn.load("xplusy.so")
xplusy <- function(x, y){
.C("foo", as.double(x), as.double(y), out=double(1))$out
}
xplusy(1, 2)
dyn.unload("xplusy.so")
Now, dyn.load() works and xplus...
2007 Nov 06
2
[LLVMdev] Dynamic (JIT) type resolution
...a GhostLinkage, can the
compiler generate a callback? In this case I don't need a new intrinsic).
> Or, quite similarly, accessor functions also to be supplied by the JIT/
> linker:
>
You lose performance here, because you have to call the accessor
function each time you call the xPlusY function. My goal is to patch the
native code so that you do not need to call these accessor functions again.
> declare float @obj.x(i8* %obj)
> declare float @obj.y(i8* %obj)
>
> define float @xPlusY(i8* %obj) {
> entry:
> %x = call float @obj.x(i8* %o...
2007 Nov 06
0
[LLVMdev] Dynamic (JIT) type resolution
...calculations until JIT compilation time?
Perhaps I'm missing something, but can't you accomplish this by using
external constants in the source program, to be supplied at JIT/link
time?
external constant i32 @obj.x.offs;
external constant i32 @obj.y.offs;
define float @xPlusY(i8* %obj) {
entry:
%x.offs = load i32* @obj.x.offs;
%x.ptr = getelementptr %obj, i32 %x.offs;
%x.ptr2 = bitcast i8* %x.ptr to float*
%x = load float* %x.ptr2
%y.offs = load i32* @obj.y.offs;
%y.ptr = getelementptr %obj, i32 %y.offs;
%y.ptr2 = bi...
2007 Nov 06
4
[LLVMdev] Dynamic (JIT) type resolution
Hi everyone,
I would like to implement an equivalent mechanism of function callbacks
in the JIT, but for fields. Typically in Java, when you compile a
method, there may be some instructions (getfield, putfield) that depend
on a type which is not yet resolved.
I think the best way to do this in LLVM is to add an intrinsic. The
intrinsic would be only valid if we jit, and would be lowered only in
2011 Oct 24
0
R.oo package: do setMethodS3 work upon construction
...t;, function(this,...) {
this$.x
})
> a = ClassA()
> a$x
[1] 1
The following further illustrates what you can do with Example 1 above:
Example 3:
setConstructorS3("ClassA", function() {
this = extend(Object(), "ClassA",
.x=NULL,
.y=1
)
this$xOne()
this$xPlusY()
this
})
setMethodS3("xOne", "ClassA", function(this,...) {
this$.x = 1
})
setMethodS3("xPlusY", "ClassA", function(this,...) {
this$.x = this$.x + this$.y
})
setMethodS3("getX", "ClassA", function(this,...) {
this$.x
})
>...
2010 Aug 25
1
Estimate average standard deviation of mean of two dependent groups
Dear R-experts!
I am currently running a meta-analysis with the help of the great metafor
package. However I have some difficulties setting up my raw data to enter it
to the meta-analysis models.
I have a group of subjects that have been measured in two continuous
variables (A & B). I have the information about the mean of the two
variables, the group size (n) and the standard deviations of
2007 Nov 06
0
[LLVMdev] Dynamic (JIT) type resolution
On 2007-11-06, at 11:29, Nicolas Geoffray wrote:
>> Or, quite similarly, accessor functions also to be supplied by the
>> JIT/
>> linker:
>>
>
> You lose performance here, because you have to call the accessor
> function each time you call the xPlusY function. My goal is to patch
> the
> native code so that you do not need to call these accessor functions
> again.
Just run the inliner.
— Gordon