1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67
|
/* ObjCryst++ Object-Oriented Crystallographic Library
(c) 2000-2002 Vincent Favre-Nicolin vincefn@users.sourceforge.net
2000-2001 University of Geneva (Switzerland)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* Simplex.h
* header file for Simplex Algorithm object
*
*/
#ifndef _SIMPLEX_H
#define _SIMPLEX_H
#include "ObjCryst/RefinableObj/GlobalOptimObj.h"
namespace ObjCryst
{
/** Conjugate Gradient Algorithm object
*
* currently does not handle parameters hitting limits, and is not very efficient
* (uses numerical derivatives)
*/
class SimplexObj:public OptimizationObj
{
public:
/// Constructor
SimplexObj(const string name="Unnamed Simplex Object");
virtual void Optimize(long &nbSteps,const bool silent=false,const REAL finalcost=0,
const REAL maxTime=-1);
virtual void MultiRunOptimize(long &nbCycle,long &nbSteps,const bool silent=false,
const REAL finalcost=0,const REAL maxTime=-1);
virtual void XMLOutput(ostream &os,int indent=0)const;
virtual void XMLInput(istream &is,const XMLCrystTag &tag);
private:
/// Try a new configuration by expanding the worst vertex from the
/// center by a factor f. If it is better, store it as new worst.
/// Return the new obtained llk
REAL GenerateNewSimplexConfiguration(CrystVector_REAL &vLLK,
CrystVector_long &vIndex,
unsigned long worst,
REAL f);
#ifdef __WX__CRYST__
public:
// :TODO: This should not be required !
virtual WXCrystObjBasic* WXCreate(wxWindow*);
virtual WXOptimizationObj* WXGet();
virtual void WXDelete();
virtual void WXNotifyDelete();
#endif
};
}//namespace
#endif //_CONJUGATEGRADIENT_H
|