Sophie

Sophie

distrib > Mandriva > 9.1 > ppc > media > contrib > by-pkgid > 263386785cefb9ae5d63b926d214d809 > files > 957

mpqc-2.1.2-4mdk.ppc.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><meta name="robots" content="noindex">
<meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>energy.h Source File</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body bgcolor="#ffffff">
<!-- Generated by Doxygen 1.2.5 on Mon Oct 14 14:16:36 2002 -->
<center>
<a class="qindex" href="index.html">Main Page</a> &nbsp; <a class="qindex" href="hierarchy.html">Class Hierarchy</a> &nbsp; <a class="qindex" href="annotated.html">Compound List</a> &nbsp; <a class="qindex" href="files.html">File List</a> &nbsp; <a class="qindex" href="functions.html">Compound Members</a> &nbsp; <a class="qindex" href="pages.html">Related Pages</a> &nbsp; </center>
<hr><h1>energy.h</h1><div class="fragment"><pre>00001 <font class="comment">//</font>
00002 <font class="comment">// energy.h</font>
00003 <font class="comment">//</font>
00004 <font class="comment">// Copyright (C) 1996 Limit Point Systems, Inc.</font>
00005 <font class="comment">//</font>
00006 <font class="comment">// Author: Curtis Janssen &lt;cljanss@limitpt.com&gt;</font>
00007 <font class="comment">// Maintainer: LPS</font>
00008 <font class="comment">//</font>
00009 <font class="comment">// This file is part of the SC Toolkit.</font>
00010 <font class="comment">//</font>
00011 <font class="comment">// The SC Toolkit is free software; you can redistribute it and/or modify</font>
00012 <font class="comment">// it under the terms of the GNU Library General Public License as published by</font>
00013 <font class="comment">// the Free Software Foundation; either version 2, or (at your option)</font>
00014 <font class="comment">// any later version.</font>
00015 <font class="comment">//</font>
00016 <font class="comment">// The SC Toolkit is distributed in the hope that it will be useful,</font>
00017 <font class="comment">// but WITHOUT ANY WARRANTY; without even the implied warranty of</font>
00018 <font class="comment">// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</font>
00019 <font class="comment">// GNU Library General Public License for more details.</font>
00020 <font class="comment">//</font>
00021 <font class="comment">// You should have received a copy of the GNU Library General Public License</font>
00022 <font class="comment">// along with the SC Toolkit; see the file COPYING.LIB.  If not, write to</font>
00023 <font class="comment">// the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.</font>
00024 <font class="comment">//</font>
00025 <font class="comment">// The U.S. Government is granted a limited license as per AL 91-7.</font>
00026 <font class="comment">//</font>
00027 
00028 <font class="preprocessor">#ifndef _chemistry_molecule_energy_h</font>
00029 <font class="preprocessor"></font><font class="preprocessor">#define _chemistry_molecule_energy_h</font>
00030 <font class="preprocessor"></font>
00031 <font class="preprocessor">#ifdef __GNUC__</font>
00032 <font class="preprocessor"></font><font class="preprocessor">#pragma interface</font>
00033 <font class="preprocessor"></font><font class="preprocessor">#endif</font>
00034 <font class="preprocessor"></font>
00035 <font class="preprocessor">#include &lt;iostream&gt;</font>
00036 
00037 <font class="preprocessor">#include &lt;math/optimize/function.h&gt;</font>
00038 <font class="preprocessor">#include &lt;math/optimize/conv.h&gt;</font>
00039 <font class="preprocessor">#include &lt;chemistry/molecule/molecule.h&gt;</font>
00040 <font class="preprocessor">#include &lt;chemistry/molecule/coor.h&gt;</font>
00041 <font class="preprocessor">#include &lt;chemistry/molecule/hess.h&gt;</font>
00042 
00043 <font class="keyword">namespace </font>sc {
00044 
<a name="l00048"></a><a class="code" href="class_sc__MolecularEnergy.html">00048</a> <font class="keyword">class </font>MolecularEnergy: <font class="keyword">public</font> Function {
00049   <font class="keyword">private</font>:
00050     RefSCDimension moldim_; <font class="comment">// the number of cartesian variables</font>
00051     Ref&lt;MolecularCoor&gt; mc_;
00052     Ref&lt;Molecule&gt; mol_;
00053     Ref&lt;MolecularHessian&gt; hess_;
00054     Ref&lt;MolecularHessian&gt; guesshess_;
00055 
00056     RefSCVector cartesian_gradient_;
00057     RefSymmSCMatrix cartesian_hessian_;
00058   <font class="keyword">protected</font>:
00059     Ref&lt;PointGroup&gt; initial_pg_;
00060 
00061     <font class="keywordtype">void</font> failure(<font class="keyword">const</font> <font class="keywordtype">char</font> *);
00062 
00064     <font class="keyword">virtual</font> <font class="keywordtype">void</font> <a class="code" href="class_sc__MolecularEnergy.html#b1">set_energy</a>(<font class="keywordtype">double</font>);
00065 
00068     <font class="keyword">virtual</font> <font class="keywordtype">void</font> <a class="code" href="class_sc__MolecularEnergy.html#b2">set_gradient</a>(RefSCVector&amp;);
00069     <font class="keyword">virtual</font> <font class="keywordtype">void</font> set_hessian(RefSymmSCMatrix&amp;);
00070 
00071     <font class="keywordtype">void</font> x_to_molecule();
00072     <font class="keywordtype">void</font> molecule_to_x();
00073 
00074     <font class="keywordtype">int</font> print_molecule_when_changed_;
00075   <font class="keyword">public</font>:
00076     <a class="code" href="class_sc__MolecularEnergy.html#a1">MolecularEnergy</a>(<font class="keyword">const</font> MolecularEnergy&amp;);
00101     <a class="code" href="class_sc__MolecularEnergy.html#a1">MolecularEnergy</a>(<font class="keyword">const</font> Ref&lt;KeyVal&gt;&amp;);
00102     <a class="code" href="class_sc__MolecularEnergy.html#a1">MolecularEnergy</a>(StateIn&amp;);
00103     ~MolecularEnergy();
00104 
00105     <font class="keywordtype">void</font> <a class="code" href="class_sc__MolecularEnergy.html#a4">save_data_state</a>(StateOut&amp;);
00106 
00107     MolecularEnergy &amp; operator=(<font class="keyword">const</font> MolecularEnergy&amp;);
00108     
00110     <font class="keyword">virtual</font> <font class="keywordtype">double</font> <a class="code" href="class_sc__MolecularEnergy.html#a6">energy</a>();
00111 
00112     <font class="keyword">virtual</font> Ref&lt;Molecule&gt; molecule() <font class="keyword">const</font>;
00113     <font class="keyword">virtual</font> RefSCDimension moldim() <font class="keyword">const</font>;
00114     
00115     <font class="keywordtype">void</font> <a class="code" href="class_sc__MolecularEnergy.html#a9">guess_hessian</a>(RefSymmSCMatrix&amp;);
00116     RefSymmSCMatrix inverse_hessian(RefSymmSCMatrix&amp;);
00117 
00120     RefSymmSCMatrix <a class="code" href="class_sc__MolecularEnergy.html#a11">hessian</a>();
00121     <font class="keywordtype">int</font> hessian_implemented() <font class="keyword">const</font>;
00122 
00123     <font class="keywordtype">void</font> <a class="code" href="class_sc__MolecularEnergy.html#a13">set_x</a>(<font class="keyword">const</font> RefSCVector&amp;);
00124 
00126     RefSCVector <a class="code" href="class_sc__MolecularEnergy.html#a14">get_cartesian_x</a>();
00128     RefSCVector <a class="code" href="class_sc__MolecularEnergy.html#a15">get_cartesian_gradient</a>();
00130     RefSymmSCMatrix <a class="code" href="class_sc__MolecularEnergy.html#a16">get_cartesian_hessian</a>();
00131 
00132     Ref&lt;MolecularCoor&gt; molecularcoor()<font class="keyword"> </font>{ <font class="keywordflow">return</font> mc_; }
00133 
00136     <font class="keyword">virtual</font> <font class="keywordtype">void</font> <a class="code" href="class_sc__MolecularEnergy.html#a18">symmetry_changed</a>();
00137 
00138     Ref&lt;NonlinearTransform&gt; <a class="code" href="class_sc__MolecularEnergy.html#a19">change_coordinates</a>();
00139     
00141     <font class="keywordtype">void</font> <a class="code" href="class_sc__MolecularEnergy.html#a20">print_natom_3</a>(<font class="keyword">const</font> RefSCVector &amp;,
00142                        <font class="keyword">const</font> <font class="keywordtype">char</font> *t=0, std::ostream&amp;o=ExEnv::out0()) <font class="keyword">const</font>;
00143     <font class="keywordtype">void</font> <a class="code" href="class_sc__MolecularEnergy.html#a20">print_natom_3</a>(<font class="keywordtype">double</font> **, <font class="keyword">const</font> <font class="keywordtype">char</font> *t=0, std::ostream&amp;o=ExEnv::out0()) <font class="keyword">const</font>;
00144     <font class="keywordtype">void</font> <a class="code" href="class_sc__MolecularEnergy.html#a20">print_natom_3</a>(<font class="keywordtype">double</font> *, <font class="keyword">const</font> <font class="keywordtype">char</font> *t=0, std::ostream&amp;o=ExEnv::out0()) <font class="keyword">const</font>;
00145 
00146     <font class="keyword">virtual</font> <font class="keywordtype">void</font> <a class="code" href="class_sc__MolecularEnergy.html#a23">print</a>(std::ostream&amp; = ExEnv::out0()) <font class="keyword">const</font>;
00147 };
00148 
00149 
00150 <font class="keyword">class </font>SumMolecularEnergy: <font class="keyword">public</font> MolecularEnergy {
00151   <font class="keyword">protected</font>:
00152     <font class="keywordtype">int</font> n_;
00153     Ref&lt;MolecularEnergy&gt; *mole_;
00154     <font class="keywordtype">double</font> *coef_;
00155     <font class="keywordtype">void</font> compute();
00156   <font class="keyword">public</font>:
00157     SumMolecularEnergy(<font class="keyword">const</font> Ref&lt;KeyVal&gt; &amp;);
00158     SumMolecularEnergy(StateIn&amp;);
00159     ~SumMolecularEnergy();
00160 
00161     <font class="keywordtype">void</font> save_data_state(StateOut&amp;);
00162 
00163     <font class="keywordtype">int</font> value_implemented() <font class="keyword">const</font>;
00164     <font class="keywordtype">int</font> gradient_implemented() <font class="keyword">const</font>;
00165     <font class="keywordtype">int</font> hessian_implemented() <font class="keyword">const</font>;
00166 
00167     <font class="keywordtype">void</font> set_x(<font class="keyword">const</font> RefSCVector&amp;);
00168 };
00169 
00170 
00171 <font class="comment">/* The MolEnergyConvergence class derives from the Convergence class.  The</font>
00172 <font class="comment">MolEnergyConvergence class allows the user to request that cartesian</font>
00173 <font class="comment">coordinates be used in evaluating the convergence criteria.  This is</font>
00174 <font class="comment">useful, since the internal coordinates can be somewhat arbitary.  If the</font>
00175 <font class="comment">optimization is constrained, then the fixed internal coordinates will be</font>
00176 <font class="comment">projected out of the cartesian gradients.  The input is similar to that for</font>
00177 <font class="comment">Convergence class with the exception that giving none of the convergence</font>
00178 <font class="comment">criteria keywords is the same as providing the following input to the</font>
00179 <font class="comment">KeyVal constructor:</font>
00180 <font class="comment"></font>
00181 <font class="comment">&lt;pre&gt;</font>
00182 <font class="comment">  conv&lt;MolEnergyConvergence&gt;: (</font>
00183 <font class="comment">    max_disp = 1.0e-4</font>
00184 <font class="comment">    max_grad = 1.0e-4</font>
00185 <font class="comment">    graddisp = 1.0e-4</font>
00186 <font class="comment">  )</font>
00187 <font class="comment">&lt;/pre&gt;</font>
00188 <font class="comment"></font>
00189 <font class="comment">For MolEnergyConverence to work, the Function object given to the Optimizer</font>
00190 <font class="comment">object must derive from MolecularEnergy.</font>
00191 <font class="comment">*/</font>
00192 <font class="keyword">class </font>MolEnergyConvergence: <font class="keyword">public</font> Convergence {
00193   <font class="keyword">protected</font>:
00194     Ref&lt;MolecularEnergy&gt; mole_;
00195     <font class="keywordtype">int</font> cartesian_;
00196 
00197     <font class="keywordtype">void</font> set_defaults();
00198   <font class="keyword">public</font>:
00199     <font class="comment">// Standard constructors and destructor.</font>
00200     MolEnergyConvergence();
00201     MolEnergyConvergence(StateIn&amp;);
00219     MolEnergyConvergence(<font class="keyword">const</font> Ref&lt;KeyVal&gt;&amp;);
00220     <font class="keyword">virtual</font> ~MolEnergyConvergence();
00221 
00222     <font class="keywordtype">void</font> save_data_state(StateOut&amp;);
00223 
00224     <font class="comment">// Set the current gradient and position information.  These</font>
00225     <font class="comment">//will possibly grab the cartesian infomation if we have a</font>
00226     <font class="comment">//MolecularEnergy.</font>
00227     <font class="keywordtype">void</font> get_grad(<font class="keyword">const</font> Ref&lt;Function&gt; &amp;);
00228     <font class="keywordtype">void</font> get_x(<font class="keyword">const</font> Ref&lt;Function&gt; &amp;);
00229     <font class="keywordtype">void</font> set_nextx(<font class="keyword">const</font> RefSCVector &amp;);
00230 
00231     <font class="comment">// Return nonzero if the optimization has converged.</font>
00232     <font class="keywordtype">int</font> converged();
00233 };
00234 
00235 }
00236 
00237 <font class="preprocessor">#endif</font>
00238 <font class="preprocessor"></font>
00239 <font class="comment">// Local Variables:</font>
00240 <font class="comment">// mode: c++</font>
00241 <font class="comment">// c-file-style: "CLJ"</font>
00242 <font class="comment">// End:</font>
</div></pre><hr>
<address>
<small>

Generated at Mon Oct 14 14:16:36 2002 for <a
href="http://aros.ca.sandia.gov/~cljanss/mpqc">MPQC</a>
2.1.2 using the documentation package <a
href="http://www.stack.nl/~dimitri/doxygen/index.html">Doxygen</a>
1.2.5.

</small>
</address>
</body>
</html>