Class Integrator

java.lang.Object
edu.cmu.tetrad.util.Integrator

public class Integrator extends Object
Integrates under a function from one endpoint to another.
Version:
$Id: $Id
Author:
josephramsey
  • Method Details

    • getArea

      public static double getArea(Function f, double x1, double x2, int numIntervals)
      Finds the area under function f between x1 and x2 using Simpson's rule. Divides the interval [x1, x2] into numIntervals subintervals.
      Parameters:
      f - a Function object.
      x1 - the lower cutoff
      x2 - the upper cutoff
      numIntervals - the number of intervals to divide the interval [x1, x2] into for integrating.
      Returns:
      the area.