|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sourceforge.webcompmath.functions.ZeroFinder
public class ZeroFinder
Description for ZeroFinder
ZeroFinder computes one zero of the continuous function func,
provided that the two starting values x1 and x2 satisfy:
func( x1 ) * func( x2 ) <= 0 .
Field Summary | |
---|---|
protected double |
ABSERROR
Default value of absolute error bound |
protected double |
funcERR
-1: no inclusion given 0: with abs( f( x )) <= Double.Min_Value 1: ABS( xnew-xold ) < ABSERROR + xnew * RELERROR 2: iterationlimit ITERMAX reached 3: improper function 4: NaN encountered at: x3; |
protected Function |
function
The function, for which zeros are to be found ( should be continous!) |
protected double |
fX1in
Interval ( left ) point |
protected double |
fX2in
Interval ( right ) point |
protected int |
iter
Iterations used |
protected int |
ITERMAX
Default value of maximun number of iterations |
protected double |
RELERROR
Default value of relative error bound |
protected java.lang.String |
resultOfIteration
Description of kind of soulution |
protected double |
solution
Place of a zero ( within precision ) |
protected boolean |
solved
Solution with given precision found or not |
protected static double |
ZERO
Description of the Field |
Constructor Summary | |
---|---|
ZeroFinder()
Default constructor for the ZeroFinder object |
|
ZeroFinder(Function inFunction)
The object with standard precision parameters |
Method Summary | |
---|---|
double |
getAbsError()
Gets the AbsError attribute of the ZeroFinder object |
double |
getFX1in()
Gets the FX1in attribute of the ZeroFinder object |
double |
getFX2in()
Gets the FX2in attribute of the ZeroFinder object |
int |
getIter()
Gets the Iter attribute of the ZeroFinder object |
int |
getIterMax()
Gets the IterMax attribute of the ZeroFinder object |
double |
getRelError()
Gets the RelError attribute of the ZeroFinder object |
java.lang.String |
getResultOfIteration()
Gets the ResultOfIteration attribute of the ZeroFinder object |
double |
getSolution()
Gets the Solution attribute of the ZeroFinder object |
boolean |
isSolved()
Gets the Solved attribute of the ZeroFinder object |
static void |
main(java.lang.String[] arg)
To test ZeroFinder |
void |
setAbsError(double newAbsError)
Sets the AbsError attribute of the ZeroFinder object |
void |
setFunction(Function newFunction)
Sets the Function attribute of the ZeroFinder object |
void |
setIterMax(int maxiter)
Sets the IterMax attribute of the ZeroFinder object |
void |
setRelError(double newRelError)
Sets the RelError attribute of the ZeroFinder object |
void |
Solve(double x1in,
double x2in)
The 'Regula Falsi' extended ZeroFinder zero-finder: |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected Function function
protected boolean solved
protected double solution
protected double fX1in
protected double fX2in
protected int ITERMAX
protected double ABSERROR
protected double RELERROR
protected java.lang.String resultOfIteration
protected double funcERR
-1: no inclusion given 0: with abs( f( x )) <= Double.Min_Value 1: ABS( xnew-xold ) < ABSERROR + xnew * RELERROR 2: iterationlimit ITERMAX reached 3: improper function 4: NaN encountered at: x3;
protected int iter
protected static double ZERO
Constructor Detail |
---|
public ZeroFinder()
public ZeroFinder(Function inFunction)
ITERMAX = 20;
ABSERROR = 1.0E-6D;
RELERROR = 1.0E-6D;
funcERR = Double.MIN_VALUE;
inFunction
- a Function Object e.g. from TaylorInputMethod Detail |
---|
public void setRelError(double newRelError)
newRelError
- The new RelError valuepublic void setAbsError(double newAbsError)
newAbsError
- The new AbsError valuepublic void setIterMax(int maxiter)
maxiter
- The new IterMax valuepublic void setFunction(Function newFunction)
newFunction
- The new Function valuepublic double getSolution()
public boolean isSolved()
public double getRelError()
public double getFX1in()
public double getFX2in()
public double getAbsError()
public int getIter()
public int getIterMax()
public java.lang.String getResultOfIteration()
public void Solve(double x1in, double x2in)
x1in
- left point of intervalx2in
- right point of intervalpublic static void main(java.lang.String[] arg)
arg
- (
not used )
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |