Package gnu.trove.set.hash

Examples of gnu.trove.set.hash.TIntHashSet.addAll()


        for (i = factors.length - 1; i >= 0; --i) {
            if ((f = factors[i]) instanceof Sum || f.getIndices().getFree().size() == 0) {
                toResolve.add(f);
                forbidden.addAll(f.getIndices().getFree().getAllIndices().copy());
            } else {
                forbidden.addAll(TensorUtils.getAllIndicesNamesT(f));
                result[i] = f;
            }
        }

        Tensor factor, newFactor;
View Full Code Here


        int toResolvePosition = toResolve.size();
        for (i = factors.length - 1; i >= 0; --i)
            if (result[i] == null) {
                factor = toResolve.get(--toResolvePosition);
                newFactor = ApplyIndexMapping.renameDummy(factor, forbidden.toArray());
                forbidden.addAll(TensorUtils.getAllIndicesNamesT(newFactor));
                result[i] = newFactor;
            }
//        for (int i = toResolve.size() - 1; i >= 0; --i) {
//            factor = toResolve.get(i);
//            newFactor = ApplyIndexMapping.renameDummy(factor, forbidden.toArray());
View Full Code Here

    public static void resolveAllDummies(Tensor[] factors) {
        TIntHashSet forbidden = new TIntHashSet();
        int i;
        for (i = factors.length - 1; i >= 0; --i)
            forbidden.addAll(TensorUtils.getAllIndicesNamesT(factors[i]));

        for (i = factors.length - 1; i >= 0; --i) {
            factors[i] = ApplyIndexMapping.renameDummy(factors[i], forbidden.toArray());
            forbidden.addAll(TensorUtils.getAllIndicesNamesT(factors[i]));
        }
View Full Code Here

        for (i = factors.length - 1; i >= 0; --i)
            forbidden.addAll(TensorUtils.getAllIndicesNamesT(factors[i]));

        for (i = factors.length - 1; i >= 0; --i) {
            factors[i] = ApplyIndexMapping.renameDummy(factors[i], forbidden.toArray());
            forbidden.addAll(TensorUtils.getAllIndicesNamesT(factors[i]));
        }
    }

    /**
     * Returns {@code a} divided by {@code b}.
View Full Code Here

            if (possiblyAddsDummies) {
                if (forbidden.forbidden == null)
                    forbidden.forbidden = new TIntHashSet(iterator.getForbidden());

                TIntHashSet remainderIndices = new TIntHashSet(forbidden.forbidden);
                remainderIndices.addAll(getAllIndicesNamesT(indexlessRemainder));
                remainderIndices.addAll(getAllIndicesNamesT(dataRemainderT));
                newTo = applyIndexMapping(to, mapping, remainderIndices.toArray());
                forbidden.forbidden.addAll(getAllIndicesNamesT(newTo));
            } else {
                TIntHashSet allowed = new TIntHashSet();
View Full Code Here

                if (forbidden.forbidden == null)
                    forbidden.forbidden = new TIntHashSet(iterator.getForbidden());

                TIntHashSet remainderIndices = new TIntHashSet(forbidden.forbidden);
                remainderIndices.addAll(getAllIndicesNamesT(indexlessRemainder));
                remainderIndices.addAll(getAllIndicesNamesT(dataRemainderT));
                newTo = applyIndexMapping(to, mapping, remainderIndices.toArray());
                forbidden.forbidden.addAll(getAllIndicesNamesT(newTo));
            } else {
                TIntHashSet allowed = new TIntHashSet();
                for (int index : indexlessBijection)
View Full Code Here

                newTo = applyIndexMapping(to, mapping, remainderIndices.toArray());
                forbidden.forbidden.addAll(getAllIndicesNamesT(newTo));
            } else {
                TIntHashSet allowed = new TIntHashSet();
                for (int index : indexlessBijection)
                    allowed.addAll(TensorUtils.getAllDummyIndicesT(content.indexless[index]));
                IndicesBuilder ib = new IndicesBuilder();
                for (int index : dataBijection) {
                    allowed.addAll(TensorUtils.getAllDummyIndicesT(currentData[index]));
                    ib.append(currentData[index]);
                }
View Full Code Here

                TIntHashSet allowed = new TIntHashSet();
                for (int index : indexlessBijection)
                    allowed.addAll(TensorUtils.getAllDummyIndicesT(content.indexless[index]));
                IndicesBuilder ib = new IndicesBuilder();
                for (int index : dataBijection) {
                    allowed.addAll(TensorUtils.getAllDummyIndicesT(currentData[index]));
                    ib.append(currentData[index]);
                }
                allowed.addAll(ib.getIndices().getNamesOfDummies());
                allowed.removeAll(IndicesUtils.getIndicesNames(mapping.getToData()));
                newTo = applyIndexMappingAndRenameAllDummies(to, mapping, allowed.toArray());
View Full Code Here

                IndicesBuilder ib = new IndicesBuilder();
                for (int index : dataBijection) {
                    allowed.addAll(TensorUtils.getAllDummyIndicesT(currentData[index]));
                    ib.append(currentData[index]);
                }
                allowed.addAll(ib.getIndices().getNamesOfDummies());
                allowed.removeAll(IndicesUtils.getIndicesNames(mapping.getToData()));
                newTo = applyIndexMappingAndRenameAllDummies(to, mapping, allowed.toArray());
            }
        }
        return new SubsResult(newTo, remainder);
View Full Code Here

        TIntHashSet allowedDummies = TensorUtils.getAllIndicesNamesT(temp);
        IndicesBuilder free = new IndicesBuilder().append(temp.getIndices());
        for (int i = 1; i < content.length; ++i) {
            temp = content[i].toTensor();
            free.append(temp.getIndices().getInverted());
            allowedDummies.addAll(IndicesUtils.getIndicesNames(temp.getIndices()));
            if (!(temp instanceof SimpleTensor) && !(temp instanceof TensorField))
                throw new IllegalArgumentException("Derivative with respect to non simple argument: " + temp);
            vars[i - 1] = (SimpleTensor) temp;
        }
        allowedDummies.removeAll(IndicesUtils.getIndicesNames(free.getIndices().getFree()));
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.