- java.lang.Object
-
- spice.basic.GFSearchUtils
-
public class GFSearchUtils extends java.lang.Object
Class GFDefaultSearchUtils is the default GF search utility class that provides user-defined GF search step, convergence tolerance, refinement, progress reporting, and interrupt handling functions.Normally SPICE users wishing to customize GF search functionality should subclass this class, overriding any methods for which custom functionality is sought. Note that certain subsets of methods of this class work cooperatively, so all methods of such a subset must be overridden if any one of them is overridden. For example, all of the progress reporting methods must be overridden together if custom progress reporting is desired.
Note that the calling application must set the search step size via a call to
setSearchStep(double)
prior to starting a GF search that uses these utilities.Version 1.0.0 30-DEC-2009 (NJB)
-
-
Field Summary
Fields Modifier and Type Field Description private boolean
interruptEnabled
private boolean
reportingEnabled
private double
tolerance
-
Constructor Summary
Constructors Constructor Description GFSearchUtils()
No-arguments constructor.
-
Method Summary
Modifier and Type Method Description void
clearInterruptStatus()
Clear interrupt status.void
finalizeReport()
Finalize a GF progress report.double
getRefinement(double t1, double t2, boolean s2, boolean s1)
Get a refined root estimate.The inputs are, respectively, the endpoints of an interval that brackets a root, and the binary states corresponding to the those endpoints.double
getSearchStep(double et)
Return the search step size last set bysetSearchStep(double)
.double
getTolerance()
Get the convergence tolerance.void
initializeReport(SpiceWindow confine, java.lang.String begmsg, java.lang.String endmsg)
Initialize a GF progress report.boolean
interruptOccurred()
Indicate whether an interrupt occurred.boolean
isInterruptHandlingEnabled()
Determine whether interrupt handling is enabled.boolean
isReportingEnabled()
Determine whether progress reporting is enabled.void
setInterruptHandlingEnabled(boolean isEnabled)
Enable or disable interrupt handling.The boolean input argument should be set to `true' to enable interrupt handling and to `false' otherwise.void
setReportingEnabled(boolean isEnabled)
Enable or disable progress reporting.The boolean input argument should be set to `true' to enable progress reporting and to `false' otherwise.void
setSearchStep(double step)
Set the search step size.void
setTolerance(double tol)
Set the convergence tolerance.Units are TDB seconds.void
updateReport(double ivbeg, double ivend, double t)
Update a GF progress report.
-
-
-
Method Detail
-
setSearchStep
public void setSearchStep(double step) throws SpiceException
Set the search step size.- Parameters:
step
- double- Throws:
SpiceException
- exception
-
getSearchStep
public double getSearchStep(double et) throws SpiceException
Return the search step size last set bysetSearchStep(double)
.- Parameters:
et
- double- Returns:
- double
- Throws:
SpiceException
- exception
-
getRefinement
public double getRefinement(double t1, double t2, boolean s2, boolean s1) throws SpiceException
Get a refined root estimate.The inputs are, respectively, the endpoints of an interval that brackets a root, and the binary states corresponding to the those endpoints.- Parameters:
t1
- doubles1
- booleant2
- doubles2
- boolean- Returns:
- double
- Throws:
SpiceException
- exception
-
setReportingEnabled
public void setReportingEnabled(boolean isEnabled)
Enable or disable progress reporting.The boolean input argument should be set to `true' to enable progress reporting and to `false' otherwise.- Parameters:
isEnabled
- boolean
-
isReportingEnabled
public boolean isReportingEnabled()
Determine whether progress reporting is enabled.- Returns:
- boolean
-
setInterruptHandlingEnabled
public void setInterruptHandlingEnabled(boolean isEnabled)
Enable or disable interrupt handling.The boolean input argument should be set to `true' to enable interrupt handling and to `false' otherwise.- Parameters:
isEnabled
- boolean
-
isInterruptHandlingEnabled
public boolean isInterruptHandlingEnabled()
Determine whether interrupt handling is enabled.- Returns:
- boolean
-
interruptOccurred
public boolean interruptOccurred() throws SpiceException
Indicate whether an interrupt occurred.This is currently a no-op function which must be overridden by the user if GF interrupt detection is desired.
- Returns:
- boolean
- Throws:
SpiceException
- exception
-
clearInterruptStatus
public void clearInterruptStatus() throws SpiceException
Clear interrupt status.This is currently a no-op function which must be overridden by the user if GF interrupt detection is desired.
- Throws:
SpiceException
- exception
-
setTolerance
public void setTolerance(double tol)
Set the convergence tolerance.Units are TDB seconds.- Parameters:
tol
- double
-
getTolerance
public double getTolerance()
Get the convergence tolerance.- Returns:
- double
-
initializeReport
public void initializeReport(SpiceWindow confine, java.lang.String begmsg, java.lang.String endmsg) throws SpiceException
Initialize a GF progress report.- Parameters:
confine
- SpiceWindowendmsg
- Stringbegmsg
- String- Throws:
SpiceException
- exception
-
updateReport
public void updateReport(double ivbeg, double ivend, double t) throws SpiceException
Update a GF progress report.- Parameters:
ivbeg
- doublet
- doubleivend
- double- Throws:
SpiceException
- exception
-
finalizeReport
public void finalizeReport() throws SpiceException
Finalize a GF progress report.- Throws:
SpiceException
- exception
-
-