private static void getContainExpr(EvalNode expr, Column target, Set<EvalNode> exprSet) { switch (expr.getType()) { case EQUAL: case LTH: case LEQ: case GTH: case GEQ: case NOT_EQUAL: if (containColumnRef(expr, target)) { exprSet.add(expr); } break; default: break; } }
private static void getContainExpr(EvalNode expr, Column target, Set<EvalNode> exprSet) { switch (expr.getType()) { case EQUAL: case LTH: case LEQ: case GTH: case GEQ: case NOT_EQUAL: if (containColumnRef(expr, target)) { exprSet.add(expr); } break; default: break; } }
/** * Transpose a given comparison expression into the expression * where the variable corresponding to the target is placed * on the left-hand side. * * @param evalNode * @param target * @return Transposed expression */ public static EvalNode transpose(EvalNode evalNode, Column target) { BinaryEval commutated; if (evalNode instanceof BinaryEval) { // if it is binary BinaryEval binaryEval = (BinaryEval) evalNode; // If the variable is in the right term, inverse the expr. if (!EvalTreeUtil.containColumnRef(binaryEval.getLeftExpr(), target)) { // the commutate method works with a copy of the expr commutated = commutate(binaryEval); } else { try { commutated = (BinaryEval) evalNode.clone(); } catch (CloneNotSupportedException e) { throw new AlgebraicException(e); } } return _transpose(commutated, target); } else { return evalNode; } }
/** * Transpose a given comparison expression into the expression * where the variable corresponding to the target is placed * on the left-hand side. * * @param evalNode * @param target * @return Transposed expression */ public static EvalNode transpose(EvalNode evalNode, Column target) { BinaryEval commutated; if (evalNode instanceof BinaryEval) { // if it is binary BinaryEval binaryEval = (BinaryEval) evalNode; // If the variable is in the right term, inverse the expr. if (!EvalTreeUtil.containColumnRef(binaryEval.getLeftExpr(), target)) { // the commutate method works with a copy of the expr commutated = commutate(binaryEval); } else { try { commutated = (BinaryEval) evalNode.clone(); } catch (CloneNotSupportedException e) { throw new AlgebraicException(e); } } return _transpose(commutated, target); } else { return evalNode; } }
if (EvalTreeUtil.containColumnRef(((BinaryEval)left).getLeftExpr(), target)) { PartialBinaryExpr tmpTerm = splitRightTerm((BinaryEval) left); tmpTerm.type = inverseOperator(tmpTerm.type);
if (EvalTreeUtil.containColumnRef(((BinaryEval)left).getLeftExpr(), target)) { PartialBinaryExpr tmpTerm = splitRightTerm((BinaryEval) left); tmpTerm.type = inverseOperator(tmpTerm.type);