ocra-recipes
Doxygen documentation for the ocra-recipes repository
ObjQLD.h
Go to the documentation of this file.
1 
21 #ifndef _MPCW_OBJ_QLD_EIGEN_H_
22 #define _MPCW_OBJ_QLD_EIGEN_H_
23 
24 //ocra includes
25 #include <Eigen/Eigen>
26 
27 
28 //f2c reduced header
29 #ifndef F2C_INCLUDE
30 #define F2C_INCLUDE
31 
32 #define TRUE_ (1)
33 #define FALSE_ (0)
34 
35 #endif
36 
37 using Eigen::MatrixXd;
38 using Eigen::VectorXd;
39 using Eigen::Map;
40 
41 namespace ocra
42 {
52  class ObjQLD
53  {
54  // ------------------------ structures --------------------------------------
55  public:
56  protected:
57  private:
58 
59  // ------------------------ public static members ---------------------------
60  public:
61 
62  // ------------------------ constructors ------------------------------------
63  private:
64  protected:
65  public:
66  ObjQLD();
67 
68  // ------------------------ public interface --------------------------------
69  public:
70  int solve(Map<MatrixXd>& C, const Map<VectorXd>& d, const Map<MatrixXd>& A, const Map<VectorXd>& b, int me,
71  Map<VectorXd>& x, const Map<VectorXd>& xl, const Map<VectorXd>& xu, bool factorizedC = false); //< if factorizedC == true, the upper triangle factor of choleski factorization of C must be given instead of C
72 
73  const VectorXd& getLagrangeMultipliers(void) const;
74  double getSizeFactor(void) const;
75  void setSizeFactor(double f);
76  double getEps(void) const {return _eps;}
77  void setEps(double eps) {_eps = eps;}
78 
79  // ------------------------ public methods ----------------------------------
80  public:
81 
82  // ------------------------ public static methods ---------------------------
83  public:
84 
85  // ------------------------ protected methods -------------------------------
86  protected:
87 
88  // ------------------------ protected static methods ------------------------
89  protected:
90 
91  // ------------------------ private methods ---------------------------------
92  private:
93  //Matrices begins at 0 and are column major
94  static int ql0001_(int *m,int *me,int *mmax,int *n,int *nmax,int *mnn,
95  double *c,double *d,double *a,double *b,double *xl,
96  double *xu,double *x,double *u,int *iout,int *ifail,
97  int *iprint,double *war,int *lwar,int *iwar,int *liwar,
98  double *eps1);
99  static int ql0002_(int *n,int *m,int *meq,int *mmax,
100  int *mn,int *mnn,int *nmax,
101  long int *lql,
102  double *a,double *b,double *grad,
103  double *g,double *xl,double *xu,double *x,
104  int *nact,int *iact,int *maxit,
105  double *vsmall,
106  int *info,
107  double *diag, double *w,
108  int *lw);
109 
110  int resize();
111 
112  // ------------------------ private static methods --------------------------
113  private:
114  inline static int abs(int x) {if (x >= 0) return x; else return -x;}
115  inline static double abs(double x) {if (x >= 0.) return x; else return -x;}
116  inline static int min(int a, int b) {if (a <= b) return a; else return b;}
117  inline static int max(int a, int b) {if (a >= b) return a; else return b;}
118  inline static double min(double a, double b) {if (a <= b) return a; else return b;}
119  inline static double max(double a, double b) {if (a >= b) return a; else return b;}
120 
121  // ------------------------ protected members -------------------------------
122  protected:
123 
124  // ------------------------ protected static members ------------------------
125  protected:
126 
127  // ------------------------ private members ---------------------------------
128  private:
129  int _lwar;
130  int _liwar;
131  int _mnn;
132  double _sizeFactor; //< lwar (resp. liwar) is equal to the minimum possible value of lwar (resp. liwar) times sizeFactor
133  double _eps;
134  int* _iwar; //< interger working array
135  int _iwarCapacity;
136  VectorXd _war; //< working array
137  VectorXd _u; //< lagrange multipliers
138 
139 
140  // ------------------------ private static members --------------------------
141  private:
142 
143  // ------------------------ friendship declarations -------------------------
144  friend class OFSQP;
145  };
146 
147  void testObjQLD(void);
148 }
149 
150 #endif //_OCRA_OBJ_QLD_H_
151 
152 
153 // cmake:sourcegroup=Solvers
154 
155 
156 //Original code for reference
157 #if 0
158 /* ************************************************************/
159 
160 /* -- translated by f2c (version of 22 July 1992 22:54:52).
161 */
162 
163 /* umd
164 Must include math.h before f2c.h - f2c does a #define abs.
165 (Thanks go to Martin Wauchope for providing this correction)
166 We manually included AT&T's f2c.h in this source file, i.e.
167 it does not have to be present separately in order to compile.
168 */
169 #include <math.h>
170 
171 /* CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
172  !!!! NOTICE !!!!
173 
174 1. The routines contained in this file are due to Prof. K.Schittkowski
175  of the University of Bayreuth, Germany (modification of routines
176  due to Prof. MJD Powell at the University of Cambridge). They can
177  be freely distributed.
178 
179 2. A few minor modifications were performed at the University of
180  Maryland. They are marked in the code by "umd".
181 
182  A.L. Tits, J.L. Zhou, and
183  Craig Lawrence
184  University of Maryland
185 
186  ***********************************************************************
187 
188 
189 
190  SOLUTION OF QUADRATIC PROGRAMMING PROBLEMS
191 
192 
193 
194  QL0001 SOLVES THE QUADRATIC PROGRAMMING PROBLEM
195 
196  MINIMIZE .5*X'*C*X + D'*X
197  SUBJECT TO A(J)*X + B(J) = 0 , J=1,...,ME
198  A(J)*X + B(J) >= 0 , J=ME+1,...,M
199  XL <= X <= XU
200 
201 HERE C MUST BE AN N BY N SYMMETRIC AND POSITIVE MATRIX, D AN N-DIMENSIONAL
202 VECTOR, A AN M BY N MATRIX AND B AN M-DIMENSIONAL VECTOR. THE ABOVE
203 SITUATION IS INDICATED BY IWAR(1)=1. ALTERNATIVELY, I.E. IF IWAR(1)=0,
204 THE OBJECTIVE FUNCTION MATRIX CAN ALSO BE PROVIDED IN FACTORIZED FORM.
205 IN THIS CASE, C IS AN UPPER TRIANGULAR MATRIX.
206 
207 THE SUBROUTINE REORGANIZES SOME DATA SO THAT THE PROBLEM CAN BE SOLVED
208 BY A MODIFICATION OF AN ALGORITHM PROPOSED BY POWELL (1983).
209 
210 
211 USAGE:
212 
213  QL0001(M,ME,MMAX,N,NMAX,MNN,C,D,A,B,XL,XU,X,U,IOUT,IFAIL,IPRINT,
214  WAR,LWAR,IWAR,LIWAR)
215 
216 
217  DEFINITION OF THE PARAMETERS:
218 
219  M : TOTAL NUMBER OF CONSTRAINTS.
220  ME : NUMBER OF EQUALITY CONSTRAINTS.
221  MMAX : ROW DIMENSION OF A. MMAX MUST BE AT LEAST ONE AND GREATER
222  THAN M.
223  N : NUMBER OF VARIABLES.
224  NMAX : ROW DIMENSION OF C. NMAX MUST BE GREATER OR EQUAL TO N.
225  MNN : MUST BE EQUAL TO M + N + N.
226  C(NMAX,NMAX): OBJECTIVE FUNCTION MATRIX WHICH SHOULD BE SYMMETRIC AND
227  POSITIVE DEFINITE. IF IWAR(1) = 0, C IS SUPPOSED TO BE THE
228  CHOLESKEY-FACTOR OF ANOTHER MATRIX, I.E. C IS UPPER
229  TRIANGULAR.
230  D(NMAX) : CONTAINS THE CONSTANT VECTOR OF THE OBJECTIVE FUNCTION.
231  A(MMAX,NMAX): CONTAINS THE DATA MATRIX OF THE LINEAR CONSTRAINTS.
232  B(MMAX) : CONTAINS THE CONSTANT DATA OF THE LINEAR CONSTRAINTS.
233  XL(N),XU(N): CONTAIN THE LOWER AND UPPER BOUNDS FOR THE VARIABLES.
234  X(N) : ON RETURN, X CONTAINS THE OPTIMAL SOLUTION VECTOR.
235  U(MNN) : ON RETURN, U CONTAINS THE LAGRANGE MULTIPLIERS. THE FIRST
236  M POSITIONS ARE RESERVED FOR THE MULTIPLIERS OF THE M
237  LINEAR CONSTRAINTS AND THE SUBSEQUENT ONES FOR THE
238  MULTIPLIERS OF THE LOWER AND UPPER BOUNDS. ON SUCCESSFUL
239  TERMINATION, ALL VALUES OF U WITH RESPECT TO INEQUALITIES
240  AND BOUNDS SHOULD BE GREATER OR EQUAL TO ZERO.
241  IOUT : INTEGER INDICATING THE DESIRED OUTPUT UNIT NUMBER, I.E.
242  ALL WRITE-STATEMENTS START WITH 'WRITE(IOUT,... '.
243  IFAIL : SHOWS THE TERMINATION REASON.
244  IFAIL = 0 : SUCCESSFUL RETURN.
245  IFAIL = 1 : TOO MANY ITERATIONS (MORE THAN 40*(N+M)).
246  IFAIL = 2 : ACCURACY INSUFFICIENT TO SATISFY CONVERGENCE
247  CRITERION.
248  IFAIL = 5 : LENGTH OF A WORKING ARRAY IS TOO SHORT.
249  IFAIL > 10 : THE CONSTRAINTS ARE INCONSISTENT.
250  IPRINT : OUTPUT CONTROL.
251  IPRINT = 0 : NO OUTPUT OF QL0001.
252  IPRINT > 0 : BRIEF OUTPUT IN ERROR CASES.
253  WAR(LWAR) : REAL WORKING ARRAY. THE LENGTH LWAR SHOULD BE GRATER THAN
254  3*NMAX*NMAX/2 + 10*NMAX + 2*MMAX.
255  IWAR(LIWAR): INTEGER WORKING ARRAY. THE LENGTH LIWAR SHOULD BE AT
256  LEAST N.
257  IF IWAR(1)=0 INITIALLY, THEN THE CHOLESKY DECOMPOSITION
258  WHICH IS REQUIRED BY THE DUAL ALGORITHM TO GET THE FIRST
259  UNCONSTRAINED MINIMUM OF THE OBJECTIVE FUNCTION, IS
260  PERFORMED INTERNALLY. OTHERWISE, I.E. IF IWAR(1)=1, THEN
261  IT IS ASSUMED THAT THE USER PROVIDES THE INITIAL FAC-
262  TORIZATION BY HIMSELF AND STORES IT IN THE UPPER TRIAN-
263  GULAR PART OF THE ARRAY C.
264 
265  A NAMED COMMON-BLOCK /CMACHE/EPS MUST BE PROVIDED BY THE USER,
266  WHERE EPS DEFINES A GUESS FOR THE UNDERLYING MACHINE PRECISION.
267 
268 
269  AUTHOR: K. SCHITTKOWSKI,
270  MATHEMATISCHES INSTITUT,
271  UNIVERSITAET BAYREUTH,
272  8580 BAYREUTH,
273  GERMANY, F.R.
274 
275 
276  VERSION: 1.4 (MARCH, 1987)
277 */
278 /* f2c.h -- Standard Fortran to C header file */
279 
284 #ifndef F2C_INCLUDE
285 #define F2C_INCLUDE
286 
287 typedef int integer;
288 typedef char *address;
289 typedef short int shortint;
290 typedef float real;
291 typedef double doublereal;
292 typedef struct { real r, i; } complex;
293 typedef struct { doublereal r, i; } doublecomplex;
294 typedef long int logical;
295 typedef short int shortlogical;
296 
297 #define TRUE_ (1)
298 #define FALSE_ (0)
299 
300 /* Extern is for use with -E */
301 #ifndef Extern
302 #define Extern extern
303 #endif
304 
305 /* I/O stuff */
306 
307 #ifdef f2c_i2
308 /* for -i2 */
309 typedef short flag;
310 typedef short ftnlen;
311 typedef short ftnint;
312 #else
313 typedef long flag;
314 typedef long ftnlen;
315 typedef long ftnint;
316 #endif
317 
318 /*external read, write*/
319 typedef struct
320 { flag cierr;
321  ftnint ciunit;
322  flag ciend;
323  char *cifmt;
324  ftnint cirec;
325 } cilist;
326 
327 /*internal read, write*/
328 typedef struct
329 { flag icierr;
330  char *iciunit;
331  flag iciend;
332  char *icifmt;
333  ftnint icirlen;
334  ftnint icirnum;
335 } icilist;
336 
337 /*open*/
338 typedef struct
339 { flag oerr;
340  ftnint ounit;
341  char *ofnm;
342  ftnlen ofnmlen;
343  char *osta;
344  char *oacc;
345  char *ofm;
346  ftnint orl;
347  char *oblnk;
348 } olist;
349 
350 /*close*/
351 typedef struct
352 { flag cerr;
353  ftnint cunit;
354  char *csta;
355 } cllist;
356 
357 /*rewind, backspace, endfile*/
358 typedef struct
359 { flag aerr;
360  ftnint aunit;
361 } alist;
362 
363 /* inquire */
364 typedef struct
365 { flag inerr;
366  ftnint inunit;
367  char *infile;
368  ftnlen infilen;
369  ftnint *inex; /*parameters in standard's order*/
370  ftnint *inopen;
371  ftnint *innum;
372  ftnint *innamed;
373  char *inname;
374  ftnlen innamlen;
375  char *inacc;
376  ftnlen inacclen;
377  char *inseq;
378  ftnlen inseqlen;
379  char *indir;
380  ftnlen indirlen;
381  char *infmt;
382  ftnlen infmtlen;
383  char *inform;
384  ftnint informlen;
385  char *inunf;
386  ftnlen inunflen;
387  ftnint *inrecl;
388  ftnint *innrec;
389  char *inblank;
390  ftnlen inblanklen;
391 } inlist;
392 
393 #define VOID void
394 
395 union Multitype { /* for multiple entry points */
396  shortint h;
397  integer i;
398  real r;
399  doublereal d;
400  complex c;
401  doublecomplex z;
402  };
403 
404 typedef union Multitype Multitype;
405 
406 typedef long Long;
407 
408 struct Vardesc { /* for Namelist */
409  char *name;
410  char *addr;
411  Long *dims;
412  int type;
413  };
414 typedef struct Vardesc Vardesc;
415 
416 struct Namelist {
417  char *name;
418  Vardesc **vars;
419  int nvars;
420  };
421 typedef struct Namelist Namelist;
422 
423 #define abs(x) ((x) >= 0 ? (x) : -(x))
424 #define dabs(x) (doublereal)abs(x)
425 #define min(a,b) ((a) <= (b) ? (a) : (b))
426 #define max(a,b) ((a) >= (b) ? (a) : (b))
427 #define dmin(a,b) (doublereal)min(a,b)
428 #define dmax(a,b) (doublereal)max(a,b)
429 
430 /* procedure parameter types for -A and -C++ */
431 
432 #define F2C_proc_par_types 1
433 #ifdef __cplusplus
434 typedef int /* Unknown procedure type */ (*U_fp)(...);
435 typedef shortint (*J_fp)(...);
436 typedef integer (*I_fp)(...);
437 typedef real (*R_fp)(...);
438 typedef doublereal (*D_fp)(...), (*E_fp)(...);
439 typedef /* Complex */ VOID (*C_fp)(...);
440 typedef /* Double Complex */ VOID (*Z_fp)(...);
441 typedef logical (*L_fp)(...);
442 typedef shortlogical (*K_fp)(...);
443 typedef /* Character */ VOID (*H_fp)(...);
444 typedef /* Subroutine */ int (*S_fp)(...);
445 #else
446 typedef int /* Unknown procedure type */ (*U_fp)();
447 typedef shortint (*J_fp)();
448 typedef integer (*I_fp)();
449 typedef real (*R_fp)();
450 typedef doublereal (*D_fp)(), (*E_fp)();
451 typedef /* Complex */ VOID (*C_fp)();
452 typedef /* Double Complex */ VOID (*Z_fp)();
453 typedef logical (*L_fp)();
454 typedef shortlogical (*K_fp)();
455 typedef /* Character */ VOID (*H_fp)();
456 typedef /* Subroutine */ int (*S_fp)();
457 #endif
458 /* E_fp is for real functions when -R is not specified */
459 typedef VOID C_f; /* complex function */
460 typedef VOID H_f; /* character function */
461 typedef VOID Z_f; /* double complex function */
462 typedef doublereal E_f; /* real function with -R not specified */
463 
464 /* undef any lower-case symbols that your C compiler predefines, e.g.: */
465 
466 #ifndef Skip_f2c_Undefs
467 #undef cray
468 #undef gcos
469 #undef mc68010
470 #undef mc68020
471 #undef mips
472 #undef pdp11
473 #undef sgi
474 #undef sparc
475 #undef sun
476 #undef sun2
477 #undef sun3
478 #undef sun4
479 #undef u370
480 #undef u3b
481 #undef u3b2
482 #undef u3b5
483 #undef unix
484 #undef vax
485 #endif
486 #endif
487 
488 
489 
490 /* Common Block Declarations */
491 
492 struct {
493  doublereal eps;
494 } cmache_;
495 
496 #define cmache_1 cmache_
497 
498 /* Table of constant values */
499 
500 static integer c__1 = 1;
501 
502 /* umd */
503 /*
504 ql0002_ is declared here to provide ANSI C compliance.
505 (Thanks got to Martin Wauchope for providing this correction)
506 */
507 #ifdef __STDC__
508 
509 int ql0002_(integer *n,integer *m,integer *meq,integer *mmax,
510  integer *mn,integer *mnn,integer *nmax,
511  logical *lql,
512  doublereal *a,doublereal *b,doublereal *grad,
513  doublereal *g,doublereal *xl,doublereal *xu,doublereal *x,
514  integer *nact,integer *iact,integer *maxit,
515  doublereal *vsmall,
516  integer *info,
517  doublereal *diag, doublereal *w,
518  integer *lw);
519 #else
520 int ql0002_();
521 #endif
522 /* umd */
523 /*
524 When the fortran code was f2c converted, the use of fortran COMMON
525 blocks was no longer available. Thus an additional variable, eps1,
526 was added to the parameter list to account for this.
527 */
528 /* umd */
529 /*
530 Two alternative definitions are provided in order to give ANSI
531 compliance.
532 */
533 #ifdef __STDC__
534 int ql0001_(int *m,int *me,int *mmax,int *n,int *nmax,int *mnn,
535  double *c,double *d,double *a,double *b,double *xl,
536  double *xu,double *x,double *u,int *iout,int *ifail,
537  int *iprint,double *war,int *lwar,int *iwar,int *liwar,
538  double *eps1)
539 #else
540 /* Subroutine */
541 int ql0001_(m, me, mmax, n, nmax, mnn, c, d, a, b, xl, xu, x,
542  u, iout, ifail, iprint, war, lwar, iwar, liwar, eps1)
543 integer *m, *me, *mmax, *n, *nmax, *mnn;
544 doublereal *c, *d, *a, *b, *xl, *xu, *x, *u;
545 integer *iout, *ifail, *iprint;
546 doublereal *war;
547 integer *lwar, *iwar, *liwar;
548 doublereal *eps1;
549 #endif
550 {
551  /* Format strings */
552  static char fmt_1000[] = "(/8x,\002***QL: MATRIX G WAS ENLARGED\002,i3\
553 ,\002-TIMES BY UNITMATRIX\002)";
554  static char fmt_1100[] = "(/8x,\002***QL: CONSTRAINT \002,i5,\002 NOT CO\
555 NSISTENT TO \002,/,(10x,10i5))";
556  static char fmt_1200[] = "(/8x,\002***QL: LWAR TOO SMALL\002)";
557  static char fmt_1210[] = "(/8x,\002***QL: LIWAR TOO SMALL\002)";
558  static char fmt_1220[] = "(/8x,\002***QL: MNN TOO SMALL\002)";
559  static char fmt_1300[] = "(/8x,\002***QL: TOO MANY ITERATIONS (MORE THA\
560 N\002,i6,\002)\002)";
561  static char fmt_1400[] = "(/8x,\002***QL: ACCURACY INSUFFICIENT TO ATTAI\
562 N CONVERGENCE\002)";
563 
564  /* System generated locals */
565  integer c_dim1, c_offset, a_dim1, a_offset, i__1, i__2;
566 
567  /* Builtin functions */
568 /* integer s_wsfe(), do_fio(), e_wsfe(); */
569 
570  /* Local variables */
571  static doublereal diag;
572  /* extern int ql0002_(); */
573  static integer nact, info;
574  static doublereal zero;
575  static integer i, j, idiag, maxit;
576  static doublereal qpeps;
577  static integer in, mn, lw;
578  static doublereal ten;
579  static logical lql;
580  static integer inw1, inw2;
581 
582  /* Fortran I/O blocks */
583  static cilist io___16 = { 0, 0, 0, fmt_1000, 0 };
584  static cilist io___18 = { 0, 0, 0, fmt_1100, 0 };
585  static cilist io___19 = { 0, 0, 0, fmt_1200, 0 };
586  static cilist io___20 = { 0, 0, 0, fmt_1210, 0 };
587  static cilist io___21 = { 0, 0, 0, fmt_1220, 0 };
588  static cilist io___22 = { 0, 0, 0, fmt_1300, 0 };
589  static cilist io___23 = { 0, 0, 0, fmt_1400, 0 };
590 
591 
592 
593 
594 
595 /* INTRINSIC FUNCTIONS: DSQRT */
596 
597  /* Parameter adjustments */
598  --iwar;
599  --war;
600  --u;
601  --x;
602  --xu;
603  --xl;
604  --b;
605  a_dim1 = *mmax;
606  a_offset = a_dim1 + 1;
607  a -= a_offset;
608  --d;
609  c_dim1 = *nmax;
610  c_offset = c_dim1 + 1;
611  c -= c_offset;
612 
613  /* Function Body */
614  cmache_1.eps = *eps1;
615 
616 /* CONSTANT DATA */
617 
618 /* ################################################################# */
619 
620  if (fabs(c[*nmax + *nmax * c_dim1]) == 0.e0) {
621  c[*nmax + *nmax * c_dim1] = cmache_1.eps;
622  }
623 
624 /* umd */
625 /* This prevents a subsequent more major modification of the Hessian */
626 /* matrix in the important case when a minmax problem (yielding a */
627 /* singular Hessian matrix) is being solved. */
628 /* ----UMCP, April 1991, Jian L. Zhou */
629 /* ################################################################# */
630 
631  lql = FALSE_;
632  if (iwar[1] == 1) {
633  lql = TRUE_;
634  }
635  zero = 0.;
636  ten = 10.;
637  maxit = (*m + *n) * 40;
638  qpeps = cmache_1.eps;
639  inw1 = 1;
640  inw2 = inw1 + *mmax;
641 
642 /* PREPARE PROBLEM DATA FOR EXECUTION */
643 
644  if (*m <= 0) {
645  goto L20;
646  }
647  in = inw1;
648  i__1 = *m;
649  for (j = 1; j <= i__1; ++j) {
650  war[in] = -b[j];
651 /* L10: */
652  ++in;
653  }
654 L20:
655  lw = *nmax * 3 * *nmax / 2 + *nmax * 10 + *m;
656  if (inw2 + lw > *lwar) {
657  goto L80;
658  }
659  if (*liwar < *n) {
660  goto L81;
661  }
662  if (*mnn < *m + *n + *n) {
663  goto L82;
664  }
665  mn = *m + *n;
666 
667 /* CALL OF QL0002 */
668 
669  ql0002_(n, m, me, mmax, &mn, mnn, nmax, &lql, &a[a_offset], &war[inw1], &
670  d[1], &c[c_offset], &xl[1], &xu[1], &x[1], &nact, &iwar[1], &
671  maxit, &qpeps, &info, &diag, &war[inw2], &lw);
672 
673 /* TEST OF MATRIX CORRECTIONS */
674 
675  *ifail = 0;
676  if (info == 1) {
677  goto L40;
678  }
679  if (info == 2) {
680  goto L90;
681  }
682  idiag = 0;
683  if (diag > zero && diag < 1e3) {
684  idiag = (integer) diag;
685  }
686 /*
687  if (*iprint > 0 && idiag > 0) {
688  io___16.ciunit = *iout;
689  s_wsfe(&io___16);
690  do_fio(&c__1, (char *)&idiag, (ftnlen)sizeof(integer));
691  e_wsfe();
692  }
693 */
694  if (info < 0) {
695  goto L70;
696  }
697 
698 /* REORDER MULTIPLIER */
699 
700  i__1 = *mnn;
701  for (j = 1; j <= i__1; ++j) {
702 /* L50: */
703  u[j] = zero;
704  }
705  in = inw2 - 1;
706  if (nact == 0) {
707  goto L30;
708  }
709  i__1 = nact;
710  for (i = 1; i <= i__1; ++i) {
711  j = iwar[i];
712  u[j] = war[in + i];
713 /* L60: */
714  }
715 L30:
716  return 0;
717 
718 /* ERROR MESSAGES */
719 
720 L70:
721  *ifail = -info + 10;
722 /*
723  if (*iprint > 0 && nact > 0) {
724  io___18.ciunit = *iout;
725  s_wsfe(&io___18);
726  i__1 = -info;
727  do_fio(&c__1, (char *)&i__1, (ftnlen)sizeof(integer));
728  i__2 = nact;
729  for (i = 1; i <= i__2; ++i) {
730  do_fio(&c__1, (char *)&iwar[i], (ftnlen)sizeof(integer));
731  }
732  e_wsfe();
733  }
734 */
735  return 0;
736 L80:
737  *ifail = 5;
738 /*
739  if (*iprint > 0) {
740  io___19.ciunit = *iout;
741  s_wsfe(&io___19);
742  e_wsfe();
743  }
744 */
745  return 0;
746 L81:
747  *ifail = 5;
748 /*
749  if (*iprint > 0) {
750  io___20.ciunit = *iout;
751  s_wsfe(&io___20);
752  e_wsfe();
753  }
754 */
755  return 0;
756 L82:
757  *ifail = 5;
758 /*
759  if (*iprint > 0) {
760  io___21.ciunit = *iout;
761  s_wsfe(&io___21);
762  e_wsfe();
763  }
764 */
765  return 0;
766 L40:
767  *ifail = 1;
768 /*
769  if (*iprint > 0) {
770  io___22.ciunit = *iout;
771  s_wsfe(&io___22);
772  do_fio(&c__1, (char *)&maxit, (ftnlen)sizeof(integer));
773  e_wsfe();
774  }
775 */
776  return 0;
777 L90:
778  *ifail = 2;
779 /*
780  if (*iprint > 0) {
781  io___23.ciunit = *iout;
782  s_wsfe(&io___23);
783  e_wsfe();
784  }
785 */
786  return 0;
787 
788 /* FORMAT-INSTRUCTIONS */
789 
790 } /* ql0001_ */
791 
792 
793 /* umd
794 Two alternative definitions are provided in order to give ANSI
795 compliance.
796 (Thanks got to Martin Wauchope for providing this correction)
797 */
798 #ifdef __STDC__
799 int ql0002_(integer *n,integer *m,integer *meq,integer *mmax,
800  integer *mn,integer *mnn,integer *nmax,
801  logical *lql,
802  doublereal *a,doublereal *b,doublereal *grad,
803  doublereal *g,doublereal *xl,doublereal *xu,doublereal *x,
804  integer *nact,integer *iact,integer *maxit,
805  doublereal *vsmall,
806  integer *info,
807  doublereal *diag, doublereal *w,
808  integer *lw)
809 #else
810 /* Subroutine */ int ql0002_(n, m, meq, mmax, mn, mnn, nmax, lql, a, b, grad,
811  g, xl, xu, x, nact, iact, maxit, vsmall, info, diag, w, lw)
812 integer *n, *m, *meq, *mmax, *mn, *mnn, *nmax;
813 logical *lql;
814 doublereal *a, *b, *grad, *g, *xl, *xu, *x;
815 integer *nact, *iact, *maxit;
816 doublereal *vsmall;
817 integer *info;
818 doublereal *diag, *w;
819 integer *lw;
820 #endif
821 {
822  /* System generated locals */
823  integer a_dim1, a_offset, g_dim1, g_offset, i__1, i__2, i__3, i__4;
824  doublereal d__1, d__2, d__3, d__4;
825 
826  /* Builtin functions */
827  /* umd */
828  /* double sqrt(); */
829 
830  /* Local variables */
831  static doublereal onha, xmag, suma, sumb, sumc, temp, step, zero;
832  static integer iwwn;
833  static doublereal sumx, sumy;
834  static integer i, j, k;
835  static doublereal fdiff;
836  static integer iflag, jflag, kflag, lflag;
837  static doublereal diagr;
838  static integer ifinc, kfinc, jfinc, mflag, nflag;
839  static doublereal vfact, tempa;
840  static integer iterc, itref;
841  static doublereal cvmax, ratio, xmagr;
842  static integer kdrop;
843  static logical lower;
844  static integer knext, k1;
845  static doublereal ga, gb;
846  static integer ia, id;
847  static doublereal fdiffa;
848  static integer ii, il, kk, jl, ip, ir, nm, is, iu, iw, ju, ix, iz, nu, iy;
849 
850  static doublereal parinc, parnew;
851  static integer ira, irb, iwa;
852  static doublereal one;
853  static integer iwd, iza;
854  static doublereal res;
855  static integer ipp, iwr, iws;
856  static doublereal sum;
857  static integer iww, iwx, iwy;
858  static doublereal two;
859  static integer iwz;
860 
861 
862 /* WHETHER THE CONSTRAINT IS ACTIVE. */
863 
864 
865 /* AUTHOR: K. SCHITTKOWSKI, */
866 /* MATHEMATISCHES INSTITUT, */
867 /* UNIVERSITAET BAYREUTH, */
868 /* 8580 BAYREUTH, */
869 /* GERMANY, F.R. */
870 
871 /* AUTHOR OF ORIGINAL VERSION: */
872 /* M.J.D. POWELL, DAMTP, */
873 /* UNIVERSITY OF CAMBRIDGE, SILVER STREET */
874 /* CAMBRIDGE, */
875 /* ENGLAND */
876 
877 
878 /* REFERENCE: M.J.D. POWELL: ZQPCVX, A FORTRAN SUBROUTINE FOR CONVEX */
879 /* PROGRAMMING, REPORT DAMTP/1983/NA17, UNIVERSITY OF */
880 /* CAMBRIDGE, ENGLAND, 1983. */
881 
882 
883 /* VERSION : 2.0 (MARCH, 1987) */
884 
885 
886 /************************************************************************
887 ***/
888 
889 
890 /* INTRINSIC FUNCTIONS: DMAX1,DSQRT,DABS,DMIN1 */
891 
892 
893 /* INITIAL ADDRESSES */
894 
895  /* Parameter adjustments */
896  --w;
897  --iact;
898  --x;
899  --xu;
900  --xl;
901  g_dim1 = *nmax;
902  g_offset = g_dim1 + 1;
903  g -= g_offset;
904  --grad;
905  --b;
906  a_dim1 = *mmax;
907  a_offset = a_dim1 + 1;
908  a -= a_offset;
909 
910  /* Function Body */
911  iwz = *nmax;
912  iwr = iwz + *nmax * *nmax;
913  iww = iwr + *nmax * (*nmax + 3) / 2;
914  iwd = iww + *nmax;
915  iwx = iwd + *nmax;
916  iwa = iwx + *nmax;
917 
918 /* SET SOME CONSTANTS. */
919 
920  zero = 0.;
921  one = 1.;
922  two = 2.;
923  onha = 1.5;
924  vfact = 1.;
925 
926 /* SET SOME PARAMETERS. */
927 /* NUMBER LESS THAN VSMALL ARE ASSUMED TO BE NEGLIGIBLE. */
928 /* THE MULTIPLE OF I THAT IS ADDED TO G IS AT MOST DIAGR TIMES */
929 /* THE LEAST MULTIPLE OF I THAT GIVES POSITIVE DEFINITENESS. */
930 /* X IS RE-INITIALISED IF ITS MAGNITUDE IS REDUCED BY THE */
931 /* FACTOR XMAGR. */
932 /* A CHECK IS MADE FOR AN INCREASE IN F EVERY IFINC ITERATIONS, */
933 /* AFTER KFINC ITERATIONS ARE COMPLETED. */
934 
935  diagr = two;
936  xmagr = .01;
937  ifinc = 3;
938  kfinc = max(10,*n);
939 
940 /* FIND THE RECIPROCALS OF THE LENGTHS OF THE CONSTRAINT NORMALS. */
941 /* RETURN IF A CONSTRAINT IS INFEASIBLE DUE TO A ZERO NORMAL. */
942 
943  *nact = 0;
944  if (*m <= 0) {
945  goto L45;
946  }
947  i__1 = *m;
948  for (k = 1; k <= i__1; ++k) {
949  sum = zero;
950  i__2 = *n;
951  for (i = 1; i <= i__2; ++i) {
952 /* L10: */
953 /* Computing 2nd power */
954  d__1 = a[k + i * a_dim1];
955  sum += d__1 * d__1;
956  }
957  if (sum > zero) {
958  goto L20;
959  }
960  if (b[k] == zero) {
961  goto L30;
962  }
963  *info = -k;
964  if (k <= *meq) {
965  goto L730;
966  }
967  if (b[k] <= 0.) {
968  goto L30;
969  } else {
970  goto L730;
971  }
972 L20:
973  sum = one / sqrt(sum);
974 L30:
975  ia = iwa + k;
976 /* L40: */
977  w[ia] = sum;
978  }
979 L45:
980  i__1 = *n;
981  for (k = 1; k <= i__1; ++k) {
982  ia = iwa + *m + k;
983 /* L50: */
984  w[ia] = one;
985  }
986 
987 /* IF NECESSARY INCREASE THE DIAGONAL ELEMENTS OF G. */
988 
989  if (! (*lql)) {
990  goto L165;
991  }
992  *diag = zero;
993  i__1 = *n;
994  for (i = 1; i <= i__1; ++i) {
995  id = iwd + i;
996  w[id] = g[i + i * g_dim1];
997 /* Computing MAX */
998  d__1 = *diag, d__2 = *vsmall - w[id];
999  *diag = max(d__1,d__2);
1000  if (i == *n) {
1001  goto L60;
1002  }
1003  ii = i + 1;
1004  i__2 = *n;
1005  for (j = ii; j <= i__2; ++j) {
1006 /* Computing MIN */
1007  d__1 = w[id], d__2 = g[j + j * g_dim1];
1008  ga = -min(d__1,d__2);
1009  gb = (d__1 = w[id] - g[j + j * g_dim1], abs(d__1)) + (d__2 = g[i
1010  + j * g_dim1], abs(d__2));
1011  if (gb > zero) {
1012 /* Computing 2nd power */
1013  d__1 = g[i + j * g_dim1];
1014  ga += d__1 * d__1 / gb;
1015  }
1016 /* L55: */
1017  *diag = max(*diag,ga);
1018  }
1019 L60:
1020  ;
1021  }
1022  if (*diag <= zero) {
1023  goto L90;
1024  }
1025 L70:
1026  *diag = diagr * *diag;
1027  i__1 = *n;
1028  for (i = 1; i <= i__1; ++i) {
1029  id = iwd + i;
1030 /* L80: */
1031  g[i + i * g_dim1] = *diag + w[id];
1032  }
1033 
1034 /* FORM THE CHOLESKY FACTORISATION OF G. THE TRANSPOSE */
1035 /* OF THE FACTOR WILL BE PLACED IN THE R-PARTITION OF W. */
1036 
1037 L90:
1038  ir = iwr;
1039  i__1 = *n;
1040  for (j = 1; j <= i__1; ++j) {
1041  ira = iwr;
1042  irb = ir + 1;
1043  i__2 = j;
1044  for (i = 1; i <= i__2; ++i) {
1045  temp = g[i + j * g_dim1];
1046  if (i == 1) {
1047  goto L110;
1048  }
1049  i__3 = ir;
1050  for (k = irb; k <= i__3; ++k) {
1051  ++ira;
1052 /* L100: */
1053  temp -= w[k] * w[ira];
1054  }
1055 L110:
1056  ++ir;
1057  ++ira;
1058  if (i < j) {
1059  w[ir] = temp / w[ira];
1060  }
1061 /* L120: */
1062  }
1063  if (temp < *vsmall) {
1064  goto L140;
1065  }
1066 /* L130: */
1067  w[ir] = sqrt(temp);
1068  }
1069  goto L170;
1070 
1071 /* INCREASE FURTHER THE DIAGONAL ELEMENT OF G. */
1072 
1073 L140:
1074  w[j] = one;
1075  sumx = one;
1076  k = j;
1077 L150:
1078  sum = zero;
1079  ira = ir - 1;
1080  i__1 = j;
1081  for (i = k; i <= i__1; ++i) {
1082  sum -= w[ira] * w[i];
1083 /* L160: */
1084  ira += i;
1085  }
1086  ir -= k;
1087  --k;
1088  w[k] = sum / w[ir];
1089 /* Computing 2nd power */
1090  d__1 = w[k];
1091  sumx += d__1 * d__1;
1092  if (k >= 2) {
1093  goto L150;
1094  }
1095  *diag = *diag + *vsmall - temp / sumx;
1096  goto L70;
1097 
1098 /* STORE THE CHOLESKY FACTORISATION IN THE R-PARTITION */
1099 /* OF W. */
1100 
1101 L165:
1102  ir = iwr;
1103  i__1 = *n;
1104  for (i = 1; i <= i__1; ++i) {
1105  i__2 = i;
1106  for (j = 1; j <= i__2; ++j) {
1107  ++ir;
1108 /* L166: */
1109  w[ir] = g[j + i * g_dim1];
1110  }
1111  }
1112 
1113 /* SET Z THE INVERSE OF THE MATRIX IN R. */
1114 
1115 L170:
1116  nm = *n - 1;
1117  i__2 = *n;
1118  for (i = 1; i <= i__2; ++i) {
1119  iz = iwz + i;
1120  if (i == 1) {
1121  goto L190;
1122  }
1123  i__1 = i;
1124  for (j = 2; j <= i__1; ++j) {
1125  w[iz] = zero;
1126 /* L180: */
1127  iz += *n;
1128  }
1129 L190:
1130  ir = iwr + (i + i * i) / 2;
1131  w[iz] = one / w[ir];
1132  if (i == *n) {
1133  goto L220;
1134  }
1135  iza = iz;
1136  i__1 = nm;
1137  for (j = i; j <= i__1; ++j) {
1138  ir += i;
1139  sum = zero;
1140  i__3 = iz;
1141  i__4 = *n;
1142  for (k = iza; i__4 < 0 ? k >= i__3 : k <= i__3; k += i__4) {
1143  sum += w[k] * w[ir];
1144 /* L200: */
1145  ++ir;
1146  }
1147  iz += *n;
1148 /* L210: */
1149  w[iz] = -sum / w[ir];
1150  }
1151 L220:
1152  ;
1153  }
1154 
1155 /* SET THE INITIAL VALUES OF SOME VARIABLES. */
1156 /* ITERC COUNTS THE NUMBER OF ITERATIONS. */
1157 /* ITREF IS SET TO ONE WHEN ITERATIVE REFINEMENT IS REQUIRED. */
1158 /* JFINC INDICATES WHEN TO TEST FOR AN INCREASE IN F. */
1159 
1160  iterc = 1;
1161  itref = 0;
1162  jfinc = -kfinc;
1163 
1164 /* SET X TO ZERO AND SET THE CORRESPONDING RESIDUALS OF THE */
1165 /* KUHN-TUCKER CONDITIONS. */
1166 
1167 L230:
1168  iflag = 1;
1169  iws = iww - *n;
1170  i__2 = *n;
1171  for (i = 1; i <= i__2; ++i) {
1172  x[i] = zero;
1173  iw = iww + i;
1174  w[iw] = grad[i];
1175  if (i > *nact) {
1176  goto L240;
1177  }
1178  w[i] = zero;
1179  is = iws + i;
1180  k = iact[i];
1181  if (k <= *m) {
1182  goto L235;
1183  }
1184  if (k > *mn) {
1185  goto L234;
1186  }
1187  k1 = k - *m;
1188  w[is] = xl[k1];
1189  goto L240;
1190 L234:
1191  k1 = k - *mn;
1192  w[is] = -xu[k1];
1193  goto L240;
1194 L235:
1195  w[is] = b[k];
1196 L240:
1197  ;
1198  }
1199  xmag = zero;
1200  vfact = 1.;
1201  if (*nact <= 0) {
1202  goto L340;
1203  } else {
1204  goto L280;
1205  }
1206 
1207 /* SET THE RESIDUALS OF THE KUHN-TUCKER CONDITIONS FOR GENERAL X. */
1208 
1209 L250:
1210  iflag = 2;
1211  iws = iww - *n;
1212  i__2 = *n;
1213  for (i = 1; i <= i__2; ++i) {
1214  iw = iww + i;
1215  w[iw] = grad[i];
1216  if (*lql) {
1217  goto L259;
1218  }
1219  id = iwd + i;
1220  w[id] = zero;
1221  i__1 = *n;
1222  for (j = i; j <= i__1; ++j) {
1223 /* L251: */
1224  w[id] += g[i + j * g_dim1] * x[j];
1225  }
1226  i__1 = i;
1227  for (j = 1; j <= i__1; ++j) {
1228  id = iwd + j;
1229 /* L252: */
1230  w[iw] += g[j + i * g_dim1] * w[id];
1231  }
1232  goto L260;
1233 L259:
1234  i__1 = *n;
1235  for (j = 1; j <= i__1; ++j) {
1236 /* L261: */
1237  w[iw] += g[i + j * g_dim1] * x[j];
1238  }
1239 L260:
1240  ;
1241  }
1242  if (*nact == 0) {
1243  goto L340;
1244  }
1245  i__2 = *nact;
1246  for (k = 1; k <= i__2; ++k) {
1247  kk = iact[k];
1248  is = iws + k;
1249  if (kk > *m) {
1250  goto L265;
1251  }
1252  w[is] = b[kk];
1253  i__1 = *n;
1254  for (i = 1; i <= i__1; ++i) {
1255  iw = iww + i;
1256  w[iw] -= w[k] * a[kk + i * a_dim1];
1257 /* L264: */
1258  w[is] -= x[i] * a[kk + i * a_dim1];
1259  }
1260  goto L270;
1261 L265:
1262  if (kk > *mn) {
1263  goto L266;
1264  }
1265  k1 = kk - *m;
1266  iw = iww + k1;
1267  w[iw] -= w[k];
1268  w[is] = xl[k1] - x[k1];
1269  goto L270;
1270 L266:
1271  k1 = kk - *mn;
1272  iw = iww + k1;
1273  w[iw] += w[k];
1274  w[is] = -xu[k1] + x[k1];
1275 L270:
1276  ;
1277  }
1278 
1279 /* PRE-MULTIPLY THE VECTOR IN THE S-PARTITION OF W BY THE */
1280 /* INVERS OF R TRANSPOSE. */
1281 
1282 L280:
1283  ir = iwr;
1284  ip = iww + 1;
1285  ipp = iww + *n;
1286  il = iws + 1;
1287  iu = iws + *nact;
1288  i__2 = iu;
1289  for (i = il; i <= i__2; ++i) {
1290  sum = zero;
1291  if (i == il) {
1292  goto L300;
1293  }
1294  ju = i - 1;
1295  i__1 = ju;
1296  for (j = il; j <= i__1; ++j) {
1297  ++ir;
1298 /* L290: */
1299  sum += w[ir] * w[j];
1300  }
1301 L300:
1302  ++ir;
1303 /* L310: */
1304  w[i] = (w[i] - sum) / w[ir];
1305  }
1306 
1307 /* SHIFT X TO SATISFY THE ACTIVE CONSTRAINTS AND MAKE THE */
1308 /* CORRESPONDING CHANGE TO THE GRADIENT RESIDUALS. */
1309 
1310  i__2 = *n;
1311  for (i = 1; i <= i__2; ++i) {
1312  iz = iwz + i;
1313  sum = zero;
1314  i__1 = iu;
1315  for (j = il; j <= i__1; ++j) {
1316  sum += w[j] * w[iz];
1317 /* L320: */
1318  iz += *n;
1319  }
1320  x[i] += sum;
1321  if (*lql) {
1322  goto L329;
1323  }
1324  id = iwd + i;
1325  w[id] = zero;
1326  i__1 = *n;
1327  for (j = i; j <= i__1; ++j) {
1328 /* L321: */
1329  w[id] += g[i + j * g_dim1] * sum;
1330  }
1331  iw = iww + i;
1332  i__1 = i;
1333  for (j = 1; j <= i__1; ++j) {
1334  id = iwd + j;
1335 /* L322: */
1336  w[iw] += g[j + i * g_dim1] * w[id];
1337  }
1338  goto L330;
1339 L329:
1340  i__1 = *n;
1341  for (j = 1; j <= i__1; ++j) {
1342  iw = iww + j;
1343 /* L331: */
1344  w[iw] += sum * g[i + j * g_dim1];
1345  }
1346 L330:
1347  ;
1348  }
1349 
1350 /* FORM THE SCALAR PRODUCT OF THE CURRENT GRADIENT RESIDUALS */
1351 /* WITH EACH COLUMN OF Z. */
1352 
1353 L340:
1354  kflag = 1;
1355  goto L930;
1356 L350:
1357  if (*nact == *n) {
1358  goto L380;
1359  }
1360 
1361 /* SHIFT X SO THAT IT SATISFIES THE REMAINING KUHN-TUCKER */
1362 /* CONDITIONS. */
1363 
1364  il = iws + *nact + 1;
1365  iza = iwz + *nact * *n;
1366  i__2 = *n;
1367  for (i = 1; i <= i__2; ++i) {
1368  sum = zero;
1369  iz = iza + i;
1370  i__1 = iww;
1371  for (j = il; j <= i__1; ++j) {
1372  sum += w[iz] * w[j];
1373 /* L360: */
1374  iz += *n;
1375  }
1376 /* L370: */
1377  x[i] -= sum;
1378  }
1379  *info = 0;
1380  if (*nact == 0) {
1381  goto L410;
1382  }
1383 
1384 /* UPDATE THE LAGRANGE MULTIPLIERS. */
1385 
1386 L380:
1387  lflag = 3;
1388  goto L740;
1389 L390:
1390  i__2 = *nact;
1391  for (k = 1; k <= i__2; ++k) {
1392  iw = iww + k;
1393 /* L400: */
1394  w[k] += w[iw];
1395  }
1396 
1397 /* REVISE THE VALUES OF XMAG. */
1398 /* BRANCH IF ITERATIVE REFINEMENT IS REQUIRED. */
1399 
1400 L410:
1401  jflag = 1;
1402  goto L910;
1403 L420:
1404  if (iflag == itref) {
1405  goto L250;
1406  }
1407 
1408 /* DELETE A CONSTRAINT IF A LAGRANGE MULTIPLIER OF AN */
1409 /* INEQUALITY CONSTRAINT IS NEGATIVE. */
1410 
1411  kdrop = 0;
1412  goto L440;
1413 L430:
1414  ++kdrop;
1415  if (w[kdrop] >= zero) {
1416  goto L440;
1417  }
1418  if (iact[kdrop] <= *meq) {
1419  goto L440;
1420  }
1421  nu = *nact;
1422  mflag = 1;
1423  goto L800;
1424 L440:
1425  if (kdrop < *nact) {
1426  goto L430;
1427  }
1428 
1429 /* SEEK THE GREATEAST NORMALISED CONSTRAINT VIOLATION, DISREGARDING */
1430 
1431 /* ANY THAT MAY BE DUE TO COMPUTER ROUNDING ERRORS. */
1432 
1433 L450:
1434  cvmax = zero;
1435  if (*m <= 0) {
1436  goto L481;
1437  }
1438  i__2 = *m;
1439  for (k = 1; k <= i__2; ++k) {
1440  ia = iwa + k;
1441  if (w[ia] <= zero) {
1442  goto L480;
1443  }
1444  sum = -b[k];
1445  i__1 = *n;
1446  for (i = 1; i <= i__1; ++i) {
1447 /* L460: */
1448  sum += x[i] * a[k + i * a_dim1];
1449  }
1450  sumx = -sum * w[ia];
1451  if (k <= *meq) {
1452  sumx = abs(sumx);
1453  }
1454  if (sumx <= cvmax) {
1455  goto L480;
1456  }
1457  temp = (d__1 = b[k], abs(d__1));
1458  i__1 = *n;
1459  for (i = 1; i <= i__1; ++i) {
1460 /* L470: */
1461  temp += (d__1 = x[i] * a[k + i * a_dim1], abs(d__1));
1462  }
1463  tempa = temp + abs(sum);
1464  if (tempa <= temp) {
1465  goto L480;
1466  }
1467  temp += onha * abs(sum);
1468  if (temp <= tempa) {
1469  goto L480;
1470  }
1471  cvmax = sumx;
1472  res = sum;
1473  knext = k;
1474 L480:
1475  ;
1476  }
1477 L481:
1478  i__2 = *n;
1479  for (k = 1; k <= i__2; ++k) {
1480  lower = TRUE_;
1481  ia = iwa + *m + k;
1482  if (w[ia] <= zero) {
1483  goto L485;
1484  }
1485  sum = xl[k] - x[k];
1486  if (sum < 0.) {
1487  goto L482;
1488  } else if (sum == 0) {
1489  goto L485;
1490  } else {
1491  goto L483;
1492  }
1493 L482:
1494  sum = x[k] - xu[k];
1495  lower = FALSE_;
1496 L483:
1497  if (sum <= cvmax) {
1498  goto L485;
1499  }
1500  cvmax = sum;
1501  res = -sum;
1502  knext = k + *m;
1503  if (lower) {
1504  goto L485;
1505  }
1506  knext = k + *mn;
1507 L485:
1508  ;
1509  }
1510 
1511 /* TEST FOR CONVERGENCE */
1512 
1513  *info = 0;
1514  if (cvmax <= *vsmall) {
1515  goto L700;
1516  }
1517 
1518 /* RETURN IF, DUE TO ROUNDING ERRORS, THE ACTUAL CHANGE IN */
1519 /* X MAY NOT INCREASE THE OBJECTIVE FUNCTION */
1520 
1521  ++jfinc;
1522  if (jfinc == 0) {
1523  goto L510;
1524  }
1525  if (jfinc != ifinc) {
1526  goto L530;
1527  }
1528  fdiff = zero;
1529  fdiffa = zero;
1530  i__2 = *n;
1531  for (i = 1; i <= i__2; ++i) {
1532  sum = two * grad[i];
1533  sumx = abs(sum);
1534  if (*lql) {
1535  goto L489;
1536  }
1537  id = iwd + i;
1538  w[id] = zero;
1539  i__1 = *n;
1540  for (j = i; j <= i__1; ++j) {
1541  ix = iwx + j;
1542 /* L486: */
1543  w[id] += g[i + j * g_dim1] * (w[ix] + x[j]);
1544  }
1545  i__1 = i;
1546  for (j = 1; j <= i__1; ++j) {
1547  id = iwd + j;
1548  temp = g[j + i * g_dim1] * w[id];
1549  sum += temp;
1550 /* L487: */
1551  sumx += abs(temp);
1552  }
1553  goto L495;
1554 L489:
1555  i__1 = *n;
1556  for (j = 1; j <= i__1; ++j) {
1557  ix = iwx + j;
1558  temp = g[i + j * g_dim1] * (w[ix] + x[j]);
1559  sum += temp;
1560 /* L490: */
1561  sumx += abs(temp);
1562  }
1563 L495:
1564  ix = iwx + i;
1565  fdiff += sum * (x[i] - w[ix]);
1566 /* L500: */
1567  fdiffa += sumx * (d__1 = x[i] - w[ix], abs(d__1));
1568  }
1569  *info = 2;
1570  sum = fdiffa + fdiff;
1571  if (sum <= fdiffa) {
1572  goto L700;
1573  }
1574  temp = fdiffa + onha * fdiff;
1575  if (temp <= sum) {
1576  goto L700;
1577  }
1578  jfinc = 0;
1579  *info = 0;
1580 L510:
1581  i__2 = *n;
1582  for (i = 1; i <= i__2; ++i) {
1583  ix = iwx + i;
1584 /* L520: */
1585  w[ix] = x[i];
1586  }
1587 
1588 /* FORM THE SCALAR PRODUCT OF THE NEW CONSTRAINT NORMAL WITH EACH */
1589 /* COLUMN OF Z. PARNEW WILL BECOME THE LAGRANGE MULTIPLIER OF */
1590 /* THE NEW CONSTRAINT. */
1591 
1592 L530:
1593  ++iterc;
1594  if (iterc <= *maxit) {
1595  goto L531;
1596  }
1597  *info = 1;
1598  goto L710;
1599 L531:
1600  iws = iwr + (*nact + *nact * *nact) / 2;
1601  if (knext > *m) {
1602  goto L541;
1603  }
1604  i__2 = *n;
1605  for (i = 1; i <= i__2; ++i) {
1606  iw = iww + i;
1607 /* L540: */
1608  w[iw] = a[knext + i * a_dim1];
1609  }
1610  goto L549;
1611 L541:
1612  i__2 = *n;
1613  for (i = 1; i <= i__2; ++i) {
1614  iw = iww + i;
1615 /* L542: */
1616  w[iw] = zero;
1617  }
1618  k1 = knext - *m;
1619  if (k1 > *n) {
1620  goto L545;
1621  }
1622  iw = iww + k1;
1623  w[iw] = one;
1624  iz = iwz + k1;
1625  i__2 = *n;
1626  for (i = 1; i <= i__2; ++i) {
1627  is = iws + i;
1628  w[is] = w[iz];
1629 /* L543: */
1630  iz += *n;
1631  }
1632  goto L550;
1633 L545:
1634  k1 = knext - *mn;
1635  iw = iww + k1;
1636  w[iw] = -one;
1637  iz = iwz + k1;
1638  i__2 = *n;
1639  for (i = 1; i <= i__2; ++i) {
1640  is = iws + i;
1641  w[is] = -w[iz];
1642 /* L546: */
1643  iz += *n;
1644  }
1645  goto L550;
1646 L549:
1647  kflag = 2;
1648  goto L930;
1649 L550:
1650  parnew = zero;
1651 
1652 /* APPLY GIVENS ROTATIONS TO MAKE THE LAST (N-NACT-2) SCALAR */
1653 /* PRODUCTS EQUAL TO ZERO. */
1654 
1655  if (*nact == *n) {
1656  goto L570;
1657  }
1658  nu = *n;
1659  nflag = 1;
1660  goto L860;
1661 
1662 /* BRANCH IF THERE IS NO NEED TO DELETE A CONSTRAINT. */
1663 
1664 L560:
1665  is = iws + *nact;
1666  if (*nact == 0) {
1667  goto L640;
1668  }
1669  suma = zero;
1670  sumb = zero;
1671  sumc = zero;
1672  iz = iwz + *nact * *n;
1673  i__2 = *n;
1674  for (i = 1; i <= i__2; ++i) {
1675  ++iz;
1676  iw = iww + i;
1677  suma += w[iw] * w[iz];
1678  sumb += (d__1 = w[iw] * w[iz], abs(d__1));
1679 /* L563: */
1680 /* Computing 2nd power */
1681  d__1 = w[iz];
1682  sumc += d__1 * d__1;
1683  }
1684  temp = sumb + abs(suma) * .1;
1685  tempa = sumb + abs(suma) * .2;
1686  if (temp <= sumb) {
1687  goto L570;
1688  }
1689  if (tempa <= temp) {
1690  goto L570;
1691  }
1692  if (sumb > *vsmall) {
1693  goto L5;
1694  }
1695  goto L570;
1696 L5:
1697  sumc = sqrt(sumc);
1698  ia = iwa + knext;
1699  if (knext <= *m) {
1700  sumc /= w[ia];
1701  }
1702  temp = sumc + abs(suma) * .1;
1703  tempa = sumc + abs(suma) * .2;
1704  if (temp <= sumc) {
1705  goto L567;
1706  }
1707  if (tempa <= temp) {
1708  goto L567;
1709  }
1710  goto L640;
1711 
1712 /* CALCULATE THE MULTIPLIERS FOR THE NEW CONSTRAINT NORMAL */
1713 /* EXPRESSED IN TERMS OF THE ACTIVE CONSTRAINT NORMALS. */
1714 /* THEN WORK OUT WHICH CONTRAINT TO DROP. */
1715 
1716 L567:
1717  lflag = 4;
1718  goto L740;
1719 L570:
1720  lflag = 1;
1721  goto L740;
1722 
1723 /* COMPLETE THE TEST FOR LINEARLY DEPENDENT CONSTRAINTS. */
1724 
1725 L571:
1726  if (knext > *m) {
1727  goto L574;
1728  }
1729  i__2 = *n;
1730  for (i = 1; i <= i__2; ++i) {
1731  suma = a[knext + i * a_dim1];
1732  sumb = abs(suma);
1733  if (*nact == 0) {
1734  goto L581;
1735  }
1736  i__1 = *nact;
1737  for (k = 1; k <= i__1; ++k) {
1738  kk = iact[k];
1739  if (kk <= *m) {
1740  goto L568;
1741  }
1742  kk -= *m;
1743  temp = zero;
1744  if (kk == i) {
1745  temp = w[iww + kk];
1746  }
1747  kk -= *n;
1748  if (kk == i) {
1749  temp = -w[iww + kk];
1750  }
1751  goto L569;
1752 L568:
1753  iw = iww + k;
1754  temp = w[iw] * a[kk + i * a_dim1];
1755 L569:
1756  suma -= temp;
1757 /* L572: */
1758  sumb += abs(temp);
1759  }
1760 L581:
1761  if (suma <= *vsmall) {
1762  goto L573;
1763  }
1764  temp = sumb + abs(suma) * .1;
1765  tempa = sumb + abs(suma) * .2;
1766  if (temp <= sumb) {
1767  goto L573;
1768  }
1769  if (tempa <= temp) {
1770  goto L573;
1771  }
1772  goto L630;
1773 L573:
1774  ;
1775  }
1776  lflag = 1;
1777  goto L775;
1778 L574:
1779  k1 = knext - *m;
1780  if (k1 > *n) {
1781  k1 -= *n;
1782  }
1783  i__2 = *n;
1784  for (i = 1; i <= i__2; ++i) {
1785  suma = zero;
1786  if (i != k1) {
1787  goto L575;
1788  }
1789  suma = one;
1790  if (knext > *mn) {
1791  suma = -one;
1792  }
1793 L575:
1794  sumb = abs(suma);
1795  if (*nact == 0) {
1796  goto L582;
1797  }
1798  i__1 = *nact;
1799  for (k = 1; k <= i__1; ++k) {
1800  kk = iact[k];
1801  if (kk <= *m) {
1802  goto L579;
1803  }
1804  kk -= *m;
1805  temp = zero;
1806  if (kk == i) {
1807  temp = w[iww + kk];
1808  }
1809  kk -= *n;
1810  if (kk == i) {
1811  temp = -w[iww + kk];
1812  }
1813  goto L576;
1814 L579:
1815  iw = iww + k;
1816  temp = w[iw] * a[kk + i * a_dim1];
1817 L576:
1818  suma -= temp;
1819 /* L577: */
1820  sumb += abs(temp);
1821  }
1822 L582:
1823  temp = sumb + abs(suma) * .1;
1824  tempa = sumb + abs(suma) * .2;
1825  if (temp <= sumb) {
1826  goto L578;
1827  }
1828  if (tempa <= temp) {
1829  goto L578;
1830  }
1831  goto L630;
1832 L578:
1833  ;
1834  }
1835  lflag = 1;
1836  goto L775;
1837 
1838 /* BRANCH IF THE CONTRAINTS ARE INCONSISTENT. */
1839 
1840 L580:
1841  *info = -knext;
1842  if (kdrop == 0) {
1843  goto L700;
1844  }
1845  parinc = ratio;
1846  parnew = parinc;
1847 
1848 /* REVISE THE LAGRANGE MULTIPLIERS OF THE ACTIVE CONSTRAINTS. */
1849 
1850 L590:
1851  if (*nact == 0) {
1852  goto L601;
1853  }
1854  i__2 = *nact;
1855  for (k = 1; k <= i__2; ++k) {
1856  iw = iww + k;
1857  w[k] -= parinc * w[iw];
1858  if (iact[k] > *meq) {
1859 /* Computing MAX */
1860  d__1 = zero, d__2 = w[k];
1861  w[k] = max(d__1,d__2);
1862  }
1863 /* L600: */
1864  }
1865 L601:
1866  if (kdrop == 0) {
1867  goto L680;
1868  }
1869 
1870 /* DELETE THE CONSTRAINT TO BE DROPPED. */
1871 /* SHIFT THE VECTOR OF SCALAR PRODUCTS. */
1872 /* THEN, IF APPROPRIATE, MAKE ONE MORE SCALAR PRODUCT ZERO. */
1873 
1874  nu = *nact + 1;
1875  mflag = 2;
1876  goto L800;
1877 L610:
1878  iws = iws - *nact - 1;
1879  nu = min(*n,nu);
1880  i__2 = nu;
1881  for (i = 1; i <= i__2; ++i) {
1882  is = iws + i;
1883  j = is + *nact;
1884 /* L620: */
1885  w[is] = w[j + 1];
1886  }
1887  nflag = 2;
1888  goto L860;
1889 
1890 /* CALCULATE THE STEP TO THE VIOLATED CONSTRAINT. */
1891 
1892 L630:
1893  is = iws + *nact;
1894 L640:
1895  sumy = w[is + 1];
1896  step = -res / sumy;
1897  parinc = step / sumy;
1898  if (*nact == 0) {
1899  goto L660;
1900  }
1901 
1902 /* CALCULATE THE CHANGES TO THE LAGRANGE MULTIPLIERS, AND REDUCE */
1903 /* THE STEP ALONG THE NEW SEARCH DIRECTION IF NECESSARY. */
1904 
1905  lflag = 2;
1906  goto L740;
1907 L650:
1908  if (kdrop == 0) {
1909  goto L660;
1910  }
1911  temp = one - ratio / parinc;
1912  if (temp <= zero) {
1913  kdrop = 0;
1914  }
1915  if (kdrop == 0) {
1916  goto L660;
1917  }
1918  step = ratio * sumy;
1919  parinc = ratio;
1920  res = temp * res;
1921 
1922 /* UPDATE X AND THE LAGRANGE MULTIPIERS. */
1923 /* DROP A CONSTRAINT IF THE FULL STEP IS NOT TAKEN. */
1924 
1925 L660:
1926  iwy = iwz + *nact * *n;
1927  i__2 = *n;
1928  for (i = 1; i <= i__2; ++i) {
1929  iy = iwy + i;
1930 /* L670: */
1931  x[i] += step * w[iy];
1932  }
1933  parnew += parinc;
1934  if (*nact >= 1) {
1935  goto L590;
1936  }
1937 
1938 /* ADD THE NEW CONSTRAINT TO THE ACTIVE SET. */
1939 
1940 L680:
1941  ++(*nact);
1942  w[*nact] = parnew;
1943  iact[*nact] = knext;
1944  ia = iwa + knext;
1945  if (knext > *mn) {
1946  ia -= *n;
1947  }
1948  w[ia] = -w[ia];
1949 
1950 /* ESTIMATE THE MAGNITUDE OF X. THEN BEGIN A NEW ITERATION, */
1951 /* RE-INITILISING X IF THIS MAGNITUDE IS SMALL. */
1952 
1953  jflag = 2;
1954  goto L910;
1955 L690:
1956  if (sum < xmagr * xmag) {
1957  goto L230;
1958  }
1959  if (itref <= 0) {
1960  goto L450;
1961  } else {
1962  goto L250;
1963  }
1964 
1965 /* INITIATE ITERATIVE REFINEMENT IF IT HAS NOT YET BEEN USED, */
1966 /* OR RETURN AFTER RESTORING THE DIAGONAL ELEMENTS OF G. */
1967 
1968 L700:
1969  if (iterc == 0) {
1970  goto L710;
1971  }
1972  ++itref;
1973  jfinc = -1;
1974  if (itref == 1) {
1975  goto L250;
1976  }
1977 L710:
1978  if (! (*lql)) {
1979  return 0;
1980  }
1981  i__2 = *n;
1982  for (i = 1; i <= i__2; ++i) {
1983  id = iwd + i;
1984 /* L720: */
1985  g[i + i * g_dim1] = w[id];
1986  }
1987 L730:
1988  return 0;
1989 
1990 
1991 /* THE REMAINIG INSTRUCTIONS ARE USED AS SUBROUTINES. */
1992 
1993 
1994 /* ******************************************************************** */
1995 
1996 
1997 
1998 /* CALCULATE THE LAGRANGE MULTIPLIERS BY PRE-MULTIPLYING THE */
1999 /* VECTOR IN THE S-PARTITION OF W BY THE INVERSE OF R. */
2000 
2001 L740:
2002  ir = iwr + (*nact + *nact * *nact) / 2;
2003  i = *nact;
2004  sum = zero;
2005  goto L770;
2006 L750:
2007  ira = ir - 1;
2008  sum = zero;
2009  if (*nact == 0) {
2010  goto L761;
2011  }
2012  i__2 = *nact;
2013  for (j = i; j <= i__2; ++j) {
2014  iw = iww + j;
2015  sum += w[ira] * w[iw];
2016 /* L760: */
2017  ira += j;
2018  }
2019 L761:
2020  ir -= i;
2021  --i;
2022 L770:
2023  iw = iww + i;
2024  is = iws + i;
2025  w[iw] = (w[is] - sum) / w[ir];
2026  if (i > 1) {
2027  goto L750;
2028  }
2029  if (lflag == 3) {
2030  goto L390;
2031  }
2032  if (lflag == 4) {
2033  goto L571;
2034  }
2035 
2036 /* CALCULATE THE NEXT CONSTRAINT TO DROP. */
2037 
2038 L775:
2039  ip = iww + 1;
2040  ipp = iww + *nact;
2041  kdrop = 0;
2042  if (*nact == 0) {
2043  goto L791;
2044  }
2045  i__2 = *nact;
2046  for (k = 1; k <= i__2; ++k) {
2047  if (iact[k] <= *meq) {
2048  goto L790;
2049  }
2050  iw = iww + k;
2051  if (res * w[iw] >= zero) {
2052  goto L790;
2053  }
2054  temp = w[k] / w[iw];
2055  if (kdrop == 0) {
2056  goto L780;
2057  }
2058  if (abs(temp) >= abs(ratio)) {
2059  goto L790;
2060  }
2061 L780:
2062  kdrop = k;
2063  ratio = temp;
2064 L790:
2065  ;
2066  }
2067 L791:
2068  switch ((int)lflag) {
2069  case 1: goto L580;
2070  case 2: goto L650;
2071  }
2072 
2073 
2074 /* ******************************************************************** */
2075 
2076 
2077 
2078 /* DROP THE CONSTRAINT IN POSITION KDROP IN THE ACTIVE SET. */
2079 
2080 L800:
2081  ia = iwa + iact[kdrop];
2082  if (iact[kdrop] > *mn) {
2083  ia -= *n;
2084  }
2085  w[ia] = -w[ia];
2086  if (kdrop == *nact) {
2087  goto L850;
2088  }
2089 
2090 /* SET SOME INDICES AND CALCULATE THE ELEMENTS OF THE NEXT */
2091 /* GIVENS ROTATION. */
2092 
2093  iz = iwz + kdrop * *n;
2094  ir = iwr + (kdrop + kdrop * kdrop) / 2;
2095 L810:
2096  ira = ir;
2097  ir = ir + kdrop + 1;
2098 /* Computing MAX */
2099  d__3 = (d__1 = w[ir - 1], abs(d__1)), d__4 = (d__2 = w[ir], abs(d__2));
2100  temp = max(d__3,d__4);
2101 /* Computing 2nd power */
2102  d__1 = w[ir - 1] / temp;
2103 /* Computing 2nd power */
2104  d__2 = w[ir] / temp;
2105  sum = temp * sqrt(d__1 * d__1 + d__2 * d__2);
2106  ga = w[ir - 1] / sum;
2107  gb = w[ir] / sum;
2108 
2109 /* EXCHANGE THE COLUMNS OF R. */
2110 
2111  i__2 = kdrop;
2112  for (i = 1; i <= i__2; ++i) {
2113  ++ira;
2114  j = ira - kdrop;
2115  temp = w[ira];
2116  w[ira] = w[j];
2117 /* L820: */
2118  w[j] = temp;
2119  }
2120  w[ir] = zero;
2121 
2122 /* APPLY THE ROTATION TO THE ROWS OF R. */
2123 
2124  w[j] = sum;
2125  ++kdrop;
2126  i__2 = nu;
2127  for (i = kdrop; i <= i__2; ++i) {
2128  temp = ga * w[ira] + gb * w[ira + 1];
2129  w[ira + 1] = ga * w[ira + 1] - gb * w[ira];
2130  w[ira] = temp;
2131 /* L830: */
2132  ira += i;
2133  }
2134 
2135 /* APPLY THE ROTATION TO THE COLUMNS OF Z. */
2136 
2137  i__2 = *n;
2138  for (i = 1; i <= i__2; ++i) {
2139  ++iz;
2140  j = iz - *n;
2141  temp = ga * w[j] + gb * w[iz];
2142  w[iz] = ga * w[iz] - gb * w[j];
2143 /* L840: */
2144  w[j] = temp;
2145  }
2146 
2147 /* REVISE IACT AND THE LAGRANGE MULTIPLIERS. */
2148 
2149  iact[kdrop - 1] = iact[kdrop];
2150  w[kdrop - 1] = w[kdrop];
2151  if (kdrop < *nact) {
2152  goto L810;
2153  }
2154 L850:
2155  --(*nact);
2156  switch ((int)mflag) {
2157  case 1: goto L250;
2158  case 2: goto L610;
2159  }
2160 
2161 
2162 /* ******************************************************************** */
2163 
2164 
2165 
2166 /* APPLY GIVENS ROTATION TO REDUCE SOME OF THE SCALAR */
2167 /* PRODUCTS IN THE S-PARTITION OF W TO ZERO. */
2168 
2169 L860:
2170  iz = iwz + nu * *n;
2171 L870:
2172  iz -= *n;
2173 L880:
2174  is = iws + nu;
2175  --nu;
2176  if (nu == *nact) {
2177  goto L900;
2178  }
2179  if (w[is] == zero) {
2180  goto L870;
2181  }
2182 /* Computing MAX */
2183  d__3 = (d__1 = w[is - 1], abs(d__1)), d__4 = (d__2 = w[is], abs(d__2));
2184  temp = max(d__3,d__4);
2185 /* Computing 2nd power */
2186  d__1 = w[is - 1] / temp;
2187 /* Computing 2nd power */
2188  d__2 = w[is] / temp;
2189  sum = temp * sqrt(d__1 * d__1 + d__2 * d__2);
2190  ga = w[is - 1] / sum;
2191  gb = w[is] / sum;
2192  w[is - 1] = sum;
2193  i__2 = *n;
2194  for (i = 1; i <= i__2; ++i) {
2195  k = iz + *n;
2196  temp = ga * w[iz] + gb * w[k];
2197  w[k] = ga * w[k] - gb * w[iz];
2198  w[iz] = temp;
2199 /* L890: */
2200  --iz;
2201  }
2202  goto L880;
2203 L900:
2204  switch ((int)nflag) {
2205  case 1: goto L560;
2206  case 2: goto L630;
2207  }
2208 
2209 
2210 /* ******************************************************************** */
2211 
2212 
2213 
2214 /* CALCULATE THE MAGNITUDE OF X AN REVISE XMAG. */
2215 
2216 L910:
2217  sum = zero;
2218  i__2 = *n;
2219  for (i = 1; i <= i__2; ++i) {
2220  sum += (d__1 = x[i], abs(d__1)) * vfact * ((d__2 = grad[i], abs(d__2))
2221  + (d__3 = g[i + i * g_dim1] * x[i], abs(d__3)));
2222  if (*lql) {
2223  goto L920;
2224  }
2225  if (sum < 1e-30) {
2226  goto L920;
2227  }
2228  vfact *= 1e-10;
2229  sum *= 1e-10;
2230  xmag *= 1e-10;
2231 L920:
2232  ;
2233  }
2234 /* L925: */
2235  xmag = max(xmag,sum);
2236  switch ((int)jflag) {
2237  case 1: goto L420;
2238  case 2: goto L690;
2239  }
2240 
2241 
2242 /* ******************************************************************** */
2243 
2244 
2245 
2246 /* PRE-MULTIPLY THE VECTOR IN THE W-PARTITION OF W BY Z TRANSPOSE. */
2247 
2248 L930:
2249  jl = iww + 1;
2250  iz = iwz;
2251  i__2 = *n;
2252  for (i = 1; i <= i__2; ++i) {
2253  is = iws + i;
2254  w[is] = zero;
2255  iwwn = iww + *n;
2256  i__1 = iwwn;
2257  for (j = jl; j <= i__1; ++j) {
2258  ++iz;
2259 /* L940: */
2260  w[is] += w[iz] * w[j];
2261  }
2262  }
2263  switch ((int)kflag) {
2264  case 1: goto L350;
2265  case 2: goto L550;
2266  }
2267  return 0;
2268 } /* ql0002_ */
2269 
2270 #ifdef uNdEfInEd
2271 comments from the converter: (stderr from f2c)
2272  ql0001:
2273  ql0002:
2274 #endif
2275 
2276 #endif
#define FALSE_
Definition: ObjQLD.h:33
void setEps(double eps)
Definition: ObjQLD.h:77
int solve(Map< MatrixXd > &C, const Map< VectorXd > &d, const Map< MatrixXd > &A, const Map< VectorXd > &b, int me, Map< VectorXd > &x, const Map< VectorXd > &xl, const Map< VectorXd > &xu, bool factorizedC=false)
Definition: ObjQLD.cpp:15
ObjQLD class.
Definition: ObjQLD.h:52
void testObjQLD(void)
const VectorXd & getLagrangeMultipliers(void) const
Definition: ObjQLD.cpp:54
double getSizeFactor(void) const
Definition: ObjQLD.cpp:60
Optimization-based Robot Controller namespace. a library of classes to write and solve optimization p...
#define TRUE_
Definition: ObjQLD.h:32
void setSizeFactor(double f)
Definition: ObjQLD.cpp:66
double real
Definition: MathTypes.h:27
double getEps(void) const
Definition: ObjQLD.h:76