Ejemplo n.º 1
0
 @Override
 public Object execute(
     RArray base, Selector selectorI, Selector selectorJ, boolean drop, int exact)
     throws UnexpectedResultException {
   int[] ndim = base.dimensions();
   int m = ndim[0];
   int n = ndim[1];
   selectorI.start(m, ast);
   selectorJ.start(n, ast);
   int i = selectorI.nextIndex(ast);
   int j = selectorJ.nextIndex(ast);
   assert Utils.check(i != RInt.NA && j != RInt.NA); // ensured by subscript selectors
   int offset = j * m + i;
   if (!(base instanceof RList)) {
     return base.boxedGet(offset);
   } else {
     return ((RList) base).getRAny(offset);
   }
 }