CONOPT
Loading...
Searching...
No Matches
fvboth2.f90
Go to the documentation of this file.
1!> @file fvboth2.f90
2!! @ingroup FORT1THREAD_EXAMPLES
3!!
4!!
5!! This is the pindyck example rewritten to use both the FVforAll
6!! and FVincLin way of defining nonlinear functions. All functions, linear as
7!! well as nonlinear, will be called, and the functions must return the
8!! sum of the linear and nonlinear terms.
9!! Similar to FvBoth but with Linear Jacobian elements defined in FDEval
10!!
11!!
12!! For more information about the individual callbacks, please have a look at the source code.
13
14#if defined(_WIN32) && !defined(_WIN64)
15#define dec_directives_win32
16#endif
17
18!> Main program. A simple setup and call of CONOPT
19!!
20Program fvboth2
21 Use proginfo
23 Use data_t
24 Implicit none
25!
26! Declare the user callback routines as Integer, External:
27!
28 Integer, External :: pin_readmatrix ! Mandatory Matrix definition routine defined below
29 Integer, External :: pin_fdeval ! Function and Derivative evaluation routine
30 ! needed a nonlinear model.
31 Integer, External :: std_status ! Standard callback for displaying solution status
32 Integer, External :: pin_solution ! Specialized callback for displaying solution values
33 Integer, External :: std_message ! Standard callback for managing messages
34 Integer, External :: std_errmsg ! Standard callback for managing error messages
35#ifdef dec_directives_win32
36!DEC$ ATTRIBUTES STDCALL, REFERENCE, NOMIXED_STR_LEN_ARG :: Pin_ReadMatrix
37!DEC$ ATTRIBUTES STDCALL, REFERENCE, NOMIXED_STR_LEN_ARG :: Pin_FDEval
38!DEC$ ATTRIBUTES STDCALL, REFERENCE, NOMIXED_STR_LEN_ARG :: Std_Status
39!DEC$ ATTRIBUTES STDCALL, REFERENCE, NOMIXED_STR_LEN_ARG :: Pin_Solution
40!DEC$ ATTRIBUTES STDCALL, REFERENCE, NOMIXED_STR_LEN_ARG :: Std_Message
41!DEC$ ATTRIBUTES STDCALL, REFERENCE, NOMIXED_STR_LEN_ARG :: Std_ErrMsg
42#endif
43!
44! Control vector
45!
46 INTEGER, Dimension(:), Pointer :: cntvect
47 INTEGER :: coi_error
48!
49! Other variables
50!
51 INTEGER :: major, minor, patch
52
53 call startup
54!
55! Create and initialize a Control Vector
56!
57 coi_error = coi_create( cntvect )
58
59! Write which version of CONOPT we are using.
60
61 call coiget_version( major, minor, patch )
62 write(*,"('Solving Pindyck Model using CONOPT version ',i2,'.',i2,'.',i2)") major, minor, patch
63!
64! Define the number of time periods, T.
65!
66 t = 16
67!
68! Tell CONOPT about the size of the model by populating the Control Vector:
69!
70! Number of variables (excl. slacks): 7 per period
71!
72 coi_error = max( coi_error, coidef_numvar( cntvect, 7 * t ) )
73!
74! Number of equations: 1 objective + 6 per period
75!
76 coi_error = max( coi_error, coidef_numcon( cntvect, 1 + 6 * t ) )
77!
78! Number of nonzeros in the Jacobian. See the counting in ReadMatrix below:
79! For each period there is 1 in the objective, 16 for unlagged
80! variables and 4 for lagged variables.
81!
82 coi_error = max( coi_error, coidef_numnz( cntvect, 17 * t + 4 * (t-1) ) )
83!
84! Number of nonlinear nonzeros. 5 unlagged for each period.
85!
86 coi_error = max( coi_error, coidef_numnlnz( cntvect, 5 * t ) )
87!
88! Direction: +1 = maximization.
89!
90 coi_error = max( coi_error, coidef_optdir( cntvect, 1 ) )
91!
92! Objective: Constraint no 1
93!
94 coi_error = max( coi_error, coidef_objcon( cntvect, 1 ) )
95!
96! Define that all functions should be called.
97!
98 coi_error = max( coi_error, coidef_fvforall( cntvect, +1 ) )
99!
100! Define that functions will include linear terms
101!
102 coi_error = max( coi_error, coidef_fvinclin( cntvect, +1 ) )
103!
104! Turn function debugging on in the initial point to check if it is consistent
105! with FVforAll:
106!
107 coi_error = max( coi_error, coidef_debugfv( cntvect, -1 ) )
108!
109! Tell CONOPT about the callback routines:
110!
111 coi_error = max( coi_error, coidef_readmatrix( cntvect, pin_readmatrix ) )
112 coi_error = max( coi_error, coidef_fdeval( cntvect, pin_fdeval ) )
113 coi_error = max( coi_error, coidef_status( cntvect, std_status ) )
114 coi_error = max( coi_error, coidef_solution( cntvect, pin_solution ) )
115 coi_error = max( coi_error, coidef_message( cntvect, std_message ) )
116 coi_error = max( coi_error, coidef_errmsg( cntvect, std_errmsg ) )
117
118#if defined(CONOPT_LICENSE_INT_1) && defined(CONOPT_LICENSE_INT_2) && defined(CONOPT_LICENSE_INT_3) && defined(CONOPT_LICENSE_TEXT)
119 coi_error = max( coi_error, coidef_license( cntvect, conopt_license_int_1, conopt_license_int_2, conopt_license_int_3, conopt_license_text) )
120#endif
121
122 If ( coi_error .ne. 0 ) THEN
123 write(*,*)
124 write(*,*) '**** Fatal Error while loading CONOPT Callback routines.'
125 write(*,*)
126 call flog( "Skipping Solve due to setup errors", 1 )
127 ENDIF
128!
129! Save the solution so we can check the duals:
130!
131 do_allocate = .true.
132!
133! Start CONOPT:
134!
135 coi_error = coi_solve( cntvect )
136
137 write(*,*)
138 write(*,*) 'End of FVboth2 Model. Return code=',coi_error
139
140 If ( coi_error /= 0 ) then
141 call flog( "Errors encountered during solution", 1 )
142 elseif ( stacalls == 0 .or. solcalls == 0 ) then
143 call flog( "Status or Solution routine was not called", 1 )
144 elseif ( sstat /= 1 .or. mstat /= 2 ) then
145 call flog( "Solver and Model Status was not as expected (1,2)", 1 )
146 elseif ( abs( obj-1170.4863d0 ) > 0.0001d0 ) then
147 call flog( "Incorrect objective returned", 1 )
148 Else
149 Call checkdual( 'FVboth2', maximize )
150 endif
151
152 if ( coi_free(cntvect) /= 0 ) call flog( "Error while freeing control vector",1)
153
154 call flog( "Successful Solve", 0 )
155
156end Program fvboth2
157!
158! =====================================================================
159! Define information about the model structure
160!
161
162!> Define information about the model
163!!
164!! @include{doc} readMatrix_params.dox
165Integer Function pin_readmatrix( lower, curr, upper, vsta, type, rhs, esta, &
166 colsta, rowno, value, nlflag, n, m, nz, usrmem )
167#ifdef dec_directives_win32
168!DEC$ ATTRIBUTES STDCALL, REFERENCE, NOMIXED_STR_LEN_ARG :: Pin_ReadMatrix
169#endif
170 Use data_t
171 implicit none
172 integer, intent (in) :: n ! number of variables
173 integer, intent (in) :: m ! number of constraints
174 integer, intent (in) :: nz ! number of nonzeros
175 real*8, intent (in out), dimension(n) :: lower ! vector of lower bounds
176 real*8, intent (in out), dimension(n) :: curr ! vector of initial values
177 real*8, intent (in out), dimension(n) :: upper ! vector of upper bounds
178 integer, intent (in out), dimension(n) :: vsta ! vector of initial variable status
179 ! (not defined here)
180 integer, intent (out), dimension(m) :: type ! vector of equation types
181 integer, intent (in out), dimension(m) :: esta ! vector of initial equation status
182 ! (not defined here)
183 real*8, intent (in out), dimension(m) :: rhs ! vector of right hand sides
184 integer, intent (in out), dimension(n+1) :: colsta ! vector with start of column indices
185 integer, intent (out), dimension(nz) :: rowno ! vector of row numbers
186 integer, intent (in out), dimension(nz) :: nlflag ! vector of nonlinearity flags
187 real*8, intent (in out), dimension(nz) :: value ! vector of matrix values
188 real*8 usrmem(*) ! optional user memory
189
190 Integer :: it, is, i, icol, iz
191!
192! Define the information for the columns.
193!
194! We should not supply status information, vsta.
195!
196! We order the variables as follows:
197! td, cs, s, d, r, p, and rev. All variables for period 1 appears
198! first followed by all variables for period 2 etc.
199!
200! td, cs, s, and d have lower bounds of 0, r and p have lower
201! bounds of 1, and rev has no lower bound.
202! All have infinite upper bounds (default).
203! The initial value of td is 18, s is 7, cs is 7*t, d is td-s,
204! p is 14, and r is r(t-1)-d. No initial value for rev.
205!
206 do it = 1, t
207 is = 7*(it-1)
208 lower(is+1) = 0.d0
209 lower(is+2) = 0.d0
210 lower(is+3) = 0.d0
211 lower(is+4) = 0.d0
212 lower(is+5) = 1.d0
213 lower(is+6) = 1.d0
214 curr(is+1) = 18.d0
215 curr(is+2) = 7.d0*it
216 curr(is+3) = 7.d0
217 curr(is+4) = curr(is+1) - curr(is+3)
218 if ( it .gt. 1 ) then
219 curr(is+5) = curr(is+5-7) - curr(is+4)
220 else
221 curr(is+5) = 500.d0 - curr(is+4)
222 endif
223 curr(is+6) = 14.d0
224 enddo
225!
226! Define the information for the rows
227!
228! We order the constraints as follows: The objective is first,
229! followed by tddef, sdef, csdef, ddef, rdef, and revdef for
230! the first period, the same for the second period, etc.
231!
232! The objective is a nonbinding constraint:
233!
234 type(1) = 3
235!
236! All others are equalities:
237!
238 do i = 2, m
239 type(i) = 0
240 enddo
241!
242! Right hand sides: In all periods except the first, only tddef
243! has a nonzero right hand side of 1+2.3*1.015**(t-1).
244! In the initial period there are contributions from lagged
245! variables in the constraints that have lagged variables.
246!
247 do it = 1, t
248 is = 1 + 6*(it-1)
249 rhs(is+1) = 1.d0+2.3d0*1.015d0**(it-1)
250 enddo
251!
252! tddef: + 0.87*td(0)
253!
254 rhs(2) = rhs(2) + 0.87d0*18.d0
255!
256! sdef: +0.75*s(0)
257!
258 rhs(3) = 0.75d0*6.5d0
259!
260! csdef: +1*cs(0)
261!
262 rhs(4) = 0.d0
263!
264! rdef: +1*r(0)
265!
266 rhs(6) = 500.d0
267!
268! Define the structure and content of the Jacobian:
269! To help define the Jacobian pattern and values it can be useful to
270! make a picture of the Jacobian. We describe the variables for one
271! period and the constraints they are part of:
272!
273! td cs s d r p rev
274! Obj (1+r)**(1-t)
275! Period t:
276! tddef 1.0 0.13
277! sdef NL 1.0 NL
278! csdef 1.0 -1.0
279! ddef -1.0 1.0 1.0
280! rdef 1.0 1.0
281! revdef NL NL NL 1.0
282! Period t+1:
283! tddef -0.87
284! sdef -0.75
285! csdef -1.0
286! ddef
287! rdef -1.0
288! revdef
289!
290! The Jacobian has to be sorted column-wise so we will just define
291! the elements column by column according to the table above:
292!
293 iz = 1
294 icol = 1
295 do it = 1, t
296!
297! is points to the position before the first equation for the period
298!
299 is = 1 + 6*(it-1)
300!
301! Column td:
302!
303 colsta(icol) = iz
304 icol = icol + 1
305 rowno(iz) = is+1
306 value(iz) = +1.d0
307 nlflag(iz) = 0
308 iz = iz + 1
309 rowno(iz) = is+4
310 value(iz) = -1.d0
311 nlflag(iz) = 0
312 iz = iz + 1
313 if ( it .lt. t ) then
314 rowno(iz) = is+7
315 value(iz) = -0.87d0
316 nlflag(iz) = 0
317 iz = iz + 1
318 endif
319!
320! Column cs
321!
322 colsta(icol) = iz
323 icol = icol + 1
324 rowno(iz) = is+2
325 nlflag(iz) = 1
326 iz = iz + 1
327 rowno(iz) = is+3
328 value(iz) = +1.d0
329 nlflag(iz) = 0
330 iz = iz + 1
331 if ( it .lt. t ) then
332 rowno(iz) = is+9
333 value(iz) = -1.d0
334 nlflag(iz) = 0
335 iz = iz + 1
336 endif
337!
338! Column s
339!
340 colsta(icol) = iz
341 icol = icol + 1
342 rowno(iz) = is+2
343 value(iz) = +1.d0
344 nlflag(iz) = 0
345 iz = iz + 1
346 rowno(iz) = is+3
347 value(iz) = -1.d0
348 nlflag(iz) = 0
349 iz = iz + 1
350 rowno(iz) = is+4
351 value(iz) = +1.d0
352 nlflag(iz) = 0
353 iz = iz + 1
354 if ( it .lt. t ) then
355 rowno(iz) = is+8
356 value(iz) = -0.75d0
357 nlflag(iz) = 0
358 iz = iz + 1
359 endif
360!
361! Column d:
362!
363 colsta(icol) = iz
364 icol = icol + 1
365 rowno(iz) = is+4
366 value(iz) = +1.d0
367 nlflag(iz) = 0
368 iz = iz + 1
369 rowno(iz) = is+5
370 value(iz) = +1.d0
371 nlflag(iz) = 0
372 iz = iz + 1
373 rowno(iz) = is+6
374 nlflag(iz) = 1
375 iz = iz + 1
376!
377! Column r:
378!
379 colsta(icol) = iz
380 icol = icol + 1
381 rowno(iz) = is+5
382 value(iz) = +1.d0
383 nlflag(iz) = 0
384 iz = iz + 1
385 rowno(iz) = is+6
386 nlflag(iz) = 1
387 iz = iz + 1
388 if ( it .lt. t ) then
389 rowno(iz) = is+11
390 value(iz) = -1.d0
391 nlflag(iz) = 0
392 iz = iz + 1
393 endif
394!
395! Column p:
396!
397 colsta(icol) = iz
398 icol = icol + 1
399 rowno(iz) = is+1
400 value(iz) = +0.13d0
401 nlflag(iz) = 0
402 iz = iz + 1
403 rowno(iz) = is+2
404 nlflag(iz) = 1
405 iz = iz + 1
406 rowno(iz) = is+6
407 nlflag(iz) = 1
408 iz = iz + 1
409!
410! Column rev:
411!
412 colsta(icol) = iz
413 icol = icol + 1
414 rowno(iz) = +1
415 value(iz) = 1.05d0**(1-it)
416 nlflag(iz) = 0
417 iz = iz + 1
418 rowno(iz) = is+6
419 value(iz) = 1.d0
420 nlflag(iz) = 0
421 iz = iz + 1
422 enddo
423 colsta(icol) = iz
426
427end Function pin_readmatrix
428!
429! =====================================================================
430! Compute nonlinear terms and non-constant Jacobian elements
431!
432
433!> Compute nonlinear terms and non-constant Jacobian elements
434!!
435!! @include{doc} fdeval_params.dox
436Integer Function pin_fdeval( x, g, jac, rowno, jcnm, mode, ignerr, errcnt, &
437 n, nz, thread, usrmem )
438#ifdef dec_directives_win32
439!DEC$ ATTRIBUTES STDCALL, REFERENCE, NOMIXED_STR_LEN_ARG :: Pin_FDEval
440#endif
441 Use data_t
442 implicit none
443 integer, intent (in) :: n ! number of variables
444 integer, intent (in) :: rowno ! number of the row to be evaluated
445 integer, intent (in) :: nz ! number of nonzeros in this row
446 real*8, intent (in), dimension(n) :: x ! vector of current solution values
447 real*8, intent (in out) :: g ! constraint value
448 real*8, intent (in out), dimension(n) :: jac ! vector of derivatives for current constraint
449 integer, intent (in), dimension(nz) :: jcnm ! list of variables that appear nonlinearly
450 ! in this row. Ffor information only.
451 integer, intent (in) :: mode ! evaluation mode: 1 = function value
452 ! 2 = derivatives, 3 = both
453 integer, intent (in) :: ignerr ! if 1 then errors can be ignored as long
454 ! as errcnt is incremented
455 integer, intent (in out) :: errcnt ! error counter to be incremented in case
456 ! of function evaluation errors.
457 integer, intent (in) :: thread
458 real*8 usrmem(*) ! optional user memory
459
460 integer it, is
461 real*8 h1, h2
462!
463! Compute the number of the period
464!
465 pin_fdeval = 0
466 it = (rowno+4) / 6
467 is = 7*(it-1)
468 if ( rowno == 1 ) then
469!
470! This is the linear objective
471! Obj : sum(t,(1+r)**(1-t)*rev(t)
472!
473 if ( mode == 1 .or. mode == 3 ) then
474 g = 0.0d0
475 do it = 1, t
476 is = 7*(it-1)
477 g = g + x(is+7) * 1.05d0**(1-it)
478 enddo
479 endif
480 if ( mode == 2 .or. mode == 3 ) then
481 do it = 1, t
482 is = 7*(it-1)
483 jac(is+7) = 1.05d0**(1-it)
484 enddo
485 endif
486 else if ( rowno == (it-1)*6+2 ) then
487!
488! tddef equation. All terms: td + 0.13*p -0.87*td(t-1)
489!
490 if ( mode == 1 .or. mode == 3 ) then
491 g = x(is+1) + 0.13d0*x(is+6)
492 if ( it > 1 ) g = g - 0.87d0*x(is+1-7)
493 endif
494 if ( mode == 2 .or. mode == 3 ) then
495 jac(is+1) = 1.0d0
496 jac(is+6) = 0.13d0
497 if ( it > 1 ) jac(is+1-7) = -0.87d0
498 endif
499 else if ( rowno == (it-1)*6+3 ) then
500!
501! sdef equation. All terms: s - 0.75*s(t-1) -(1.1+0.1*p)*1.02**(-cs/7)
502!
503 h1 = (1.1d0+0.1d0*x(is+6))
504 h2 = 1.02d0**(-x(is+2)/7.d0)
505 if ( mode == 1 .or. mode == 3 ) then
506 g = x(is+3) -h1*h2
507 if ( it > 1 ) g = g - 0.75d0*x(is+3-7) ! 0.75*s(t-1) only it t > 1
508 endif
509 if ( mode == 2 .or. mode == 3 ) then
510 jac(is+2) = h1*h2*log(1.02d0)/7.d0
511 jac(is+6) = -h2*0.1d0
512 jac(is+3) = +1.0d0
513 if ( it > 1 ) jac(is+3-7) = -0.75d0
514 endif
515 else if ( rowno == (it-1)*6+4 ) then
516!
517! csdef equation. All terms: cs - s - cs(t-1)
518!
519 if ( mode == 1 .or. mode == 3 ) then
520 g = x(is+2) - x(is+3)
521 if ( it > 1 ) g = g - x(is+2-7)
522 endif
523 if ( mode == 2 .or. mode == 3 ) then
524 jac(is+2) = 1.0d0
525 jac(is+3) = -1.0d0
526 if ( it > 1 ) jac(is+2-7) = -1.0d0
527 endif
528 else if ( rowno == (it-1)*6+5 ) then
529!
530! ddef equation. All terms: -td + s + d
531!
532 if ( mode == 1 .or. mode == 3 ) then
533 g = -x(is+1) + x(is+3) + x(is+4)
534 endif
535 if ( mode == 2 .or. mode == 3 ) then
536 jac(is+1) = -1.0d0
537 jac(is+3) = 1.0d0
538 jac(is+4) = 1.0d0
539 endif
540 else if ( rowno == (it-1)*6+6 ) then
541!
542! rdef equation. All terms: d + r - r(t-1)
543!
544 if ( mode == 1 .or. mode == 3 ) then
545 g = x(is+4) + x(is+5)
546 if ( it > 1 ) g = g - x(is+5-7)
547 endif
548 if ( mode == 2 .or. mode == 3 ) then
549 jac(is+4) = 1.0d0
550 jac(is+5) = 1.0d0
551 if ( it > 1 ) jac(is+5-7) = -1.0d0
552 endif
553 elseif ( rowno == (it-1)*6+7 ) then
554!
555! revdef equation. All terms: rev - d*(p-250/r)
556!
557 if ( mode == 1 .or. mode == 3 ) then
558 g = x(is+7) -x(is+4)*(x(is+6)-250.d0/x(is+5))
559 endif
560 if ( mode == 2 .or. mode == 3 ) then
561 jac(is+4) = -(x(is+6)-250.d0/x(is+5))
562 jac(is+5) = -x(is+4)*250d0/x(is+5)**2
563 jac(is+6) = -x(is+4)
564 jac(is+7) = +1.0d0
565 endif
566 else
567!
568! We should have covered everything above so this is an error.
569!
570 pin_fdeval = 1
571 endif
572
573end Function pin_fdeval
574
575Integer Function pin_solution( XVAL, XMAR, XBAS, XSTA, YVAL, YMAR, YBAS, YSTA, N, M, USRMEM )
576#ifdef dec_directives_win32
577!DEC$ ATTRIBUTES STDCALL, REFERENCE, NOMIXED_STR_LEN_ARG :: Pin_Solution
578#endif
579!
580! Specialized solution callback routine with names for variables and constraints
581!
582 Use proginfo
583 Use data_t
584 IMPLICIT NONE
585 INTEGER, Intent(IN) :: n, m
586 INTEGER, Intent(IN), Dimension(N) :: xbas, xsta
587 INTEGER, Intent(IN), Dimension(M) :: ybas, ysta
588 real*8, Intent(IN), Dimension(N) :: xval, xmar
589 real*8, Intent(IN), Dimension(M) :: yval, ymar
590 real*8, Intent(IN OUT) :: usrmem(*)
591 character*6, parameter, dimension(7) :: vname = (/'td ','cs ','s ','d ','r ','p ','rev '/)
592 character*6, parameter, dimension(6) :: ename = (/'tddef ','sdef ','csdef ','ddef ','rdef ','revdef'/)
593
594 INTEGER :: i, it, i1
595 CHARACTER*5, Parameter, Dimension(4) :: stat = (/ 'Lower','Upper','Basic','Super' /)
596
597 WRITE(10,"(/' Variable Solution value Reduced cost B-stat'/)")
598 i = 0
599 do it = 1, t
600 DO i1 = 1, 7
601 i = i + 1
602 WRITE(10,"(1X,A6,i2,1p,E20.6,E16.6,4X,A5 )") vname(i1), it, xval(i), xmar(i), stat(1+xbas(i))
603 ENDDO
604 enddo
605
606 WRITE(10,"(/' Constrnt Activity level Marginal cost B-stat'/)")
607 i = 1
608 WRITE(10,"(1x,'Objective',1P,E19.6,E16.6,4X,A5 )") yval(i), ymar(i), stat(1+ybas(i))
609 do it = 1, t
610 do i1 = 1, 6
611 i = i + 1
612 WRITE(10,"(1x,A6,i2,1P,E20.6,E16.6,4X,A5 )") ename(i1),it, yval(i), ymar(i), stat(1+ybas(i))
613 enddo
614 ENDDO
615
616 solcalls = solcalls + 1
617 pin_solution = 0
618
619END Function pin_solution
integer function std_status(modsta, solsta, iter, objval, usrmem)
Definition comdecl.f90:88
subroutine checkdual(case, minmax)
Definition comdecl.f90:394
integer function std_message(smsg, dmsg, nmsg, llen, usrmem, msgv)
Definition comdecl.f90:205
integer function std_errmsg(rowno, colno, posno, msglen, usrmem, msg)
Definition comdecl.f90:248
program fvboth2
Main program. A simple setup and call of CONOPT.
Definition fvboth2.f90:22
integer function pin_fdeval(x, g, jac, rowno, jcnm, mode, ignerr, errcnt, n, nz, thread, usrmem)
Compute nonlinear terms and non-constant Jacobian elements.
Definition fvboth.f90:425
integer function pin_readmatrix(lower, curr, upper, vsta, type, rhs, esta, colsta, rowno, value, nlflag, n, m, nz, usrmem)
Define information about the model.
Definition fvboth.f90:157
integer function pin_solution(xval, xmar, xbas, xsta, yval, ymar, ybas, ysta, n, m, usrmem)
Definition fvboth.f90:531
integer(c_int) function coidef_message(cntvect, coi_message)
define callback routine for handling messages returned during the solution process.
Definition conopt.f90:1265
integer(c_int) function coidef_solution(cntvect, coi_solution)
define callback routine for returning the final solution values.
Definition conopt.f90:1238
integer(c_int) function coidef_status(cntvect, coi_status)
define callback routine for returning the completion status.
Definition conopt.f90:1212
integer(c_int) function coidef_readmatrix(cntvect, coi_readmatrix)
define callback routine for providing the matrix data to CONOPT.
Definition conopt.f90:1111
integer(c_int) function coidef_errmsg(cntvect, coi_errmsg)
define callback routine for returning error messages for row, column or Jacobian elements.
Definition conopt.f90:1291
integer(c_int) function coidef_fdeval(cntvect, coi_fdeval)
define callback routine for performing function and derivative evaluations.
Definition conopt.f90:1135
integer(c_int) function coidef_fvforall(cntvect, fvforall)
call the FDEval for all constraints, including linear constraints.
Definition conopt.f90:1083
integer(c_int) function coidef_license(cntvect, licint1, licint2, licint3, licstring)
define the License Information.
Definition conopt.f90:293
integer(c_int) function coidef_debugfv(cntvect, debugfv)
turn Debugging of FDEval on and off.
Definition conopt.f90:387
integer(c_int) function coidef_fvinclin(cntvect, fvinclin)
include the linear terms in function evaluations.
Definition conopt.f90:1053
integer(c_int) function coidef_numvar(cntvect, numvar)
defines the number of variables in the model.
Definition conopt.f90:97
integer(c_int) function coidef_numcon(cntvect, numcon)
defines the number of constraints in the model.
Definition conopt.f90:121
integer(c_int) function coidef_numnlnz(cntvect, numnlnz)
defines the Number of Nonlinear Nonzeros.
Definition conopt.f90:167
integer(c_int) function coidef_optdir(cntvect, optdir)
defines the Optimization Direction.
Definition conopt.f90:213
integer(c_int) function coidef_numnz(cntvect, numnz)
defines the number of nonzero elements in the Jacobian.
Definition conopt.f90:144
integer(c_int) function coidef_objcon(cntvect, objcon)
defines the Objective Constraint.
Definition conopt.f90:239
integer(c_int) function coi_create(cntvect)
initializes CONOPT and creates the control vector.
Definition conopt.f90:1726
integer(c_int) function coi_free(cntvect)
frees the control vector.
Definition conopt.f90:1749
subroutine coiget_version(major, minor, patch)
returns the version number. It can be used to ensure that the modeler is linked to the correct versio...
Definition conopt.f90:1645
integer(c_int) function coi_solve(cntvect)
method for starting the solving process of CONOPT.
Definition conopt.f90:1625
real *8 obj
Definition comdecl.f90:16
integer solcalls
Definition comdecl.f90:15
integer sstat
Definition comdecl.f90:18
integer stacalls
Definition comdecl.f90:14
subroutine flog(msg, code)
Definition comdecl.f90:62
logical do_allocate
Definition comdecl.f90:27
integer, parameter maximize
Definition comdecl.f90:31
integer mstat
Definition comdecl.f90:17
subroutine startup
Definition comdecl.f90:41