@Override public void visit(Exponentiation exponentiation) { code.append("Math.pow("); addChild(exponentiation, exponentiation.getLeft()); code.append(','); addChild(exponentiation, exponentiation.getRight()); code.append(")"); }
/** * Returns if the exponentiation has an exponent which is equal to 2 * @param exponentiation The exponentiation * @return <value>true</value> if the exponent is equal to 2, <value>false</value> otherwise */ protected boolean isSquare(Exponentiation exponentiation) { final FloatConstant two = new FloatConstant(2.0f); return two.equals(exponentiation.getRight()); }
@Override public void visit(Exponentiation exponentiation) { exponentiation.getLeft().accept(this); code.append("^{"); exponentiation.getRight().accept(this); code.append('}'); }
@Override public void visit(Exponentiation node) { traverseBinary(node); MvExpressions l = expressions.get(node.getLeft()); MvExpressions r = expressions.get(node.getRight()); MvExpressions result = createNewMvExpressions(); result.bladeExpressions[0] = new Exponentiation(l.bladeExpressions[0], r.bladeExpressions[0]); expressions.put(node, result); System.err.println("Warning: Exponentiation is only implemented for scalars!"); }
private boolean isSquare(Exponentiation exponentiation) { final FloatConstant two = new FloatConstant(2.0f); return two.equals(exponentiation.getRight()); }
private boolean isSquare(Exponentiation exponentiation) { final FloatConstant two = new FloatConstant(2.0f); return two.equals(exponentiation.getRight()); }
private boolean isSquare(Exponentiation exponentiation) { final FloatConstant two = new FloatConstant(2.0f); return two.equals(exponentiation.getRight()); }
private boolean isSquare(Exponentiation exponentiation) { final FloatConstant two = new FloatConstant(2.0f); return two.equals(exponentiation.getRight()); }
protected boolean isSquare(Exponentiation exponentiation) { final FloatConstant two = new FloatConstant(2.0f); return two.equals(exponentiation.getRight()); }
@Override public void visit(Exponentiation node) { handleBinary(node.getLeft(), node.getRight()); }
@Override public void visit(Exponentiation node) { node.getLeft().accept(this); double leftValue = resultValue; node.getRight().accept(this); resultValue = Math.pow(leftValue,resultValue); }
@Override public void visit(Exponentiation node) { node.getLeft().accept(this); Double left = result; node.getRight().accept(this); result = Math.pow(left,result); }
@Override public void visit(Exponentiation node) { node.getLeft().accept(this); node.getRight().accept(this); }
/** * Converts this node to a human readable string. * * @return The string "<code>left ^ right</code>" where left and right are the two operands converted to strings * using their toString methods. */ public String toString() { return bracketComposite(getLeft()) + " ^ " + bracketComposite(getRight()); } }
public void visit(Exponentiation node) { // just do nothing, because only MulitvectorComponent is important node.getLeft().accept(this); node.getRight().accept(this); }
@Override public void visit(Exponentiation exponentiation) { if (isSquare(exponentiation)) { Multiplication m = new Multiplication(exponentiation.getLeft(), exponentiation.getLeft()); m.accept(this); } else { code.append("pow("); exponentiation.getLeft().accept(this); code.append(','); exponentiation.getRight().accept(this); code.append(')'); } }
@Override public void visit(Exponentiation node) { result = null; node.getLeft().accept(this); Expression leftResult = result; node.getRight().accept(this); Expression rightResult = result; if (leftResult != null || rightResult != null) result = new Exponentiation(leftResult, rightResult); }
@Override public Expression copy() { return new Exponentiation(getLeft().copy(), getRight().copy()); }
@Override public void visit(Exponentiation node) { node.getLeft().accept(this); RealInterval left = result; node.getRight().accept(this); double hi = result.hi(); if (Math.abs(hi-result.lo()) < 0.001 && Math.abs(hi-((int) hi)) < 0.001 && hi>=0) { result = new RealInterval(1); for (int i=0;i<((int) hi);i++) result = IAMath.mul(result, left); } else result = IAMath.power(left, result); }
@Override public void visit(Exponentiation exponentiation) { if (isSquare(exponentiation)) { Multiplication m = new Multiplication(exponentiation.getLeft(), exponentiation.getLeft()); m.accept(this); } else { append("Math.pow("); exponentiation.getLeft().accept(this); append(','); exponentiation.getRight().accept(this); append(')'); } }