globals.h
00001 #ifndef globals_h
00002 #define globals_h
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifdef HAVE_CONFIG_H
00013 #include "OPT++_config.h"
00014 #endif
00015
00016 #ifdef HAVE_STD
00017 #include <cstring>
00018 #else
00019 #include <string.h>
00020 #endif
00021
00022 #if defined(__cplusplus)
00023 #include<algorithm>
00024 inline double min(double a,double b) { return ((a) <= (b) ? (a) : (b)); }
00025 inline double max(double a,double b) { return ((a) >= (b) ? (a) : (b)); }
00026
00027 inline float min(float a,float b) { return ((a) <= (b) ? (a) : (b)); }
00028 inline float max(float a,float b) { return ((a) >= (b) ? (a) : (b)); }
00029
00030 inline int min(int a,int b) { return ((a) <= (b) ? (a) : (b)); }
00031 inline int max(int a,int b) { return ((a) >= (b) ? (a) : (b)); }
00032 #else
00033 #define min(a,b) ((a) <= (b) ? (a) : (b))
00034 #define max(a,b) ((a) >= (b) ? (a) : (b))
00035 #endif
00036
00037 #define WANT_MATH
00038
00039 #include "include.h"
00040 #include "newmatap.h"
00041
00042 namespace OPTPP {
00043
00044 #define GOOD 0
00045 #define BAD 1
00046
00047
00048
00049 typedef double real;
00050
00051 typedef enum {LineSearch, TrustRegion, TrustPDS }
00052 SearchStrategy;
00053
00054 typedef enum {Cauchy_Step, Dogleg_Step, Newton_Step, Backtrack_Step}
00055 Step_type;
00056
00057 typedef enum {Leqn, NLeqn, Lineq, NLineq, Bound} ConstraintType;
00058
00059 typedef enum {NLPNoOp = 0, NLPFunction = 1, NLPGradient = 2, NLPHessian = 4,
00060 NLPConstraint = 8, NLPCJacobian = 16} FcnMode;
00061
00062 typedef enum {ForwardDiff, BackwardDiff, CentralDiff }
00063 DerivOption;
00064
00065 typedef enum {NormFmu, ArgaezTapia, VanShanno}
00066 MeritFcn;
00067
00068 typedef enum {NoSpec, Spec1, Spec2} SpecOption;
00069
00070 typedef void (*UPDATEFCN)(int, int, NEWMAT::ColumnVector);
00071
00072 struct OPT_GLOBALS {
00073 static const float OPT_VERSION;
00074 static const int OPT_MINOR;
00075 };
00076
00077 }
00078
00079 #endif