All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.opengamma.strata.math.impl.rootfinding.SingleRootFinder Maven / Gradle / Ivy

There is a newer version: 2.12.46
Show newest version
/*
 * Copyright (C) 2009 - present by OpenGamma Inc. and the OpenGamma group of companies
 *
 * Please see distribution for license.
 */
package com.opengamma.strata.math.impl.rootfinding;

import java.util.function.Function;

/**
 * Interface for classes that attempt to find a root for a one-dimensional function
 * (see {@link Function}) $f(x)$ bounded by user-supplied values,
 * $x_1$ and $x_2$. If there is not a single root between these  bounds, an exception is thrown.
 * 
 * @param  The input type of the function
 * @param  The output type of the function
 */
public interface SingleRootFinder {

  /**
   * Finds the root.
   * 
   * @param function the function, not null
   * @param roots  the roots, not null
   * @return a root lying between x1 and x2
   */
  @SuppressWarnings("unchecked")
  public abstract S getRoot(Function function, S... roots);

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy