Package cc.redberry.core.indexgenerator

Examples of cc.redberry.core.indexgenerator.IndexGenerator.generate()


        IndexGenerator generator = new IndexGenerator(forbiddenGeneratorIndices);//also sorts allForbidden array
        for (Integer index : dummyIndices)
            if (Arrays.binarySearch(allForbidden, index) >= 0 && Arrays.binarySearch(from, index) < 0) {
                fromL.add(index);
                toL.add(generator.generate(IndicesUtils.getType(index)));
            }

        int[] _from = fromL.toArray(), _to = toL.toArray();
        ArraysUtils.quickSort(_from, _to);
View Full Code Here


                freeIndices[b] = new int[typeData.length];
                System.arraycopy(_freeIndices, typeData.from, freeIndices[b], 0, typeData.length);
            }
            int diff = (totalIndicesCounts[b] - freeIndices[b].length) / 2;
            for (i = 0; i < diff; ++i)
                indicesSpace[b][i] = indexGenerator.generate(b);
            for (i = 0; i < diff; ++i)
                indicesSpace[b][i + diff] = IndicesUtils.inverseIndexState(indicesSpace[b][i]);
            System.arraycopy(freeIndices[b], 0, indicesSpace[b], diff * 2, freeIndices[b].length);
            shuffle(indicesSpace[b]);
        }
View Full Code Here

                freeIndices[b] = new int[typeData.length];
                System.arraycopy(_freeIndices, typeData.from, freeIndices[b], 0, typeData.length);
            }
            int diff = (totalIndicesCounts[b] - freeIndices[b].length) / 2;
            for (i = 0; i < diff; ++i)
                indicesSpace[b][i] = indexGenerator.generate(b);
            for (i = 0; i < diff; ++i)
                indicesSpace[b][i + diff] = IndicesUtils.inverseIndexState(indicesSpace[b][i]);
            System.arraycopy(freeIndices[b], 0, indicesSpace[b], diff * 2, freeIndices[b].length);
            shuffle(indicesSpace[b]);
        }
View Full Code Here

        int fromIndex;
        for (i = upperLower.length - 1; i >= 0; --i) {
            fromIndex = upperLower[i];
            if (dummyIndices.contains(fromIndex)) {
                from.add(fromIndex);
                to.add(generator.generate(IndicesUtils.getType(fromIndex)));
            }
        }

        int[] _from = from.toArray(), _to = to.toArray();
        ArraysUtils.quickSort(_from, _to);
View Full Code Here

        byte type = getType(eps.getIndices().get(0));
        int count = eps.getIndices().size();
        int[] newIndices = new int[count];
        IndexGenerator generator = new IndexGenerator(eps.getIndices());
        for (int i = 0; i < count; ++i)
            newIndices[i] = generator.generate(type);
        return Tensors.simpleTensor(eps.getName(), IndicesFactory.createSimple(null, newIndices));
    }

    private static SimpleTensor setInversedIndices(SimpleTensor eps) {
        return Tensors.simpleTensor(eps.getName(), eps.getIndices().getInverted());
View Full Code Here

        IndexGenerator generator = new IndexGenerator();

        //creating  T_a*T_b  = 1/2N g_ab + I/2*f_abc*T^c + 1/2*d_abc*T^c
        int upper, lower, contracted, firstMetric, secondMetric, thirdMetric;
        SimpleIndices indicesOfA = IndicesFactory.createSimple(null,
                firstMetric = generator.generate(metricType),
                upper = (0x80000000 | generator.generate(matrixType)),
                contracted = generator.generate(matrixType));

        SimpleIndices indicesOfB = IndicesFactory.createSimple(null,
                secondMetric = generator.generate(metricType),
View Full Code Here

        //creating  T_a*T_b  = 1/2N g_ab + I/2*f_abc*T^c + 1/2*d_abc*T^c
        int upper, lower, contracted, firstMetric, secondMetric, thirdMetric;
        SimpleIndices indicesOfA = IndicesFactory.createSimple(null,
                firstMetric = generator.generate(metricType),
                upper = (0x80000000 | generator.generate(matrixType)),
                contracted = generator.generate(matrixType));

        SimpleIndices indicesOfB = IndicesFactory.createSimple(null,
                secondMetric = generator.generate(metricType),
                (0x80000000 | contracted),
View Full Code Here

        //creating  T_a*T_b  = 1/2N g_ab + I/2*f_abc*T^c + 1/2*d_abc*T^c
        int upper, lower, contracted, firstMetric, secondMetric, thirdMetric;
        SimpleIndices indicesOfA = IndicesFactory.createSimple(null,
                firstMetric = generator.generate(metricType),
                upper = (0x80000000 | generator.generate(matrixType)),
                contracted = generator.generate(matrixType));

        SimpleIndices indicesOfB = IndicesFactory.createSimple(null,
                secondMetric = generator.generate(metricType),
                (0x80000000 | contracted),
                lower = generator.generate(matrixType));
View Full Code Here

                firstMetric = generator.generate(metricType),
                upper = (0x80000000 | generator.generate(matrixType)),
                contracted = generator.generate(matrixType));

        SimpleIndices indicesOfB = IndicesFactory.createSimple(null,
                secondMetric = generator.generate(metricType),
                (0x80000000 | contracted),
                lower = generator.generate(matrixType));

        SimpleIndices indicesOfC = IndicesFactory.createSimple(null,
                (0x80000000 | (thirdMetric = generator.generate(metricType))),
View Full Code Here

                contracted = generator.generate(matrixType));

        SimpleIndices indicesOfB = IndicesFactory.createSimple(null,
                secondMetric = generator.generate(metricType),
                (0x80000000 | contracted),
                lower = generator.generate(matrixType));

        SimpleIndices indicesOfC = IndicesFactory.createSimple(null,
                (0x80000000 | (thirdMetric = generator.generate(metricType))),
                upper, lower);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.