Examples of RINT


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

        return new UnivariateFunction[] {
            new Power(2.0), new Exp(), new Expm1(),
            new Log1p(), new Cosh(), new Sinh(), new Tanh(), new Cos(),
            new Sin(), new Tan(), new Acos(), new Asin(), new Atan(),
            new Abs(), new Sqrt(), new Cbrt(), new Ceil(),
            new Floor(), new Rint(), new Signum()
        };
    }
View Full Code Here

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

        return new UnivariateFunction[] {
            new Power(2.0), new Exp(), new Expm1(),
            new Log1p(), new Cosh(), new Sinh(), new Tanh(), new Cos(),
            new Sin(), new Tan(), new Acos(), new Asin(), new Atan(),
            new Abs(), new Sqrt(), new Cbrt(), new Ceil(),
            new Floor(), new Rint(), new Signum()
        };
    }
View Full Code Here

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

        return new UnivariateFunction[] {
            new Power(2.0), new Exp(), new Expm1(), new Log(), new Log10(),
            new Log1p(), new Cosh(), new Sinh(), new Tanh(), new Cos(),
            new Sin(), new Tan(), new Acos(), new Asin(), new Atan(),
            new Inverse(), new Abs(), new Sqrt(), new Cbrt(), new Ceil(),
            new Floor(), new Rint(), new Signum(), new Ulp()
        };
    }
View Full Code Here

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

        return new UnivariateFunction[] {
            new Power(2.0), new Exp(), new Expm1(), new Log(), new Log10(),
            new Log1p(), new Cosh(), new Sinh(), new Tanh(), new Cos(),
            new Sin(), new Tan(), new Acos(), new Asin(), new Atan(),
            new Inverse(), new Abs(), new Sqrt(), new Cbrt(), new Ceil(),
            new Floor(), new Rint(), new Signum(), new Ulp()
        };
    }
View Full Code Here

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

        v_mapFloorToSelf.mapToSelf(new Floor());
        double[] result_mapFloorToSelf =  {-2d,0d,1d};
        assertClose("compare vectors" ,result_mapFloorToSelf,v_mapFloorToSelf.toArray(),normTolerance);

        //octave =  ???
        RealVector v_mapRint = ceil_v.map(new Rint());
        double[] result_mapRint = {-1d,1d,1d};
        assertClose("compare vectors" ,result_mapRint,v_mapRint.toArray(),normTolerance);

        //octave = ???
        RealVector v_mapRintToSelf = ceil_v.copy();
        v_mapRintToSelf.mapToSelf(new Rint());
        double[] result_mapRintToSelf =  {-1d,1d,1d};
        assertClose("compare vectors" ,result_mapRintToSelf,v_mapRintToSelf.toArray(),normTolerance);

        //octave =  ???
        RealVector v_mapSignum = ceil_v.map(new Signum());
View Full Code Here

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

        v_mapFloorToSelf.mapToSelf(new Floor());
        double[] result_mapFloorToSelf =  {-2d,0d,1d};
        assertClose("compare vectors" ,result_mapFloorToSelf,v_mapFloorToSelf.toArray(),normTolerance);

        //octave =  ???
        RealVector v_mapRint = ceil_v.map(new Rint());
        double[] result_mapRint = {-1d,1d,1d};
        assertClose("compare vectors" ,result_mapRint,v_mapRint.toArray(),normTolerance);

        //octave = ???
        RealVector v_mapRintToSelf = ceil_v.copy();
        v_mapRintToSelf.mapToSelf(new Rint());
        double[] result_mapRintToSelf =  {-1d,1d,1d};
        assertClose("compare vectors" ,result_mapRintToSelf,v_mapRintToSelf.toArray(),normTolerance);

        //octave =  ???
        RealVector v_mapSignum = ceil_v.map(new Signum());
View Full Code Here

Examples of org.apache.imperius.spl.parser.expressions.impl.Rint

    //SensorLookup lookup = new SensorLookupImpl(map);

    try {
      Vector v = new Vector();
      v.add(new ShortConstant(sn1));
      Expression e1 = new Rint(v,true);

      v.clear();
      v.add(new IntegerConstant(in1));
      Expression e2 = new Rint(v,true);

      v.clear();
      v.add(new LongConstant(ln1));
      Expression e3 = new Rint(v,true);

      v.clear();
      v.add(new FloatConstant(fn1));
      Expression e4 = new Rint(v,true);

      v.clear();
      v.add(new DoubleConstant(dn1));
      Expression e5 = new Rint(v,true);

      assertTrue(
        (Math.rint(sn1) - ((Number) e1.evaluate()).shortValue())
          == 0);
      assertTrue(
        (Math.rint(in1) - ((Number) e2.evaluate()).intValue())
          == 0);
      assertTrue(
          (Math.rint(ln1) - ((Number) e3.evaluate()).intValue())
            == 0);
      assertTrue(
        (Math.rint(fn1) - ((Number) e4.evaluate()).intValue())
          == 0);
      assertTrue(
        (Math.rint(dn1) - ((Number) e5.evaluate()).longValue())
          == 0);
/*
      assertSame((new Double(sn1)).getClass(), (e1.evaluate()).getClass());
      assertSame((new Double(in1)).getClass(), (e2.evaluate()).getClass());
      assertSame((new Double(ln1)).getClass(), (e3.evaluate()).getClass());
View Full Code Here

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

          assertEquals(actual, expected, delta);
      }
  
  
   public void testRINT() throws Exception{
       EvalFunc<DataAtom> RINT = new RINT();
          Tuple tup = new Tuple(1);
          tup.setField(0, -0.5);
          DataAtom output = new DataAtom();
          RINT.exec(tup, output);
          double expected = Math.rint(0.5);
          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.