Package cc.redberry.core.indexgenerator

Examples of cc.redberry.core.indexgenerator.IndexGeneratorFromData


        allIndicesNames.addAll(getIndicesNames(tensor.getIndices().getFree()));
        int[] from = fromL.toArray(), to = new int[fromL.size()];
        Arrays.sort(from);
        int i;
        IndexGeneratorFromData generator = new IndexGeneratorFromData(allowedDummiesNames);
        for (i = from.length - 1; i >= 0; --i)
            to[i] = generator.generate(IndicesUtils.getType(from[i]));

        return applyIndexMapping(tensor, new IndexMapper(from, to), false);
    }
View Full Code Here


        int[] to = new int[mapping.size() + dummies.length];
        ArraysUtils.arraycopy(mapping.getFromNames(), 0, from, 0, mapping.size());
        ArraysUtils.arraycopy(mapping.getToData(), 0, to, 0, mapping.size());
        System.arraycopy(dummies, 0, from, mapping.size(), dummies.length);

        IndexGeneratorFromData generator = new IndexGeneratorFromData(allowedDummies);
        for (int i = mapping.size() + dummies.length - 1, mappingSize = mapping.size(); i >= mappingSize; --i)
            to[i] = generator.generate(IndicesUtils.getType(from[i]));

        ArraysUtils.quickSort(from, to);
        tensor = applyIndexMapping(tensor, new IndexMapper(from, to));
        if (mapping.getSign())
            tensor = Tensors.negate(tensor);
View Full Code Here

        allIndicesNames.addAll(getIndicesNames(tensor.getIndices().getFree()));
        int[] from = fromL.toArray(), to = new int[fromL.size()];
        Arrays.sort(from);
        int i;
        IndexGeneratorFromData generator = new IndexGeneratorFromData(allowedDummiesNames);
        for (i = from.length - 1; i >= 0; --i)
            to[i] = generator.generate(IndicesUtils.getType(from[i]));

        return applyIndexMapping(tensor, new IndexMapper(from, to), false);
    }
View Full Code Here

        int[] to = new int[mapping.size() + dummies.length];
        ArraysUtils.arraycopy(mapping.getFromNames(), 0, from, 0, mapping.size());
        ArraysUtils.arraycopy(mapping.getToData(), 0, to, 0, mapping.size());
        System.arraycopy(dummies, 0, from, mapping.size(), dummies.length);

        IndexGeneratorFromData generator = new IndexGeneratorFromData(allowedDummies);
        for (int i = mapping.size() + dummies.length - 1, mappingSize = mapping.size(); i >= mappingSize; --i)
            to[i] = generator.generate(IndicesUtils.getType(from[i]));

        ArraysUtils.quickSort(from, to);
        tensor = applyIndexMapping(tensor, new IndexMapper(from, to));
        if (mapping.getSign())
            tensor = Tensors.negate(tensor);
View Full Code Here

        allIndicesNames.addAll(getIndicesNames(tensor.getIndices().getFree()));
        int[] from = fromL.toArray(), to = new int[fromL.size()];
        Arrays.sort(from);
        int i;
        IndexGeneratorFromData generator = new IndexGeneratorFromData(allowedDummiesNames);
        for (i = from.length - 1; i >= 0; --i)
            to[i] = generator.generate(IndicesUtils.getType(from[i]));

        return applyIndexMapping(tensor, new IndexMapper(from, to), false);
    }
View Full Code Here

        int[] to = new int[mapping.size() + dummies.length];
        ArraysUtils.arraycopy(mapping.getFromNames(), 0, from, 0, mapping.size());
        ArraysUtils.arraycopy(mapping.getToData(), 0, to, 0, mapping.size());
        System.arraycopy(dummies, 0, from, mapping.size(), dummies.length);

        IndexGeneratorFromData generator = new IndexGeneratorFromData(allowedDummies);
        for (int i = mapping.size() + dummies.length - 1, mappingSize = mapping.size(); i >= mappingSize; --i)
            to[i] = generator.generate(IndicesUtils.getType(from[i]));

        ArraysUtils.quickSort(from, to);
        tensor = applyIndexMapping(tensor, new IndexMapper(from, to));
        if (mapping.getSign())
            tensor = Tensors.negate(tensor);
View Full Code Here

TOP

Related Classes of cc.redberry.core.indexgenerator.IndexGeneratorFromData

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.