Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

SearchDegenerate Class Reference

#include <SearchDegenerate.h>

Inheritance diagram for SearchDegenerate:

Inheritance graph
[legend]
Collaboration diagram for SearchDegenerate:

Collaboration graph
[legend]
List of all members.

Detailed Description

SearchDegenerate is a wrapper for NewtonDegenerate to search for degenerate critical points.

Simply call the search() method to invoke Newton's method for finding roots. The roots will be stored in the fRoots list (found in Newton.h). You can also print out the found roots to stdout by calling the print() method.

Definition at line 22 of file SearchDegenerate.h.

Public Member Functions

 SearchDegenerate ()
 Default constructor.

 SearchDegenerate (Implicit *)
 Constructs an object containing critical points for a given Implicit.

virtual void setSurface (Implicit *)
 Changes the surface to search.

virtual ImplicitgetSurface ()
 Returns the current surface being searched.

void setBoxBounds (double)
 Sets the internal value of the bounds for a cubic box.

void setBoxBounds (Box3d)
 Sets the internal value of the bounds for a Box.

Box3d getBoxBounds ()
 Returns the current bounds for a Box for critical points.

void search ()
 Finds all of the critical points of the given surface.

void print ()
 Prints all critical points to stdout.


Protected Member Functions

virtual bool NewtonPostProcess (Box< double > &X)
 Overridden NewtonPostProcess method to try to prevent critical sets.


Protected Attributes

Implicitsurface
 Find critical points for this Implicit surface.


Private Attributes

Box3d theBoxBounds
int savedfMaxRoots
 If we change fMaxRoots, save the original value for restoration.

double savedfSameTolerance
 If we change fSameTolerance, save the original value for restoration.


Constructor & Destructor Documentation

SearchDegenerate::SearchDegenerate  ) 
 

Default constructor.

This method isn't very useful since it sets the surface to be NULL which means that there is no surface for which to find critical points. This is just here so that you can declare a SearchDegenerate value without having to initialize it at the same time.

Definition at line 19 of file SearchDegenerate.cpp.

References setSurface().

SearchDegenerate::SearchDegenerate Implicit surf  ) 
 

Constructs an object containing critical points for a given Implicit.

You MUST pass in an Implicit surface. This method assumes that you are going to use the standard 3D Newton solver when finding critical points.

Parameters:
surf The implicit surface to be used when finding critical points.

Definition at line 31 of file SearchDegenerate.cpp.

References CP_CUBE_BOUNDS, setSurface(), surf, and theBoxBounds.


Member Function Documentation

Box3d SearchDegenerate::getBoxBounds  ) 
 

Returns the current bounds for a Box for critical points.

Returns:
The critical point bounds for the current Implicit.

Definition at line 93 of file SearchDegenerate.cpp.

References theBoxBounds.

Referenced by search().

Implicit * SearchDegenerate::getSurface  )  [virtual]
 

Returns the current surface being searched.

This method is virtual and should be overridden (along with setSurface(Implicit*)) to keep the surface variable consistent.

Returns:
The Implicit surface being searched for critical points.
See also:
setSurface(Implicit*)

Reimplemented from NewtonDegenerate.

Definition at line 58 of file SearchDegenerate.cpp.

References surface.

Referenced by print(), and search().

bool SearchDegenerate::NewtonPostProcess Box< double > &  X  )  [protected, virtual]
 

Overridden NewtonPostProcess method to try to prevent critical sets.

This is pretty much a hack, but maybe it will help in the long run. We check to see if we have reached the maximum number of roots we want to store. If so, we first increase the size of the interval used for checking to see if two roots are the same, and then we double the number of allowable roots.

Parameters:
X The Box containing the root to process just before we call NewtonOutput().
Returns:
True if the root (Box) is okay and we should call NewtonOutput(). False if you want to throw the Box away.

Reimplemented from Newton.

Definition at line 110 of file SearchDegenerate.cpp.

References Newton::fMaxRoots, Newton::fRoots, Newton::fSameTolerance, Newton::SameRoot(), savedfMaxRoots, savedfSameTolerance, and X.

void SearchDegenerate::print  ) 
 

Prints all critical points to stdout.

The first line lists the name of the Implicit object, and subsequent lines list the coordinates of the degenerate critical points.

Definition at line 184 of file SearchDegenerate.cpp.

References Newton::fRoots, Surface::getObjectName(), getSurface(), Newton::plIter, and surf.

void SearchDegenerate::search  ) 
 

Finds all of the critical points of the given surface.

Use this method to do the actual work of finding the critical points of the Implicit surface that you passed in at construction time. The resulting critical points will be stored in the fRoots list (found in Newton.h). If you change the parameters of your Implicit surface, you will have to completely redo the finding process.

Definition at line 148 of file SearchDegenerate.cpp.

References Newton::FindZeros(), Newton::fMaxRoots, Newton::fNewtonTolerance, Newton::fSameTolerance, getBoxBounds(), getSurface(), Intervald, savedfMaxRoots, savedfSameTolerance, and surf.

void SearchDegenerate::setBoxBounds Box3d  bounds  ) 
 

Sets the internal value of the bounds for a Box.

You must pass in a positive value for this method to do anything.

Parameters:
bounds The new bounds for searching for critical points.

Definition at line 84 of file SearchDegenerate.cpp.

References theBoxBounds.

void SearchDegenerate::setBoxBounds double  bounds  ) 
 

Sets the internal value of the bounds for a cubic box.

You must pass in a positive value for this method to do anything. The value you pass in the the length of a side of the box. So if you want a box with mincorner = (-1,-1,-1) and maxcorner = (1,1,1), you should pass in bounds = 2.

Parameters:
bounds The length of a side of a cube to be used as the bounds for searching for critical points.

Definition at line 72 of file SearchDegenerate.cpp.

References theBoxBounds.

void SearchDegenerate::setSurface Implicit surf  )  [virtual]
 

Changes the surface to search.

This method is called by the constructors to set up the private surface variable. It is also virtual and should be overridden (along with getSurface()) to keep the surface variable consistent.

Parameters:
surf The new Implicit surface to search for critical points.
See also:
getSurface()

Reimplemented from NewtonDegenerate.

Definition at line 46 of file SearchDegenerate.cpp.

References surf, and surface.

Referenced by SearchDegenerate().


Member Data Documentation

int SearchDegenerate::savedfMaxRoots [private]
 

If we change fMaxRoots, save the original value for restoration.

Definition at line 27 of file SearchDegenerate.h.

Referenced by NewtonPostProcess(), and search().

double SearchDegenerate::savedfSameTolerance [private]
 

If we change fSameTolerance, save the original value for restoration.

Definition at line 29 of file SearchDegenerate.h.

Referenced by NewtonPostProcess(), and search().

Implicit* SearchDegenerate::surface [protected]
 

Find critical points for this Implicit surface.

Reimplemented from NewtonDegenerate.

Definition at line 32 of file SearchDegenerate.h.

Referenced by getSurface(), and setSurface().

Box3d SearchDegenerate::theBoxBounds [private]
 

Definition at line 25 of file SearchDegenerate.h.

Referenced by getBoxBounds(), SearchDegenerate(), and setBoxBounds().


The documentation for this class was generated from the following files:
Generated on Mon Jun 28 15:03:07 2004 for Advanced Surface Library by doxygen 1.3.4