8int COI_CALLCONV
Std_Message(
int SMSG,
int DMSG,
int NMSG,
char* MSGV[],
void* USRMEM )
16 for( i=0; i<SMSG;i++ ) printf(
"%s\n", MSGV[i]);
17 for( i=0; i<DMSG;i++ ) fprintf(
fd,
"%s\n", MSGV[i]);
18 for( i=0; i<SMSG;i++ ) fprintf(
fs,
"%s\n", MSGV[i]);
21 fflush(
fd); fflush(
fs);
26int COI_CALLCONV
Std_ErrMsg(
int ROWNO,
int COLNO,
int POSNO,
const char* MSG,
void* USRMEM )
29 if ( ROWNO == -1 ) fprintf(
fd,
"Variable %d : ",COLNO);
30 else if ( COLNO == -1 ) fprintf(
fd,
"Equation %d : ",ROWNO);
31 else fprintf(
fd,
"Variable %d appearing in Equation %d : ", COLNO, ROWNO);
32 fprintf(
fd,
"%s\n", MSG);
34 if ( ROWNO == -1 ) fprintf(
fs,
"Variable %d : ",COLNO);
35 else if ( COLNO == -1 ) fprintf(
fs,
"Equation %d : ",ROWNO);
36 else fprintf(
fs,
"Variable %d appearing in Equation %d : ", COLNO, ROWNO);
37 fprintf(
fs,
"%s\n", MSG);
40 fflush(
fd); fflush(
fs);
45int COI_CALLCONV
Std_Status(
int MODSTA,
int SOLSTA,
int ITER,
double OBJVAL,
void* USRMEM )
49 printf(
"CONOPT has finished Optimizing\n");
50 printf(
"Model status = %8d\n", MODSTA);
51 printf(
"Solver status = %8d\n", SOLSTA);
52 printf(
"Iteration count = %8d\n", ITER);
53 printf(
"Objective value = %10f\n", OBJVAL);
56 fprintf(
fd,
"CONOPT has finished Optimizing\n");
57 fprintf(
fd,
"Model status = %8d\n", MODSTA);
58 fprintf(
fd,
"Solver status = %8d\n", SOLSTA);
59 fprintf(
fd,
"Iteration count = %8d\n", ITER);
60 fprintf(
fd,
"Objective value = %10f\n", OBJVAL);
63 fprintf(
fs,
"Model status = %8d\n", MODSTA);
64 fprintf(
fs,
"Solver status = %8d\n", SOLSTA);
65 fprintf(
fs,
"Objective value = %10f\n", OBJVAL);
72 fflush(
fd); fflush(
fs);
77int COI_CALLCONV
Std_Solution(
const double XVAL[],
const double XMAR[],
const int XBAS[],
const int XSTA[],
78 const double YVAL[],
const double YMAR[],
const int YBAS[],
const int YSTA[],
79 int NUMVAR,
int NUMCON,
void* USRMEM )
83 char *status[4] = {
"Lower",
"Upper",
"Basic",
"Super"};
84 fprintf(
fd,
"\n Variable Solution value Reduced cost Status\n\n");
85 for ( i=0; i<NUMVAR; i++ )
86 fprintf(
fd,
"%6d%18f%18f%10s\n", i, XVAL[i], XMAR[i], status[XBAS[i]] );
87 fprintf(
fd,
"\n Constrnt Activity level Marginal cost Status\n\n");
88 for ( i=0; i<NUMCON; i++ )
89 fprintf(
fd,
"%6d%18f%18f%10s\n", i, YVAL[i], YMAR[i], status[YBAS[i]] );
98int COI_CALLCONV
Std_TriOrd(
int mode,
int type,
int status,
int irow,
int icol,
int inf,
double value,
double resid,
void* USRMEM )
103 enum types { Pretriangular = 1,
136 fprintf(
fd,
"\n The preprocessing transformation are described below in detection order:'\n\n");
137 else if ( -2 == mode )
138 fprintf(
fd,
"\n The order of the critical transformations is:\n\n");
142 fprintf(
fd,
"Equation %6d solved with respect to variable %6d. Value= %18f\n", irow, icol, value );
144 fprintf(
fd,
"Equation %6d solved with respect to variable %6d. Value= +Infinity\n", irow, icol );
146 fprintf(
fd,
"Equation %6d solved with respect to variable %6d. Value= -Infinity\n", irow, icol );
149 fprintf(
fd,
"Variable %6d fixed at value= %18f\n", icol, value );
152 fprintf(
fd,
"Equation %6d is dependent (all variables are fixed).\n", irow );
155 fprintf(
fd,
"Equation %6d is redundant (will later be solved with respect to the slack.\n", irow );
158 fprintf(
fd,
"Equation %6d turned into lower bound on variable %6d. Bound= %18f\n", irow, icol, value );
161 fprintf(
fd,
"Equation %6d turned into upper bound on variable %6d. Bound= %18f\n", irow, icol, value );
164 fprintf(
fd,
"Ranged Equation %6d turned into two bounds on variable %6d. Bound= %18f\n", irow, icol, value );
167 fprintf(
fd,
"Variable %6d forced to lower bound= %18f\n", icol, value );
170 fprintf(
fd,
"Variable %6d forced to upper bound= %18f\n", icol, value );
173 fprintf(
fd,
"Variable %6d forced to implied bound= %18f\n", icol, value );
176 fprintf(
fd,
"Previous variables were forced by equation %6d binding as a less than or equal constraint.\n", irow );
179 fprintf(
fd,
"Previous variables were forced by equation %6d binding as a greater than or equal constraint.\n", irow );
182 fprintf(
fd,
"Equation %6d cannot be solved with respect to variable %6d due to bounds. Value= %18f\n", irow, icol, value );
185 fprintf(
fd,
"Equation %6d cannot be solved with respect to variable %6d. Infeasibility has local minimum at %18f\n", irow, icol, value );
188 fprintf(
fd,
"Equation %6d is still infeasible after the above variables have been moved to the best bounds.\n", irow );
190 case InconsistentRow:
191 fprintf(
fd,
"Equation %6d cannot be solved. No free variables left.\n", irow );
194 fprintf(
fd,
"Pretriangular action= %6d not implemented yet.\n", type );
197 if ( resid != 0.0 ) fprintf(
fd,
"Residual after last transformation= %18f\n", resid );
225 while ( (c = getchar()) != EOF && i <
MAXLINE )
pname[i++] = (char)c;
229 printf(
"Could not create CONOPT object: %s\n", msgc);
231 fc = fopen(
fname,
"w");
232 fprintf(fc,
"%s: Could not create CONOPT object.\n",
pname );
242 fc = fopen(
fname,
"w");
243 fprintf(fc,
"%s: %s.\n",
pname, msgt );
void COI_CALLCONV coiFinalize(void)
finializes the solving process for CONOPT. This must be called when using OpenMP. It will terminate t...
int COI_CALLCONV coiCreate(coiHandle_t *cntvect)
initialises and create the control vector.
int COI_CALLCONV coiFree(coiHandle_t *cntvect)
frees the control vector.
int COI_CALLCONV Std_Status(int MODSTA, int SOLSTA, int ITER, double OBJVAL, void *USRMEM)
int COI_CALLCONV Std_Message(int SMSG, int DMSG, int NMSG, char *MSGV[], void *USRMEM)
int COI_CALLCONV Std_TriOrd(int mode, int type, int status, int irow, int icol, int inf, double value, double resid, void *USRMEM)
void c_log(char *msgt, int code)
int COI_CALLCONV Std_ErrMsg(int ROWNO, int COLNO, int POSNO, const char *MSG, void *USRMEM)
int COI_CALLCONV Std_Solution(const double XVAL[], const double XMAR[], const int XBAS[], const int XSTA[], const double YVAL[], const double YMAR[], const int YBAS[], const int YSTA[], int NUMVAR, int NUMCON, void *USRMEM)