Package cc.redberry.core.tensor.iterator

Examples of cc.redberry.core.tensor.iterator.FromChildToParentIterator.result()


                if (simplifyLeviCivita != null)
                    current = simplifyLeviCivita.transform(current);
                iterator.set(current);
            }
        }
        return iterator.result();
    }

    private SimpleTensor setMatrixIndices(SimpleTensor gamma, int matrixUpper, int matrixLower) {
        int[] indices = gamma.getIndices().getAllIndices().copy();
        for (int i = indices.length - 1; i >= 0; --i)
View Full Code Here


        Tensor c;
        while ((c = iterator.next()) != null)
            if (c instanceof Sum)
                iterator.set(factorOut(c));

        iterator = new FromParentToChildIterator(iterator.result());
        while ((c = iterator.next()) != null) {
            if (!(c instanceof Sum))
                continue;
            if (needTogether(c)) {
                c = TogetherTransformation.together(c, true);
View Full Code Here

                    iterator.set(pb == null ? c : pb.build());
                }
            } else
                iterator.set(JasFactor.factor(c));
        }
        return iterator.result();
    }

    private static boolean needTogether(Tensor t) {
        if (t instanceof Power) {
            if (needTogether(t.get(0)))
View Full Code Here

        FromChildToParentIterator iterator = new FromChildToParentIterator(tensor);
        Tensor c;
        while ((c = iterator.next()) != null)
            if (c instanceof Sum)
                iterator.set(factorOut1(c));
        return iterator.result();
    }

    private static boolean isProductOfSums(Tensor tensor) {
        if (tensor instanceof Sum)
            return false;
View Full Code Here

        Tensor c;
        while ((c = iterator.next()) != null)
            if (c instanceof Sum)
                iterator.set(factorOut(c));

        iterator = new FromParentToChildIterator(iterator.result());
        while ((c = iterator.next()) != null) {
            if (!(c instanceof Sum))
                continue;
            if (needTogether(c)) {
                c = TogetherTransformation.together(c, true);
View Full Code Here

                    iterator.set(pb == null ? c : pb.build());
                }
            } else
                iterator.set(JasFactor.factor(c));
        }
        return iterator.result();
    }

    private static boolean needTogether(Tensor t) {
        if (t instanceof Power) {
            if (needTogether(t.get(0)))
View Full Code Here

        FromChildToParentIterator iterator = new FromChildToParentIterator(tensor);
        Tensor c;
        while ((c = iterator.next()) != null)
            if (c instanceof Sum)
                iterator.set(factorOut1(c));
        return iterator.result();
    }

    private static boolean isProductOfSums(Tensor tensor) {
        if (tensor instanceof Sum)
            return false;
View Full Code Here

                iterator.set(Complex.ZERO);
            }
            if (c instanceof Product)
                iterator.set(simplifyProduct(c, LeviCivita));
        }
        return iterator.result();
    }

    private static void checkLeviCivita(SimpleTensor LeviCivita) {
        SimpleIndices indices = LeviCivita.getIndices();
        if (indices.size() <= 1)
View Full Code Here

        FromChildToParentIterator iterator = new FromChildToParentIterator(t);
        Tensor c;
        while ((c = iterator.next()) != null)
            if (c instanceof Product)
                iterator.set(inverseOrderInProduct((Product) c, type));
        return iterator.result();
    }

    private static Tensor inverseOrderInProduct(Product product, IndexType type) {
        ProductContent pc = product.getContent();
        PrimitiveSubgraph[] subgraphs = PrimitiveSubgraphPartition.calculatePartition(pc, type);
View Full Code Here

                temp = ExpandTransformation.expand(temp, EliminateMetricsTransformation.ELIMINATE_METRICS);
                temp = EliminateMetricsTransformation.eliminate(temp);
                iterator.set(temp);
            }
        }
        return iterator.result();
    }

    private static Tensor traceOfProduct(Tensor tensor,
                                         int sunName, int fName, int dName, Tensor N,
                                         IndexType metricType, IndexType matrixType) {
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.