/*  HJSearch.h 
 *  header file for a Hooke and Jeeves search based 
 *                       on the class PatternSearch
 *  For a good description of the Hooke and Jeeves search algorithm
 *  I recommend Non-Linear Optimization Techniques by Box, Davies,
 *  and Swann, 1969. 
 *  Liz Dolan, The College of William and Mary, 1999
 *                                                                 
 *  The author of this software is Elizabeth  D. Dolan.                     
 *  Permission to use, copy, modify, and distribute this software  
 *  for any purpose without fee is hereby granted, provided that   
 *  this entire notice is included in all copies of any software   
 *  which is or includes a copy or modification of this software   
 *  and in all copies of the supporting documentation for such     
 *  software.  THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT    
 *  ANY EXPRESS OR IMPLIED WARRANTY.  IN PARTICULAR, THE AUTHOR    
 *  OFFERS NO REPRESENTATION OR WARRANTY OF ANY KIND                   
 *  CONCERNING THE MERCHANTABILITY OF THIS SOFTWARE OR ITS    
 *  FITNESS FOR ANY PARTICULAR PURPOSE.                            
 */                                                                 
   

#ifndef _HJSearch_
#define _HJSearch_

#include "PatternSearch.h"

class HJSearch: public PatternSearch
{

  public :
  HJSearch(int numberOfVariables); 
  HJSearch(const HJSearch & Original); 
  ~HJSearch();

  void CopySearch(const HJSearch & Original);
  //deep search copy
  void ExploratoryMoves();
  //searches in Hooke and Jeeves pattern for a better solution to the objective function
  bool Stop(double pace);
  //makes certain search has not exceeded maxCalls or 
  //is stepping at less than stoppingStepLength
   double GetStepLength();
  //overrides the PatternSearch version with an acurate length
   void CleanSlate(int dimensions);
  //reinitialize all values
private:
   double step;
   double factor;  //factor by which the step is reduced
};//class HJSearch


#endif










