Examples of Pow


Examples of cc.redberry.core.tensor.Pow

        Tensor get() {
            Tensor pow = Transformations.calculateNumbers(power);
            pow = CollectEquals.INSTANCE.transform(pow).equivalent();
            if (pow instanceof TensorNumber && ((TensorNumber) pow).isOne())
                return innerTensor;
            return new Pow(innerTensor, pow);
        }
View Full Code Here

Examples of cc.redberry.core.tensor.Pow

        Tensor arg = parser.parse(parts[0]);

        Tensor power = parser.parse(parts[1]);
        if (!(power instanceof TensorNumber))
            return null;
        return new Pow(arg, (TensorNumber) power);
    }
View Full Code Here

Examples of cc.redberry.core.tensor.Pow

    private ProviderPowFactory() {
    }

    @Override
    public IndexMappingProvider create(IndexMappingProvider opu, Tensor from, Tensor to, boolean allowDiffStates) {
        final Pow fromP = (Pow) from, toP = (Pow) to;
        if (IndexMappings.mappingExists(fromP.getPower(), toP.getPower(), allowDiffStates) && IndexMappings.mappingExists(fromP.getTarget(), toP.getTarget(), allowDiffStates))
            return opu;
        return IndexMappingProvider.Util.EMPTY_PROVIDER;
    }
View Full Code Here

Examples of org.apache.commons.math3.analysis.function.Pow

    public void testFixingArguments() {
        UnivariateFunction scaler = FunctionUtils.fix1stArgument(new Multiply(), 10);
        Assert.assertEquals(1.23456, scaler.value(0.123456), EPS);

        UnivariateFunction pow1 = new Power(2);
        UnivariateFunction pow2 = FunctionUtils.fix2ndArgument(new Pow(), 2);

        for (int i = 0; i < 10; i++) {
            double x = FastMath.random() * 10;
            Assert.assertEquals(pow1.value(x), pow2.value(x), 0);
        }
View Full Code Here

Examples of org.apache.commons.math3.analysis.function.Pow

    public void testFixingArguments() {
        UnivariateFunction scaler = FunctionUtils.fix1stArgument(new Multiply(), 10);
        Assert.assertEquals(1.23456, scaler.value(0.123456), EPS);

        UnivariateFunction pow1 = new Power(2);
        UnivariateFunction pow2 = FunctionUtils.fix2ndArgument(new Pow(), 2);

        for (int i = 0; i < 10; i++) {
            double x = Math.random() * 10;
            Assert.assertEquals(pow1.value(x), pow2.value(x), 0);
        }
View Full Code Here

Examples of org.apache.commons.math3.analysis.function.Pow

    public void testFixingArguments() {
        UnivariateFunction scaler = FunctionUtils.fix1stArgument(new Multiply(), 10);
        Assert.assertEquals(1.23456, scaler.value(0.123456), EPS);

        UnivariateFunction pow1 = new Power(2);
        UnivariateFunction pow2 = FunctionUtils.fix2ndArgument(new Pow(), 2);

        for (int i = 0; i < 10; i++) {
            double x = Math.random() * 10;
            Assert.assertEquals(pow1.value(x), pow2.value(x), 0);
        }
View Full Code Here

Examples of org.apache.pig.piggybank.evaluation.math.POW

          assertEquals(actual, expected, delta);
      }
  
  
   public void testPOW() throws Exception {
          EvalFunc<DataAtom> POW = new POW();
          Tuple tup = new Tuple(2);
          tup.setField(0, 0.5);
          tup.setField(1,0.6);
          DataAtom output = new DataAtom();
          POW.exec(tup, output);
          double expected = Math.pow(0.5,0.6);
          double actual = (new Double(output.strval())).doubleValue();
          assertEquals(actual, expected, delta);
      }
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.