Package cc.redberry.core.indexgenerator

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


            for (j = 0; j < upper[i].length; ++j)
                upper[i][j] = 0x80000000 | generator.generate(i);

            lower[i] = new int[outerIndices.lower[i]];
            for (j = 0; j < lower[i].length; ++j)
                lower[i][j] = generator.generate(i);
        }
        transformer.apply(generator, upper, lower);
        return node;
    }
View Full Code Here


            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);
View Full Code Here

            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);
View Full Code Here

        int[] from = fromL.toArray(), to = new int[fromL.size()];
        Arrays.sort(from);
        added.ensureCapacity(from.length);
        int i;
        for (i = from.length - 1; i >= 0; --i)
            added.add(to[i] = generator.generate(IndicesUtils.getType(from[i])));


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

        IndexGeneratorImpl generator = new IndexGeneratorImpl(allIndicesNames.toArray());
        int[] from = fromL.toArray(), to = new int[fromL.size()];
        Arrays.sort(from);
        int i;
        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

            if (Arrays.binarySearch(allForbidden, index) >= 0) {
                //if index is dummy it cannot be free, so from (which is equal to free)
                //cannot contain it
                assert ArraysUtils.binarySearch(fromNames, 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

                _from = TensorUtils.getAllIndicesNamesT(arg).toArray();
                Arrays.sort(_from);
                _to = new int[_from.length];
                for (j = _from.length - 1; j >= 0; --j) {
                    if (forbidden.contains(_from[j]))
                        _to[j] = ig.generate(getType(_from[j]));
                    else _to[j] = _from[j];
                    forbidden.add(_to[j]);
                }
                arg = applyIndexMapping(arg, mapping = new IndexMapper(_from, _to));
                if (arg != field.args[i]) {
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.