this.freeVarIndices = freeVarIndices;
}
SymmetricDifferentiationRule(SimpleTensor var) {
super(var);
SimpleIndices varIndices = var.getIndices();
int[] allFreeVarIndices = new int[varIndices.size()];
int[] allFreeArgIndices = new int[varIndices.size()];
byte type;
int state, i = 0, length = allFreeArgIndices.length;
IndexGeneratorImpl indexGenerator = new IndexGeneratorImpl(varIndices);
for (; i < length; ++i) {
type = getType(varIndices.get(i));
state = getRawStateInt(varIndices.get(i));
allFreeVarIndices[i] = setRawState(indexGenerator.generate(type), inverseIndexState(state));
allFreeArgIndices[i] = setRawState(indexGenerator.generate(type), state);
}
int[] allIndices = addAll(allFreeVarIndices, allFreeArgIndices);
SimpleIndices dIndices = IndicesFactory.createSimple(null, allIndices);
SimpleTensor symmetric = simpleTensor("@!@#@##_AS@23@@#", dIndices);
SimpleIndices allFreeVarIndicesI = IndicesFactory.createSimple(varIndices.getSymmetries(), allFreeVarIndices);
Tensor derivative =
new SymmetrizeTransformation(allFreeVarIndicesI, true).transform(symmetric);
derivative = applyIndexMapping(
derivative,