PaGMO  1.1.5
worhp_param_serialization.h
1 /*****************************************************************************
2  * Copyright (C) 2015 The PaGMO development team, *
3  * Advanced Concepts Team (ACT), European Space Agency (ESA) *
4  * http://apps.sourceforge.net/mediawiki/pagmo *
5  * http://apps.sourceforge.net/mediawiki/pagmo/index.php?title=Developers *
6  * http://apps.sourceforge.net/mediawiki/pagmo/index.php?title=Credits *
7  * act@esa.int *
8  * *
9  * This program is free software; you can redistribute it and/or modify *
10  * it under the terms of the GNU General Public License as published by *
11  * the Free Software Foundation; either version 2 of the License, or *
12  * (at your option) any later version. *
13  * *
14  * This program is distributed in the hope that it will be useful, *
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
17  * GNU General Public License for more details. *
18  * *
19  * You should have received a copy of the GNU General Public License *
20  * along with this program; if not, write to the *
21  * Free Software Foundation, Inc., *
22  * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
23  *****************************************************************************/
24 
25 #ifndef PAGMO_ALGORITHM_WORHP_SERIALIZATION_H
26 #define PAGMO_ALGORITHM_WORHP_SERIALIZATION_H
27 
28 #include <worhp/worhp.h>
29 
30 // This is from WORHP 1.8.0
31 
32 template <class Archive>
33 void serialize(Archive &ar, QPParamsStruct &cb, const unsigned int)
34 {
35  ar & cb.ipBarrier;
36  ar & cb.ipComTol;
37  ar & cb.ipFracBound;
38  ar & cb.ipMinAlpha;
39  ar & cb.ipRelaxDiv;
40  ar & cb.ipRelaxMax;
41  ar & cb.ipRelaxMin;
42  ar & cb.ipRelaxMult;
43  ar & cb.ipResTol;
44  ar & cb.lsTol;
45  ar & cb.nsnBeta;
46  ar & cb.nsnKKT;
47  ar & cb.nsnMinAlpha;
48  ar & cb.nsnSigma;
49 
50  ar & cb.ipLsMethod;
51  ar & cb.lsItMaxIter;
52  ar & cb.lsItMethod;
53  ar & cb.lsItPrecondMethod;
54  ar & cb.lsRefineMaxIter;
55  ar & cb.maxIter;
56  ar & cb.method;
57  ar & cb.nsnLsMethod;
58  ar & cb.printLevel;
59 
60  ar & cb.ipTryRelax;
61  ar & cb.lsScale;
62  ar & cb.lsTrySimple;
63  ar & cb.nsnGradStep;
64  ar & cb.scaleIntern;
65  ar & cb.strict;
66 }
67 
68 template <class Archive>
69 void serialize(Archive &ar, ParamsStruct &cb, const unsigned int)
70 {
71 /* Pointer to QP parameter structure */
72  ar & cb.qp;
73 
74  /* Debug marker. Used to find memory alignment/padding issues */
75  ar & cb.DebugMarker05;
76 
77  /*------------------------------------------------
78  * Real parameters
79  *------------------------------------------------ */
80 
81  /* Tolerance for acceptable feasibility */
82  ar & cb.AcceptTolFeas;
83 
84  /* Tolerance for acceptable optimality */
85  ar & cb.AcceptTolOpti;
86 
87  /* Trial stepsize decrease factor for Armijo rule */
88  ar & cb.ArmijoBeta;
89 
90  /* Initial alpha for Armijo rule */
91  ar & cb.ArmijoMaxAlpha;
92 
93  /* Lower bound on alpha for Armijo rule */
94  ar & cb.ArmijoMinAlpha;
95 
96  /* Lower bound on alpha for Armijo rule during recovery */
97  ar & cb.ArmijoMinAlphaRec;
98 
99  /* Scale factor for linearised descent check in Armijo rule */
100  ar & cb.ArmijoSigma;
101 
102  /* Update factor for Betts' Hessian regularisation */
103  ar & cb.BettsFactor;
104 
105  /* Smallest eigenvalue of the regularised Hessian */
106  ar & cb.BettsPoint;
107 
108  /* Factor in determining active constraints by KKT */
109  ar & cb.BoundTolFac;
110 
111  /* (experimental) */
112  ar & cb.CorStepBettsSum;
113 
114  /* (experimental) */
115  ar & cb.CorStepConvio;
116 
117  /* (experimental) */
118  ar & cb.CorStepConStop;
119 
120  /* (experimental) */
121  ar & cb.CorStepPFactor;
122 
123  /* (experimental) */
124  ar & cb.CorStepPMax;
125 
126  /* Upper bound used by Fritz-John heuristic */
127  ar & cb.CheckFJ;
128 
129  /* Block BFGS curvature condition bound */
130  ar & cb.CurvBCond;
131 
132  /* Block BFGS curvature condition regularisation factor */
133  ar & cb.CurvBFac;
134 
135  /* BFGS Curvature condition bound */
136  ar & cb.CurvCond;
137 
138  /* BFGS curvature condition regularisation factor */
139  ar & cb.CurvFac;
140 
141  /* Feasibility tolerance for no-objective feasible mode */
142  ar & cb.FeasibleInitTol;
143 
144  /* Finite difference perturbation */
145  ar & cb.FidifEps;
146 
147  /* Factor in Focus-on-Feasibility mode */
148  ar & cb.FocusOnFeasFactor;
149 
150  /* Upper bound for numbers to be regarded as finite */
151  ar & cb.Infty;
152 
153  /* Tolerance for unboundedness detection heuristic */
154  ar & cb.InftyUnbounded;
155 
156  /* IP complementarity tolerance in initial multiplier estimate */
157  ar & cb.LMestQPipComTol;
158 
159  /* IP residual tolerance in initial multiplier estimate */
160  ar & cb.LMestQPipResTol;
161 
162  /* Lowpass-filter update factor for objective values */
163  ar & cb.LowPassAlphaF;
164 
165  /* Lowpass-filter update factor for constraint values */
166  ar & cb.LowPassAlphaG;
167 
168  /* Lowpass-filter update factor for merit function values */
169  ar & cb.LowPassAlphaMerit;
170 
171  /* Any pivot whose modulus is less than this is treated as zero by MA97 */
172  ar & cb.MA97small;
173 
174  /* Relative pivot tolerance of MA97 */
175  ar & cb.MA97u;
176 
177  /* Threshold of meritfunction gradient for increasing Hessian regularisation */
178  ar & cb.MeritGradTol;
179 
180  /* Penalty update parameter factor for MeritFunction = 4 */
181  ar & cb.PenUpdEpsKFac;
182 
183  /* Penalty update parameter factor for MeritFunction = 3 */
184  ar & cb.PenUpdEpsBar;
185 
186  /* Max penalty for MeritFunction = 4 */
187  ar & cb.PenUpdMaxDeltaK;
188 
189  /* Max factor for increasing penalty for MeritFunction = 4 */
190  ar & cb.PenUpdMaxFac;
191 
192  /* Penalty update parameter for MeritFunction = 3 */
193  ar & cb.PenUpdRBar;
194 
195  /* (currently unused) Relative precision of objective */
196  ar & cb.PrecisionF;
197 
198  /* (currently unused) Relative precision of constraints */
199  ar & cb.PrecisionG;
200 
201  /* (currently unused) Scaling factor for QP */
202  ar & cb.QPscaleParam;
203 
204  /* Upper bound for accepting the constraint relaxation variable */
205  ar & cb.RelaxMaxDelta;
206 
207  /* Upper bound on the constraint relaxation penalty */
208  ar & cb.RelaxMaxPen;
209 
210  /* Update factor for the constraint relaxation penalty */
211  ar & cb.RelaxRho;
212 
213  /* Initial value of the constraint relaxation penalty */
214  ar & cb.RelaxStart;
215 
216  /* Value to scale large objective functions to */
217  ar & cb.ScaleFacObj;
218 
219  /* Upper bound on resulting matrix norm for QP scaling */
220  ar & cb.ScaleFacQP;
221 
222  /* Initial value for Betts' update dampening term */
223  ar & cb.StartBettsTau;
224 
225  /* Timeout in seconds */
226  ar & cb.Timeout;
227 
228  /* Complementarity tolerance */
229  ar & cb.TolComp;
230 
231  /* Feasibility tolerance */
232  ar & cb.TolFeas;
233 
234  /* Optimality tolerance */
235  ar & cb.TolOpti;
236 
237  /* (experimental) */
238  ar & cb.TolWeakActive;
239 
240  /* Upper bound on constraint violation for too-big heuristic */
241  ar & cb.TooBigCV;
242 
243  /* Upper bound on KKT values for too-big heuristic */
244  ar & cb.TooBigKKT;
245 
246  /* Machine epsilon */
247  ar & cb.eps;
248 
249  /* Increase factor for estimated integer workspace requirement */
250  ar & cb.IncreaseIWS;
251 
252  /* Increase factor for estimated real workspace requirement */
253  ar & cb.IncreaseRWS;
254 
255  /* Constraint violation decrease factor in Filter acceptance check */
256  ar & cb.FilterGammaCV;
257 
258  /* Objective decrease factor in Filter acceptance check */
259  ar & cb.FilterGammaF;
260 
261  /* Safety factor for alphamin calculation by Filter */
262  ar & cb.GammaAlpha;
263 
264  /* Increase factor for Betts' update dampening term */
265  ar & cb.IncBettsTau;
266 
267  /* Larger increase factor for Betts' update dampening term */
268  ar & cb.IncBettsTauMore;
269 
270  /* Lower bound for Betts' update dampening term */
271  ar & cb.MinBettsTau;
272 
273  /* Decrease factor for Betts' update dampening term */
274  ar & cb.ReduceBettsTau;
275 
276  /* Start tolerance for successful termination of iterative refinement due to perturbation in constraints */
277  ar & cb.RefineStartTol;
278 
279  /* Maximum allowed relaxation to apply feasibility refinement */
280  ar & cb.RefineMaxRelax;
281 
282  /* Maximum allowed regularisation of the hessian CAUTION absolute value */
283  ar & cb.RefineMaxHMReg;
284 
285  /* Filter switching condition parameter */
286  ar & cb.SwitchingDelta;
287 
288  /* Filter switching condition parameter */
289  ar & cb.SwitchingSF;
290 
291  /* Filter switching condition parameter */
292  ar & cb.SwitchingSCV;
293 
294  /*------------------------------------------------
295  * Integer parameters
296  *------------------------------------------------ */
297 
298  /* Armijo recovery strategies */
299  ar & cb.Ares[NAres];
300 
301  /* Choose BFGS method (0: dense, 1-3: block, 100+: sparse) */
302  ar & cb.BFGSmethod;
303 
304  /* Restart BFGS update after this many iterations */
305  ar & cb.BFGSrestart;
306 
307  /* Block size parameter used by certain BFGS methods */
308  ar & cb.BFGSmaxblockSize;
309 
310  /* Block size parameter used by certain BFGS methods */
311  ar & cb.BFGSminblockSize;
312 
313  /* (experimental) */
314  ar & cb.CorStepMaxIter;
315 
316  /* (experimental) */
317  ar & cb.CorStepMethod;
318 
319  /* (experimental) */
320  ar & cb.CorStepMode;
321 
322  /* Select method to determine graph colouring groups */
323  ar & cb.GroupMethod;
324 
325  /* Enable XML logfiles and writing interval */
326  ar & cb.LogLevel;
327 
328  /* Enable XML result logging and detail level */
329  ar & cb.LogResult;
330 
331  /* Ordering used by MA97 */
332  ar & cb.MA97ordering;
333 
334  /* Scaling used by MA97 */
335  ar & cb.MA97scaling;
336 
337  /* Print level used by MA97 */
338  ar & cb.MA97print;
339 
340  /* Node amalgation, controls merging in elimination tree by MA97 */
341  ar & cb.MA97nemin;
342 
343  /* Upper bound to Reverse Communication calls */
344  ar & cb.MaxCalls;
345 
346  /* Maximum number of Force recovery strategy steps */
347  ar & cb.MaxForce;
348 
349  /* (experimental) */
350  ar & cb.MaxGPart;
351 
352  /* Upper bound on major iterations */
353  ar & cb.MaxIter;
354 
355  /* Select merit function and penalty update [0, 3..5] */
356  ar & cb.MeritFunction;
357 
358  /* Select (1) Meritfunction or (3) Filter globalisation */
359  ar & cb.NLPmethod;
360 
361  /* NLP print level [-1..4] */
362  ar & cb.NLPprint;
363 
364  /* Select method to determine graph colouring pairgroups */
365  ar & cb.PairMethod;
366 
367  /* Penalty update parameter */
368  ar & cb.PenUpdEpsKSequence;
369 
370  /* 0 - Deactivated, 1 - After first feasible iterate, 2 - Always on, Activates iterative refinement due to perturbation in constraints using parametric sensitivities */
371  ar & cb.RefineFeasibility;
372 
373  /* Enable automatic Hessian structure generation or checking */
374  ar & cb.UserHMstructure;
375 
376  /* Control activation of Filter acceleration heuristics */
377  ar & cb.MaxLScounter;
378 
379  /* Select Hessian regularisation strategy in Filter */
380  ar & cb.RegStrategy;
381 
382  /*------------------------------------------------
383  * Logical parameters
384  *------------------------------------------------ */
385 
386  /* Enable automatic QP recovery */
387  ar & cb.AutoQPRecovery;
388 
389  /* Enable structural checking of DF */
390  ar & cb.CheckStructureDF;
391 
392  /* Enable structural checking of DG */
393  ar & cb.CheckStructureDG;
394 
395  /* Enable structural checking of HM */
396  ar & cb.CheckStructureHM;
397 
398  /* (experimental) */
399  ar & cb.CorStepRecoveryDX;
400 
401  /* F and G cannot be evaluated separately */
402  ar & cb.FGtogether;
403 
404  /* Enable Fritz-John and non-differentiable check heuristics */
405  ar & cb.FJandND;
406 
407  /* Activate dual feasibility mode */
408  ar & cb.FeasibleDual;
409 
410  /* Activate initial feasibility mode */
411  ar & cb.FeasibleInit;
412 
413  /* Activate feasible-only mode */
414  ar & cb.FeasibleOnly;
415 
416  /* Approximate Hessian by finite differences (otherwise BFGS) */
417  ar & cb.FidifHM;
418 
419  /* Use central finite difference quotient for first derivatives */
420  ar & cb.FirstDifCentral;
421 
422  /* Enable Focus-on-Feasibility mode */
423  ar & cb.FocusOnFeas;
424 
425  /* Enable initial Lagrange multiplier estimate */
426  ar & cb.InitialLMest;
427 
428  /* Counter for changed parameters. Internal use only. */
429  ar & cb.internalParChanged;
430 
431  /* Save acceptable solutions as fallback */
432  ar & cb.KeepAcceptableSol;
433 
434  /* Control Lagrange multiplier update */
435  ar & cb.LinMult;
436 
437  /* Enable lowpass-filter termination criterion */
438  ar & cb.LowPassFilter;
439 
440  /* Use BLAS level 3 (dgemm) in MA97 */
441  ar & cb.MA97blas3;
442 
443  /* Use multifrontal-style forward solve of MA97 */
444  ar & cb.MA97mf;
445 
446  /* Not to be included into a parameter file! */
447  ar & cb.MatrixCC;
448 
449  /* Introduce one relaxation variable for every constraint */
450  ar & cb.MoreRelax;
451 
452  /* Not to be included into a parameter file! */
453  ar & cb.QuadraticProblem;
454 
455  /* Use Steffensen Extrapolation during Feasibility Refinement */
456  ar & cb.SteffensenOnRefine;
457 
458  /* Activates new iterative refinement of constraints only when Armijo alpha equals one */
459  ar & cb.RefineOnlyOnAlpha;
460 
461  /* Do restoration until a feasible solution is found */
462  ar & cb.RestUntilFeas;
463 
464  /* Scale constraints in every iteration */
465  ar & cb.ScaleConIter;
466 
467  /* Use a scaled perturbation for finite differences */
468  ar & cb.ScaledFD;
469 
470  /* Scale KKT conditions */
471  ar & cb.ScaledKKT;
472 
473  /* Scale the objective function */
474  ar & cb.ScaledObj;
475 
476  /* Scale some matrices handed to the QP */
477  ar & cb.ScaledQP;
478 
479  /* Evaluate QP search direction regardless of convergence */
480  ar & cb.TakeQPSol;
481 
482  /* Enable too-big termination heuristics */
483  ar & cb.TooBig;
484 
485  /* Activates update of lagrange multipliers during correction step */
486  ar & cb.UpdateMu;
487 
488  /* Objective gradient values supplied by caller */
489  ar & cb.UserDF;
490 
491  /* Jacobian values supplied by caller */
492  ar & cb.UserDG;
493 
494  /* Hessian values supplied by caller */
495  ar & cb.UserHM;
496 
497  /* Hessian values supplied by caller */
498  ar & cb.UserZenDGp;
499 
500  /* Hessian values supplied by caller */
501  ar & cb.UserZenDLxp;
502 
503  /* Gradient values supplied by caller */
504  ar & cb.UserZenDLp;
505 
506  /* Hessian values supplied by caller */
507  ar & cb.UserZenDLpp;
508 
509  /* Run Zen module after successful termination */
510  ar & cb.UseZen;
511 
512  /* Check maximum of secure perturbation when updating solution */
513  ar & cb.ZenCheckMaxPert;
514 
515  /* false: use LU from last QP step; true: renew LU decomposition. */
516  ar & cb.ZenRenewLU;
517  ar & cb.ZenFDnewMethod;
518 
519  /* (experimental) */
520  ar & cb.WeakActiveSet;
521 
522  /* Use a constant lower bound on Armijo stepsize in Filter */
523  ar & cb.AlphaMinConst;
524 
525  /* Activate accelerating heuristics for Filter */
526  ar & cb.IgnoreFilterCrit;
527 
528  /* Filter heuristic to save Armijo iterations */
529  ar & cb.FilterBisecAlpha;
530 
531  /* Filter heuristic to save Armijo iterations */
532  ar & cb.FilterIntersecAlpha;
533 
534  /* Select max-norm instead of 1-norm in Filter */
535  ar & cb.MaxNorm;
536 
537  /* Enables Filter-reinitialisation accelerating heuristic */
538  ar & cb.ReinitFilter;
539 
540  /* Debug marker. Used to find memory alignment/padding issues */
541  ar & cb.DebugMarker06;
542 
543  /* Automatically added initialisation flag. */
544  ar & cb.initialised;
545 }
546 
547 #endif // PAGMO_ALGORITHM_WORHP_SERIALIZATION_H