@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) { curLine++; access(gappSetMv.getDestination()); access(gappSetMv.getSource()); return null; }
@Override public Object visitSetMv(GAPPSetMv gappSetMv, Object arg) { result.append("setMv "); printMultivector(gappSetMv.getDestination()); printPosSelectors(gappSetMv.getSelectorsDest()); result.append(" = "); printSetOfVariables(gappSetMv.getSource()); printSelectors(gappSetMv.getSelectorsSrc()); result.append(";\n"); return null; }
@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; }
@Override public Object visitSetMv(GAPPSetMv gappSetMv, Object arg) { incrementSize(GAPPOpenCLCodeGenerator.getVarName(gappSetMv.getDestination().getName()), gappSetMv.getSelectorsDest().size()); return null; }
@Override public Object visitSetMv(GAPPSetMv gappSetMv, Object arg) { return new GAPPSetMv( (GAPPMultivector) GAPPValueHolderCopier.copyValueHolder(gappSetMv.getDestination()), (GAPPSetOfVariables) GAPPValueHolderCopier.copyValueHolder(gappSetMv.getSource()), copyPosSelectorset(gappSetMv.getSelectorsDest()), copySelectorset(gappSetMv.getSelectorsSrc())); }
@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; }