/home/coin/SVN-release/OS-1.0.0/OS/src/OSSolverInterfaces/KnitroSolver.h

Go to the documentation of this file.
00001 
00016 #ifndef KNITROSOLVER_H 
00017 #define KNITROSOLVER_H
00018 
00019 #include "OSConfig.h" 
00020 
00021 #ifndef KNITRO_H__
00022 #include  "knitro.h"
00023 #endif
00024 #ifndef NLPPROBLEMDEF_H__
00025 #include  "nlpProblemDef.h"
00026 #endif
00027 
00028 #include "OSConfig.h" 
00029 #include "DefaultSolver.h"
00030 #include "OSrLWriter.h"
00031 #include "OSInstance.h"
00032 #include "OSParameters.h"
00033 #include "OSnLNode.h"
00034 #include "OSiLReader.h"
00035 #include "OSInstance.h"
00036 #include "OSExpressionTree.h"
00037 #include "OSnLNode.h"
00038 #include "OSDataStructures.h"
00039 #include "FileUtil.h"  
00040 #include "ErrorClass.h"
00041 
00042 # include <cstddef>
00043 # include <cstdlib>
00044 # include <cctype>
00045 # include <cassert>
00046 # include <stack>
00047 #include <string>
00048 # include <cppad/cppad.hpp>
00049 #include<iostream>
00050 
00051 
00052 
00053 
00054 #ifdef HAVE_CTIME
00055 # include <ctime>
00056 #else
00057 # ifdef HAVE_TIME_H
00058 #  include <time.h>
00059 # else
00060 #  error "don't have header file for time"
00061 # endif
00062 #endif
00063 
00064  
00065 #ifdef HAVE_CMATH
00066 # include <cmath>
00067 #else
00068 # ifdef HAVE_MATH_H
00069 #  include <math.h>
00070 # else
00071 #  error "don't have header file for math"
00072 # endif
00073 #endif
00074 
00075 
00076 
00077 #include<vector>
00078 #include <map>  
00079 
00080 
00093 class KnitroSolver : public DefaultSolver, public NlpProblemDef {  
00094         
00095 public:
00097         KnitroSolver();
00098 
00100         ~KnitroSolver();
00101         
00104         virtual void  solve() throw (ErrorClass) ;
00105         
00111         void dataEchoCheck(); 
00112         
00113         //Knitro specific methods
00114         //++ Declare virtual base class methods that are implemented here.
00115     //++ See NlpProblemDef.h for descriptions.
00116     int   getN (void);
00117     int   getM (void);
00118     void  getInitialX (double * const  daX);
00119     bool  loadProblemIntoKnitro (KTR_context_ptr  kc);
00120     bool  areDerivativesImplemented
00121               (const DerivativesImplementedType  nWhichDers);
00122 
00123     int  evalFC (const double * const  daX,
00124                        double * const  dObj,
00125                        double * const  daC,
00126                        void   *        userParams);
00127     int  evalGA (const double * const  daX,
00128                        double * const  daG,
00129                        double * const  daJ,
00130                        void   *        userParams);
00131     int  evalH (const double * const  daX,
00132                 const double * const  daLambda,
00133                       double * const  daH,
00134                       void   *        userParams);
00135     int  evalHV (const double * const  daX,
00136                  const double * const  daLambda,
00137                        double * const  daHV,
00138                        void   *        userParams);
00139 private:
00140 
00141         OSrLWriter  *osrlwriter;
00142 
00154         //  KnitroSolver();
00155         KnitroSolver(const KnitroSolver&);
00156         KnitroSolver& operator=(const KnitroSolver&);
00158         std::string knitroErrorMsg;
00159 
00160 };
00161 #endif

Generated on Thu May 15 22:15:05 2008 by  doxygen 1.4.7