Package cc.redberry.core.number

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


                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

                    indexlessArray.add(tensor);
            }

            for (Tensor t : powersContainer)
                if (t instanceof Product) {
                    factor = factor.multiply(((Product) t).factor);
                    indexlessArray.ensureCapacity(t.size());
                    for (Tensor multiplier : ((Product) t).indexlessData)
                        indexlessArray.add(multiplier);

                } else if (t instanceof Complex) {
View Full Code Here

                    indexlessArray.ensureCapacity(t.size());
                    for (Tensor multiplier : ((Product) t).indexlessData)
                        indexlessArray.add(multiplier);

                } else 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

                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

                    indexlessArray.add(tensor);
            }

            for (Tensor t : powersContainer)
                if (t instanceof Product) {
                    factor = factor.multiply(((Product) t).factor);
                    indexlessArray.ensureCapacity(t.size());
                    for (Tensor multiplier : ((Product) t).indexlessData)
                        indexlessArray.add(multiplier);

                } else if (t instanceof Complex) {
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.