TOLS.h

00001 #ifndef tols_h
00002 #define tols_h
00003 
00004 
00005 /*----------------------------------------------------------------------
00006  Copyright (c) 2001, Sandia Corporation.   Under the terms of Contract 
00007  DE-AC04-94AL85000, there is a non-exclusive license for use of this 
00008  work by or on behalf of the U.S. Government.
00009  
00010  J.C. Meza, Sandia National Laboratories, meza@ca.sandia.gov
00011  ----------------------------------------------------------------------*/
00012 
00013 #include <iostream>
00014 #include <fstream>
00015 
00016 using std::ostream;
00017 
00018 namespace OPTPP {
00019 
00029 class TOLS{
00030   double  mcheps;         
00031   double  max_step;       
00032   double  min_step;       
00033   double  step_tol;       
00034   double  fcn_tol;        
00035   double  con_tol;        
00036   double  grad_tol;       
00037   double  linesearch_tol; 
00038   double  tr_size;        
00039   int     max_iter;       
00040   int     max_backiter;   
00041   int     max_feval;      
00042 
00043 public:
00045   TOLS() {}                     
00047   TOLS(TOLS& t) {*this = t;}    
00049   virtual ~TOLS() {}            
00050 
00052   void operator= (TOLS& t) {
00053     mcheps         = t.mcheps;
00054     max_step       = t.max_step;
00055     min_step       = t.min_step;
00056     step_tol       = t.step_tol;
00057     fcn_tol        = t.fcn_tol;
00058     con_tol        = t.con_tol ;
00059     grad_tol       = t.grad_tol;
00060     linesearch_tol = t.linesearch_tol;
00061     max_iter       = t.max_iter;
00062     max_backiter   = t.max_backiter;
00063     max_feval      = t.max_feval;
00064   }
00066   void    setDefaultTol();      
00068   void    setMaxStep(double x); 
00070   void    setMinStep(double x); 
00072   void    setStepTol(double x); 
00074   void    setFTol(double x);    
00076   void    setCTol(double x);    
00078   void    setGTol(double x);    
00080   void    setLSTol(double x);   
00082   void    setTRSize(double x);  
00084   void    setMaxIter(int k);    
00086   void    setMaxBacktrackIter(int k);   
00088   void    setMaxFeval(int k);   
00089 
00093   double  getMaxStep()  const {return max_step;}
00094 
00098   double  getMinStep()  const {return min_step;}
00099 
00103   double  getStepTol()  const {return step_tol;}
00104 
00108   double  getFTol()     const {return fcn_tol;}
00109 
00113   double  getCTol()     const {return con_tol;}
00114 
00118   double  getGTol()     const {return grad_tol;}
00119 
00123   double  getLSTol()    const {return linesearch_tol;}
00124 
00128   double  getTRSize()   const {return tr_size;}
00129 
00133   int     getMaxIter()  const {return max_iter;}
00134 
00138   int     getMaxBacktrackIter()  const {return max_backiter;}
00139 
00143   int     getMaxFeval() const {return max_feval;}
00144 
00155   void printTol();
00156 
00160   void printTol(ostream *);
00161 };
00162 
00163 } // namespace OPTPP
00164 
00165 #endif
Generated on Mon Jan 24 12:04:37 2011 for FASTlib by  doxygen 1.6.3