@Override public void visit(AssignmentNode node) { appendIndent(); code.append(node.getVariable()); code.append(" = "); code.append(node.getValue()); code.append(";\n"); node.getSuccessor().accept(this); }
@Override public LinkedList<AssignmentNode> differentiate(LinkedList<AssignmentNode> toDerive, MultivectorComponent variable) { LinkedList<AssignmentNode> result = new LinkedList<AssignmentNode>(); for (AssignmentNode node : toDerive) { Expression differentiated = DFGDifferentiater.differentiate(node.getValue(), variable); ConstantFolding cF = new ConstantFolding(); differentiated.accept(cF); result.add(new AssignmentNode(null, node.getVariable(), cF.getResultExpr())); } return result; }
@Override public void visit(AssignmentNode node) { node.getValue().accept(expressionVisitor); if (resultValue != null) { //Direct MathFunctionCalls won't need an extra temporary variable, //because they will be assigned to the AssignmentNode variable! //For this optimization the variable must be removed from the toInsertVars list toInsertVars.remove((Variable) resultValue); resultValue = null; } for (Variable var : toInsertVars) { AssignmentNode newNode = new AssignmentNode(node.getGraph(), var, toInsert.get(var)); node.insertBefore(newNode); } toInsertVars.clear(); toInsert.clear(); super.visit(node); } }
@Override public AssignmentNode copyElements() { AssignmentNode result = new AssignmentNode(getGraph(), variable.copy(), value.copy()); result.setGAPP(copyGAPP()); return result; }
public void visit(AssignmentNode node) { ReplaceVisitor replaceVisitor = new ReplaceVisitor() { @Override public void visit(Variable node) { if (mapExpressions.containsKey(node)) result = mapExpressions.get(node); } @Override public void visit(MultivectorComponent node) { if (mapExpressions.containsKey(node)) result = mapExpressions.get(node); } }; node.setValue(replaceVisitor.replace(node.getValue())); mapExpressions.put(node.getVariable(), node.getValue()); }
public void visit(AssignmentNode node) { node.getValue().accept(this); values.put((MultivectorComponent) node.getVariable(), result); }
@Override public void visit(AssignmentNode node) { String variable = node.getVariable().getName(); if (assigned.contains(variable)) { String message = "Variable " + variable + " has been reset for reuse."; log.warn(message); Notifications.addWarning(message); code.append("\n"); appendIndentation(); code.append("memset("); code.append(variable); code.append(", 0, sizeof("); code.append(variable); code.append(")); // Reset variable for reuse.\n"); assigned.remove(variable); } appendIndentation(); node.getVariable().accept(this); code.append(" = "); node.getValue().accept(this); code.append(";"); if (node.getVariable() instanceof MultivectorComponent) { code.append(" // "); MultivectorComponent component = (MultivectorComponent) node.getVariable(); code.append(node.getGraph().getAlgebraDefinitionFile().getBladeString(component.getBladeIndex())); } code.append('\n'); node.getSuccessor().accept(this); }
@Override public void visit(AssignmentNode node) { node.setVariable((Variable) visitor.replace(node.getVariable())); node.setValue(visitor.replace(node.getValue())); super.visit(node); }
@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) { 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(AssignmentNode node) { node.getSuccessor().accept(this); node.getValue().accept(this); node.setValue(resultExpr); }
list.add(node.copyElements()); node.setVariable((Variable) visitor.replace(node.getVariable())); node.setValue(visitor.replace(node.getValue())); sb.append("\n"); for (AssignmentNode node: list) { String name = node.getVariable().getName(); String newName = renderingExpressions.get(name).toString(); AssignmentNode nodeCpy = node.copyElements(); nodeCpy.setVariable(new MultivectorComponent(newName, ((MultivectorComponent) nodeCpy.getVariable()).getBladeIndex())); sb.append(nodeCpy.toString()); sb.append("\n"); sb.append("\n"); for (AssignmentNode node: list) { sb.append(node.toString()); sb.append("\n");
@Override public void visit(AssignmentNode node) { mvDestComponents.add((MultivectorComponent) node.getVariable()); super.visit(node); }
AssignmentNode node = listIterator.next(); Expression exp = MaximaRoutines.getExpressionFromMaximaOutput(io); result.add(new AssignmentNode(node.getGraph(), new MultivectorComponent(node.getVariable().getName(), 0), exp));
@Override public void visit(AssignmentNode node) { findUndeclaredVariables(node.getValue()); //graph.addLocalVariable(node.getVariable()); node.getSuccessor().accept(this); }
node.setGAPP(gapp); gappCreator.setGapp(gapp); if (gappStart != null) { Variable variable = node.getVariable(); node.getValue().accept(collector); ParallelObject parallelObject = collector.getResultValue();
@Override public void visit(AssignmentNode node) { MultivectorComponent mvComp = (MultivectorComponent)node.getVariable(); if(mvComp == null) return; Integer numEntries = mvSizes.get(mvComp.getName()); if(numEntries == null) numEntries = 1; else ++numEntries; mvSizes.put(mvComp.getName(), numEntries); node.getSuccessor().accept(this); }
if (!((arg instanceof Variable) || (arg instanceof FloatConstant))) { Variable newVariable = createNewVariable(); AssignmentNode assignmentNode = new AssignmentNode(graph, newVariable, arg); curNode.insertBefore(assignmentNode); StoreResultNode storeNode = new StoreResultNode(graph, newVariable); if (sNode instanceof AssignmentNode) { AssignmentNode assignmentNode = (AssignmentNode) sNode; String name = assignmentNode.getVariable().getName();