Package cc.redberry.core.number

Examples of cc.redberry.core.number.Complex


    static Tensor power(Tensor argument, Tensor power) {
        //TODO improve Complex^Complex
        if (argument instanceof Complex && power instanceof Complex) {

            Complex a = (Complex) argument;
            Complex p = (Complex) power;
            Complex result = Exponentiation.exponentiateIfPossible(a, p);

            if (result != null)
                return result;
        }
        if (TensorUtils.isOne(power))
View Full Code Here


        return tensor instanceof Complex && ((Complex) tensor).isNegativeInteger();
    }

    public static boolean isRealPositiveNumber(Tensor tensor) {
        if (tensor instanceof Complex) {
            Complex complex = (Complex) tensor;
            return complex.isReal() && complex.getReal().signum() > 0;
        }
        return false;
    }
View Full Code Here

        return false;
    }

    public static boolean isRealNegativeNumber(Tensor tensor) {
        if (tensor instanceof Complex) {
            Complex complex = (Complex) tensor;
            return complex.isReal() && complex.getReal().signum() < 0;
        }
        return false;
    }
View Full Code Here

        //d^a_a = numberOfIndices
        substitutions[1] = expression(createKronecker(
                setType(typeOfLeviCivitaIndices, 0),
                setType(typeOfLeviCivitaIndices, 0x80000000)),
                new Complex(numberOfIndices));

        return substitutions;
    }
View Full Code Here

        Tensors.addSymmetry("R_lm", IndexType.LatinLower, false, new int[]{1, 0});
        Tensors.addSymmetry("R_lmab", IndexType.LatinLower, true, new int[]{0, 1, 3, 2});
        Tensors.addSymmetry("R_lmab", IndexType.LatinLower, false, new int[]{2, 3, 0, 1});


        this.L = Tensors.expression(Tensors.parse("L"), new Complex(operatorOrder));
        this.hatQuantities = new Expression[HAT_QUANTITIES_GENERAL_COUNT][];
        this.matrixIndicesCount = inputValues[1].get(0).getIndices().size() - operatorOrder;

        //all are upper
        int[] covariantIndices = new int[operatorOrder];
View Full Code Here

        return tensor instanceof Complex && ((Complex) tensor).isPositiveNatural();
    }

    public static boolean isRealPositiveNumber(Tensor tensor) {
        if (tensor instanceof Complex) {
            Complex complex = (Complex) tensor;
            return complex.isReal() && complex.getReal().signum() > 0;
        }
        return false;
    }
View Full Code Here

        return false;
    }

    public static boolean isRealNegativeNumber(Tensor tensor) {
        if (tensor instanceof Complex) {
            Complex complex = (Complex) tensor;
            return complex.isReal() && complex.getReal().signum() < 0;
        }
        return false;
    }
View Full Code Here

            pb.put(descriptor);
        }


        if (random.nextBoolean()) {
            Complex factor = new Complex(1 + nextInt(100));
            factor = random.nextBoolean() ? factor : factor.negate();
            pb.put(factor);
        }
        return pb.build();
    }
View Full Code Here

     * @param power    power
     * @return result of argument exponentiation
     * @throws IllegalArgumentException if argument is not scalar
     */
    public static Tensor pow(Tensor argument, int power) {
        return pow(argument, new Complex(power));
    }
View Full Code Here

     * @param power    power
     * @return result of argument exponentiation
     * @throws IllegalArgumentException if argument is not scalar
     */
    public static Tensor pow(Tensor argument, java.math.BigInteger power) {
        return pow(argument, new Complex(power));
    }
View Full Code Here

TOP

Related Classes of cc.redberry.core.number.Complex

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.