Main Page   Class Hierarchy   Compound List   File List   Compound Members   Related Pages  

conv.h

00001 //
00002 // conv.h
00003 //
00004 // Copyright (C) 1996 Limit Point Systems, Inc.
00005 //
00006 // Author: Curtis Janssen <cljanss@limitpt.com>
00007 // Maintainer: LPS
00008 //
00009 // This file is part of the SC Toolkit.
00010 //
00011 // The SC Toolkit is free software; you can redistribute it and/or modify
00012 // it under the terms of the GNU Library General Public License as published by
00013 // the Free Software Foundation; either version 2, or (at your option)
00014 // any later version.
00015 //
00016 // The SC Toolkit is distributed in the hope that it will be useful,
00017 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00018 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00019 // GNU Library General Public License for more details.
00020 //
00021 // You should have received a copy of the GNU Library General Public License
00022 // along with the SC Toolkit; see the file COPYING.LIB.  If not, write to
00023 // the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
00024 //
00025 // The U.S. Government is granted a limited license as per AL 91-7.
00026 //
00027 
00028 #ifndef _math_optimize_conv_h
00029 #define _math_optimize_conv_h
00030 
00031 #ifdef __GNUC__
00032 #pragma interface
00033 #endif
00034 
00035 #include <util/state/state.h>
00036 #include <util/class/class.h>
00037 #include <math/scmat/matrix.h>
00038 #include <math/optimize/function.h>
00039 
00040 // //////////////////////////////////////////////////////////////////////
00041 
00054 class Convergence: virtual public SavableState {
00055   protected:
00056     RefSCVector grad_;
00057     RefSCVector x_;
00058     RefSCVector nextx_;
00059     int use_max_disp_;
00060     double max_disp_;
00061     int use_max_grad_;
00062     double max_grad_;
00063     int use_rms_disp_;
00064     double rms_disp_;
00065     int use_rms_grad_;
00066     double rms_grad_;
00067     int use_graddisp_;
00068     double graddisp_;
00069 
00070     void check_conv(const char *heading,
00071                     double val, double bound,
00072                     int &pass, int &fail);
00073 
00074     void set_defaults();
00075   public:
00076     Convergence();
00077     Convergence(double tolerance);
00078     Convergence(StateIn&);
00079 
00116     Convergence(const Ref<KeyVal>&);
00117     virtual ~Convergence();
00118 
00119     void save_data_state(StateOut&);
00120 
00122     virtual void get_grad(const Ref<Function> &);
00123     virtual void get_x(const Ref<Function> &);
00124     virtual void set_nextx(const RefSCVector &);
00125 
00127     virtual void reset();
00128 
00130     virtual int converged();
00131 };
00132 
00133 
00134 #endif
00135 
00136 // Local Variables:
00137 // mode: c++
00138 // c-file-style: "CLJ"
00139 // End:

Generated at Thu Oct 4 18:08:42 2001 for MPQC 2.0.0 using the documentation package Doxygen 1.2.5.