Package com.hpctoday.fada

Examples of com.hpctoday.fada.Inequation


      StringBuilder negative = new StringBuilder();
      positive.append("_pos_").append(it);
      negative.append("_neg_").append(it);
      Expression sub = new Expression(new Expression(positive.toString()), Expression.Operation.FADA_SUB, new Expression(
          negative.toString()));
      constraints.add(new Inequation(new Expression(it), Inequation.Predicate.FADA_EQ, sub));
      constraints.add(new Inequation(new Expression(positive.toString()), Inequation.Predicate.FADA_GREATER_EQ, new Expression(0)));
      constraints.add(new Inequation(new Expression(negative.toString()), Inequation.Predicate.FADA_GREATER_EQ, new Expression(0)));
      var.add(positive.toString());
      var.add(negative.toString());
    }
  }
View Full Code Here


    SubSolution<N> sSolution = solution.getSolution();
    // conditional node
    if(sSolution instanceof PipQuast){
      PipQuast<N> __quast = (PipQuast<N>)sSolution;
      Expression ineq = PipVectorToExpression(__quast.getCondition(), __params, __new_param);
      Condition __cond = new Condition(new Inequation(ineq.GetLeftChild(), Inequation.Predicate.FADA_GREATER_EQ, ineq.GetRightChild()));
      log.trace("Cond: " + __cond);
      return new Quast(__cond,
          FromPipQuast(__index, __deep, __counters, __params, __quast.getThen(), __new_param),
          FromPipQuast(__index, __deep, __counters, __params, __quast.getElse(), __new_param));
    } else if(sSolution instanceof PipList){ // leaf
View Full Code Here

      break;
    case IASTBinaryExpression.op_logicalOr:
      finalCond =  new Condition(lhs.getCond(), Condition.Logical_Operator.FADA_OR, rhs.getCond());
      break;
    case IASTBinaryExpression.op_equals:
      finalCond =  new Condition(new Inequation(lhs.getExpr(), Inequation.Predicate.FADA_EQ, rhs.getExpr()));
      break;
    case IASTBinaryExpression.op_notequals:
      finalCond =  new Condition(new Inequation(lhs.getExpr(), Inequation.Predicate.FADA_NEQ, rhs.getExpr()));
      break;
    case IASTBinaryExpression.op_lessThan:
      finalCond =  new Condition(new Inequation(lhs.getExpr(), Inequation.Predicate.FADA_LESS, rhs.getExpr()));
      break;
    case IASTBinaryExpression.op_lessEqual:
      finalCond =  new Condition(new Inequation(lhs.getExpr(), Inequation.Predicate.FADA_LESS_EQ, rhs.getExpr()));
      break;
    case IASTBinaryExpression.op_greaterThan:
      finalCond =  new Condition(new Inequation(lhs.getExpr(), Inequation.Predicate.FADA_GREATER, rhs.getExpr()));
      break;
    case IASTBinaryExpression.op_greaterEqual:
      finalCond =  new Condition(new Inequation(lhs.getExpr(), Inequation.Predicate.FADA_GREATER_EQ, rhs.getExpr()));
      break
    default:
      System.err.println("COND OP NOT HANDLED: " + bexpr.getOperator() + " -> " + bexpr.getRawSignature());
    }   
   
View Full Code Here

      expr.accept(aVisitor);
      finalExpr = new Expression(aVisitor.id);
      for (int i = aVisitor.indices.size()-1; i >=0; i--) {
        finalExpr.AddIndex(aVisitor.indices.get(i));
      }
      finalCond =  new Condition(new Inequation(finalExpr, Inequation.Predicate.FADA_NEQ, new Expression(0)));
      return PROCESS_SKIP;
    } else if (expr instanceof IASTUnaryExpression){
      return visit ((IASTUnaryExpression)expr);
    } else if (expr instanceof IASTFunctionCallExpression){
      IASTFunctionCallExpression funcExpr = (IASTFunctionCallExpression)expr;
     
      List<Expression> arguments = new ArrayList<Expression>();
      for(IASTInitializerClause argument: funcExpr.getArguments()){
        ExprVisitor visitor = new ExprVisitor();
        argument.accept(visitor);
        arguments.add(visitor.getExpr());
      }
     
      finalExpr = new Expression(Expression.Leaf.FADA_function, funcExpr.getFunctionNameExpression().getRawSignature(), arguments);
     
      finalCond =  new Condition(new Inequation(finalExpr, Inequation.Predicate.FADA_NEQ, new Expression(0)));
      return PROCESS_SKIP;
    } else {
      System.err.println("ExprVisitor.visit: " + expr.getRawSignature() + " " + expr.getClass());
     
      return PROCESS_ABORT;
View Full Code Here

TOP

Related Classes of com.hpctoday.fada.Inequation

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.