/** * This method is called, if a GAPPSetOfVariables instance is accessed * @param gappSetOfVariables The GAPPSetOfVariables instance */ private void access(GAPPSetOfVariables gappSetOfVariables) { if (!liveStatistics.containsKey(gappSetOfVariables.getName())) { System.err.println("Multivector " + gappSetOfVariables.getName() + " was not reseted!"); } else { liveStatistics.get(gappSetOfVariables.getName()).getInterval().setTo(curLine); } }
@Override public Object visitSetMv(GAPPSetMv gappSetMv, Object arg) { if (gappSetMv.getDestination().getName().equals(curDestination)) { String src = gappSetMv.getSource().getName(); if (!mapSetMv.containsKey(src)) { mapSetMv.put(src, new LinkedList<GAPPSetMv>()); } mapSetMv.get(src).add(gappSetMv); } return super.visitSetMv(gappSetMv, arg); } }
@Override public Object visitSetMv(GAPPSetMv gappSetMv, Object arg) { String name = gappSetMv.getSource().getName(); if (multivectors.contains(name)) { gappSetMv.setSource(new GAPPMultivector(name)); } else { if (vectors.contains(name)) { gappSetMv.setSource(new GAPPVector(name)); } else { System.err.println("Multivector/Vector "+name+" is not declared!"); } } multivectors.add(gappSetMv.getDestination().getName()); return null; }
@Override public Object visitSetMv(GAPPSetMv gappSetMv, Object arg) { final String destMv = GAPPOpenCLCodeGenerator.getVarName(gappSetMv.getDestination().getName()); Integer thisMvSetCount = mvBladeMap.get(destMv).size(); int selCount = 0; for(PosSelector sel : gappSetMv.getSelectorsDest()) { declareGPCMultivectorComponent(destMv, thisMvSetCount, sel); final String bladeCoeff = getBladeCoeff(destMv,thisMvSetCount); result.append(bladeCoeff); result.append(" = "); if(gappSetMv.getSelectorsSrc().get(0).getSign() < 0) result.append("-"); result.append(mvBladeMap.get(GAPPOpenCLCodeGenerator.getVarName(gappSetMv.getSource().getName())).get(gappSetMv.getSelectorsSrc().get(selCount++).getIndex())); result.append(";\n"); mvBladeMap.get(destMv).put(sel.getIndex(),bladeCoeff); ++thisMvSetCount; } return null; }
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; }
PairSetOfVariablesAndIndices pair = (PairSetOfVariablesAndIndices) last; if (pair.getSetOfVariable().getName().equals(mvC.getName())) {
@Override public Object visitSetMv(GAPPSetMv gappSetMv, Object arg) { MultivectorWithValues destination = getMultivector(gappSetMv.getDestination().getName()); MultivectorWithValues source = getMultivector(gappSetMv.getSource().getName()); Selectorset selSrc = gappSetMv.getSelectorsSrc(); PosSelectorset selDest = gappSetMv.getSelectorsDest(); int selCount = gappSetMv.getSelectorsSrc().size(); for (int sel = 0; sel < selCount; sel++) { PosSelector sDest = selDest.get(sel); Selector sSrc = selSrc.get(sel); destination.getEntries()[sDest.getIndex()] = sSrc.getSign() * source.getEntries()[sSrc.getIndex()]; } return null; }
} 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()]);