CONOPT
Loading...
Searching...
No Matches
comdecl.f90
Go to the documentation of this file.
1#if defined(_WIN32) && !defined(_WIN64)
2#define dec_directives_win32
3#endif
4
5Module proginfo
6!
7! Module with information about the progress of the program used to
8! check if the examples execute properly and write messages accordingly.
9!
10 IMPLICIT NONE
11 Character(len=128):: Progname ! Program name
12 Integer :: Stacalls = 0 ! Number of times Std_Status has been called
13 Integer :: solcalls = 0 ! Number of times Std_Solution has been called
14 real*8 :: obj ! Objective in last Std_Status
15 Integer :: mstat = 0 ! Value of MODSTA in last Std_Status
16 Integer :: sstat = 0 ! Value of SOLSTA in last Std_Status
17 Integer :: miter = 0 ! Value of ITER in last Std_Status
18 Integer :: c_infeas = 0 ! Count of infeasibilities in last Std_Solution
19 Integer :: c_nonopt = 0 ! Count of non-optimalities in last Std_Solution
20 Integer :: c_unbnd = 0 ! Count of unbounded in last Std_Solution
21 real*8, Dimension(:), Pointer :: xprim, xdual ! Primal and dual values for variables
22 real*8, Dimension(:), Pointer :: uprim, udual ! Primal and dual values for equations
23 Integer, Dimension(:), Pointer :: xbasc, xstat ! Basis and Status value for variables
24 Integer, Dimension(:), Pointer :: ubasc, ustat ! Basis and Status value for equations
25 Logical :: do_allocate ! If set to .true. then allocate above vectors at first call to Std_Solution
26 Integer :: maxvar, maxcon ! If defined then these sizes are used to allocate space
27 ! for variable and constraint related vectors with Do_allocate
29 Integer, Parameter :: minimize = 1, maximize = 2, infeasible = 3
30! Basis status for variables:
31 Integer, Parameter :: bslower = 0, bsupper = 1, bsbasic = 2, bssuper = 3
32
33 Contains
34!
35! Nullify pointers, get the name of the program, and write the first
36! status-line with "Starting to execute".
37!
38 Subroutine startup
39!$ Use OMP_Lib
40 IMPLICIT NONE
41!$ Integer :: MaxThread
42 Nullify(xprim); Nullify(xdual)
43 Nullify(uprim); Nullify(udual)
44 read(*,"(A)") progname
45 call flog( "Starting to execute", 0 )
46!
47! Open the Progname.lst and Progname.sta files on unit 10 and 11
48!
49 open(10,file=trim(progname) // '.lst',status='Unknown')
50 open(11,file=trim(progname) // '.sta',status='Unknown')
51 do_allocate = .false.
52 maxvar = 0; maxcon = 0
53!$ maxthread = OMP_GET_MAX_THREADS() ! We make the call to force the right libraries to be loaded.
54 End Subroutine startup
55!
56! Write a one-line status report used to monitor in the Progname.rc file
57! how far the program has progressed.
58!
59 Subroutine flog( Msg, Code )
60 IMPLICIT NONE
61 character(len=*), Intent(IN) :: Msg
62 Integer, Intent(IN) :: Code
63
64 open(15,file=trim(progname) // '.rc',action='write',form='formatted',status='unknown')
65 write(15,"(A,': ',A)") trim(progname), msg
66 close(15)
67 if ( code /= 0 ) then ! Error return.
68 close(10) ! Close the Status and
69 close(11) ! Document files and
70 stop 1 ! Stop
71 Endif
72 End Subroutine flog
73
74End Module proginfo
75!
76! Standard routines for Message, Status, Solution, and ErrMsg called
77! Std_Message, Std_Status, Std_Solution, and Std_ErrMsg.
78! The routines assume that the documentation file is opened as unit
79! 10 and that the status file is opened as unit 11.
80! The routines are use in the model if they are defined as callbacks
81! using the COIDEF_* routines. Otherwise, they will be ignored.
82! The routines are intended as inspiration for some more realistic
83! and useful implementations.
84!
85Integer Function std_status( MODSTA, SOLSTA, ITER, OBJVAL, USRMEM )
86#ifdef dec_directives_win32
87!DEC$ ATTRIBUTES STDCALL, REFERENCE, NOMIXED_STR_LEN_ARG :: Std_Status
88#endif
89!
90! Simple implementation in which we write to all files
91!
92 Use proginfo
93 IMPLICIT NONE
94 INTEGER, Intent(IN) :: modsta, solsta, iter
95 real*8, Intent(IN) :: objval
96 real*8, Intent(IN OUT) :: usrmem(*)
97
98 WRITE(*,*)
99 WRITE(*,*) 'CONOPT has finished optimizing.'
100 WRITE(*,*) 'Model status =',modsta
101 WRITE(*,*) 'Solver status =',solsta
102 WRITE(*,*) 'Iteration count=',iter
103 WRITE(*,*) 'Objective value=',objval
104
105 WRITE(10,*)
106 WRITE(10,*) 'CONOPT has finished optimizing.'
107 WRITE(10,*) 'Model status =',modsta
108 WRITE(10,*) 'Solver status =',solsta
109 WRITE(10,*) 'Iteration count=',iter
110 WRITE(10,*) 'Objective value=',objval
111
112 WRITE(11,*)
113 WRITE(11,*) 'Model status =',modsta
114 WRITE(11,*) 'Solver status =',solsta
115 WRITE(11,*) 'Objective value=',objval
116 Call flush(10)
117 Call flush(11)
118
119 stacalls = stacalls + 1
120 obj = objval
121 mstat = modsta
122 sstat = solsta
123 miter = iter
124
125 std_status = 0
126
127END Function std_status
128
129Integer Function std_solution( XVAL, XMAR, XBAS, XSTA, YVAL, YMAR, YBAS, YSTA, N, M, USRMEM )
130#ifdef dec_directives_win32
131!DEC$ ATTRIBUTES STDCALL, REFERENCE, NOMIXED_STR_LEN_ARG :: Std_Solution
132#endif
133!
134! Simple implementation in which we write the solution values to
135! the 'Documentation file' on unit 10.
136! If Xprim and Uprim are allocated with enough space, the primal and
137! dual solutions are also saved to Xprim and Uprim.
138!
139 Use proginfo
140 IMPLICIT NONE
141 INTEGER, Intent(IN) :: n, m
142 INTEGER, Intent(IN), Dimension(N) :: xbas, xsta
143 INTEGER, Intent(IN), Dimension(M) :: ybas, ysta
144 real*8, Intent(IN), Dimension(N) :: xval, xmar
145 real*8, Intent(IN), Dimension(M) :: yval, ymar
146 real*8, Intent(IN OUT) :: usrmem(*)
147
148 INTEGER :: i, na, ma
149 CHARACTER*5, Parameter, Dimension(4) :: basc = (/ 'Lower','Upper','Basic','Super' /)
150 CHARACTER*6, Parameter, Dimension(4) :: stat = (/ 'Normal','NonOpt','Infeas','Unbnd ' /)
151
152 c_infeas = 0
153 c_nonopt = 0
154 c_unbnd = 0
155 WRITE(10,"(/' Variable Solution value Reduced cost Var-Basc Var-stat')")
156 DO i = 1, n
157 WRITE(10,"(1P,I7,E20.6,E16.6,4X,A5,7X,A6 )") i, xval(i), xmar(i), basc(1+xbas(i)), stat(1+xsta(i))
158 if ( xsta(i) == 1 ) c_nonopt = c_nonopt + 1
159 if ( xsta(i) == 2 ) c_infeas = c_infeas + 1
160 if ( xsta(i) == 3 ) c_unbnd = c_unbnd + 1
161 ENDDO
162
163 WRITE(10,"(/' Constrnt Activity level Marginal cost Con-Basc Con-stat')")
164 DO i = 1, m
165 WRITE(10,"(1P,I7,E20.6,E16.6,4X,A5,7X,A6 )") i, yval(i), ymar(i), basc(1+ybas(i)), stat(1+ysta(i))
166 if ( ysta(i) == 1 ) c_nonopt = c_nonopt + 1
167 if ( ysta(i) == 2 ) c_infeas = c_infeas + 1
168 if ( ysta(i) == 3 ) c_unbnd = c_unbnd + 1
169 ENDDO
170 if ( c_nonopt > 0 ) write(10,"(/' Number of non-optimalities =',i5)") c_nonopt
171 if ( c_infeas > 0 ) write(10,"(/' Number of infeasibilities =',i5)") c_infeas
172 Call flush(10)
173 Call flush(11)
174
175 If ( do_allocate ) Then
176 If ( maxvar > 0 ) then; na = maxvar; else; na = n; Endif
177 If ( maxcon > 0 ) then; ma = maxcon; else; ma = m; Endif
178 Allocate( xprim(na), xdual(na), uprim(ma), udual(ma), xbasc(na), xstat(na), ubasc(ma), ustat(ma) )
179 do_allocate = .false.
180 Endif
181 If ( associated(xprim) .and. associated(xdual) .and. associated(uprim) .and. associated(udual) ) Then
182 If ( Size(xprim) >= n .and. Size(xdual) >= n .AND. Size(uprim) >= m .and. Size(udual) >= m ) Then
183 xprim(1:n) = xval(1:n)
184 xdual(1:n) = xmar(1:n)
185 uprim(1:m) = yval(1:m)
186 udual(1:m) = ymar(1:m)
187 Endif
188 Endif
189 If ( associated(xbasc) .and. associated(xstat) .and. associated(ubasc) .and. associated(ustat) ) Then
190 If ( Size(xbasc) >= n .and. Size(xstat) >= n .AND. Size(ubasc) >= m .and. Size(ustat) >= m ) Then
191 xbasc(1:n) = xbas(1:n)
192 xstat(1:n) = xsta(1:n)
193 ubasc(1:m) = ybas(1:m)
194 ustat(1:m) = ysta(1:m)
195 Endif
196 Endif
197 solcalls = solcalls + 1
198 std_solution = 0
199
200END Function std_solution
201
202Integer Function std_message( SMSG, DMSG, NMSG, LLEN, USRMEM, MSGV )
203#ifdef dec_directives_win32
204!DEC$ ATTRIBUTES STDCALL, REFERENCE, NOMIXED_STR_LEN_ARG :: Std_Message
205#endif
206!
207! Simple implementation in which we only write the 'Screen file'
208! to unit *, the 'Status file' to unit 11, and the 'Documentation file'
209! to unit 10.
210!
211 Use proginfo
212 IMPLICIT NONE
213
214 INTEGER, Intent(IN) :: smsg, dmsg, nmsg
215 INTEGER, Intent(IN) , Dimension(*) :: llen
216 CHARACTER(Len=133), Intent(IN), Dimension(*) :: msgv
217 real*8, Intent(IN OUT) :: usrmem(*)
218
219 Integer :: i
220!
221! write to screen
222!
223 do i = 1, smsg
224 write(*,"(A)") msgv(i)(1:llen(i))
225 enddo
226!
227! write to status file
228!
229 do i = 1, nmsg
230 write(11,"(A)") msgv(i)(1:llen(i))
231 enddo
232!
233! write to document file
234!
235 do i = 1, dmsg
236 write(10,"(A)") msgv(i)(1:llen(i))
237 enddo
238 Call flush(10)
239 Call flush(11)
240
241 std_message = 0
242
243END Function std_message
244
245Integer Function std_errmsg( ROWNO, COLNO, POSNO, MSGLEN, USRMEM, MSG )
246#ifdef dec_directives_win32
247!DEC$ ATTRIBUTES STDCALL, REFERENCE, NOMIXED_STR_LEN_ARG :: Std_ErrMsg
248#endif
249!
250! Simple implementation of ErrMsg in which we just write 'Variable XX',
251! 'Equation YY' or 'Variable XX appearing in Equation YY' followed by
252! the text. We write both to the 'Documentation file' on unit 10 and
253! to the 'Status File' on unit 11.
254!
255 Use proginfo
256 IMPLICIT NONE
257
258 INTEGER, Intent(IN) :: rowno, colno, posno, msglen
259 CHARACTER(len=*), Intent(IN) :: msg
260 real*8, Intent(IN OUT) :: usrmem(*)
261!
262! If Rowno = 0 then the message is about a Column.
263! If Colno = 0 then the message is abuut a Row.
264! Otherwise, the message is about (Rowno,Colno)
265!
266 IF ( rowno .EQ. 0 ) THEN ! Must be a column (error) message
267 WRITE(10,1001) colno, msg(1:msglen)
268 WRITE(11,1001) colno, msg(1:msglen)
269 ELSEIF ( colno .EQ. 0 ) THEN ! Must be a row (error) message
270 WRITE(10,1002) rowno, msg(1:msglen)
271 WRITE(11,1002) rowno, msg(1:msglen)
272 ELSE ! Must be a (row,col) (error) message
273 WRITE(10,1000) colno, rowno, msg(1:msglen)
274 WRITE(11,1000) colno, rowno, msg(1:msglen)
275 ENDIF
276 Call flush(10)
277 Call flush(11)
2781002 FORMAT('Equation',i8,' : ',a)
2791001 FORMAT('Variable',i8,' : ',a)
2801000 FORMAT('Variable',i8,' appearing in Equation',i8,' : ',a)
281
282 std_errmsg = 0
283
284END Function std_errmsg
285
286Integer Function std_triord( Mode, Type, Status, Irow, Icol, Inf, Value, Resid, Usrmem )
287#ifdef dec_directives_win32
288!DEC$ ATTRIBUTES STDCALL, REFERENCE, NOMIXED_STR_LEN_ARG :: Std_TriOrd
289#endif
290!
291! Simple implementation of the TriOrd callback routine.
292!
293 Implicit NONE
294 INTEGER, INTENT(IN) :: mode, Type, status, irow, icol, inf
295 real*8, INTENT(IN) :: VALUE, resid
296 real*8, Intent(IN OUT) :: usrmem(*)
297
298! This list has been copied here from src/preaction.inc
299! Eventually, it should maybe move into conopt.f90 and conopt.h.
300 Integer, Parameter :: pretriangular = 1, & ! Fix a structural variable from an equality equation
301 fixedcolumn = 2, & ! Fix a structural variable from equal lower and upper bouunds
302 dependentrow = 3, & ! All structural variables are fixed and the row is feasible
303 redundantrow = 4, & ! The row is feasible due to bounds on all variables.
304 impliedlower = 5, & ! Change a simple inequality to a lower bound
305 impliedupper = 6, & ! Change a simple inequality to an upper bound
306 impliedrange = 7, & ! Changed a ranged constraint to both a lower and an upper bound.
307 forcedlower = 8, & ! A variable is forced to the lower bound by a ForcingLower or
308 ! ForcingUpper constraint.
309 forcedupper = 9, & ! A variable is forced to the upper bound by a ForcingLower or
310 ! ForcingUpper constraint.
311 forcedvalue = 10, & ! A variable if forced to a value equal to an implied but not
312 ! original bound by a ForcingLower or ForcingUpper constraint
313 forcinglower = 11, & ! A constraint is forcing all variables in it to a bound
314 ! and it works as an =L= constraint.
315 forcingupper = 12, & ! A constraint is forcing all variables in it to a bound
316 ! and it works as an =G= constraint.
317!
318! Any of the next actions will terminate the pre-processor and there can therefore only be one of them
319! and only in an infeasible model.
320!
321 pretriainfeasb = 13, & ! An equation has only one nonfixed variable, but it cannot
322 ! be solved because the variable will exceed a bound.
323 pretriainfeasl = 14, & ! An equation has only one nonfixed variable, but it cannot
324 ! be solved because the infeasibility is at a (local) minimum.
325 forcinginfeas = 15, & ! A constraint is infeasible due to bounds on all variables
326 inconsistentrow = 16, & ! All structural variables are fixed and the row in infeasible
327 wforcinginfeas = 17, & ! A constraint is forcing but based on weak bound so no traceback
328!
329! FixedDual is only used if the preprocessor terminates properly (feasible) and is always last
330!
331 fixeddual = 18 ! A variable is fixed based on dual information.
332
333 If ( mode == -1 ) THEN
334 write(10,"(/'The preprocessing transformation are described below in detection order:'/)")
335 Else if ( mode == -2 ) Then
336 write(10,"(//'The order of the critical transformations is:'/)")
337 Endif
338 Select case (type)
339 Case (pretriangular)
340 If ( inf == 0 ) Then
341 WRITE(10,"('Equation',i7,' solved with respect to variable',i7,'. Value=',1p,e18.10)") irow, icol, value
342 Elseif ( inf == 1 ) Then
343 WRITE(10,"('Equation',i7,' solved with respect to variable',i7,'. Value=',9x,'+Infinity')") irow, icol
344 Else
345 WRITE(10,"('Equation',i7,' solved with respect to variable',i7,'. Value=',9x,'-Infinity')") irow, icol
346 Endif
347 Case (fixedcolumn)
348 WRITE(10,"('Variable',i7,' fixed at value=',1p,e18.10)") icol, value
349 Case (dependentrow)
350 WRITE(10,"('Equation',i7,' is dependent (all variables are fixed.)')") irow
351 Case (redundantrow)
352 WRITE(10,"('Equation',i7,' is redundant (will later be solved with respect to the slack.)')") irow
353 Case (impliedlower)
354 WRITE(10,"('Equation',i7,' turned into lower bound on variable',i7,'. Bound=',1p,e18.10)") irow, icol, value
355 Case (impliedupper)
356 WRITE(10,"('Equation',i7,' turned into upper bound on variable',i7,'. Bound=',1p,e18.10)") irow, icol, value
357 Case (impliedrange)
358 WRITE(10,"('Ranged Equation',i7,' turned into two bounds on variable',i7,'. Bound=',1p,e18.10)") irow, icol, value
359 Case (forcedlower)
360 WRITE(10,"('Variable',i7,' forced to lower bound=',1p,e18.10)") icol, value
361 Case (forcedupper)
362 WRITE(10,"('Variable',i7,' forced to upper bound=',1p,e18.10)") icol, value
363 Case (forcedvalue)
364 WRITE(10,"('Variable',i7,' forced to implied bound=',1p,e18.10)") icol, value
365 Case (forcinglower)
366 WRITE(10,"('Previous variables were forced by equation',i7,' binding as a less than or equal constraint.')") irow
367 Case (forcingupper)
368 WRITE(10,"('Previous variables were forced by equation',i7,' binding as a greater than or equal constraint.')") irow
369 Case (pretriainfeasb)
370 WRITE(10,"('Equation',i7,' cannot be solved with respect to variable',i7,' due to bounds. Value=',1p,e18.10)") &
371 irow, icol, value
372 Case (pretriainfeasl)
373 WRITE(10, &
374 "('Equation',i7,' cannot be solved with respect to variable',i7,'. Infeasibility has local minimum at',1p,e18.10)") &
375 irow, icol, value
376 Case (forcinginfeas)
377 WRITE(10,"('Equation',i7,' is still infeasible after the above variables have been forced to their best bounds.')") irow
378 Case (inconsistentrow)
379 WRITE(10,"('Equation',i7,' cannot be solved. No free variables left.')") irow
380 Case Default
381 WRITE(10,"('Pretriangular action=',i7,' not implemented yet.')") type
382 stop 1
383 End Select
384 If ( resid /= 0.d0 ) write(10,"('Residual after last transformation=',1p,e18.10)") resid
385 Call flush(10)
386
387 std_triord = 0
388
389End Function std_triord
390
391Subroutine checkdual( Case, MinMax )
392!
393! This routine can check if the status and dual information is
394! consistent.
395! Case is a string to be added in front of any error messages.
396! MinMax defines termination status of the model according to
397! Integer, Parameter :: Minimize = 1, Maximize = 2, Infeasible = 3
398! The solution must not be in an intermediate state.
399!
400! The solution must have been saved using DO_Allocate and the size
401! of the model must correspond to the sizes of the allocated vectors,
402! i.e. MaxVar and MaxCon cannot be used with this routine.
403!
404 Use proginfo
405 Implicit NONE
406 Character(Len=*), Intent(IN) :: Case
407 INTEGER, INTENT(IN) :: MinMax
408
409 real*8, Parameter :: opttol = 2.d-6
410 Integer :: I
411 Character(Len=120) Text
412
413 If ( solcalls <= 0 ) Return
414 If ( .not. ( associated(xprim) .and. associated(xdual) .and. associated(uprim) .and. associated(udual) ) ) Return
415 If ( .not. ( associated(xbasc) .and. associated(xstat) .and. associated(ubasc) .and. associated(ustat) ) ) Return
416!
417! Check variable status. Must be normal
418!
419 do i = 1, Size(xstat)
420 If ( xstat(i) /= 0 ) then
421 write(text, "(A,': Status of variable',i6,' is not zero(normal). Is',i10)") Case, i, xstat(i)
422 call flog( trim(text), 1 )
423 Endif
424 Enddo
425!
426! Check Variable Basis status is consistent with the reduced cost in Xdual
427!
428 do i = 1, size(xbasc)
429 select case(xbasc(i))
430 case(bslower)
431 if ( minmax == maximize ) then
432 if ( xdual(i) > opttol ) then
433 write(text, "(A,': Max and variable',i6,' at lower. Reduced cost is positive:',1p,d15.6)") Case, i, xdual(i)
434 call flog( trim(text), 1 )
435 Endif
436 else ! Minimize or infeasible
437 if ( xdual(i) < -opttol ) then
438 write(text, "(A,': Min and variable',i6,' at lower. Reduced cost is negative:',1p,d15.6)") Case, i, xdual(i)
439 call flog( trim(text), 1 )
440 Endif
441 endif
442 case(bsupper)
443 if ( minmax == maximize ) then
444 if ( xdual(i) < -opttol ) then
445 write(text, "(A,': Max and variable',i6,' at upper. Reduced cost is negative:',1p,d15.6)") Case, i, xdual(i)
446 call flog( trim(text), 1 )
447 Endif
448 else ! Minimize or infeasible
449 if ( xdual(i) > opttol ) then
450 write(text, "(A,': Min and variable',i6,' at upper. Reduced cost is positive:',1p,d15.6)") Case, i, xdual(i)
451 call flog( trim(text), 1 )
452 Endif
453 endif
454 case(bsbasic)
455 if ( xdual(i) /= 0.d0 ) then
456 write(text, "(A,': Basic variable',i6,' does not have reduced cost zero. Is',1p,d15.6)") Case, i, xdual(i)
457 call flog( trim(text), 1 )
458 Endif
459 case(bssuper)
460 if ( abs( xdual(i) ) > opttol ) then
461 write(text, "(A,': Superbasic variable',i6,' does not have small reduced cost. Is',1p,d15.6)") Case, i, xdual(i)
462 call flog( trim(text), 1 )
463 Endif
464 case default
465 write(text, "(A,': Variable',i6,' bas illegal basis status:',I10)") Case, i, xbasc(i)
466 call flog( trim(text), 1 )
467 end select
468 enddo
469!
470! Check Equation status. Must be normal if the model is not infeasible
471!
472 if ( minmax /= infeasible ) then
473 do i = 1, Size(ustat)
474 If ( ustat(i) /= 0 ) then
475 write(text, "(A,': Status of constraint',i6,' is not zero(normal). Is',i10)") Case, i, ustat(i)
476 call flog( trim(text), 1 )
477 Endif
478 Enddo
479 Endif
480!
481! Check Constraint Basis status is consistent with the reduced cost in Xdual
482!
483 do i = 1, size(ubasc)
484 select case(ubasc(i))
485 case(bslower)
486 if ( minmax == maximize ) then
487 if ( udual(i) > opttol ) then
488 write(text, "(A,': Max and constraint',i6,' at lower. Reduced cost is positive:',1p,d15.6)") Case, i, udual(i)
489 call flog( trim(text), 1 )
490 Endif
491 else ! Minimize or infeasible
492 if ( udual(i) < -opttol ) then
493 write(text, "(A,': Min and constraint',i6,' at lower. Reduced cost is negative:',1p,d15.6)") Case, i, udual(i)
494 call flog( trim(text), 1 )
495 Endif
496 endif
497 case(bsupper)
498 if ( minmax == maximize ) then
499 if ( udual(i) < -opttol ) then
500 write(text, "(A,': Max and constraint',i6,' at upper. Reduced cost is negative:',1p,d15.6)") Case, i, udual(i)
501 call flog( trim(text), 1 )
502 Endif
503 else ! Minimize or infeasible
504 if ( udual(i) > opttol ) then
505 write(text, "(A,': Min and constraint',i6,' at upper. Reduced cost is positive:',1p,d15.6)") Case, i, udual(i)
506 call flog( trim(text), 1 )
507 Endif
508 endif
509 case(bsbasic)
510 if ( minmax /= infeasible .and. udual(i) /= 0.d0 ) then
511 write(text, "(A,': Basic constraint',i6,' does not have reduced cost zero. Is',1p,d15.6)") Case, i, udual(i)
512 call flog( trim(text), 1 )
513 Endif
514 case(bssuper)
515 if ( minmax /= infeasible .and. abs( udual(i) ) > opttol ) then
516 write(text, "(A,': Superbasic constraint',i6,' does not have small reduced cost. Is',1p,d15.6)") Case, i, udual(i)
517 call flog( trim(text), 1 )
518 Endif
519 case default
520 write(text, "(A,': Constraint',i6,' bas illegal basis status:',I10)") Case, i, ubasc(i)
521 call flog( trim(text), 1 )
522 end select
523 enddo
524
525End Subroutine checkdual
integer function std_solution(xval, xmar, xbas, xsta, yval, ymar, ybas, ysta, n, m, usrmem)
Definition comdecl.f90:132
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_triord(mode, type, status, irow, icol, inf, value, resid, usrmem)
Definition comdecl.f90:289
integer function std_errmsg(rowno, colno, posno, msglen, usrmem, msg)
Definition comdecl.f90:248
real *8 obj
Definition comdecl.f90:16
integer, dimension(:), pointer ubasc
Definition comdecl.f90:26
integer c_nonopt
Definition comdecl.f90:21
integer, parameter bssuper
Definition comdecl.f90:33
integer solcalls
Definition comdecl.f90:15
integer maxvar
Definition comdecl.f90:28
integer sstat
Definition comdecl.f90:18
real *8, dimension(:), pointer udual
Definition comdecl.f90:24
integer, parameter bslower
Definition comdecl.f90:33
real *8, dimension(:), pointer xdual
Definition comdecl.f90:23
integer, dimension(:), pointer xstat
Definition comdecl.f90:25
integer c_infeas
Definition comdecl.f90:20
integer, dimension(:), pointer xbasc
Definition comdecl.f90:25
integer, dimension(:), pointer ustat
Definition comdecl.f90:26
integer, parameter infeasible
Definition comdecl.f90:31
integer, parameter bsbasic
Definition comdecl.f90:33
integer maxcon
Definition comdecl.f90:28
integer, parameter minimize
Definition comdecl.f90:31
integer stacalls
Definition comdecl.f90:14
integer, parameter bsupper
Definition comdecl.f90:33
subroutine flog(msg, code)
Definition comdecl.f90:62
logical do_allocate
Definition comdecl.f90:27
integer, parameter maximize
Definition comdecl.f90:31
integer miter
Definition comdecl.f90:19
real *8, dimension(:), pointer xprim
Definition comdecl.f90:23
real *8, dimension(:), pointer uprim
Definition comdecl.f90:24
integer mstat
Definition comdecl.f90:17
subroutine startup
Definition comdecl.f90:41
integer c_unbnd
Definition comdecl.f90:22