tests/matrixSubsetCmp.R

library(RLLVMCompile)

f =
function(x, i)
{
  x[i, 2L] == 1L
}

m = Module()
fc = compileFunction(f, Int1Type, list(RMatrixType(Int32Type), Int32Type), m)
.llvm(fc, matrix(1:10, 5, 2)[, 2:1], 1)

# Fails - comparing double to Int32Type
m = Module()
gc = compileFunction(f, Int1Type, list(RMatrixType(DoubleType), Int32Type), m)
.llvm(gc, matrix(1:10 + .1, 5, 2), 1)
duncantl/RLLVMCompile documentation built on May 15, 2019, 5:31 p.m.