@Override public Object visitSetVector(GAPPSetVector gappSetVector, Object arg) { curLine++; for (SetVectorArgument curArg: gappSetVector.getEntries()) if (!curArg.isConstant()) { PairSetOfVariablesAndIndices p = (PairSetOfVariablesAndIndices) curArg; access(p.getSetOfVariable()); } return null; }
/** * Prints a SetVectorArgument instance * @param arg The argument */ private void printArgument(SetVectorArgument arg) { if (arg.isConstant()) result.append(((ConstantSetVectorArgument) arg).getValue()); else { PairSetOfVariablesAndIndices pair = (PairSetOfVariablesAndIndices) arg; result.append(pair.getSetOfVariable().prettyPrint()); printSelectors(pair.getSelectors()); } }
GAPPOpenCLCodeGenerator.getVarName(pair.getSetOfVariable().getName())));
@Override public Object visitSetVector(GAPPSetVector gappSetVector, Object arg) { LinkedList<SetVectorArgument> entries = gappSetVector.getEntries(); for (SetVectorArgument entry: entries) { if (!entry.isConstant()) { PairSetOfVariablesAndIndices pair = (PairSetOfVariablesAndIndices) entry; String name = pair.getSetOfVariable().getName(); if (multivectors.contains(name)) { pair.setSetOfVariable(new GAPPMultivector(name)); } else { if (vectors.contains(name)) { pair.setSetOfVariable(new GAPPVector(name)); } else { System.err.println("Multivector/Vector "+name+" is not declared!"); } } } } vectors.add(gappSetVector.getDestination().getName()); return null; }
/** * Copies a SetVectorArgument instance * @param arg The argument * @return The copied argument */ private SetVectorArgument copyArgument(SetVectorArgument arg) { if (arg.isConstant()) { ConstantSetVectorArgument c = (ConstantSetVectorArgument) arg; return new ConstantSetVectorArgument(c.getValue()); } else { PairSetOfVariablesAndIndices pair = (PairSetOfVariablesAndIndices) arg; return new PairSetOfVariablesAndIndices((GAPPSetOfVariables) GAPPValueHolderCopier.copyValueHolder(pair.getSetOfVariable()), copySelectorset(pair.getSelectors())); } }
PairSetOfVariablesAndIndices pair = (PairSetOfVariablesAndIndices) last; if (pair.getSetOfVariable().getName().equals(mvC.getName())) {
} else { PairSetOfVariablesAndIndices p = (PairSetOfVariablesAndIndices) curArg; MultivectorWithValues source = getMultivector(p.getSetOfVariable().getName()); for (Selector sel: p.getSelectors()) { destination.setEntry(i, sel.getSign() * source.getEntries()[sel.getIndex()]);