@Override public Object visitDotVectors(GAPPDotVectors gappDotVectors, Object arg) { return new GAPPDotVectors( (GAPPMultivector) GAPPValueHolderCopier.copyValueHolder(gappDotVectors.getDestination()), copySelector(gappDotVectors.getDestSelector()), copyVectors(gappDotVectors.getParts())); }
@Override public Object visitDotVectors(GAPPDotVectors gappDotVectors, Object arg) { result.append("dotVectors "); printMultivector(gappDotVectors.getDestination()); result.append("["); printSelector(gappDotVectors.getDestSelector()); result.append("]"); result.append(" = "); printDotProduct(gappDotVectors.getParts()); result.append(";\n"); return null; }
@Override public Object visitDotVectors(GAPPDotVectors gappDotVectors, Object arg) { curLine++; access(gappDotVectors.getDestination()); 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; }
public void visitDotVectorsParallelMultiply(GAPPDotVectors gappDotVectors, final int subvectorIndex) { Iterator<GAPPVector> it = gappDotVectors.getParts().iterator(); result.append(it.next().getName()); result.append("_").append(subvectorIndex); while (it.hasNext()) { result.append(" * "); result.append(it.next().getName()); result.append("_").append(subvectorIndex); } result.append(";\n"); }
@Override public Object visitDotVectors(GAPPDotVectors gappDotVectors, Object arg) { MultivectorWithValues destination = getMultivector(gappDotVectors.getDestination().getName()); // calculate the dot product double sum = 0; int size = getMultivector(gappDotVectors.getParts().getFirst().getName()).getEntries().length; for (int slot = 0; slot < size; slot++) { double prod = 1; for (GAPPVector part : gappDotVectors.getParts()) { prod *= getMultivector(part.getName()).getEntry(slot); } sum += prod; } Selector sDest = gappDotVectors.getDestSelector(); destination.setEntry(sDest.getIndex(), sDest.getSign() * sum); return null; }
@Override public Object visitDotVectors(GAPPDotVectors gappDotVectors, Object arg) { multivectors.add(gappDotVectors.getDestination().getName()); return null; }
GAPPDotVectors dotVectors = new GAPPDotVectors(destination, parts, algebra.getBlade(destination.getBladeIndex()).toString());
@Override public Object visitDotVectors(GAPPDotVectors gappDotVectors, Object arg) { final String destMv = GAPPOpenCLCodeGenerator.getVarName(gappDotVectors.getDestination().getName()); Integer thisMvSetCount = mvBladeMap.get(destMv).size(); gappDotVectors.getDestSelector()); put(gappDotVectors.getDestSelector().getIndex(),bladeCoeff); final int operandSize = mvBladeMap.get(GAPPOpenCLCodeGenerator.getVarName(gappDotVectors.getParts().get(0).getName())).size(); if(operandSize == 1) { result.append(bladeCoeff).append(" = ");
@Override public Object visitDotVectors(GAPPDotVectors gappDotVectors, Object arg) { incrementSize(GAPPOpenCLCodeGenerator.getVarName(gappDotVectors.getDestination().getName()),1); return null; }