public class BracketRoot1D extends java.lang.Object implements java.lang.Comparable<BracketRoot1D>
Modified by: Joseph A. Huwaldt
Modifier and Type | Field and Description |
---|---|
double |
x1
The lower bound of the bracket.
|
double |
x2
The upper bound of the bracket.
|
Constructor and Description |
---|
BracketRoot1D(double x1,
double x2)
Construct a bracket around a root in a 1D function.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(BracketRoot1D o)
Compares this object with the specified object for order.
|
static java.util.List<BracketRoot1D> |
findBrackets(Evaluatable1D func,
double x1,
double x2,
int n)
Given a function,
func , defined on the interval x1 to x2 ,
this routine subdivides the interval into n equally spaced segments,
and searches for zero crossings of the function. |
java.lang.String |
toString()
Return a String representation of this object.
|
public double x1
public double x2
public BracketRoot1D(double x1, double x2)
x1
- The lower bound of the bracket.x2
- The upper bound of the bracket.public static java.util.List<BracketRoot1D> findBrackets(Evaluatable1D func, double x1, double x2, int n) throws RootException
func
, defined on the interval x1
to x2
,
this routine subdivides the interval into n
equally spaced segments,
and searches for zero crossings of the function. Brackets around any zero crossings found
are returned.func
- The function that is being search for zero crossings.x1
- The start of the interval to be searched.x2
- The end of the interval to be searched.n
- The number segments to divide the interval into.RootException
- if the Evaluatable1D throws a exception.public int compareTo(BracketRoot1D o)
compareTo
in interface java.lang.Comparable<BracketRoot1D>
public java.lang.String toString()
toString
in class java.lang.Object