Package org.jquantlib.math.integrals

Examples of org.jquantlib.math.integrals.Integrator


    checkSingleTabulated(new Fourth(),      "f(x)=x^4", 2.0/5.0, 1.0e-13);
  }

  private void checkSingleTabulated(final Ops.DoubleOp f, final String tag, final double expected, final double tolerance) {

    final Integrator quad = new GaussKronrodPatterson();
      final double realised = quad.op(f,-1,1);

        if (Math.abs(realised-expected) > tolerance)
          fail(" integrating " + tag + "\n"
                    + "    realised: " + realised + "\n"
                    + "    expected: " + expected);
View Full Code Here


      public double op(final double x) {
        return Math.exp(x);
      }
    };

    final Integrator quad = new GaussKronrodPatterson(0, 1.1*Constants.QL_EPSILON);

    final double realised = quad.op(exp, 0, 6);
    final double expected = Math.exp(6) - 1.0;
    final double tolerance = 1.0e-10;

    if (Math.abs(realised-expected)>tolerance) {
      fail("Expected: " + expected + " Realised: " + realised);
View Full Code Here

TOP

Related Classes of org.jquantlib.math.integrals.Integrator

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.