@Override public void visit(MathFunctionCall node) { // just do nothing, because only MulitvectorComponent is important node.getOperand().accept(this); }
@Override public void visit(MathFunctionCall mathFunctionCall) { mathFunctionCall.getOperand().accept(this); }
@Override public void visit(MathFunctionCall node) { node.getOperand().accept(this); }
/** * Converts this node to a human readable string representation. * * @return The string "<code>function(operand)</code>" where function and operand are both converted to strings using their * toString methods. */ public String toString() { return function.toString().toLowerCase() + "(" + getOperand() + ")"; }
@Override public void visit(MathFunctionCall node) { node.getOperand().accept(this); }
@Override public void visit(MathFunctionCall mathFunctionCall) { code.append(mathFunctionCall.getFunction().toString()); code.append('('); mathFunctionCall.getOperand().accept(this); code.append(')'); }
@Override public void visit(MathFunctionCall mathFunctionCall) { code.append(mathFunctionCall.getFunction().toString()); code.append('('); mathFunctionCall.getOperand().accept(this); code.append(')'); }
@Override public void visit(MathFunctionCall node) { resultValue = null; node.getOperand().accept(this); if (resultValue != null) { node.setOperand(resultValue); resultValue = null; } else { Variable var = getNewTemporaryVariable(); toInsert.put(var, node.getOperand()); toInsertVars.add(var); node.setOperand(var); } Variable var2 = getNewTemporaryVariable(); toInsert.put(var2, node); toInsertVars.add(var2); resultValue = var2; } };
@Override public void visit(MathFunctionCall mathFunctionCall) { code.append(mathFunctionCall.getFunction().toString()); code.append('('); mathFunctionCall.getOperand().accept(this); code.append(')'); }
@Override public void visit(MathFunctionCall mathFunctionCall) { code.append(mathFunctionCall.getFunction().toString()); code.append('('); mathFunctionCall.getOperand().accept(this); code.append(')'); }
@Override public Expression copy() { return new MathFunctionCall(getOperand().copy(), function); }
@Override //dfg public void visit(MathFunctionCall node) { if (opstor.add(node, currentAssignment)) { System.out.println("Collector: Node not in Set( " + node.toString() + " ) ---> Adding"); } else { System.out.println("Collector: Node already in Set( " + node.toString() + " ) "); } node.getOperand().accept(this); }
@Override public void visit(MathFunctionCall mathFunctionCall) { addNode(mathFunctionCall, mathFunctionCall.getFunction().toString()); mathFunctionCall.getOperand().accept(this); addEdge(mathFunctionCall.getOperand(), mathFunctionCall); }
@Override public void visit(MathFunctionCall mathFunctionCall) { String funcName; switch (mathFunctionCall.getFunction()) { case ABS: funcName = "fabs"; break; case SQRT: funcName = "sqrtf"; break; default: funcName = mathFunctionCall.getFunction().toString().toLowerCase(); } code.append(funcName); code.append('('); mathFunctionCall.getOperand().accept(this); code.append(')'); }
@Override public void visit(MathFunctionCall node) { result = null; node.getOperand().accept(this); if (result != null) result = new MathFunctionCall(result, node.getFunction()); }
@Override public void visit(MathFunctionCall node) { node.getOperand().accept(this); resultExpr = new MathFunctionCall(resultExpr, node.getFunction()); }
@Override public void visit(MathFunctionCall node) { String opName = node.getFunction().name().toLowerCase(); switch (node.getFunction()) { case CEIL: opName = "ceiling"; break; case FACT: opName = ""; result.append("("); node.getOperand().accept(this); result.append("!)"); return; } handleUnary(node, opName); }
@Override public void visit(MathFunctionCall mathFunctionCall) { String funcName = "(double) Math." + mathFunctionCall.getFunction().toString().toLowerCase(); if (mathFunctionCall.getFunction() == MathFunction.FACT) { funcName = "fact"; implementFactorial = true; } append(funcName); append('('); mathFunctionCall.getOperand().accept(this); append(')'); }
@Override public void visit(MathFunctionCall node) { //TODO Schluckt nachkommende werte if (opstor.OperationShouldBeReplaced(node)) { nx = new Variable(opstor.getReplacementID(node)); System.out.println("Replacer: Node in Set: ( " + node.toString() + " ) ---> Replacing with " + opstor.getReplacementID(node)); } else { node.getOperand().accept(this); nx = new MathFunctionCall(nx, node.getFunction()); } //nx = node; }
@Override public void visit(MathFunctionCall node) { node.getOperand().accept(this); Expression previousExpr = resultExpr; resultExpr = new MathFunctionCall(previousExpr, node.getFunction()); if ((node.getFunction() == MathFunction.SQRT) && (previousExpr instanceof FloatConstant)) { FloatConstant operand = (FloatConstant) previousExpr; resultExpr = new FloatConstant(Math.sqrt(operand.getValue())); } else if ((node.getFunction() == MathFunction.ABS) && (previousExpr instanceof MathFunctionCall)) { /* remove abs() around sqrts, as they are always positive */ MathFunctionCall insideFunc = (MathFunctionCall) previousExpr; if (insideFunc.getFunction() == MathFunction.ABS || insideFunc.getFunction() == MathFunction.SQRT) resultExpr = previousExpr; } else if ((node.getFunction() == MathFunction.SQRT) && ((!(previousExpr instanceof MathFunctionCall)) || (((MathFunctionCall) previousExpr).getFunction() != MathFunction.ABS))) { /* insert in every sqrt() an abs() */ resultExpr = new MathFunctionCall(new MathFunctionCall(previousExpr, MathFunction.ABS), MathFunction.SQRT); } }