Package cc.redberry.core.tensor.iterator

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


            if (c instanceof Sum)
                iterator.set(togetherSum(c, doFactor));
            if (c instanceof Product)
                iterator.set(collectScalarFactorsInProduct((Product) c));
        }
        return iterator.result();
    }

    private static Tensor togetherSum(Tensor t, boolean doFactor) {
        boolean performTogether = false;
        for (Tensor s : t)
View Full Code Here


        FromChildToParentIterator iterator = new FromChildToParentIterator(t);
        Tensor c;
        while ((c = iterator.next()) != null)
            if (c instanceof Complex)
                iterator.set(((Complex) c).conjugate());
        return iterator.result();
    }
}
View Full Code Here

        while ((c = iterator.next()) != null)
            if (powerExpandApplicable(c, toExpandIndicator))
                iterator.set(Tensors.multiply(powerExpandToArray1(c, toExpandIndicator)));

        return iterator.result();
    }
}
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(c);
            } 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

                c = product.remove(positionsOfMatrices.toArray());
                c = multiply(c, calculatedTraces.build());
                iterator.set(simplifications.transform(c));
            }
        }
        return simplifications.transform(iterator.result());
    }

    private Tensor traceOfProduct(Tensor tensor) {
        Tensor oldTensor = tensor, newTensor;
        while (true) {
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.