Examples of differentiateTwice()


Examples of com.opengamma.analytics.math.function.PiecewisePolynomialFunction1D.differentiateTwice()

   * @param x1Keys
   * @return Values of second derivative with respect to x1 at (x0Key_i, x1Keys_j)
   */
  public DoubleMatrix2D differentiateX1Twice(final double[] x0Values, final double[] x1Values, final double[][] yValues, final double[] x0Keys, final double[] x1Keys) {
    final PiecewisePolynomialFunction1D func = new PiecewisePolynomialFunction1D();
    final double[][] interpX1Diff = OG_ALGEBRA.getTranspose(func.differentiateTwice(_method[1].interpolate(x1Values, yValues), x1Keys)).getData();
    return OG_ALGEBRA.getTranspose(_method[0].interpolate(x0Values, interpX1Diff, x0Keys));
  }
}
View Full Code Here

Examples of com.opengamma.analytics.math.function.PiecewisePolynomialFunction1D.differentiateTwice()

   * @param x1Key
   * @return Value of second derivative with respect to x0 at (x0Key, x1Key)
   */
  public double differentiateX0Twice(final double[] x0Values, final double[] x1Values, final double[][] yValues, final double x0Key, final double x1Key) {
    final PiecewisePolynomialFunction1D func = new PiecewisePolynomialFunction1D();
    final double[] interpX0Diff = func.differentiateTwice(_method[0].interpolate(x0Values, OG_ALGEBRA.getTranspose(new DoubleMatrix2D(yValues)).getData()), x0Key).getData();
    return _method[1].interpolate(x1Values, interpX0Diff, x1Key);
  }

  /**
   * @param x0Values
View Full Code Here

Examples of com.opengamma.analytics.math.function.PiecewisePolynomialFunction1D.differentiateTwice()

   * @param x1Keys
   * @return Values of second derivative with respect to x0 at (x0Key_i, x1Keys_j)
   */
  public DoubleMatrix2D differentiateX0Twice(final double[] x0Values, final double[] x1Values, final double[][] yValues, final double[] x0Keys, final double[] x1Keys) {
    final PiecewisePolynomialFunction1D func = new PiecewisePolynomialFunction1D();
    final double[][] interpX0Diff = OG_ALGEBRA.getTranspose(func.differentiateTwice(_method[0].interpolate(x0Values, OG_ALGEBRA.getTranspose(new DoubleMatrix2D(yValues)).getData()), x0Keys))
        .getData();
    return _method[1].interpolate(x1Values, interpX0Diff, x1Keys);
  }

  /**
 
View Full Code Here

Examples of com.opengamma.analytics.math.function.PiecewisePolynomialFunction1D.differentiateTwice()

   * @param x1Key
   * @return Value of second derivative with respect to x1 at (x0Key, x1Key)
   */
  public double differentiateX1Twice(final double[] x0Values, final double[] x1Values, final double[][] yValues, final double x0Key, final double x1Key) {
    final PiecewisePolynomialFunction1D func = new PiecewisePolynomialFunction1D();
    final double[] interpX1Diff = func.differentiateTwice(_method[1].interpolate(x1Values, yValues), x1Key).getData();
    return _method[0].interpolate(x0Values, interpX1Diff, x0Key);
  }

  /**
   * @param x0Values
View Full Code Here

Examples of com.opengamma.analytics.math.function.PiecewisePolynomialFunction1D.differentiateTwice()

      final double resVal = interp.differentiateX0(x0Values, x1Values, yValues, x0Keys[2], x1Values[1]);
      final double ref = Math.abs(val) < 0.1 * EPS ? 0.1 : Math.abs(val);
      assertEquals(resVal, val, EPS * ref);
    }
    {
      final double val = func.differentiateTwice(method.interpolate(x1Values, yValues[1]), x1Keys[2]).getData()[0];
      final double resVal = interp.differentiateX1Twice(x0Values, x1Values, yValues, x0Values[1], x1Keys[2]);
      final double ref = Math.abs(val) < 0.1 * EPS ? 0.1 : Math.abs(val);
      assertEquals(resVal, val, EPS * ref);
    }
    {
View Full Code Here

Examples of com.opengamma.analytics.math.function.PiecewisePolynomialFunction1D.differentiateTwice()

      final double resVal = interp.differentiateX1Twice(x0Values, x1Values, yValues, x0Values[1], x1Keys[2]);
      final double ref = Math.abs(val) < 0.1 * EPS ? 0.1 : Math.abs(val);
      assertEquals(resVal, val, EPS * ref);
    }
    {
      final double val = func.differentiateTwice(method.interpolate(x0Values, OG_ALGEBRA.getTranspose(new DoubleMatrix2D(yValues)).getData()[1]), x0Keys[2]).getData()[0];
      final double resVal = interp.differentiateX0Twice(x0Values, x1Values, yValues, x0Keys[2], x1Values[1]);
      final double ref = Math.abs(val) < 0.1 * EPS ? 0.1 : Math.abs(val);
      assertEquals(resVal, val, EPS * ref);
    }

View Full Code Here

Examples of com.opengamma.analytics.math.function.PiecewisePolynomialFunction1D.differentiateTwice()

    System.out.println("\n");

    for (int i = 0; i < 701; ++i) {
      final double key = 1. + 7. / (701 - 1) * i;
      System.out.println(key + "\t" + function.differentiateTwice(resultPos, key).getData()[0]);
    }
  }

  /**
   *
 
View Full Code Here

Examples of com.opengamma.analytics.math.function.PiecewisePolynomialFunction1D.differentiateTwice()

    System.out.println("\n");

    for (int i = 0; i < nKeys; ++i) {
      final double key = 8.0 + 0.001 / (nKeys - 1) * i;
      System.out.println(key + "\t" + function.differentiateTwice(resultQuin, key).getData()[0]);
    }
  }

  /**
   *
 
View Full Code Here

Examples of com.opengamma.analytics.math.function.PiecewisePolynomialFunction1D.differentiateTwice()

    }
    System.out.println("\n");

    for (int i = 0; i < nKeys; ++i) {
      final double key = 3. + 0.5 / (nKeys - 1) * i;
      System.out.println(key + "\t" + function.differentiateTwice(resultPos, key).getData()[0]);
    }
  }

  /**
   *
 
View Full Code Here

Examples of com.opengamma.analytics.math.function.PiecewisePolynomialFunction1D.differentiateTwice()

      System.out.println(key + "\t" + function.evaluate(result, key).getData()[0] + "\t" + function.evaluate(resultPos, key).getData()[0]);
    }

    for (int i = 0; i < nKeys; ++i) {
      final double key = 2. + 30. / (nKeys - 1) * i;
      System.out.println(key + "\t" + function.differentiateTwice(resultPos, key).getData()[0]);
    }
  }

  /**
   *
 
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.