Package cc.redberry.core.number

Examples of cc.redberry.core.number.Complex.multiply()


            Tensor t = Tensors.pow(entry.getKey(), entry.getValue().build());

            assert !(t instanceof Product);

            if (t instanceof Complex)
                complex = complex.multiply((Complex) t);
            else
                indexlessData.add(t);

        }
View Full Code Here


        Tensor current;
        Product p;
        for (i = tensors.length - 1; i >= 0; --i) {
            current = tensors[i];
            if (current instanceof Complex)
                complex = complex.multiply((Complex) current);
            else if (current instanceof Product) {
                p = (Product) tensors[i];
                indexlessContainer.add(p.indexlessData);
                dataContainer.add(p.data, p.contentReference.get(), p.indices);
                complex = complex.multiply(p.factor);
View Full Code Here

                complex = complex.multiply((Complex) current);
            else if (current instanceof Product) {
                p = (Product) tensors[i];
                indexlessContainer.add(p.indexlessData);
                dataContainer.add(p.data, p.contentReference.get(), p.indices);
                complex = complex.multiply(p.factor);
            } else if (current.getIndices().size() == 0)
                indexlessContainer.add(current);
            else
                dataContainer.add(current);
            if (complex.isNaN())
View Full Code Here

                Tensor t = Tensors.pow(entry.getKey(), entry.getValue().build());

                assert !(t instanceof Product);

                if (t instanceof Complex)
                    complex = complex.multiply((Complex) t);
                else
                    indexlessArray.add(t);

            }
            //complex may change
View Full Code Here

        IndexlessWrapper indexlessContainer = new IndexlessWrapper();
        DataWrapper dataContainer = new DataWrapper();
        Product p;
        for (Tensor current : tensors) {
            if (current instanceof Complex)
                factor = factor.multiply((Complex) current);
            else if (current instanceof Product) {
                p = (Product) current;
                indexlessContainer.add(p.indexlessData);
                dataContainer.add(p.data, p.contentReference.getReferent(), p.indices);
                factor = factor.multiply(p.factor);
View Full Code Here

                factor = factor.multiply((Complex) current);
            else if (current instanceof Product) {
                p = (Product) current;
                indexlessContainer.add(p.indexlessData);
                dataContainer.add(p.data, p.contentReference.getReferent(), p.indices);
                factor = factor.multiply(p.factor);
            } else if (current.getIndices().size() == 0)
                indexlessContainer.add(current);
            else
                dataContainer.add(current);
            if (factor.isNaN())
View Full Code Here

            List<Tensor> newTensors = new ArrayList<>();
            factor = Complex.ONE;
            for (Tensor current : tensors) {
                current = toNumeric(current);
                if (current instanceof Complex)
                    factor = factor.multiply((Complex) current);
                else newTensors.add(current);
            }
            if (newTensors.isEmpty())
                return factor;
            indexlessContainer = new IndexlessWrapper();
View Full Code Here

            for (Tensor current : newTensors) {
                if (current instanceof Product) {
                    p = (Product) current;
                    indexlessContainer.add(p.indexlessData);
                    dataContainer.add(p.data, p.contentReference.getReferent(), p.indices);
                    factor = factor.multiply(p.factor);
                } else if (current.getIndices().size() == 0)
                    indexlessContainer.add(current);
                else
                    dataContainer.add(current);
            }
View Full Code Here

            for (Tensor t : powersContainer) {
                assert !(t instanceof Product);

                if (t instanceof Complex) {
                    factor = factor.multiply((Complex) t);
                    if (isZeroOrIndeterminate(factor))
                        return factor;
                } else
                    indexlessArray.add(t);
            }
View Full Code Here

        IndexlessWrapper indexlessContainer = new IndexlessWrapper();
        DataWrapper dataContainer = new DataWrapper();
        Product p;
        for (Tensor current : tensors) {
            if (current instanceof Complex)
                factor = factor.multiply((Complex) current);
            else if (current instanceof Product) {
                p = (Product) current;
                indexlessContainer.add(p.indexlessData);
                dataContainer.add(p.data, p.contentReference.getReferent(), p.indices);
                factor = factor.multiply(p.factor);
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.