Package cc.redberry.core.tensor

Examples of cc.redberry.core.tensor.Product$MatricesPrinter


    }

    @Override
    public Tensor transform(Tensor tensor) {
        if (tensor.getClass() == Minus.class)
            return new Product(TensorNumber.createMINUSONE(), ((Minus) tensor).getInnerTensor());
        return tensor;
    }
View Full Code Here


            return TensorNumber.createZERO();
        if (generatedTensors.size() == 1)
            return generatedTensors.get(0);
        if (multiplyFactorial) {
            TensorNumber num = new TensorNumber(new ComplexElement(new NumberFraction(1, generatedTensors.size()), RationalElement.ZERO));
            return new Product(num, new Sum(generatedTensors).equivalent());
        } else
            return new Sum(generatedTensors).equivalent();
    }
View Full Code Here

            if (indicesLevel == level)
                indicesLevel = -1;
            level--;
            if (derivativeVarChangedSignum) {
                derivativeVarChangedSignum = false;
                return new Product(TensorNumber.createMINUSONE(), tensor);
            }
            return tensor;
        }
View Full Code Here

            if (parity == null)
                continue;
            if (parity.booleanValue() == false)
                current.cip.put(split.summand);
            else
                current.cip.put(new Product(TensorNumber.createMINUSONE(), split.summand));
            break;
        }
    }
View Full Code Here

        Sum result = new Sum();
        FactorNode node;
        for (ConcurrentGrowingList<FactorNode> list : nodes.values()) {
            ConcurrentGrowingList<FactorNode>.GrowingIterator gi = list.iterator();
            while ((node = gi.next()) != null)
                result.add(new Product(node.cip.result(), node.factor));
        }
        return result.equivalent();
    }
View Full Code Here

        long index = atomicLong.getAndIncrement();
        if (index >= sum1.length * sum2.length)
            return null;
        int i1 = (int) (index / sum2.length);
        int i2 = (int) (index % sum2.length);
        return new Product(sum1[i1].clone(), sum2[i2].clone());
    }
View Full Code Here

            current = iterator.next();
           
            if (current instanceof Fraction) {
                Fraction temp = (Fraction) current;
                if (Fraction.onDenominatorIndicator.is(iterator))
                    return new Fraction(new Product(fraction.getNumerator(), temp.getDenominator()), temp.getNumerator());
                else
                    return new Fraction(temp.getNumerator(), new Product(fraction.getDenominator(), temp.getDenominator()));
            }
            if (current instanceof Product) {
                List<Tensor> multiplicands = new ArrayList<>();
                TensorIterator it = current.iterator();
                Tensor current1;
                while (it.hasNext()) {
                    current1 = it.next();
                    if (current1 instanceof Fraction) {
                        Fraction currentFraction = (Fraction) current1;
                        multiplicands.add(currentFraction.getDenominator());
                        it.set(currentFraction.getNumerator());
                    }
                }
                if (multiplicands.isEmpty())
                    return tensor;
                Product newNumerator = new Product();
                if (Fraction.onDenominatorIndicator.is(iterator)) {
                    newNumerator.add(fraction.getNumerator());
                    newNumerator.add(multiplicands);
                    return new Fraction(newNumerator, fraction.getDenominator());
                } else {
                    newNumerator.add(fraction.getDenominator());
                    newNumerator.add(multiplicands);
                    return new Fraction(fraction.getNumerator(), newNumerator);
                }
            }
        }
        return tensor;
View Full Code Here

        Tensor collectedTerm;
        Product factoredOut;

        public Split(Tensor collectingTerm, List<Tensor> factoredOut) {
            this.collectedTerm = collectingTerm;
            this.factoredOut = new Product(factoredOut);
        }
View Full Code Here

            collectedFactorsndexesNames = new IntArrayBuffer(TensorUtils.getAllIndicesNames(factoredOut));
            collectedTermIndicesNames = new IntArrayList(TensorUtils.getAllIndicesNames(collectedTerm));
        }

        Tensor result() {
            return new Product(collectedFactors.equivalent(), collectedItem.equivalent());
        }
View Full Code Here

        Sum sum = new Sum();
        for (SplitNumber split : result)
            if (split.number.isOne())
                sum.add(split.nonNumber);
            else
                sum.add(new Product(split.number, split.nonNumber));
        return sum.equivalent();
    }
View Full Code Here

TOP

Related Classes of cc.redberry.core.tensor.Product$MatricesPrinter

Copyright © 2018 www.massapicom. 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.