/** * Creates a new temporary GAPPMultivector and inserts a resetMv command in GAPP * @param The number of entries in the new multivector * @return The new GAPPMultivector */ public GAPPMultivector createMv() { GAPPMultivector mv = new GAPPMultivector(createTMP(PREFIX_TMPMV)); gapp.addInstruction(new GAPPResetMv(mv, 1)); return mv; }
/** * Creates a temporary multivector with one entry and returns the according GAPPMultivectorComponent * @return The GAPPMultivectorComponent */ public GAPPMultivectorComponent createMvComp() { GAPPMultivector mv = new GAPPMultivector(createTMP(PREFIX_TMPMV)); gapp.addInstruction(new GAPPResetMv(mv, 1)); return new GAPPMultivectorComponent(mv.getName(), 0); }
gappStart.addInstruction(new GAPPAssignInputsVector(varSet));
@Override public Object visitConstant(Constant constant, Object arg) { GAPPMultivector mvTmp = gappCreator.createMv(); PosSelectorset selDestSet = new PosSelectorset(); selDestSet.add(new PosSelector(0, algebra.getBlade(0).toString())); Valueset valSet = new Valueset(); valSet.add(new GAPPConstant((constant.isNegated() ? -1 : 1) * constant.getValue())); gappCreator.gapp.addInstruction(new GAPPAssignMv(mvTmp, selDestSet, valSet)); return mvTmp; }
@Override public Object visitConstant(Constant constant, Object arg) { //arg must be filled! GAPPMultivectorComponent destination = (GAPPMultivectorComponent) arg; PosSelectorset selSet = new PosSelectorset(); selSet.add(new PosSelector(destination.getBladeIndex(), algebra.getBlade(destination.getBladeIndex()).toString())); Valueset valSet = new Valueset(); valSet.add(new GAPPConstant(((constant.isNegated()) ? -1 : 1) * constant.getValue())); gapp.addInstruction(new GAPPAssignMv(new GAPPMultivector(destination.getName()), selSet, valSet)); return null; }
gapp.addInstruction(new GAPPSetVector(destination, list)); return destination;
gapp.addInstruction(new GAPPResetMv(mv, bladeCount)); createdGAPPVariables.add(name); gapp.addInstruction(new GAPPCalculateMv(extCalculation.getType(), new GAPPMultivector(variable.getName()), new GAPPMultivector(((ParVariable) extCalculation.getOperand1()).getName()),
gapp.addInstruction(dotVectors); selDest, selSrc); gapp.addInstruction(setMv);
@Override public Object visitMvComponent(MvComponent mvComponent, Object arg) { GAPPMultivector mvTmp = gappCreator.createMv(); PosSelectorset selDestSet = new PosSelectorset(); selDestSet.add(new PosSelector(0, algebra.getBlade(0).toString())); Selectorset selSrcSet = new Selectorset(); selSrcSet.add(new Selector( mvComponent.getMultivectorComponent().getBladeIndex(), mvComponent.isNegated() ? (byte) -1 : (byte) 1, algebra.getBlade(mvComponent.getMultivectorComponent().getBladeIndex()).toString())); gappCreator.gapp.addInstruction(new GAPPSetMv(mvTmp, new GAPPMultivector( mvComponent.getMultivectorComponent().getName()), selDestSet, selSrcSet)); return mvTmp; }
@Override public Object visitMvComponent(MvComponent mvComponent, Object arg) { //arg must be filled! GAPPMultivectorComponent destination = (GAPPMultivectorComponent) arg; PosSelectorset selDestSet = new PosSelectorset(); selDestSet.add(new PosSelector(destination.getBladeIndex(), algebra.getBlade(destination.getBladeIndex()).toString())); Selectorset selSrcSet = new Selectorset(); selSrcSet.add(new Selector( mvComponent.getMultivectorComponent().getBladeIndex(), (mvComponent.isNegated()) ? (byte) -1 : (byte) 1, algebra.getBlade(mvComponent.getMultivectorComponent().getBladeIndex()).toString())); gapp.addInstruction(new GAPPSetMv( new GAPPMultivector(destination.getName()), new GAPPMultivector(mvComponent.getMultivectorComponent().getName()), selDestSet, selSrcSet)); return null; }
gapp.addInstruction(new GAPPCalculateMvCoeff(extCalculation.getType(), destination, createMultivectorFromParallelObjectTerminal(extCalculation.getOperand1()), selDest, selSrc); gapp.addInstruction(setMv);