| pktools 2.6.7 Processing Kernel for geospatial data

Static Public Member Functions | List of all members
OptFactory Class Reference

## Static Public Member Functions
static nlopt::opt | getOptimizer (const std::string &algorithmString, unsigned int npar)

## Detailed Description

Definition at line 25 of file OptFactory.h.

## Constructor & Destructor Documentation

## ◆ OptFactory()

OptFactory::OptFactory | ( |  | ) |
| inline

Definition at line 73 of file OptFactory.h.

73 {
74 };

## ◆ ~OptFactory()

OptFactory::~OptFactory | ( |  | ) |
| inline

Definition at line 75 of file OptFactory.h.

75{};

## Member Function Documentation

## ◆ getOptimizer()

static nlopt::opt OptFactory::getOptimizer | ( | const std::string & | algorithmString,
|  | unsigned int | npar
| ) |  |
| inline static

Definition at line 76 of file OptFactory.h.

76 {
77 std::map<std::string, nlopt::algorithm> m_algMap;
78 initMap(m_algMap);
79 switch(m_algMap[algorithmString]){
80 case(nlopt::GN_DIRECT):{
81 nlopt::opt theOptimizer(nlopt::GN_DIRECT,npar);
82 return(theOptimizer);
83 break;
84 }
85 case(nlopt::GN_DIRECT_L):{
86 nlopt::opt theOptimizer(nlopt::GN_DIRECT_L,npar);
87 return(theOptimizer);
88 break;
89 }
90 case(nlopt::GN_DIRECT_L_RAND):{
91 nlopt::opt theOptimizer(nlopt::GN_DIRECT_L_RAND,npar);
92 return(theOptimizer);
93 break;
94 }
95 case(nlopt::GN_DIRECT_NOSCAL):{
96 nlopt::opt theOptimizer(nlopt::GN_DIRECT_NOSCAL,npar);
97 return(theOptimizer);
98 break;
99 }
100 case(nlopt::GN_DIRECT_L_NOSCAL):{
101 nlopt::opt theOptimizer(nlopt::GN_DIRECT_L_NOSCAL,npar);
102 return(theOptimizer);
103 break;
104 }
105 case(nlopt::GN_DIRECT_L_RAND_NOSCAL):{
106 nlopt::opt theOptimizer(nlopt::GN_DIRECT_L_RAND_NOSCAL,npar);
107 return(theOptimizer);
108 break;
109 }
110 case(nlopt::GN_ORIG_DIRECT):{
111 nlopt::opt theOptimizer(nlopt::GN_ORIG_DIRECT,npar);
112 return(theOptimizer);
113 break;
114 }
115 case(nlopt::GN_ORIG_DIRECT_L):{
116 nlopt::opt theOptimizer(nlopt::GN_ORIG_DIRECT_L,npar);
117 return(theOptimizer);
118 break;
119 }
120 case(nlopt::LN_PRAXIS):{
121 nlopt::opt theOptimizer(nlopt::LN_PRAXIS,npar);
122 return(theOptimizer);
123 break;
124 }
125 case(nlopt::GN_CRS2_LM):{
126 nlopt::opt theOptimizer(nlopt::GN_CRS2_LM,npar);
127 return(theOptimizer);
128 break;
129 }
130 case(nlopt::GN_MLSL):{
131 nlopt::opt theOptimizer(nlopt::GN_MLSL,npar);
132 return(theOptimizer);
133 break;
134 }
135 case(nlopt::GN_MLSL_LDS):{
136 nlopt::opt theOptimizer(nlopt::GN_MLSL_LDS,npar);
137 return(theOptimizer);
138 break;
139 }
140 case(nlopt::LN_COBYLA):{
141 nlopt::opt theOptimizer(nlopt::LN_COBYLA,npar);
142 return(theOptimizer);
143 break;
144 }
145 case(nlopt::LN_NEWUOA):{
146 nlopt::opt theOptimizer(nlopt::LN_NEWUOA,npar);
147 return(theOptimizer);
148 break;
149 }
150 case(nlopt::LN_NEWUOA_BOUND):{
151 nlopt::opt theOptimizer(nlopt::LN_NEWUOA_BOUND,npar);
152 return(theOptimizer);
153 break;
154 }
155 case(nlopt::LN_NELDERMEAD):{
156 nlopt::opt theOptimizer(nlopt::LN_NELDERMEAD,npar);
157 return(theOptimizer);
158 break;
159 }
160 case(nlopt::LN_SBPLX):{
161 nlopt::opt theOptimizer(nlopt::LN_SBPLX,npar);
162 return(theOptimizer);
163 break;
164 }
165 case(nlopt::LN_AUGLAG):{
166 nlopt::opt theOptimizer(nlopt::LN_AUGLAG,npar);
167 return(theOptimizer);
168 break;
169 }
170 case(nlopt::LN_AUGLAG_EQ):{
171 nlopt::opt theOptimizer(nlopt::LN_AUGLAG_EQ,npar);
172 return(theOptimizer);
173 break;
174 }
175 case(nlopt::LN_BOBYQA):{
176 nlopt::opt theOptimizer(nlopt::LN_BOBYQA,npar);
177 return(theOptimizer);
178 break;
179 }
180 case(nlopt::GN_ISRES):{
181 nlopt::opt theOptimizer(nlopt::GN_ISRES,npar);
182 return(theOptimizer);
183 break;
184 }
185 case(nlopt::G_MLSL_LDS):
186 case(nlopt::AUGLAG):
187 case(nlopt::AUGLAG_EQ):
188 case(nlopt::G_MLSL):
189 case(nlopt::GD_MLSL):
190 case(nlopt::GD_MLSL_LDS):
191 case(nlopt::GD_STOGO):
192 case(nlopt::GD_STOGO_RAND):
193 case(nlopt::LD_LBFGS_NOCEDAL):
194 case(nlopt::LD_LBFGS):
195 case(nlopt::LD_VAR1):
196 case(nlopt::LD_VAR2):
197 case(nlopt::LD_TNEWTON):
198 case(nlopt::LD_TNEWTON_RESTART):
199 case(nlopt::LD_TNEWTON_PRECOND):
200 case(nlopt::LD_TNEWTON_PRECOND_RESTART):
201 case(nlopt::LD_MMA):
202 case(nlopt::LD_AUGLAG):
203 case(nlopt::LD_AUGLAG_EQ):
204 case(nlopt::LD_SLSQP):
205 default:{
206 std::string errorString="Error: derivative optimization algorithm ";
207 errorString+= algorithmString;
208 errorString+= " not supported, select derivative-free algorithm ([GL]N_*])";
209 throw(errorString);
210 break;
211 }
212 }
213 };

The documentation for this class was generated from the following file:

- /tmp/slackdce/slackrepo.NvCr9x/build_pktools/PKTOOLS-2.6.7.6/src/algorithms/OptFactory.h