<!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>scextrap.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:38 2002 --> <center> <a class="qindex" href="index.html">Main Page</a> <a class="qindex" href="hierarchy.html">Class Hierarchy</a> <a class="qindex" href="annotated.html">Compound List</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="functions.html">Compound Members</a> <a class="qindex" href="pages.html">Related Pages</a> </center> <hr><h1>scextrap.h</h1><div class="fragment"><pre>00001 <font class="comment">//</font> 00002 <font class="comment">// scextrap.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 <cljanss@limitpt.com></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 _math_optimize_scextrap_h</font> 00029 <font class="preprocessor"></font><font class="preprocessor">#define _math_optimize_scextrap_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 <util/class/class.h></font> 00036 <font class="preprocessor">#include <util/state/state.h></font> 00037 <font class="preprocessor">#include <util/keyval/keyval.h></font> 00038 00039 <font class="keyword">namespace </font>sc { 00040 <a name="l00043"></a><a class="code" href="class_sc__SCExtrapData.html">00043</a> <font class="keyword">class </font>SCExtrapData: <font class="keyword">public</font> SavableState { 00044 <font class="keyword">public</font>: 00046 <a class="code" href="class_sc__SCExtrapData.html#a0">SCExtrapData</a>(); 00048 <a class="code" href="class_sc__SCExtrapData.html#a0">SCExtrapData</a>(StateIn&); 00049 <font class="keyword">virtual</font> ~SCExtrapData(); 00050 00051 <font class="keywordtype">void</font> <a class="code" href="class_sc__SCExtrapData.html#a3">save_data_state</a>(StateOut&); 00052 00054 <font class="keyword">virtual</font> SCExtrapData* <a class="code" href="class_sc__SCExtrapData.html#a4">copy</a>() = 0; 00056 <font class="keyword">virtual</font> <font class="keywordtype">void</font> <a class="code" href="class_sc__SCExtrapData.html#a5">zero</a>() = 0; 00059 <font class="keyword">virtual</font> <font class="keywordtype">void</font> <a class="code" href="class_sc__SCExtrapData.html#a6">accumulate_scaled</a>(<font class="keywordtype">double</font> scale, <font class="keyword">const</font> Ref<SCExtrapData>&) = 0; 00060 }; 00061 00062 <a name="l00065"></a><a class="code" href="class_sc__SCExtrapError.html">00065</a> <font class="keyword">class </font>SCExtrapError: <font class="keyword">public</font> SavableState { 00066 <font class="keyword">public</font>: 00068 <a class="code" href="class_sc__SCExtrapError.html#a0">SCExtrapError</a>(); 00070 <a class="code" href="class_sc__SCExtrapError.html#a0">SCExtrapError</a>(StateIn&); 00071 <font class="keyword">virtual</font> ~SCExtrapError(); 00072 00073 <font class="keywordtype">void</font> <a class="code" href="class_sc__SCExtrapError.html#a3">save_data_state</a>(StateOut&); 00074 00076 <font class="keyword">virtual</font> <font class="keywordtype">double</font> <a class="code" href="class_sc__SCExtrapError.html#a4">error</a>() = 0; 00078 <font class="keyword">virtual</font> <font class="keywordtype">double</font> <a class="code" href="class_sc__SCExtrapError.html#a5">scalar_product</a>(<font class="keyword">const</font> Ref<SCExtrapError>&) = 0; 00079 }; 00080 00081 <a name="l00087"></a><a class="code" href="class_sc__SelfConsistentExtrapolation.html">00087</a> <font class="keyword">class </font>SelfConsistentExtrapolation: <font class="keyword">public</font> SavableState { 00088 <font class="keyword">private</font>: 00089 <font class="keywordtype">double</font> error_; 00090 <font class="keywordtype">int</font> errorset_; 00091 <font class="keywordtype">double</font> tolerance_; 00092 <font class="keyword">protected</font>: 00093 <font class="keywordtype">void</font> set_error(<font class="keywordtype">double</font> e)<font class="keyword"> </font>{ error_ = e; errorset_ = 1; } 00094 <font class="keyword">public</font>: 00095 <a class="code" href="class_sc__SelfConsistentExtrapolation.html#a2">SelfConsistentExtrapolation</a>(); 00096 <a class="code" href="class_sc__SelfConsistentExtrapolation.html#a2">SelfConsistentExtrapolation</a>(StateIn&); 00100 <a class="code" href="class_sc__SelfConsistentExtrapolation.html#a2">SelfConsistentExtrapolation</a>(<font class="keyword">const</font> Ref<KeyVal>&); 00101 ~SelfConsistentExtrapolation(); 00102 00103 <font class="keywordtype">void</font> <a class="code" href="class_sc__SelfConsistentExtrapolation.html#a4">save_data_state</a>(StateOut&); 00104 00105 <font class="keywordtype">void</font> set_tolerance(<font class="keywordtype">double</font> t)<font class="keyword"> </font>{ tolerance_ = t; } 00106 <font class="keywordtype">double</font> tolerance()<font class="keyword"> </font>{ <font class="keywordflow">return</font> tolerance_; } 00107 <font class="keywordtype">double</font> error()<font class="keyword"> </font>{ <font class="keywordflow">return</font> error_; } 00108 00109 <font class="keywordtype">int</font> converged()<font class="keyword"> </font>{ <font class="keywordflow">return</font> errorset_? error_ <= tolerance_ : 0; } 00110 00111 <font class="comment">// Makes a copy of data and returns the extrapolation in</font> 00112 <font class="comment">// data. A reference to error is saved so a copy must</font> 00113 <font class="comment">// be given to extrapolate if error could be changed.</font> 00114 <font class="keyword">virtual</font> <font class="keywordtype">int</font> extrapolate(<font class="keyword">const</font> Ref<SCExtrapData>& data, 00115 <font class="keyword">const</font> Ref<SCExtrapError>& error) = 0; 00116 00117 <font class="comment">// Extrapolation should be started when this is called,</font> 00118 <font class="comment">// if it hasn't already started. The default starting</font> 00119 <font class="comment">// point is implemenation dependent. This member might</font> 00120 <font class="comment">// do nothing in some implementations.</font> 00121 <font class="keyword">virtual</font> <font class="keywordtype">void</font> start_extrapolation(); 00122 00123 <font class="keyword">virtual</font> <font class="keywordtype">void</font> reinitialize() =0; 00124 }; 00125 00126 } 00127 00128 <font class="preprocessor">#endif</font> 00129 <font class="preprocessor"></font> 00130 <font class="comment">// Local Variables:</font> 00131 <font class="comment">// mode: c++</font> 00132 <font class="comment">// c-file-style: "CLJ"</font> 00133 <font class="comment">// End:</font> </div></pre><hr> <address> <small> Generated at Mon Oct 14 14:16:38 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>