FOX/ObjCryst++  1.10.X (development)
Simplex.h
1 /* ObjCryst++ Object-Oriented Crystallographic Library
2  (c) 2000-2002 Vincent Favre-Nicolin vincefn@users.sourceforge.net
3  2000-2001 University of Geneva (Switzerland)
4 
5  This program is free software; you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation; either version 2 of the License, or
8  (at your option) any later version.
9 
10  This program is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License
16  along with this program; if not, write to the Free Software
17  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */
19 /* Simplex.h
20 * header file for Simplex Algorithm object
21 *
22 */
23 
24 #ifndef _SIMPLEX_H
25 #define _SIMPLEX_H
26 
27 #include "ObjCryst/RefinableObj/GlobalOptimObj.h"
28 
29 namespace ObjCryst
30 {
37 {
38  public:
40  SimplexObj(const string name="Unnamed Simplex Object");
41  virtual void Optimize(long &nbSteps,const bool silent=false,const REAL finalcost=0,
42  const REAL maxTime=-1);
43  virtual void MultiRunOptimize(long &nbCycle,long &nbSteps,const bool silent=false,
44  const REAL finalcost=0,const REAL maxTime=-1);
45  virtual void XMLOutput(ostream &os,int indent=0)const;
46  virtual void XMLInput(istream &is,const XMLCrystTag &tag);
47  private:
51  REAL GenerateNewSimplexConfiguration(CrystVector_REAL &vLLK,
52  CrystVector_long &vIndex,
53  unsigned long worst,
54  REAL f);
55  #ifdef __WX__CRYST__
56  public:
57  // :TODO: This should not be required !
58  virtual WXCrystObjBasic* WXCreate(wxWindow*);
59  virtual WXOptimizationObj* WXGet();
60  virtual void WXDelete();
61  virtual void WXNotifyDelete();
62  #endif
63 };
64 
65 }//namespace
66 
67 #endif //_CONJUGATEGRADIENT_H
Conjugate Gradient Algorithm object.
Definition: Simplex.h:36
virtual void MultiRunOptimize(long &nbCycle, long &nbSteps, const bool silent=false, const REAL finalcost=0, const REAL maxTime=-1)
Launch optimization for multiple runs of N steps.
Definition: Simplex.cpp:127
virtual void Optimize(long &nbSteps, const bool silent=false, const REAL finalcost=0, const REAL maxTime=-1)
Launch optimization (a single run) for N steps.
Definition: Simplex.cpp:32
Abstract base class for all objects in wxCryst.
Definition: wxCryst.h:127
virtual void XMLOutput(ostream &os, int indent=0) const
Output a description of the object in XML format to a stream.
Definition: Simplex.cpp:139
Base object for Optimization methods.
The namespace which includes all objects (crystallographic and algorithmic) in ObjCryst++.
Definition: Atom.cpp:47
WX Class for a Global Optimization objects.
SimplexObj(const string name="Unnamed Simplex Object")
Constructor.
Definition: Simplex.cpp:28
class to input or output a well-formatted xml beginning or ending tag.
virtual void XMLInput(istream &is, const XMLCrystTag &tag)
Input in XML format from a stream, restoring the set of refined objects and the associated cost funct...
Definition: Simplex.cpp:142
REAL GenerateNewSimplexConfiguration(CrystVector_REAL &vLLK, CrystVector_long &vIndex, unsigned long worst, REAL f)
Try a new configuration by expanding the worst vertex from the center by a factor f...
Definition: Simplex.cpp:145