MPQC  2.3.1
update.h
1 //
2 // update.h
3 //
4 // Copyright (C) 1996 Limit Point Systems, Inc.
5 //
6 // Author: Curtis Janssen <cljanss@limitpt.com>
7 // Maintainer: LPS
8 //
9 // This file is part of the SC Toolkit.
10 //
11 // The SC Toolkit is free software; you can redistribute it and/or modify
12 // it under the terms of the GNU Library General Public License as published by
13 // the Free Software Foundation; either version 2, or (at your option)
14 // any later version.
15 //
16 // The SC Toolkit is distributed in the hope that it will be useful,
17 // but WITHOUT ANY WARRANTY; without even the implied warranty of
18 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 // GNU Library General Public License for more details.
20 //
21 // You should have received a copy of the GNU Library General Public License
22 // along with the SC Toolkit; see the file COPYING.LIB. If not, write to
23 // the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
24 //
25 // The U.S. Government is granted a limited license as per AL 91-7.
26 //
27 
28 #ifndef _math_optimize_update_h
29 #define _math_optimize_update_h
30 
31 #ifdef __GNUC__
32 #pragma interface
33 #endif
34 
35 #include <util/state/state.h>
36 #include <util/class/class.h>
37 #include <math/scmat/matrix.h>
38 #include <math/optimize/function.h>
39 #include <math/optimize/transform.h>
40 
41 namespace sc {
42 
43 // //////////////////////////////////////////////////////////////////////
44 // hessian update classes. based on the value of inverse_hessian_
45 // x and g may be reversed (see Schlegel, ab initio Methods in Quantum
46 // Chemistry I, 1987, p 10
47 
48 
54 class HessianUpdate: virtual public SavableState {
55  protected:
56  int inverse_hessian_;
57  public:
58  HessianUpdate();
60  HessianUpdate(const Ref<KeyVal>&);
62  virtual ~HessianUpdate();
63  virtual void update(const RefSymmSCMatrix&hessian,const Ref<Function>&,
64  const RefSCVector&xnew,const RefSCVector&gnew) = 0;
65  virtual void set_inverse();
66  virtual void apply_transform(const Ref<NonlinearTransform>&);
67 };
68 
69 
72 class DFPUpdate: public HessianUpdate {
73  protected:
74  RefSCVector xprev;
75  RefSCVector gprev;
76  public:
77  DFPUpdate();
92  DFPUpdate(const Ref<KeyVal>&);
94  ~DFPUpdate();
95  void update(const RefSymmSCMatrix&ihessian,const Ref<Function>&,
96  const RefSCVector&xnew,const RefSCVector&gnew);
97  void apply_transform(const Ref<NonlinearTransform>&);
98  void set_inverse();
99 };
100 
104 class BFGSUpdate: public DFPUpdate {
105  public:
106  BFGSUpdate();
108  BFGSUpdate(const Ref<KeyVal>&);
109  void save_data_state(StateOut&);
110  ~BFGSUpdate();
111  void update(const RefSymmSCMatrix&ihessian,const Ref<Function>&,
112  const RefSCVector&xnew,const RefSCVector&gnew);
113 };
114 
120  protected:
121  RefSCVector xprev;
122  RefSCVector gprev;
123  public:
124  PowellUpdate();
126  PowellUpdate(const Ref<KeyVal>&);
127  void save_data_state(StateOut&);
128  ~PowellUpdate();
129  void update(const RefSymmSCMatrix&ihessian,const Ref<Function>&func,
130  const RefSCVector&xnew,const RefSCVector&gnew);
131  void apply_transform(const Ref<NonlinearTransform>&);
132 };
133 
134 }
135 
136 #endif
137 
138 // Local Variables:
139 // mode: c++
140 // c-file-style: "CLJ"
141 // End:
sc::BFGSUpdate
The DFPUpdate class is used to specify a Broyden, Fletcher, Goldfarb, and Shanno hessian update schem...
Definition: update.h:104
sc::RefSymmSCMatrix
The RefSymmSCMatrix class is a smart pointer to an SCSymmSCMatrix specialization.
Definition: matrix.h:261
sc::BFGSUpdate::save_data_state
void save_data_state(StateOut &)
Save the base classes (with save_data_state) and the members in the same order that the StateIn CTOR ...
sc::Ref
A template class that maintains references counts.
Definition: ref.h:332
sc::HessianUpdate
The HessianUpdate abstract class is used to specify a hessian update scheme.
Definition: update.h:54
sc::PowellUpdate
The PowellUpdate class is used to specify a Powell hessian update.
Definition: update.h:119
sc::DFPUpdate::save_data_state
void save_data_state(StateOut &)
Save the base classes (with save_data_state) and the members in the same order that the StateIn CTOR ...
sc::StateIn
Restores objects that derive from SavableState.
Definition: statein.h:70
sc::HessianUpdate::save_data_state
void save_data_state(StateOut &)
Save the base classes (with save_data_state) and the members in the same order that the StateIn CTOR ...
sc::DFPUpdate
The DFPUpdate class is used to specify a Davidson, Fletcher, and Powell hessian update scheme.
Definition: update.h:72
sc::RefSCVector
The RefSCVector class is a smart pointer to an SCVector specialization.
Definition: matrix.h:55
sc::StateOut
Serializes objects that derive from SavableState.
Definition: stateout.h:61
sc::SavableState
Base class for objects that can save/restore state.
Definition: state.h:46
sc::PowellUpdate::save_data_state
void save_data_state(StateOut &)
Save the base classes (with save_data_state) and the members in the same order that the StateIn CTOR ...

Generated at Sun Jan 26 2020 23:33:05 for MPQC 2.3.1 using the documentation package Doxygen 1.8.16.