Package cc.redberry.core.utils

Examples of cc.redberry.core.utils.IntArray


     * @see IntArray
     * @return IntArray representing integer array - one-line notated
     *         permutation
     */
    public IntArray getPermutation() {
        return new IntArray(permutation);
    }
View Full Code Here


    private final HashMap<IntArray, DFromTo> derivatives = new HashMap<>();

    public PrimitiveTensorFieldSubstitution(Tensor from, Tensor to) {
        super(from, to);
        this.fromDescriptor = ((TensorField) from).getNameDescriptor();
        this.orders = new IntArray(fromDescriptor.getDerivativeOrders());
        this.derivatives.put(this.orders, new DFromTo((TensorField) from, to));
    }
View Full Code Here

        //check whether derivative orders in from less or equal to orders of current node
        for (int i = currentNode.size() - 1; i >= 0; --i)
            if (currentDescriptor.getDerivativeOrder(i) < fromDescriptor.getDerivativeOrder(i))
                return currentNode;

        IntArray orders = new IntArray(currentDescriptor.getDerivativeOrders());
        DFromTo derivative = derivatives.get(orders);
        if (derivative == null) {
            int order, j;
            SimpleTensor var;
            int[] indices;
            SimpleIndices varIndices;
            TensorField __from = (TensorField) this.from;
            Tensor __to = this.to;
            IndexGeneratorImpl ig = null;
            for (int i = orders.length() - 1; i >= 0; --i) {
                order = orders.get(i) - this.orders.get(i);
                while (order > 0) {
                    var = (SimpleTensor) from.get(i);
                    indices = new int[var.getIndices().size()];

                    //lazy initialization
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

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

//                    IndexMappingDirect im = new IndexMappingDirect();
                    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

     * @return IntArray representing integer array - one-line notated
     *         permutation
     * @see IntArray
     */
    public IntArray getPermutation() {
        return new IntArray(permutation);
    }
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

        UpperLowerIndices ul = wul.get();
        if (ul == null) {
            ul = calculateUpperLower();
            upperLower = new WeakReference<>(ul);
        }
        return new IntArray(ul.upper);
    }
View Full Code Here

        UpperLowerIndices ul = wul.get();
        if (ul == null) {
            ul = calculateUpperLower();
            upperLower = new WeakReference<>(ul);
        }
        return new IntArray(ul.lower);
    }
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.