1 /****************************************************************
2 Copyright (C) 2013 AMPL Optimization LLC; written by David M. Gay.
3 
4 Permission to use, copy, modify, and distribute this software and its
5 documentation for any purpose and without fee is hereby granted,
6 provided that the above copyright notice appear in all copies and that
7 both that the copyright notice and this permission notice and warranty
8 disclaimer appear in supporting documentation.
9 
10 The author and AMPL Optimization LLC disclaim all warranties with
11 regard to this software, including all implied warranties of
12 merchantability and fitness.  In no event shall the author be liable
13 for any special, indirect or consequential damages or any damages
14 whatsoever resulting from loss of use, data or profits, whether in an
15 action of contract, negligence or other tortious action, arising out
16 of or in connection with the use or performance of this software.
17 ****************************************************************/
18 
19  struct
20 Objrep {
21 	/* For minimization (or maximization, with suitable inequality */
22 	/* sense adjustments) of Objective = c0 + c1*v */
23 	/* with v = _var[ivo] defined by constraint ico of the form */
24 	/* (_con[ico].body = c2*v + f(x)) >= rhs  with c2 > 0   or */
25 	/* (_con[ico].body = c2*v + f(x)) <= rhs  with c2 < 0, */
26 	/* We change the Objective to */
27 	/* Objective = c0 + c1*(rhs - f(x))/c2 = c0a + c12*f(x) */
28 	/* with c12 = -c1 / c2  and  c0a = c0 - c12*rhs. */
29 	/* Objective gradient = c12 * grad(f(x)). */
30 	/* We remove constraint _con[ico] and variable v; writesol */
31 	/* calls obj_adj_xy_ASL to compute v = (Objectve - c0)/c1 */
32 	/* and dual variable value -c12 for the removed constraint. */
33 
34 	int ico;	/* index of constraint that gives the objective */
35 	int ivo;	/* index of objective variable */
36 	int nxval;	/* X generation for f */
37 	void (*opify)(ASL*);	/* whether obj_adj_xy may need to call qp_opify */
38 	real c0, c0a, c1, c12, f;
39 	cgrad *cg;	/* Original gradient if modified by mqpcheck(). */
40 	cgrad *cg0;	/* Copy of cg for use in obj_adj_xy_ASL.  For solvers */
41 			/* like minos and snopt that separately evaluate the */
42 			/* linear and nonlinear parts of objectives, cg and cg0 */
43 			/* may differ. */
44 	};
45