Package cc.redberry.core.tensor

Examples of cc.redberry.core.tensor.Derivative


    }

    public Tensor transform(Tensor tensor) {
        if (!(tensor instanceof Derivative))
            return tensor;
        Derivative derivative = (Derivative) tensor;
        Tensor target = derivative.getTarget().clone();
        for (int i = 0; i < derivative.getDerivativeOrder(); ++i) {
            target = getDerivative(target, derivative.getVariation(i));
            if (target == null)
                return TensorNumber.createZERO();
        }
        return target;
    }
View Full Code Here


                                                  TensorUtils.getAllIndicesNames(multiplyer));
                }
        }
        if (tensor instanceof Derivative) {
            //Very similar to Product case
            Derivative derivative = (Derivative) tensor;

            //Collecting all indices from derivative vars
            TensorIterator it = derivative.iterator();
            IntArrayList usedIndices = new IntArrayList();
            Tensor current;
            while (it.hasNext()) {
                current = it.next();
                if (Derivative.onVarsIndicator.is(it))
                    usedIndices.addAll(TensorUtils.getAllIndicesNames(current));
            }

            //Creating int set from collected indices
            int[] usedIndicesArray = MathUtils.getSortedDistinct(usedIndices.toArray());

            Tensor target = derivative.getTarget();

            //Calculating used indices for AIM transformation
            int[] targetIndices = IndicesUtils.getSortedDistinctIndicesNames(target.getIndices().getFreeIndices());
            int[] currentUsedIndices = MathUtils.intSetDifference(targetIndices, usedIndices.toArray());
            //Applying AIM transformation
View Full Code Here

    @Override
    public Tensor transform(Tensor tensor) {
        if (!(tensor instanceof Derivative))
            return tensor;
        Derivative derivative = (Derivative) tensor;
        Tensor target = derivative.getTarget().clone();
        for (int i = 0; i < derivative.getDerivativeOrder(); ++i) {
            target = getDerivative(target, derivative.getVariation(i));
            if (target == null)
                return TensorNumber.createZERO();
        }
        return target;
    }
View Full Code Here

    public Tensor transform(Tensor tensor) {
        if (!TTest.testIsScalar(tensor))
            return tensor;
        if (!(tensor instanceof Derivative))
            return tensor;
        Derivative derivative = (Derivative) tensor;
        Tensor target = derivative.getTarget().clone();
        for (int i = 0; i < derivative.getDerivativeOrder(); ++i) {
            target = getDerivative(target, derivative.getVariation(i));
            if (target == null)
                return TensorNumber.createZERO();
        }
        return target;
    }
View Full Code Here

TOP

Related Classes of cc.redberry.core.tensor.Derivative

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.