Package cc.redberry.core.utils

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


                        kroneckers.add(Tensors.createKronecker(index, inverseIndexState(newIndex)));
                    }
                }

                factors[i] = applyDirectMapping(factors[i],
                        new StateSensitiveMapping(from.toArray(), to.toArray()));
            }

            //temp check
//            factorIndices = new IndicesBuilder().append(factors).getIndices();
//            assert factorIndices.size() == factorIndices.getFree().size();
View Full Code Here


                    break;
                }
            if (y)
                dataList.add(data[i]);
        }
        return new SimpleIndicesImpl(dataList.toArray(), symmetries);
    }

    @Override
    protected void _update() {
        sorted = null;
View Full Code Here

                --iUpper;
            }
        }
        list.add(data, iUpper, firstLower - iUpper);
        list.add(data, iLower, size - iLower);
        return new SortedIndices(list.toArray());
    }

    @Override
    protected int[] getSortedData() {
        return data;
View Full Code Here

                if (Derivative.onVarsIndicator.is(it))
                    usedIndices.addAll(TensorUtils.getAllIndicesNames(current));
            }

            //Creating int set from collected indices
            int[] usedIndicesArray = MathUtils.getSortedDistinct(usedIndices.toArray());

            Tensor target = derivative.getTarget();

            //Calculating used indices for AIM transformation
            int[] targetIndices = IndicesUtils.getSortedDistinctIndicesNames(target.getIndices().getFreeIndices());
View Full Code Here

            Tensor target = derivative.getTarget();

            //Calculating used indices for AIM transformation
            int[] targetIndices = IndicesUtils.getSortedDistinctIndicesNames(target.getIndices().getFreeIndices());
            int[] currentUsedIndices = MathUtils.intSetDifference(targetIndices, usedIndices.toArray());
            //Applying AIM transformation
            IndexMappingImpl indexMapping = new IndexMappingImpl(currentUsedIndices);
            ApplyIndexMappingTransformation.INSTANCE.perform(target, indexMapping);
        }
        return tensor;
View Full Code Here

        //building index generator
        IntArrayList usedIndices = new IntArrayList(TensorUtils.getAllIndicesNames(split.factoredOut));
        usedIndices.addAll(factorsIndicesNames);
        usedIndices.addAll(termIndicesNames);
        IndexGenerator ig = new IndexGenerator(usedIndices.toArray());

        List<Tensor> mkCollectedList = new ArrayList<>();

        for (Map.Entry<Integer, IndexMappingBufferRecord> entry : concurentBuffer.getMap().entrySet()) {
View Full Code Here

            for (int i : arr)
                if (contains(i))
                    continue;
                else
                    temp.add(i);
            super.addAll(temp.toArray());
        }
    }
}
View Full Code Here

                            continue MAIN;
                        }
                    }
                while ((currentInfo = currentInfo.next) != null);

                innerPort = new InnerPort(bijectionNew, addedBijectionsNew.toArray());
            } while (true);
        }

        private void init() {
            int j;
View Full Code Here

                hitList.clear();
                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 DistinctCombinationsPort(hits);
        }

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

                    //building index generator
                    IntArrayList usedIndices = new IntArrayList(TensorUtils.getAllIndicesNames(split.factoredOut));
                    usedIndices.addAll(collectedTerm.getCollectedFactorsIndicesNames());
                    usedIndices.addAll(collectedTerm.getCollectedTermIndicesNames());
                    IndexGenerator ig = new IndexGenerator(usedIndices.toArray());

                    List<Tensor> kroneckersCollected = new ArrayList<>();

                    for (Map.Entry<Integer, IndexMappingBufferRecord> entry : concurentBuffer.getMap().entrySet()) {
                        int indexCollected, indexToCollect, rawState = ((entry.getValue().getStates() & 1) ^ 1) << 31;
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.