Package org.renjin.sexp

Examples of org.renjin.sexp.LogicalArrayVector


    map.put("prompt", new StringArrayVector("> "));
    map.put("continue", new StringArrayVector("+ "));
    map.put("expressions" , new IntArrayVector(5000));
    map.put("width", new IntArrayVector(80));
    map.put("digits", new IntArrayVector(7));
    map.put("echo", new LogicalArrayVector(false));
    map.put("verbose", new LogicalArrayVector(false));
    map.put("check.bounds", new LogicalArrayVector(false));
    map.put("keep.source", new LogicalArrayVector(true));
    map.put("keep.source.pkgs", new LogicalArrayVector(false));
    map.put("warnings.length", new IntArrayVector(1000));
    map.put("OutDec", new StringArrayVector("."));
  }
View Full Code Here


  }
 
  @Override
  public LogicalVector convertToR(Boolean[] value) {
    if(value == null) {
      return new LogicalArrayVector(LogicalVector.NA);
    } else {
      return new LogicalArrayVector(value);
    }
  }
View Full Code Here

    builder.addStatement(new IfStatement(condition1, firstTrue, falseLabel, firstNA));
   
    // first is true.
    // set the result to true and do the next test
    builder.addLabel(firstTrue);
    builder.addStatement(new Assignment(result, new Constant(new LogicalArrayVector(true))));
    builder.addStatement(new GotoStatement(test2Label));
   
    // first is NA
    // set the result to NA and do the next test
    builder.addLabel(firstNA);
    builder.addStatement(new Assignment(result, new Constant(new LogicalArrayVector(LogicalVector.NA))));
    builder.addStatement(new GotoStatement(test2Label));
   
    // check second condition
    builder.addLabel(test2Label);
    SimpleExpression condition2 = builder.translateSimpleExpression(context, call.getArgument(1));
    builder.addStatement(new IfStatement(condition2,
        finishLabel,  // if condition 2 is true, then the result is equal to condition2
        falseLabel, // if false, final result is false,
        naLabel));

    builder.addLabel(falseLabel);
    builder.addStatement(new Assignment(result, new Constant(new LogicalArrayVector(false))));
    builder.addStatement(new GotoStatement(finishLabel));
   
    builder.addLabel(naLabel);
    builder.addStatement(new Assignment(result, new Constant(new LogicalArrayVector(LogicalVector.NA))));
   
    builder.addLabel(finishLabel);
  
    return result;
  }
View Full Code Here

    builder.addStatement(new IfStatement(condition1, trueLabel, firstFalse, firstNA));
   
    // first is true.
    // set the result to true and do the next test
    builder.addLabel(firstFalse);
    builder.addStatement(new Assignment(result, new Constant(new LogicalArrayVector(false))));
    builder.addStatement(new GotoStatement(test2Label));
   
    // first is NA
    // set the result to NA and do the next test
    builder.addLabel(firstNA);
    builder.addStatement(new Assignment(result, new Constant(new LogicalArrayVector(LogicalVector.NA))));
    builder.addStatement(new GotoStatement(test2Label));
   
    // check second condition
    builder.addLabel(test2Label);
    SimpleExpression condition2 = builder.translateSimpleExpression(context, call.getArgument(1));
    builder.addStatement(new IfStatement(condition2,
        trueLabel,
        finishLabel,  // if condition 2 is false, then the result is equal to condition1
        naLabel));

    builder.addLabel(trueLabel);
    builder.addStatement(new Assignment(result, new Constant(new LogicalArrayVector(true))));
    builder.addStatement(new GotoStatement(finishLabel));
   
    builder.addLabel(naLabel);
    builder.addStatement(new Assignment(result, new Constant(new LogicalArrayVector(LogicalVector.NA))));
   
    builder.addLabel(finishLabel);
  
    return result;
  }
View Full Code Here

TOP

Related Classes of org.renjin.sexp.LogicalArrayVector

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.