JNISpice
version 2.0.0

spice.basic
Class GFSearchUtils

java.lang.Object
  extended by 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)


Constructor Summary
GFSearchUtils()
          No-arguments constructor.
 
Method Summary
 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.
 double getSearchStep(double et)
          Return the search step size last set by setSearchStep(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.
 void setReportingEnabled(boolean isEnabled)
          Enable or disable progress reporting.
 void setSearchStep(double step)
          Set the search step size.
 void setTolerance(double tol)
          Set the convergence tolerance.
 void updateReport(double ivbeg, double ivend, double t)
          Update a GF progress report.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GFSearchUtils

public GFSearchUtils()
No-arguments constructor.

Method Detail

setSearchStep

public void setSearchStep(double step)
                   throws SpiceException
Set the search step size.

Throws:
SpiceException

getSearchStep

public double getSearchStep(double et)
                     throws SpiceException
Return the search step size last set by setSearchStep(double).

Throws:
SpiceException

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.

Throws:
SpiceException

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.


isReportingEnabled

public boolean isReportingEnabled()
Determine whether progress reporting is enabled.


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.


isInterruptHandlingEnabled

public boolean isInterruptHandlingEnabled()
Determine whether interrupt handling is enabled.


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.

Throws:
SpiceException

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

setTolerance

public void setTolerance(double tol)
Set the convergence tolerance. Units are TDB seconds.


getTolerance

public double getTolerance()
Get the convergence tolerance.


initializeReport

public void initializeReport(SpiceWindow confine,
                             java.lang.String begmsg,
                             java.lang.String endmsg)
                      throws SpiceException
Initialize a GF progress report.

Throws:
SpiceException

updateReport

public void updateReport(double ivbeg,
                         double ivend,
                         double t)
                  throws SpiceException
Update a GF progress report.

Throws:
SpiceException

finalizeReport

public void finalizeReport()
                    throws SpiceException
Finalize a GF progress report.

Throws:
SpiceException

JNISpice
version 2.0.0

JNISpice Alpha Test Version 2.0.0 28-JAN-2017 (NJB)