Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

Optima.cpp

Go to the documentation of this file.
00001 //============================================================
00002 // COOOL           version 1.1           ---     Nov,  1995
00003 //   Center for Wave Phenomena, Colorado School of Mines
00004 //============================================================
00005 //
00006 //   This code is part of a preliminary release of COOOL (CWP
00007 // Object-Oriented Optimization Library) and associated class 
00008 // libraries. 
00009 //
00010 // The COOOL library is a free software. You can do anything you want
00011 // with it including make a fortune.  However, neither the authors,
00012 // the Center for Wave Phenomena, nor anyone else you can think of
00013 // makes any guarantees about anything in this package or any aspect
00014 // of its functionality.
00015 //
00016 // Since you've got the source code you can also modify the
00017 // library to suit your own purposes. We would appreciate it 
00018 // if the headers that identify the authors are kept in the 
00019 // source code.
00020 //
00021 //==================
00022 //define the base class for  optimization classes
00023 //      H. Lydia Deng, 03/14/94
00024 //======================
00025 
00026 #include "Optima.hh"
00027 #include <limits.h>
00028 
00029 static const char*  myNameIs =  "Abstract Optima";
00030 
00031 Optima::Optima(){ 
00032         residue         =       new List<double>; 
00033         isVerbose       =       0;
00034         isSuccess       =       0;
00035         fp              =       NULL;
00036         tol             =       0.;
00037         iterMax         =       1000;
00038 }
00039 
00040 Optima::Optima(int verbose){ 
00041         residue         =       new List<double>; 
00042         isVerbose       =       verbose;
00043         isSuccess       =       0;
00044         fp              =       NULL;
00045         tol             =       0.;
00046         iterMax         =       1000;
00047 }
00048 
00049 Optima::~Optima() { 
00050         delete residue;
00051         if (fp != NULL)  fp = NULL;
00052 }
00053                                                         //Output residues
00054 int Optima::ifSuccess()                 {return isSuccess;}
00055 double Optima::finalResidue()           {return residue->last();}
00056 double Optima::firstResidue()           {return residue->first();}
00057 List<double> Optima::allResidue()       {return *residue;}
00058 List<double> Optima::normResidue()      {return residue->normalize();}
00059 int Optima::numIterations()             {return fp->iterations();}
00060 const char* Optima::objName()           {return fp->className();}
00061 const char* Optima::optName()           {return myNameIs;}
00062 
00063 List<double> Optima::appendResidue(double res)
00064 {
00065    (*residue) += res;
00066    return residue[0];
00067 }      

Generated on Wed Dec 15 21:20:30 2004 for vuVolume by  doxygen 1.3.9.1