/** * A human readable string representation of this multivector component. * @return The string "name[bladeIndex]" where name is the name of the multivector and bladeIndex is the index * returned by <code>getBladeIndex()</code>. */ @Override public String toString() { return super.toString() + "[" + bladeIndex + "]"; }
@Override public void visit(Variable variable) { addNode(variable, variable.toString()); }
@Override public void visit(AssignmentNode node) { result.append("//"); result.append(node.getVariable().toString()); result.append(" = "); result.append(node.getValue().toString()); result.append('\n'); if (node.getGAPP() != null) { node.getGAPP().accept(this, null); } result.append('\n'); node.getSuccessor().accept(this); }
@Override public void visit(Variable node) { MvExpressions v = null; String key = node.toString(); if (variables.containsKey(key)) { v = createNewMvExpressions(); for (int i = 0; i < bladeCount; i++) { if (variables.get(key).bladeExpressions[i] != null) { v.bladeExpressions[i] = new MultivectorComponent(node.getName(), i); } } } else { //input variable! v = createNewMvExpressions(); v.bladeExpressions[0] = node; } expressions.put(node, v); }
@Override //cfg public void visit(AssignmentNode node) { System.out.println("Collector: Assginment Node " + node.getVariable().toString() + " vistited------------------------------------"); currentAssignment = node; node.getValue().accept(this); node.getSuccessor().accept(this); }
@Override public void visit(AssignmentNode node) { System.out.println("Replacer : Assginment Node " + node.getVariable().toString()+" visited------------------------------------"); node.getValue().accept(this); node.setValue(nx); node.getSuccessor().accept(this); }
@Override public void visit(AssignmentNode node) { curVariable = node.getVariable(); Expression value = node.getValue(); value.accept(this); MvExpressions mvExpr = expressions.get(value); variables.put(curVariable.toString(), mvExpr); // when GAPP performing, only the MvExpressions are needed, // the graph itself mustn't changed, espescially nodes won't be inserted. // That's why we use a method for changing graph AssignmentNode lastNode = node; if (scalarFunctions) { lastNode = changeGraph(node, mvExpr, curVariable); } else { if (!(value instanceof MathFunctionCall)) { lastNode = changeGraph(node, mvExpr, curVariable); } } lastNode.getSuccessor().accept(this); }
.entrySet()) { HWOutput out = new HWOutput(); out.setName(iterable_element.getKey().getVariable().toString() .replace("[", "").replace("]", ""));
@Override public void visit(AssignmentNode node) { // node.getVariable().getName(); currAssignmentNode = node; currAssignString= node.getVariable().toString(); resultExpr = null; if (( node.getValue() instanceof Negation) &&((Negation)node.getValue()).getOperand() instanceof FloatConstant ) { FloatConstant f = (FloatConstant)((Negation)node.getValue()).getOperand(); node.setValue(new FloatConstant(-f.getValue())); } if ((node.getValue() instanceof FloatConstant)) //&&(new Float(1.0) == ((FloatConstant) node.getValue()).getValue())) { { oneset.put(node.getVariable().toString(), ((FloatConstant) node.getValue()).getValue()); System.out.println("Found: " + node.getVariable().toString()+ " Value: " +((FloatConstant) node.getValue()).getValue() ); //node.getVariable(); node.getSuccessor().accept(this); } } else { node.getValue().accept(this); node.setValue(resultExpr); node.getSuccessor().accept(this); } // throw new UnsupportedOperationException("Not supported yet."); }