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


                                if (oldArgIndices.size(IndexType.getType(j)) != 0)
                                    throw new IllegalArgumentException("Error in field arg indices.");
                                newArgIndices.addAll(newIndices.getOfType(IndexType.getType(j)).getAllIndices());
                            }
                        }
                        pntf.argumentsIndices[i] = IndicesFactory.createSimple(null, newArgIndices.toArray());
                    }
                }
        }
        if (pn.tokenType == TokenType.Power || pn.tokenType == TokenType.ScalarFunction) {
            for (int i = 0; i < pn.content.length; ++i)
View Full Code Here

                    //calculate trace
                    calculatedTraces.put(traceOfProduct(product.select(partition)));
                    positionsOfMatrices.addAll(partition);
                }
                //compiling the result
                c = product.remove(positionsOfMatrices.toArray());
                c = multiply(c, calculatedTraces.build());
                iterator.set(simplifications.transform(c));
            }
        }
        return simplifications.transform(iterator.result());
View Full Code Here

                    if (indices[b] == inverseIndexState(epsIndices[a]))
                        contract = true;
                if (!contract)
                    nonPermutableList.add(b);
            }
            int[] nonPermutableArray = nonPermutableList.toArray();

            //symmetries of eps indices, which are contracted with other product (also totally antisymmetric)
            Map<Permutation, Boolean> symmetries = getEpsilonSymmetries(indices.length);

            //symmetries of product, which is contracted with Levi-Civita
View Full Code Here

                }
                if (positionsOfMatrices.isEmpty())
                    continue out;

                //final simplifications
                traces.put(product.remove(positionsOfMatrices.toArray()));
                current = traces.build();
                current = ExpandAndEliminateTransformation.expandAndEliminate(current);
                current = deltaTrace.transform(current);
                if (simplifyLeviCivita != null)
                    current = simplifyLeviCivita.transform(current);
View Full Code Here

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

    @Override
    public SimpleIndices getOfType(IndexType type) {
        int type_ = type.getType() << 24;
View Full Code Here

        IntArrayList contracted = new IntArrayList();
        for (int i = 0; i < freeIndices1.length; ++i)
            for (int j = 0; j < freeIndices2.length; ++j)
                if (freeIndices2[j] == inverseIndexState(freeIndices1[i]))
                    contracted.add(getNameWithType(freeIndices2[j]));
        return contracted.toArray();
    }

    /**
     * Returns an array of contracted indices between specified indices.
     *
 
View Full Code Here

                --iUpper;
            }
        }
        list.add(data, iUpper, firstLower - iUpper);
        list.add(data, iLower, data.length - iLower);
        return IndicesFactory.create(list.toArray());
    }

    @Override
    public Indices getOfType(IndexType type) {
        int type_ = type.getType();
View Full Code Here

        if (fromL == null)
            return tensor;

        allIndicesNames.addAll(getIndicesNames(tensor.getIndices().getFree()));
        IndexGenerator generator = new IndexGenerator(allIndicesNames.toArray());
        int[] from = fromL.toArray(), to = new int[fromL.size()];
        Arrays.sort(from);
        added.ensureCapacity(from.length);
        int i;
        for (i = from.length - 1; i >= 0; --i)
            added.add(to[i] = generator.generate(IndicesUtils.getType(from[i])));
View Full Code Here

        if (fromL == null)
            return tensor;

        allIndicesNames.addAll(getIndicesNames(tensor.getIndices().getFree()));
        IndexGenerator generator = new IndexGenerator(allIndicesNames.toArray());
        int[] from = fromL.toArray(), to = new int[fromL.size()];
        Arrays.sort(from);
        int i;
        for (i = from.length - 1; i >= 0; --i)
            to[i] = generator.generate(IndicesUtils.getType(from[i]));
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.