Package cc.redberry.core.utils

Examples of cc.redberry.core.utils.IntArrayList.toArray()


                seen.set(start);
                ++counter;
                cycle.add(start);
                start = permutation[start];
            }
            cycles.add(cycle.toArray());
        }
        return cycles.toArray(new int[cycles.size()][]);
    }

    /**
 
View Full Code Here


                ++size;
                start = permutation[start];
            }
            sizes.add(size);
        }
        return sizes.toArray();
    }

    /**
     * Returns an array of cycles lengths.
     *
 
View Full Code Here

                ++size;
                start = permutation[start];
            }
            sizes.add(size);
        }
        return sizes.toArray();
    }

    /**
     * Returns an array of cycles lengths.
     *
 
View Full Code Here

                ++size;
                start = permutation[start];
            }
            sizes.add(size);
        }
        return sizes.toArray();
    }

    /***************************************** RANDOM *****************************************************/

    /**
 
View Full Code Here

                for (int i = 0; i < targetData.length; ++i)
                    if (weakMatch(fromData[seeds[seedIndex]], targetData[i])
                            && GraphUtils.componentSize(seeds[seedIndex], fromFContractions.components)
                            <= GraphUtils.componentSize(i, targetFContractions.components))
                        hitList.add(i);
                hits[seedIndex] = hitList.toArray();
            }
            combinationsPort = new IntDistinctTuplesPort(hits);
        }

        public int[] next() {
View Full Code Here

                //adding symmetries for indices from each slot
                cycle = Permutations.createBlockCycle(structuresOfIndices[i + 1].size(), 2);
                aggregator.addAll(mapping[j]);
                aggregator.addAll(mapping[j + 1]);
                symmetries.addSymmetry(
                        Permutations.createPermutation(convertPermutation(cycle, aggregator.toArray(), baseStructure.size())));

                if (orders[i] >= 3) {
                    for (k = 2; k < orders[i]; ++k)
                        aggregator.addAll(mapping[j + k]);
View Full Code Here

            indicesTo[tensorIndex].add(getToIndexId(indicesContractions[i]));
        }
        int f = freeIndices.size() == 0 ? 0 : 1;
        Contraction[] result = new Contraction[tensorsCount + f];
        if (f == 1)
            result[0] = new Contraction(-1, freeIndices.toArray(), null);
        tensorsCount = f;
        for (int i = 0; i < contractions.length; ++i) {
            if (involvedTensors[i] == -1)
                continue;
            result[tensorsCount++] = new Contraction(involvedTensors[i], indicesFrom[i].toArray(), indicesTo[i].toArray());
View Full Code Here

                    for (k = 2; k < orders[i]; ++k)
                        aggregator.addAll(mapping[j + k]);

                    cycle = Permutations.createBlockCycle(structuresOfIndices[i + 1].size(), orders[i]);
                    symmetries.addSymmetry(
                            Permutations.createPermutation(convertPermutation(cycle, aggregator.toArray(), baseStructure.size())));
                }
                aggregator.clear();
            }
            j += orders[i];
        }
View Full Code Here

        if (permMappingFrom == null)
            searchForPermutations = fromIndices.getSymmetries().getPermutationGroup().iterator();
        else
            searchForPermutations = new OutputPort.PortIterator<>(
                    fromIndices.getSymmetries().getPermutationGroup().mapping(
                            permMappingFrom.toArray(), permMappingTo.toArray()));
        return take();
    }

    @Override
    protected void _tick() {
View Full Code Here

                    break;
                }
            if (y)
                dataList.add(data[i]);
        }
        return UnsafeIndicesFactory.createIsolatedUnsafeWithoutSort(null, dataList.toArray());
    }

    @Override
    public int[] getNamesOfDummies() {
        IntArrayList dataList = new IntArrayList();
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.