Scippy

SCIP

Solving Constraint Integer Programs

nlp.h
Go to the documentation of this file.
1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2 /* */
3 /* This file is part of the program and library */
4 /* SCIP --- Solving Constraint Integer Programs */
5 /* */
6 /* Copyright (C) 2002-2022 Konrad-Zuse-Zentrum */
7 /* fuer Informationstechnik Berlin */
8 /* */
9 /* SCIP is distributed under the terms of the ZIB Academic License. */
10 /* */
11 /* You should have received a copy of the ZIB Academic License */
12 /* along with SCIP; see the file COPYING. If not visit scipopt.org. */
13 /* */
14 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
15 
16 /**@file nlp.h
17  * @ingroup INTERNALAPI
18  * @brief internal methods for NLP management
19  * @author Thorsten Gellermann
20  * @author Stefan Vigerske
21  */
22 
23 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
24 
25 #ifndef __SCIP_NLP_H__
26 #define __SCIP_NLP_H__
27 
28 
29 #include <stdio.h>
30 
31 #include "scip/def.h"
32 #include "blockmemshell/memory.h"
33 #include "scip/type_event.h"
34 #include "scip/type_set.h"
35 #include "scip/type_stat.h"
36 #include "scip/type_misc.h"
37 #include "scip/type_lp.h"
38 #include "scip/type_var.h"
39 #include "scip/type_prob.h"
40 #include "scip/type_sol.h"
41 #include "scip/type_primal.h"
42 #include "scip/pub_nlp.h"
43 
44 #ifdef __cplusplus
45 extern "C" {
46 #endif
47 
48 /**@name Nonlinear row methods */
49 /**@{ */
50 
51 /** create a new nonlinear row
52  *
53  * the new row is already captured
54  */
56  SCIP_NLROW** nlrow, /**< buffer to store pointer to nonlinear row */
57  BMS_BLKMEM* blkmem, /**< block memory */
58  SCIP_SET* set, /**< global SCIP settings */
59  SCIP_STAT* stat, /**< problem statistics data */
60  const char* name, /**< name of nonlinear row */
61  SCIP_Real constant, /**< constant */
62  int nlinvars, /**< number of linear variables */
63  SCIP_VAR** linvars, /**< linear variables, or NULL if nlinvars == 0 */
64  SCIP_Real* lincoefs, /**< linear coefficients, or NULL if nlinvars == 0 */
65  SCIP_EXPR* expr, /**< expression, or NULL */
66  SCIP_Real lhs, /**< left hand side */
67  SCIP_Real rhs, /**< right hand side */
68  SCIP_EXPRCURV curvature /**< curvature of the nonlinear row */
69  );
70 
71 /** create a nonlinear row that is a copy of a given row
72  *
73  * the new row is already captured
74  */
76  SCIP_NLROW** nlrow, /**< buffer to store pointer to nonlinear row */
77  BMS_BLKMEM* blkmem, /**< block memory */
78  SCIP_SET* set, /**< global SCIP settings */
79  SCIP_STAT* stat, /**< problem statistics data */
80  SCIP_NLROW* sourcenlrow /**< nonlinear row to copy */
81  );
82 
83 /** create a new nonlinear row from a linear row
84  *
85  * the new row is already captured
86  */
88  SCIP_NLROW** nlrow, /**< buffer to store pointer to nonlinear row */
89  BMS_BLKMEM* blkmem, /**< block memory */
90  SCIP_SET* set, /**< global SCIP settings */
91  SCIP_STAT* stat, /**< problem statistics data */
92  SCIP_ROW* row /**< the linear row to copy */
93  );
94 
95 /** output nonlinear row to file stream */
97  SCIP_NLROW* nlrow, /**< NLP row */
98  BMS_BLKMEM* blkmem, /**< block memory */
99  SCIP_SET* set, /**< global SCIP settings */
100  SCIP_STAT* stat, /**< problem statistics data */
101  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
102  FILE* file /**< output file (or NULL for standard output) */
103  );
104 
105 /** increases usage counter of nonlinear row */
106 void SCIPnlrowCapture(
107  SCIP_NLROW* nlrow /**< nonlinear row to capture */
108  );
109 
110 /** decreases usage counter of nonlinear row */
112  SCIP_NLROW** nlrow, /**< nonlinear row to free */
113  BMS_BLKMEM* blkmem, /**< block memory */
114  SCIP_SET* set, /**< global SCIP settings */
115  SCIP_STAT* stat /**< problem statistics data */
116  );
117 
118 /** ensures, that linear coefficient array of nonlinear row can store at least num entries */
120  SCIP_NLROW* nlrow, /**< NLP row */
121  BMS_BLKMEM* blkmem, /**< block memory */
122  SCIP_SET* set, /**< global SCIP settings */
123  int num /**< minimum number of entries to store */
124  );
125 
126 /** adds a previously non existing linear coefficient to a nonlinear row */
128  SCIP_NLROW* nlrow, /**< NLP nonlinear row */
129  BMS_BLKMEM* blkmem, /**< block memory */
130  SCIP_SET* set, /**< global SCIP settings */
131  SCIP_STAT* stat, /**< problem statistics data */
132  SCIP_NLP* nlp, /**< current NLP data */
133  SCIP_VAR* var, /**< variable */
134  SCIP_Real val /**< value of coefficient */
135  );
136 
137 /** deletes linear coefficient from nonlinear row */
139  SCIP_NLROW* nlrow, /**< nonlinear row to be changed */
140  SCIP_SET* set, /**< global SCIP settings */
141  SCIP_STAT* stat, /**< problem statistics data */
142  SCIP_NLP* nlp, /**< current NLP data */
143  SCIP_VAR* var /**< coefficient to be deleted */
144  );
145 
146 /** changes or adds a linear coefficient to a nonlinear row */
148  SCIP_NLROW* nlrow, /**< nonlinear row */
149  BMS_BLKMEM* blkmem, /**< block memory */
150  SCIP_SET* set, /**< global SCIP settings */
151  SCIP_STAT* stat, /**< problem statistics data */
152  SCIP_NLP* nlp, /**< current NLP data */
153  SCIP_VAR* var, /**< variable */
154  SCIP_Real coef /**< new value of coefficient */
155  );
156 
157 /** replaces or deletes an expression in a nonlinear row */
159  SCIP_NLROW* nlrow, /**< nonlinear row */
160  BMS_BLKMEM* blkmem, /**< block memory */
161  SCIP_SET* set, /**< global SCIP settings */
162  SCIP_STAT* stat, /**< problem statistics data */
163  SCIP_NLP* nlp, /**< current NLP data */
164  SCIP_EXPR* expr /**< new expression, or NULL to delete current one */
165  );
166 
167 /** changes constant of nonlinear row */
169  SCIP_NLROW* nlrow, /**< nonlinear row */
170  SCIP_SET* set, /**< global SCIP settings */
171  SCIP_STAT* stat, /**< problem statistics data */
172  SCIP_NLP* nlp, /**< current NLP data */
173  SCIP_Real constant /**< new constant */
174  );
175 
176 /** changes left hand side of nonlinear row */
178  SCIP_NLROW* nlrow, /**< nonlinear row */
179  SCIP_SET* set, /**< global SCIP settings */
180  SCIP_STAT* stat, /**< problem statistics data */
181  SCIP_NLP* nlp, /**< current NLP data */
182  SCIP_Real lhs /**< new left hand side */
183  );
184 
185 /** changes right hand side of nonlinear row */
187  SCIP_NLROW* nlrow, /**< nonlinear row */
188  SCIP_SET* set, /**< global SCIP settings */
189  SCIP_STAT* stat, /**< problem statistics data */
190  SCIP_NLP* nlp, /**< current NLP data */
191  SCIP_Real rhs /**< new right hand side */
192  );
193 
194 /** removes (or substitutes) all fixed, negated, aggregated, multi-aggregated variables from the linear and nonlinear part of a nonlinear row and simplifies its expression */
196  SCIP_NLROW* nlrow, /**< nonlinear row */
197  BMS_BLKMEM* blkmem, /**< block memory */
198  SCIP_SET* set, /**< global SCIP settings */
199  SCIP_STAT* stat, /**< problem statistics data */
200  SCIP_NLP* nlp /**< current NLP data */
201  );
202 
203 /** recalculates the current activity of a nonlinear row in the current NLP solution */
205  SCIP_NLROW* nlrow, /**< nonlinear row */
206  BMS_BLKMEM* blkmem, /**< block memory */
207  SCIP_SET* set, /**< global SCIP settings */
208  SCIP_STAT* stat, /**< problem statistics data */
209  SCIP_PRIMAL* primal, /**< primal data */
210  SCIP_TREE* tree, /**< branch and bound tree */
211  SCIP_NLP* nlp /**< current NLP data */
212  );
213 
214 /** gives the activity of a nonlinear row in the current NLP solution */
216  SCIP_NLROW* nlrow, /**< nonlinear row */
217  BMS_BLKMEM* blkmem, /**< block memory */
218  SCIP_SET* set, /**< global SCIP settings */
219  SCIP_STAT* stat, /**< problem statistics data */
220  SCIP_PRIMAL* primal, /**< primal data */
221  SCIP_TREE* tree, /**< branch and bound tree */
222  SCIP_NLP* nlp, /**< current NLP data */
223  SCIP_Real* activity /**< buffer to store activity value */
224  );
225 
226 /** gives the feasibility of a nonlinear row in the current NLP solution: negative value means infeasibility */
228  SCIP_NLROW* nlrow, /**< nonlinear row */
229  BMS_BLKMEM* blkmem, /**< block memory */
230  SCIP_SET* set, /**< global SCIP settings */
231  SCIP_STAT* stat, /**< problem statistics data */
232  SCIP_PRIMAL* primal, /**< primal data */
233  SCIP_TREE* tree, /**< branch and bound tree */
234  SCIP_NLP* nlp, /**< current NLP data */
235  SCIP_Real* feasibility /**< buffer to store feasibility value */
236  );
237 
238 /** calculates the current pseudo activity of a nonlinear row */
240  SCIP_NLROW* nlrow, /**< nonlinear row */
241  BMS_BLKMEM* blkmem, /**< block memory */
242  SCIP_SET* set, /**< global SCIP settings */
243  SCIP_STAT* stat, /**< problem statistics data */
244  SCIP_PROB* prob, /**< SCIP problem */
245  SCIP_PRIMAL* primal, /**< primal data */
246  SCIP_TREE* tree, /**< branch and bound tree */
247  SCIP_LP* lp /**< SCIP LP */
248  );
249 
250 /** returns the pseudo activity of a nonlinear row in the current pseudo solution */
252  SCIP_NLROW* nlrow, /**< nonlinear row */
253  BMS_BLKMEM* blkmem, /**< block memory */
254  SCIP_SET* set, /**< global SCIP settings */
255  SCIP_STAT* stat, /**< problem statistics data */
256  SCIP_PROB* prob, /**< SCIP problem */
257  SCIP_PRIMAL* primal, /**< primal data */
258  SCIP_TREE* tree, /**< branch and bound tree */
259  SCIP_LP* lp, /**< SCIP LP */
260  SCIP_Real* pseudoactivity /**< buffer to store pseudo activity value */
261  );
262 
263 /** returns the pseudo feasibility of a nonlinear row in the current pseudo solution: negative value means infeasibility */
265  SCIP_NLROW* nlrow, /**< nonlinear row */
266  BMS_BLKMEM* blkmem, /**< block memory */
267  SCIP_SET* set, /**< global SCIP settings */
268  SCIP_STAT* stat, /**< problem statistics data */
269  SCIP_PROB* prob, /**< SCIP problem */
270  SCIP_PRIMAL* primal, /**< primal data */
271  SCIP_TREE* tree, /**< branch and bound tree */
272  SCIP_LP* lp, /**< SCIP LP */
273  SCIP_Real* pseudofeasibility /**< buffer to store pseudo feasibility value */
274  );
275 
276 /** returns the activity of a nonlinear row for a given solution */
278  SCIP_NLROW* nlrow, /**< nonlinear row */
279  BMS_BLKMEM* blkmem, /**< block memory */
280  SCIP_SET* set, /**< global SCIP settings */
281  SCIP_STAT* stat, /**< problem statistics data */
282  SCIP_SOL* sol, /**< primal CIP solution */
283  SCIP_Real* activity /**< buffer to store activity value */
284  );
285 
286 /** returns the feasibility of a nonlinear row for the given solution */
288  SCIP_NLROW* nlrow, /**< nonlinear row */
289  BMS_BLKMEM* blkmem, /**< block memory */
290  SCIP_SET* set, /**< global SCIP settings */
291  SCIP_STAT* stat, /**< problem statistics data */
292  SCIP_SOL* sol, /**< primal CIP solution */
293  SCIP_Real* feasibility /**< buffer to store feasibility value */
294  );
295 
296 /** returns the minimal activity of a nonlinear row w.r.t. the variables' bounds */
298  SCIP_NLROW* nlrow, /**< nonlinear row */
299  BMS_BLKMEM* blkmem, /**< block memory */
300  SCIP_SET* set, /**< global SCIP settings */
301  SCIP_STAT* stat, /**< problem statistics data */
302  SCIP_Real* minactivity, /**< buffer to store minimal activity, or NULL */
303  SCIP_Real* maxactivity /**< buffer to store maximal activity, or NULL */
304  );
305 
306 /** returns whether the nonlinear row is redundant w.r.t. the variables' bounds */
308  SCIP_NLROW* nlrow, /**< nonlinear row */
309  BMS_BLKMEM* blkmem, /**< block memory */
310  SCIP_SET* set, /**< global SCIP settings */
311  SCIP_STAT* stat, /**< problem statistics data */
312  SCIP_Bool* isredundant /**< buffer to store whether row is redundant */
313  );
314 
315 /**@} */
316 
317 /**@name NLP methods */
318 /**@{ */
319 
320 /** includes event handler that is used by NLP */
322  SCIP_SET* set, /**< global SCIP settings */
323  BMS_BLKMEM* blkmem /**< block memory */
324  );
325 
326 /** construct a new empty NLP */
328  SCIP_NLP** nlp, /**< NLP handler, call by reference */
329  BMS_BLKMEM* blkmem, /**< block memory */
330  SCIP_SET* set, /**< global SCIP settings */
331  SCIP_STAT* stat, /**< problem statistics */
332  const char* name, /**< problem name */
333  int nvars_estimate /**< an estimate on the number of variables that may be added to the NLP later */
334  );
335 
336 /** frees NLP data object */
338  SCIP_NLP** nlp, /**< pointer to NLP data object */
339  BMS_BLKMEM* blkmem, /**< block memory */
340  SCIP_SET* set, /**< global SCIP settings */
341  SCIP_STAT* stat, /**< problem statistics */
342  SCIP_EVENTQUEUE* eventqueue, /**< event queue */
343  SCIP_LP* lp /**< SCIP LP, needed for releasing variables */
344  );
345 
346 /** resets the NLP to the empty NLP by removing all variables and rows from NLP,
347  * releasing all rows, and flushing the changes to the NLP solver
348  */
350  SCIP_NLP* nlp, /**< NLP data */
351  BMS_BLKMEM* blkmem, /**< block memory */
352  SCIP_SET* set, /**< global SCIP settings */
353  SCIP_STAT* stat, /**< problem statistics data */
354  SCIP_EVENTQUEUE* eventqueue, /**< event queue */
355  SCIP_LP* lp /**< SCIP LP, needed for releasing variables */
356  );
357 
358 /** currently a dummy function that always returns TRUE */
360  SCIP_NLP* nlp /**< NLP data */
361  );
362 
363 /** ensures, that variables array of NLP can store at least num entries */
365  SCIP_NLP* nlp, /**< NLP data */
366  BMS_BLKMEM* blkmem, /**< block memory */
367  SCIP_SET* set, /**< global SCIP settings */
368  int num /**< minimum number of entries to store */
369  );
370 
371 /** adds a variable to the NLP and captures the variable */
373  SCIP_NLP* nlp, /**< NLP data */
374  BMS_BLKMEM* blkmem, /**< block memory */
375  SCIP_SET* set, /**< global SCIP settings */
376  SCIP_VAR* var /**< variable */
377  );
378 
379 /** adds a set of variables to the NLP and captures the variables */
381  SCIP_NLP* nlp, /**< NLP data */
382  BMS_BLKMEM* blkmem, /**< block memory */
383  SCIP_SET* set, /**< global SCIP settings */
384  int nvars, /**< number of variables to add */
385  SCIP_VAR** vars /**< variables to add */
386  );
387 
388 /** deletes a variable from the NLP and releases the variable */
390  SCIP_NLP* nlp, /**< NLP data */
391  BMS_BLKMEM* blkmem, /**< block memory */
392  SCIP_SET* set, /**< global SCIP settings */
393  SCIP_STAT* stat, /**< problem statistics data */
394  SCIP_EVENTQUEUE* eventqueue, /**< event queue */
395  SCIP_LP* lp, /**< SCIP LP, needed to release variable */
396  SCIP_VAR* var /**< variable */
397  );
398 
399 /** ensures, that nonlinear rows array of NLP can store at least num entries */
401  SCIP_NLP* nlp, /**< NLP data */
402  BMS_BLKMEM* blkmem, /**< block memory */
403  SCIP_SET* set, /**< global SCIP settings */
404  int num /**< minimum number of entries to store */
405  );
406 
407 /** adds a nonlinear row to the NLP and captures it
408  *
409  * all variables of the row need to be present in the NLP
410  */
412  SCIP_NLP* nlp, /**< NLP data */
413  BMS_BLKMEM* blkmem, /**< block memory */
414  SCIP_SET* set, /**< global SCIP settings */
415  SCIP_STAT* stat, /**< problem statistics data */
416  SCIP_NLROW* nlrow /**< nonlinear row */
417  );
418 
419 /** adds nonlinear rows to the NLP and captures them
420  *
421  * all variables of the row need to be present in the NLP
422  */
424  SCIP_NLP* nlp, /**< NLP data */
425  BMS_BLKMEM* blkmem, /**< block memory */
426  SCIP_SET* set, /**< global SCIP settings */
427  SCIP_STAT* stat, /**< problem statistics data */
428  int nnlrows, /**< number of rows to add */
429  SCIP_NLROW** nlrows /**< rows to add */
430  );
431 
432 /** deletes a nonlinear row from the NLP
433  *
434  * does nothing if nonlinear row is not in NLP
435  */
437  SCIP_NLP* nlp, /**< NLP data */
438  BMS_BLKMEM* blkmem, /**< block memory */
439  SCIP_SET* set, /**< global SCIP settings */
440  SCIP_STAT* stat, /**< problem statistics data */
441  SCIP_NLROW* nlrow /**< nonlinear row */
442  );
443 
444 /** applies all cached changes to the NLP solver */
446  SCIP_NLP* nlp, /**< current NLP data */
447  BMS_BLKMEM* blkmem, /**< block memory */
448  SCIP_SET* set, /**< global SCIP settings */
449  SCIP_STAT* stat /**< problem statistics */
450  );
451 
452 /** solves the NLP or diving NLP */
454  SCIP_NLP* nlp, /**< NLP data */
455  BMS_BLKMEM* blkmem, /**< block memory buffers */
456  SCIP_SET* set, /**< global SCIP settings */
457  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
458  SCIP_STAT* stat, /**< problem statistics */
459  SCIP_PRIMAL* primal, /**< primal data */
460  SCIP_TREE* tree, /**< branch and bound tree */
461  SCIP_NLPPARAM* nlpparam /**< NLP solve parameters */
462  );
463 
464 /** gets objective value of current NLP */
466  SCIP_NLP* nlp /**< current NLP data */
467  );
468 
469 /** gives current pseudo objective value */
471  SCIP_NLP* nlp, /**< current NLP data */
472  BMS_BLKMEM* blkmem, /**< block memory */
473  SCIP_SET* set, /**< global SCIP settings */
474  SCIP_STAT* stat, /**< problem statistics data */
475  SCIP_PROB* prob, /**< SCIP problem */
476  SCIP_PRIMAL* primal, /**< primal data */
477  SCIP_TREE* tree, /**< branch and bound tree */
478  SCIP_LP* lp, /**< SCIP LP */
479  SCIP_Real* pseudoobjval /**< buffer to store pseudo objective value */
480  );
481 
482 /** gets fractional variables of last NLP solution along with solution values and fractionalities
483  */
485  SCIP_NLP* nlp, /**< NLP data structure */
486  BMS_BLKMEM* blkmem, /**< block memory */
487  SCIP_SET* set, /**< global SCIP settings */
488  SCIP_STAT* stat, /**< problem statistics */
489  SCIP_VAR*** fracvars, /**< pointer to store the array of NLP fractional variables, or NULL */
490  SCIP_Real** fracvarssol, /**< pointer to store the array of NLP fractional variables solution values, or NULL */
491  SCIP_Real** fracvarsfrac, /**< pointer to store the array of NLP fractional variables fractionalities, or NULL */
492  int* nfracvars, /**< pointer to store the number of NLP fractional variables , or NULL */
493  int* npriofracvars /**< pointer to store the number of NLP fractional variables with maximal branching priority, or NULL */
494  );
495 
496 /** removes all redundant nonlinear rows */
498  SCIP_NLP* nlp, /**< current NLP data */
499  BMS_BLKMEM* blkmem, /**< block memory buffers */
500  SCIP_SET* set, /**< global SCIP settings */
501  SCIP_STAT* stat /**< problem statistics */
502  );
503 
504 /** set initial guess (approximate primal solution) for next solve
505  *
506  * array initguess must be NULL or have length at least SCIPnlpGetNVars()
507  */
509  SCIP_SET* set, /**< global SCIP settings */
510  SCIP_NLP* nlp, /**< current NLP data */
511  BMS_BLKMEM* blkmem, /**< block memory buffers */
512  SCIP_Real* initguess /**< new initial guess, or NULL to clear previous one */
513  );
514 
515 /** writes NLP to a file */
517  SCIP_NLP* nlp, /**< current NLP data */
518  BMS_BLKMEM* blkmem, /**< block memory buffers */
519  SCIP_SET* set, /**< global SCIP settings */
520  SCIP_STAT* stat, /**< problem statistics */
521  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
522  const char* fname /**< file name */
523  );
524 
525 /*
526  * NLP diving methods
527  */
528 
529 /** signals start of diving */
531  SCIP_NLP* nlp, /**< current NLP data */
532  BMS_BLKMEM* blkmem, /**< block memory buffers */
533  SCIP_SET* set, /**< global SCIP settings */
534  SCIP_STAT* stat /**< problem statistics */
535  );
536 
537 /** resets the bound and objective changes made during diving and disables diving mode */
539  SCIP_NLP* nlp, /**< current NLP data */
540  BMS_BLKMEM* blkmem, /**< block memory buffers */
541  SCIP_SET* set, /**< global SCIP settings */
542  SCIP_STAT* stat /**< problem statistics data */
543  );
544 
545 /** changes coefficient of variable in diving NLP */
547  SCIP_NLP* nlp, /**< current NLP data */
548  BMS_BLKMEM* blkmem, /**< block memory */
549  SCIP_SET* set, /**< global SCIP settings */
550  SCIP_STAT* stat, /**< problem statistics data */
551  SCIP_VAR* var, /**< variable which coefficient to change */
552  SCIP_Real coef /**< new linear coefficient of variable in objective */
553  );
554 
555 /** changes bounds of variable in diving NLP */
557  SCIP_SET* set, /**< global SCIP settings */
558  SCIP_NLP* nlp, /**< current NLP data */
559  SCIP_VAR* var, /**< variable which bounds to change */
560  SCIP_Real lb, /**< new lower bound of variable */
561  SCIP_Real ub /**< new upper bound of variable */
562  );
563 
564 /** changes bounds of a set of variables in diving NLP */
566  SCIP_NLP* nlp, /**< current NLP data */
567  SCIP_SET* set, /**< global SCIP settings */
568  int nvars, /**< number of variables which bounds to change */
569  SCIP_VAR** vars, /**< variables which bounds to change */
570  SCIP_Real* lbs, /**< new lower bounds of variables */
571  SCIP_Real* ubs /**< new upper bounds of variables */
572  );
573 
574 /** returns whether the objective function has been changed during diving */
576  SCIP_NLP* nlp /**< current NLP data */
577  );
578 
579 /** gets array with variables of the NLP */
581  SCIP_NLP* nlp /**< current NLP data */
582  );
583 
584 /** gets current number of variables in NLP */
585 int SCIPnlpGetNVars(
586  SCIP_NLP* nlp /**< current NLP data */
587  );
588 
589 /** computes for each variables the number of NLP rows in which the variable appears in a nonlinear var */
591  SCIP_NLP* nlp, /**< current NLP data */
592  BMS_BLKMEM* blkmem, /**< block memory buffers */
593  SCIP_SET* set, /**< global SCIP settings */
594  SCIP_STAT* stat, /**< problem statistics */
595  int* nlcount /**< an array of length at least SCIPnlpGetNVars() to store nonlinearity counts of variables */
596  );
597 
598 /** indicates whether there exists a row that contains a continuous variable in a nonlinear term
599  *
600  * @note The method may have to touch every row and nonlinear term to compute its result.
601  */
603  SCIP_NLP* nlp, /**< current NLP data */
604  BMS_BLKMEM* blkmem, /**< block memory buffers */
605  SCIP_SET* set, /**< global SCIP settings */
606  SCIP_STAT* stat, /**< problem statistics */
607  SCIP_Bool* result /**< buffer to store whether continuous variable present in an expression of any row */
608  );
609 
610 /** gives dual solution values associated with lower bounds of NLP variables */
612  SCIP_NLP* nlp /**< current NLP data */
613  );
614 
615 /** gives dual solution values associated with upper bounds of NLP variables */
617  SCIP_NLP* nlp /**< current NLP data */
618  );
619 
620 /** gets array with nonlinear rows of the NLP */
622  SCIP_NLP* nlp /**< current NLP data */
623  );
624 
625 /** gets current number of nonlinear rows in NLP */
627  SCIP_NLP* nlp /**< current NLP data */
628  );
629 
630 /** gets the NLP solver interface */
632  SCIP_NLP* nlp /**< current NLP data */
633  );
634 
635 /** gets the NLP problem in the solver interface */
637  SCIP_NLP* nlp /**< current NLP data */
638  );
639 
640 /** indicates whether NLP is currently in diving mode */
642  SCIP_NLP* nlp /**< current NLP data */
643  );
644 
645 /** gets solution status of current NLP */
647  SCIP_NLP* nlp /**< current NLP data */
648  );
649 
650 /** gets termination status of last NLP solve */
652  SCIP_NLP* nlp /**< current NLP data */
653  );
654 
655 /** gives statistics (number of iterations, solving time, ...) of last NLP solve */
657  SCIP_SET* set, /**< global SCIP settings */
658  SCIP_NLP* nlp, /**< pointer to NLP datastructure */
659  SCIP_NLPSTATISTICS* statistics /**< pointer to store statistics */
660  );
661 
662 /** indicates whether a solution for the current NLP is available
663  *
664  * The solution may be optimal, feasible, or infeasible.
665  * Thus, returns whether the NLP solution status is at most \ref SCIP_NLPSOLSTAT_LOCINFEASIBLE.
666  */
668  SCIP_NLP* nlp /**< current NLP data */
669  );
670 
671 /**@} */
672 
673 #ifdef __cplusplus
674 }
675 #endif
676 
677 #endif /* __SCIP_NLP_H__ */
enum SCIP_NlpTermStat SCIP_NLPTERMSTAT
Definition: type_nlpi.h:185
int SCIPnlpGetNVars(SCIP_NLP *nlp)
Definition: nlp.c:4201
SCIP_RETCODE SCIPnlrowDelLinearCoef(SCIP_NLROW *nlrow, SCIP_SET *set, SCIP_STAT *stat, SCIP_NLP *nlp, SCIP_VAR *var)
Definition: nlp.c:1207
SCIP_RETCODE SCIPnlpHasContinuousNonlinearity(SCIP_NLP *nlp, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_Bool *result)
Definition: nlp.c:4265
SCIP_RETCODE SCIPnlpStartDive(SCIP_NLP *nlp, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat)
Definition: nlp.c:4433
type definitions for miscellaneous datastructures
SCIP_RETCODE SCIPnlrowEnsureLinearSize(SCIP_NLROW *nlrow, BMS_BLKMEM *blkmem, SCIP_SET *set, int num)
Definition: nlp.c:1134
SCIP_RETCODE SCIPnlrowIsRedundant(SCIP_NLROW *nlrow, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_Bool *isredundant)
Definition: nlp.c:1711
SCIP_RETCODE SCIPnlpFlush(SCIP_NLP *nlp, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat)
Definition: nlp.c:3913
SCIP_NLPTERMSTAT SCIPnlpGetTermstat(SCIP_NLP *nlp)
Definition: nlp.c:4388
SCIP_RETCODE SCIPnlrowRecalcPseudoActivity(SCIP_NLROW *nlrow, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *prob, SCIP_PRIMAL *primal, SCIP_TREE *tree, SCIP_LP *lp)
Definition: nlp.c:1505
SCIP_RETCODE SCIPnlrowAddLinearCoef(SCIP_NLROW *nlrow, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_NLP *nlp, SCIP_VAR *var, SCIP_Real val)
Definition: nlp.c:1159
int SCIPnlpGetNNlRows(SCIP_NLP *nlp)
Definition: nlp.c:4338
SCIP_RETCODE SCIPnlrowChgExpr(SCIP_NLROW *nlrow, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_NLP *nlp, SCIP_EXPR *expr)
Definition: nlp.c:1278
SCIP_RETCODE SCIPnlrowGetNLPFeasibility(SCIP_NLROW *nlrow, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_PRIMAL *primal, SCIP_TREE *tree, SCIP_NLP *nlp, SCIP_Real *feasibility)
Definition: nlp.c:1482
SCIP_RETCODE SCIPnlrowCreate(SCIP_NLROW **nlrow, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, const char *name, SCIP_Real constant, int nlinvars, SCIP_VAR **linvars, SCIP_Real *lincoefs, SCIP_EXPR *expr, SCIP_Real lhs, SCIP_Real rhs, SCIP_EXPRCURV curvature)
Definition: nlp.c:833
SCIP_RETCODE SCIPnlrowRecalcNLPActivity(SCIP_NLROW *nlrow, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_PRIMAL *primal, SCIP_TREE *tree, SCIP_NLP *nlp)
Definition: nlp.c:1400
SCIP_NLPI * SCIPnlpGetNLPI(SCIP_NLP *nlp)
Definition: nlp.c:4348
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:54
SCIP_RETCODE SCIPnlpEnsureVarsSize(SCIP_NLP *nlp, BMS_BLKMEM *blkmem, SCIP_SET *set, int num)
Definition: nlp.c:3673
type definitions for global SCIP settings
SCIP_Bool SCIPnlpIsDiving(SCIP_NLP *nlp)
Definition: nlp.c:4368
SCIP_RETCODE SCIPnlpAddVar(SCIP_NLP *nlp, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_VAR *var)
Definition: nlp.c:3707
SCIP_RETCODE SCIPnlpGetPseudoObjval(SCIP_NLP *nlp, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *prob, SCIP_PRIMAL *primal, SCIP_TREE *tree, SCIP_LP *lp, SCIP_Real *pseudoobjval)
Definition: nlp.c:3988
SCIP_Real SCIPnlpGetObjval(SCIP_NLP *nlp)
Definition: nlp.c:3978
SCIP_RETCODE SCIPnlpEndDive(SCIP_NLP *nlp, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat)
Definition: nlp.c:4464
SCIP_RETCODE SCIPnlpChgVarObjDive(SCIP_NLP *nlp, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_VAR *var, SCIP_Real coef)
Definition: nlp.c:4526
SCIP_RETCODE SCIPnlpReset(SCIP_NLP *nlp, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_EVENTQUEUE *eventqueue, SCIP_LP *lp)
Definition: nlp.c:3622
SCIP_RETCODE SCIPnlpDelNlRow(SCIP_NLP *nlp, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_NLROW *nlrow)
Definition: nlp.c:3881
SCIP_RETCODE SCIPnlpAddVars(SCIP_NLP *nlp, BMS_BLKMEM *blkmem, SCIP_SET *set, int nvars, SCIP_VAR **vars)
Definition: nlp.c:3733
SCIP_Real * SCIPnlpGetVarsLbDualsol(SCIP_NLP *nlp)
Definition: nlp.c:4308
SCIP_RETCODE SCIPnlrowChgLhs(SCIP_NLROW *nlrow, SCIP_SET *set, SCIP_STAT *stat, SCIP_NLP *nlp, SCIP_Real lhs)
Definition: nlp.c:1345
SCIP_NLPIPROBLEM * SCIPnlpGetNLPIProblem(SCIP_NLP *nlp)
Definition: nlp.c:4358
SCIP_RETCODE SCIPnlrowChgRhs(SCIP_NLROW *nlrow, SCIP_SET *set, SCIP_STAT *stat, SCIP_NLP *nlp, SCIP_Real rhs)
Definition: nlp.c:1365
type definitions for problem statistics
type definitions for LP management
SCIP_RETCODE SCIPnlrowChgConstant(SCIP_NLROW *nlrow, SCIP_SET *set, SCIP_STAT *stat, SCIP_NLP *nlp, SCIP_Real constant)
Definition: nlp.c:1325
SCIP_RETCODE SCIPnlrowGetActivityBounds(SCIP_NLROW *nlrow, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_Real *minactivity, SCIP_Real *maxactivity)
Definition: nlp.c:1679
SCIP_RETCODE SCIPnlrowCreateCopy(SCIP_NLROW **nlrow, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_NLROW *sourcenlrow)
Definition: nlp.c:932
void SCIPnlrowCapture(SCIP_NLROW *nlrow)
Definition: nlp.c:1077
SCIP_RETCODE SCIPnlpFree(SCIP_NLP **nlp, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_EVENTQUEUE *eventqueue, SCIP_LP *lp)
Definition: nlp.c:3562
enum SCIP_NlpSolStat SCIP_NLPSOLSTAT
Definition: type_nlpi.h:159
SCIP_RETCODE SCIPnlpChgVarBoundsDive(SCIP_SET *set, SCIP_NLP *nlp, SCIP_VAR *var, SCIP_Real lb, SCIP_Real ub)
Definition: nlp.c:4583
SCIP_RETCODE SCIPnlpWrite(SCIP_NLP *nlp, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_MESSAGEHDLR *messagehdlr, const char *fname)
Definition: nlp.c:4138
SCIP_RETCODE SCIPnlpInclude(SCIP_SET *set, BMS_BLKMEM *blkmem)
Definition: nlp.c:3416
SCIP_RETCODE SCIPnlpRemoveRedundantNlRows(SCIP_NLP *nlp, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat)
Definition: nlp.c:4056
SCIP_RETCODE SCIPnlpCreate(SCIP_NLP **nlp, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, const char *name, int nvars_estimate)
Definition: nlp.c:3442
type definitions for problem variables
SCIP_RETCODE SCIPnlrowChgLinearCoef(SCIP_NLROW *nlrow, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_NLP *nlp, SCIP_VAR *var, SCIP_Real coef)
Definition: nlp.c:1240
SCIP_RETCODE SCIPnlrowGetPseudoActivity(SCIP_NLROW *nlrow, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *prob, SCIP_PRIMAL *primal, SCIP_TREE *tree, SCIP_LP *lp, SCIP_Real *pseudoactivity)
Definition: nlp.c:1552
type definitions for managing events
public methods for NLP management
SCIP_Bool SCIPnlpIsDivingObjChanged(SCIP_NLP *nlp)
Definition: nlp.c:4656
#define SCIP_Bool
Definition: def.h:84
SCIP_RETCODE SCIPnlrowGetNLPActivity(SCIP_NLROW *nlrow, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_PRIMAL *primal, SCIP_TREE *tree, SCIP_NLP *nlp, SCIP_Real *activity)
Definition: nlp.c:1452
SCIP_EXPRCURV
Definition: type_expr.h:48
SCIP_Real * SCIPnlpGetVarsUbDualsol(SCIP_NLP *nlp)
Definition: nlp.c:4318
SCIP_RETCODE SCIPnlrowGetPseudoFeasibility(SCIP_NLROW *nlrow, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *prob, SCIP_PRIMAL *primal, SCIP_TREE *tree, SCIP_LP *lp, SCIP_Real *pseudofeasibility)
Definition: nlp.c:1583
SCIP_NLROW ** SCIPnlpGetNlRows(SCIP_NLP *nlp)
Definition: nlp.c:4328
SCIP_RETCODE SCIPnlrowCreateFromRow(SCIP_NLROW **nlrow, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_ROW *row)
Definition: nlp.c:967
type definitions for storing primal CIP solutions
type definitions for storing and manipulating the main problem
SCIP_RETCODE SCIPnlpSolve(SCIP_NLP *nlp, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, SCIP_STAT *stat, SCIP_PRIMAL *primal, SCIP_TREE *tree, SCIP_NLPPARAM *nlpparam)
Definition: nlp.c:3951
SCIP_RETCODE SCIPnlpSetInitialGuess(SCIP_SET *set, SCIP_NLP *nlp, BMS_BLKMEM *blkmem, SCIP_Real *initguess)
Definition: nlp.c:4102
SCIP_RETCODE SCIPnlpEnsureNlRowsSize(SCIP_NLP *nlp, BMS_BLKMEM *blkmem, SCIP_SET *set, int num)
Definition: nlp.c:3795
SCIP_RETCODE SCIPnlpDelVar(SCIP_NLP *nlp, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_EVENTQUEUE *eventqueue, SCIP_LP *lp, SCIP_VAR *var)
Definition: nlp.c:3758
SCIP_RETCODE SCIPnlpChgVarsBoundsDive(SCIP_NLP *nlp, SCIP_SET *set, int nvars, SCIP_VAR **vars, SCIP_Real *lbs, SCIP_Real *ubs)
Definition: nlp.c:4612
#define SCIP_Real
Definition: def.h:177
SCIP_Bool SCIPnlpHasSolution(SCIP_NLP *nlp)
Definition: nlp.c:4419
SCIP_NLPSOLSTAT SCIPnlpGetSolstat(SCIP_NLP *nlp)
Definition: nlp.c:4378
SCIP_RETCODE SCIPnlrowRelease(SCIP_NLROW **nlrow, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat)
Definition: nlp.c:1089
SCIP_RETCODE SCIPnlrowGetSolActivity(SCIP_NLROW *nlrow, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_SOL *sol, SCIP_Real *activity)
Definition: nlp.c:1608
SCIP_RETCODE SCIPnlpGetStatistics(SCIP_SET *set, SCIP_NLP *nlp, SCIP_NLPSTATISTICS *statistics)
Definition: nlp.c:4398
type definitions for collecting primal CIP solutions and primal informations
common defines and data types used in all packages of SCIP
struct BMS_BlkMem BMS_BLKMEM
Definition: memory.h:430
SCIP_RETCODE SCIPnlpGetFracVars(SCIP_NLP *nlp, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_VAR ***fracvars, SCIP_Real **fracvarssol, SCIP_Real **fracvarsfrac, int *nfracvars, int *npriofracvars)
Definition: nlp.c:4022
SCIP_RETCODE SCIPnlrowGetSolFeasibility(SCIP_NLROW *nlrow, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_SOL *sol, SCIP_Real *feasibility)
Definition: nlp.c:1657
SCIP_Bool SCIPnlpHasCurrentNodeNLP(SCIP_NLP *nlp)
Definition: nlp.c:3664
SCIP_RETCODE SCIPnlrowPrint(SCIP_NLROW *nlrow, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_MESSAGEHDLR *messagehdlr, FILE *file)
Definition: nlp.c:1030
SCIP_RETCODE SCIPnlpGetVarsNonlinearity(SCIP_NLP *nlp, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, int *nlcount)
Definition: nlp.c:4211
SCIP_RETCODE SCIPnlpAddNlRows(SCIP_NLP *nlp, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, int nnlrows, SCIP_NLROW **nlrows)
Definition: nlp.c:3851
SCIP_RETCODE SCIPnlpAddNlRow(SCIP_NLP *nlp, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_NLROW *nlrow)
Definition: nlp.c:3825
SCIP_RETCODE SCIPnlrowSimplify(SCIP_NLROW *nlrow, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_NLP *nlp)
Definition: nlp.c:1385
SCIP_VAR ** SCIPnlpGetVars(SCIP_NLP *nlp)
Definition: nlp.c:4191
memory allocation routines