Package cc.redberry.core.indexmapping

Examples of cc.redberry.core.indexmapping.IndexMappingImpl


                } else {
                    for (j = 0; j < cIndices.length; ++j) {
                        cIndices[j] = IndicesUtils.getNameWithType(cIndices[j]);
                        fIndices[j] = IndicesUtils.getNameWithType(fIndices[j]);
                    }
                    IndexMappingImpl im = new IndexMappingImpl(new int[0], fIndices, cIndices);
                    fArg = ApplyIndexMappingTransformation.INSTANCE.perform(fArg, im);
                }

                if (!IndexMappings.mappingExists(fromArgs[i], fArg, allowDiffStates))
                    throw new InconsistentSubstitutionException(from, to, current);
                transformations.add(Substitutions.createSubstitution(fArg, currentArgs[i], allowDiffStates));
            }

            Tensor newTo = to.clone();
            if (!allowDiffStates || !IndexMappingUtils.containsDiffStates(buffer))
                newTo = ApplyIndexMappingTransformation.INSTANCE.perform(newTo, new IndexMappingImpl(iterator.usedIndices(), buffer));
            else
                newTo = ApplyIndexMappingUtils.applyIndexMappingWithDiffStates(newTo, buffer, iterator.usedIndices());


            if (!transformations.isEmpty()) {
                for (Transformation transformation : transformations)
                    newTo = transformation.transform(newTo);
                int[] indices = newTo.getIndices().getFreeIndices().getAllIndices().copy();
                for (i = 0; i < indices.length; ++i)
                    indices[i] = IndicesUtils.getNameWithType(indices[i]);
                newTo = ApplyIndexMappingTransformation.INSTANCE.perform(newTo, new IndexMappingImpl(iterator.usedIndices(), indices, indices));
            }
            iterator.set(newTo);
        }
        Tensor result = tensorWrapper.getInnerTensor();
        result.setParent(parent);
View Full Code Here

TOP

Related Classes of cc.redberry.core.indexmapping.IndexMappingImpl

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.