public Tensor toProduct() { ProductBuilder pb = new ProductBuilder(); for (int i = 0; i < gPositions.size(); i++) pb.put(pc.get(gPositions.get(i))); return pb.build(); }
sb.put(nodesToProduct(term.factors)); return Tensors.multiply(pb.build(), sb.build());
@Override public Tensor take() { if (currentBuilder == null) return null; if (sumsAndPowers.length == 0) { currentBuilder = null; return tensor; } Tensor t = sumsAndPowers[sumsAndPowers.length - 1].take(); if (t == null) { currentBuilder = nextCombination(); sumsAndPowers[sumsAndPowers.length - 1].reset(); return take(); } ProductBuilder temp = currentBuilder.clone(); temp.put(t); return temp.build(); } }
OutputPort<Tensor> nextPort() { final int[] tuple = tuplesPort.take(); if (tuple == null) return null; TIntHashSet added = new TIntHashSet(initialForbidden); ProductBuilder builder = new ProductBuilder(); builder.put(base.get(tuple[0])); for (int i = 1; i < tuple.length; ++i) builder.put(ApplyIndexMapping.renameDummy(base.get(tuple[i]), added.toArray(), added)); return createPort(builder.build(), expandSymbolic); }
return builder.build(); } else if (tensor instanceof Sum || tensor instanceof Expression) {
if (ArraysUtils.binarySearch(toRemvoe, i) < 0)//toRemove is sorted pb.put(content.get(i)); return pb.build();
pb.put(factor); return pb.build();
return new NumeratorDenominator(temp, denominators.build());
c = multiply(c, calculatedTraces.build()); iterator.set(simplifications.transform(c));
for (int i = 0; i < varF.size(); i++) pb.put(createDiracDelta(field.get(i), varF.get(i))); return pb.build(); } else if (anyMappingExists(varF, field) || anyMappingExists(field, varF)) return differentiateSimpleTensor((SimpleTensor) tensor, rule, transformations);
dataRemainder.put(currentData[i]); Tensor dataRemainderT = dataRemainder.build();
for (i = 0; i < length; ++i) builder.put(createMetricOrKronecker(allFreeArgIndices[i], allFreeVarIndices[i])); derivative = new SubstitutionTransformation(symmetric, builder.build()).transform(derivative); this.derivative = derivative; this.freeVarIndices = var.getIndices().getFree().getInverted().getAllIndices().copy();