예제 #1
0
파일: ReadArray.java 프로젝트: nunb/fastr
 @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);
   }
 }
예제 #2
0
파일: RArray.java 프로젝트: srisatish/fastr
 @Override
 public RAny getRAny(int i) {
   return arr.boxedGet(i);
 }