Package com.opengamma.analytics.math.differentiation

Examples of com.opengamma.analytics.math.differentiation.ScalarFieldFirstOrderDifferentiator.differentiate()


  @Override
  public DoubleMatrix1D minimize(final Function1D<DoubleMatrix1D, Double> function, final DoubleMatrix1D startPosition) {
    Validate.notNull(function, "function");
    Validate.notNull(startPosition, "start position");
    final ScalarFieldFirstOrderDifferentiator diff = new ScalarFieldFirstOrderDifferentiator();
    final Function1D<DoubleMatrix1D, DoubleMatrix1D> grad = diff.differentiate(function);
    return minimize(function, grad, startPosition);
  }

  /**
   * {@inheritDoc}
 
View Full Code Here


        return ird.accept(valueCalculator, curves);
      }
    };

    final ScalarFieldFirstOrderDifferentiator fd = new ScalarFieldFirstOrderDifferentiator();
    final Function1D<DoubleMatrix1D, DoubleMatrix1D> grad = fd.differentiate(f);

    return grad.evaluate(new DoubleMatrix1D(yields));

  }
View Full Code Here

        return ird.accept(valueCalculator, curves);
      }
    };

    final ScalarFieldFirstOrderDifferentiator fd = new ScalarFieldFirstOrderDifferentiator();
    final Function1D<DoubleMatrix1D, DoubleMatrix1D> grad = fd.differentiate(f);
    return grad.evaluate(new DoubleMatrix1D(param));
  }
}
View Full Code Here

        return ird.accept(valueCalculator, curves);
      }
    };

    final ScalarFieldFirstOrderDifferentiator fd = new ScalarFieldFirstOrderDifferentiator();
    final Function1D<DoubleMatrix1D, DoubleMatrix1D> grad = fd.differentiate(f);

    return grad.evaluate(new DoubleMatrix1D(yields));

  }
View Full Code Here

        return ird.accept(valueCalculator, curves);
      }
    };

    final ScalarFieldFirstOrderDifferentiator fd = new ScalarFieldFirstOrderDifferentiator();
    final Function1D<DoubleMatrix1D, DoubleMatrix1D> grad = fd.differentiate(f);
    return grad.evaluate(new DoubleMatrix1D(df));
  }

  protected InstrumentDerivative getSwap() {
    return SWAP;
View Full Code Here

    final Function1D<Double, Double> grad = diff.differentiate(func);
    assertEquals(-0.5, grad.evaluate(0.0), 1e-8);

    final Function1D<DoubleMatrix1D, Double> params_func = VECTOR_PARAMS.asFunctionOfParameters(1.0);
    final ScalarFieldFirstOrderDifferentiator vdiff = new ScalarFieldFirstOrderDifferentiator();
    final Function1D<DoubleMatrix1D, DoubleMatrix1D> vgrad = vdiff.differentiate(params_func);
    final DoubleMatrix1D res = vgrad.evaluate(new DoubleMatrix1D(new double[] {Math.PI, 0}));
    assertEquals(0.0, res.getEntry(0), 1e-8);
    assertEquals(Math.PI, res.getEntry(1), 1e-8);
  }
}
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.