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

update.h

00001 //
00002 // update.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_update_h
00029 #define _math_optimize_update_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 #include <math/optimize/transform.h>
00040 
00041 // //////////////////////////////////////////////////////////////////////
00042 //  hessian update classes.  based on the value of inverse_hessian_
00043 //  x and g may be reversed (see Schlegel, ab initio Methods in Quantum
00044 //  Chemistry I, 1987, p 10
00045 
00046 
00052 class HessianUpdate: virtual public SavableState {
00053   protected:
00054     int inverse_hessian_;
00055   public:
00056     HessianUpdate();
00057     HessianUpdate(StateIn&);
00058     HessianUpdate(const Ref<KeyVal>&);
00059     void save_data_state(StateOut&);
00060     virtual ~HessianUpdate();
00061     virtual void update(const RefSymmSCMatrix&hessian,const Ref<Function>&,
00062                         const RefSCVector&xnew,const RefSCVector&gnew) = 0;
00063     virtual void set_inverse();
00064     virtual void apply_transform(const Ref<NonlinearTransform>&);
00065 };
00066 
00067 
00070 class DFPUpdate: public HessianUpdate {
00071   protected:
00072     RefSCVector xprev;
00073     RefSCVector gprev;
00074   public:
00075     DFPUpdate();
00076     DFPUpdate(StateIn&);
00090     DFPUpdate(const Ref<KeyVal>&);
00091     void save_data_state(StateOut&);
00092     ~DFPUpdate();
00093     void update(const RefSymmSCMatrix&ihessian,const Ref<Function>&,
00094                 const RefSCVector&xnew,const RefSCVector&gnew);
00095     void apply_transform(const Ref<NonlinearTransform>&);
00096     void set_inverse();
00097 };
00098 
00102 class BFGSUpdate: public DFPUpdate {
00103   public:
00104     BFGSUpdate();
00105     BFGSUpdate(StateIn&);
00106     BFGSUpdate(const Ref<KeyVal>&);
00107     void save_data_state(StateOut&);
00108     ~BFGSUpdate();
00109     void update(const RefSymmSCMatrix&ihessian,const Ref<Function>&,
00110                 const RefSCVector&xnew,const RefSCVector&gnew);
00111 };
00112 
00117 class PowellUpdate: public HessianUpdate {
00118   protected:
00119     RefSCVector xprev;
00120     RefSCVector gprev;
00121   public:
00122     PowellUpdate();
00123     PowellUpdate(StateIn&);
00124     PowellUpdate(const Ref<KeyVal>&);
00125     void save_data_state(StateOut&);
00126     ~PowellUpdate();
00127     void update(const RefSymmSCMatrix&ihessian,const Ref<Function>&func,
00128                 const RefSCVector&xnew,const RefSCVector&gnew);
00129     void apply_transform(const Ref<NonlinearTransform>&);
00130 };
00131 
00132 #endif
00133 
00134 // Local Variables:
00135 // mode: c++
00136 // c-file-style: "CLJ"
00137 // End:

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