@Override public Object visitSetVector(GAPPSetVector gappSetVector, Object arg) { result.append("setVector "); printVector(gappSetVector.getDestination()); result.append(" = "); printListOfArguments(gappSetVector.getEntries()); result.append(";\n"); return null; }
@Override public Object visitSetVector(GAPPSetVector gappSetVector, Object arg) { return new GAPPSetVector( (GAPPVector) GAPPValueHolderCopier.copyValueHolder(gappSetVector.getDestination()), copyListOfArgs(gappSetVector.getEntries()) ); }
@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; }
public GAPPBaseInstruction createBaseInstruction(String cmd) { InstructionType instr = InstructionType.valueOf(cmd); switch (instr) { case assignMv: return new GAPPAssignMv(null); case assignInputsVector: return new GAPPAssignInputsVector(null); case calculateMv: return new GAPPCalculateMv(null, null, null, null); case dotVectors: GAPPMultivector m = null; return new GAPPDotVectors(m, null, null); case resetMv: return new GAPPResetMv(null, 0); case setMv: return new GAPPSetMv(null, null, null, null); case setVector: return new GAPPSetVector(null, null); } return null; }
gapp.addInstruction(new GAPPSetVector(destination, list)); return destination;
@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; }
for(SetVectorArgument setVectorArg : gappSetVector.getEntries()) { if(setVectorArg.isConstant()) ++wholeVectorSize; final String destVecBase = GAPPOpenCLCodeGenerator.getVarName(gappSetVector.getDestination().getName()); Iterator<SetVectorArgument> itSetVectorArg = gappSetVector.getEntries().iterator(); while(itSetVectorArg.hasNext()) { final SetVectorArgument setVectorArg = itSetVectorArg.next();
for (SetVectorArgument curArg: gappSetVector.getEntries()) { if (curArg.isConstant()) { String destName = gappSetVector.getDestination().getName(); createVector(destName, size); MultivectorWithValues destination = getMultivector(destName); for (SetVectorArgument curArg: gappSetVector.getEntries()) { if (curArg.isConstant()) { ConstantSetVectorArgument c = (ConstantSetVectorArgument) curArg;