Package gnu.trove.set.hash

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


                    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)
                    allowed.addAll(TensorUtils.getAllDummyIndicesT(content.indexless[index]));
View Full Code Here


                    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

            //All dummy indices in this sum
            TIntHashSet allDummyIndicesT = TensorUtils.getAllDummyIndicesT(tensor);

            //Creating array to index individual indices origin
            allDummyIndices = allDummyIndicesT.toArray();
            Arrays.sort(allDummyIndices);

            //For performance
            final int size = tensor.size();
View Full Code Here

                    //lazy initialization
                    if (indices.length != 0 && ig == null) {
                        TIntHashSet forbidden = new TIntHashSet(iterator.getForbidden());
                        forbidden.addAll(TensorUtils.getAllIndicesNamesT(this.from));
                        forbidden.addAll(TensorUtils.getAllIndicesNamesT(this.to));
                        ig = new IndexGeneratorImpl(forbidden.toArray());

                    }

                    for (j = indices.length - 1; j >= 0; --j)
                        indices[j] = setRawState(getRawStateInt(var.getIndices().get(j)),
View Full Code Here

                return null;
            TIntHashSet added = new TIntHashSet(initialForbidden);
            ProductBuilder builder = new ProductBuilder();
            builder.put(base.get(tuple[0]));
            for (int i = 1; i < tuple.length; ++i)
                builder.put(ApplyIndexMapping.renameDummy(base.get(tuple[i]), added.toArray(), added));

            return createPort(builder.build());
        }

        @Override
View Full Code Here

            if (indicator.is(scalars[i])) {
                if (scalars[i] instanceof SimpleTensor)   //simple symbolic factor
                    factorOut.add(Tensors.pow(scalars[i], exponent));
                else
                    for (j = 0; j < exponent; ++j) {
                        temp = ApplyIndexMapping.renameDummy(scalars[i], allForbidden.toArray());
                        allForbidden.addAll(TensorUtils.getAllIndicesNamesT(temp));
                        factorOut.add(temp);
                    }
            } else leave.add(scalars[i]);
        }
View Full Code Here

                for (i = 0; i < typeData.length; ++i)
                    factorIndices[position++] = indicesSpace[b][--totalIndicesCounts[b]];
            }

            descriptor = ApplyIndexMapping.applyIndexMapping(descriptor,
                    new Mapping(descriptor.getIndices().getFree().getAllIndices().copy(), factorIndices), forbidden.toArray());
            descriptor = ApplyIndexMapping.renameDummy(descriptor, forbidden.toArray());
            forbidden.addAll(TensorUtils.getAllIndicesNamesT(descriptor));

            pb.put(descriptor);
        }
View Full Code Here

                    factorIndices[position++] = indicesSpace[b][--totalIndicesCounts[b]];
            }

            descriptor = ApplyIndexMapping.applyIndexMapping(descriptor,
                    new Mapping(descriptor.getIndices().getFree().getAllIndices().copy(), factorIndices), forbidden.toArray());
            descriptor = ApplyIndexMapping.renameDummy(descriptor, forbidden.toArray());
            forbidden.addAll(TensorUtils.getAllIndicesNamesT(descriptor));

            pb.put(descriptor);
        }
View Full Code Here

    void put(Tensor summand, Tensor factor) {
        TIntHashSet allowed = TensorUtils.getAllDummyIndicesT(factor);
        allowed.removeAll(factorForbiddenIndices);
        //old variant
        //IndexGenerator ig = new IndexGeneratorFromData(TensorUtils.getAllDummyIndicesT(factor).toArray());
        summand = ApplyIndexMapping.renameDummy(summand, factorForbiddenIndices, allowed.toArray());
        builder.put(summand);
    }

    Tensor build() {
        return builder.build();
View Full Code Here

        if (TensorUtils.passOutDummies(tensor)) {
            TIntHashSet forbidden = new TIntHashSet();
            for (j = 0; j < size; ++j)
                if (j != i)
                    TensorUtils.appendAllIndicesNamesT(get(j), forbidden);
            tensor = ApplyIndexMapping.renameDummy(tensor, forbidden.toArray());
        }

        Boolean compare = TensorUtils.compare1(old, tensor);
        if (compare == null)
            return super.set(i, tensor);
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.