Package cc.redberry.core.utils

Examples of cc.redberry.core.utils.IntArray


            l = 0;
            for (i = 0; i < combination.length; ++i)
                for (int j = 0; j < combination[i]; ++j) {
                    Tensor temp = samples[i];

                    IntArray termLow = temp.getIndices().getFree().getLower();
                    IntArray termUp = temp.getIndices().getFree().getUpper();

                    int[] oldIndices = new int[termUp.length() + termLow.length()],
                            newIndices = oldIndices.clone();
                    for (k = 0; k < termUp.length(); ++k) {
                        oldIndices[k] = termUp.get(k);
                        newIndices[k] = upperArray[u++];
                    }
                    for (k = 0; k < termLow.length(); ++k) {
                        oldIndices[k + termUp.length()] = termLow.get(k);
                        newIndices[k + termUp.length()] = lowerArray[l++];
                    }
                    temp = ApplyIndexMapping.applyIndexMapping(temp, new Mapping(oldIndices, newIndices), indices.getAllIndices().copy());
                    tCombination.add(temp);
                }
View Full Code Here


     * Returns the names of from indices.
     *
     * @return names of from indices
     */
    public IntArray getFromNames() {
        return new IntArray(fromNames);
    }
View Full Code Here

     * Returns the data array that represents to indices.
     *
     * @return data array that represents to indices.
     */
    public IntArray getToData() {
        return new IntArray(toData);
    }
View Full Code Here

    }

    private static Tensor _applyIndexMapping(Tensor tensor, Mapping mapping, int[] forbidden) {
        final int mappingSize = mapping.size();
        int[] allForbidden = new int[mappingSize + forbidden.length];
        IntArray toData = mapping.getToData(), fromNames = mapping.getFromNames();
        ArraysUtils.arraycopy(toData, 0, allForbidden, 0, mappingSize);
        System.arraycopy(forbidden, 0, allForbidden, mappingSize, forbidden.length);
        int i;
        for (i = allForbidden.length - 1; i >= 0; --i)
            allForbidden[i] = IndicesUtils.getNameWithType(allForbidden[i]);
View Full Code Here

TOP

Related Classes of cc.redberry.core.utils.IntArray

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.