Scippy

SCIP

Solving Constraint Integer Programs

scip_nlp.c
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-2018 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 scip.zib.de. */
13 /* */
14 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
15 
16 /**@file scip_nlp.c
17  * @brief public methods for nonlinear relaxations
18  * @author Tobias Achterberg
19  * @author Timo Berthold
20  * @author Gerald Gamrath
21  * @author Robert Lion Gottwald
22  * @author Stefan Heinz
23  * @author Gregor Hendel
24  * @author Thorsten Koch
25  * @author Alexander Martin
26  * @author Marc Pfetsch
27  * @author Michael Winkler
28  * @author Kati Wolter
29  *
30  * @todo check all SCIP_STAGE_* switches, and include the new stages TRANSFORMED and INITSOLVE
31  */
32 
33 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
34 
35 #include <ctype.h>
36 #include <stdarg.h>
37 #include <assert.h>
38 #include <string.h>
39 #if defined(_WIN32) || defined(_WIN64)
40 #else
41 #include <strings.h> /*lint --e{766}*/
42 #endif
43 
44 
45 #include "lpi/lpi.h"
46 #include "nlpi/exprinterpret.h"
47 #include "nlpi/nlpi.h"
48 #include "scip/benders.h"
49 #include "scip/benderscut.h"
50 #include "scip/branch.h"
51 #include "scip/branch_nodereopt.h"
52 #include "scip/clock.h"
53 #include "scip/compr.h"
54 #include "scip/concsolver.h"
55 #include "scip/concurrent.h"
56 #include "scip/conflict.h"
57 #include "scip/conflictstore.h"
58 #include "scip/cons.h"
59 #include "scip/cons_linear.h"
60 #include "scip/cutpool.h"
61 #include "scip/cuts.h"
62 #include "scip/debug.h"
63 #include "scip/def.h"
64 #include "scip/dialog.h"
65 #include "scip/dialog_default.h"
66 #include "scip/disp.h"
67 #include "scip/event.h"
68 #include "scip/heur.h"
69 #include "scip/heur_ofins.h"
70 #include "scip/heur_reoptsols.h"
72 #include "scip/heuristics.h"
73 #include "scip/history.h"
74 #include "scip/implics.h"
75 #include "scip/interrupt.h"
76 #include "scip/lp.h"
77 #include "scip/mem.h"
78 #include "scip/message_default.h"
79 #include "scip/misc.h"
80 #include "scip/nlp.h"
81 #include "scip/nodesel.h"
82 #include "scip/paramset.h"
83 #include "scip/presol.h"
84 #include "scip/presolve.h"
85 #include "scip/pricer.h"
86 #include "scip/pricestore.h"
87 #include "scip/primal.h"
88 #include "scip/prob.h"
89 #include "scip/prop.h"
90 #include "scip/reader.h"
91 #include "scip/relax.h"
92 #include "scip/reopt.h"
93 #include "scip/retcode.h"
94 #include "scip/scipbuildflags.h"
95 #include "scip/scipcoreplugins.h"
96 #include "scip/scipgithash.h"
97 #include "scip/sepa.h"
98 #include "scip/sepastore.h"
99 #include "scip/set.h"
100 #include "scip/sol.h"
101 #include "scip/solve.h"
102 #include "scip/stat.h"
103 #include "scip/syncstore.h"
104 #include "scip/table.h"
105 #include "scip/tree.h"
106 #include "scip/var.h"
107 #include "scip/visual.h"
108 #include "xml/xml.h"
109 
110 #include "scip/scip_mem.h"
111 #include "scip/scip_nlp.h"
112 #include "scip/scip_sol.h"
113 
114 #include "scip/pub_message.h"
115 #include "scip/pub_misc.h"
116 #include "scip/pub_nlp.h"
117 #include "scip/pub_paramset.h"
118 
119 
120 /* In debug mode, we include the SCIP's structure in scip.c, such that no one can access
121  * this structure except the interface methods in scip.c.
122  * In optimized mode, the structure is included in scip.h, because some of the methods
123  * are implemented as defines for performance reasons (e.g. the numerical comparisons)
124  */
125 #ifndef NDEBUG
126 #include "scip/struct_scip.h"
127 #endif
128 
129 /** method to call, when the priority of an NLPI was changed */
130 static
131 SCIP_DECL_PARAMCHGD(paramChgdNlpiPriority)
132 { /*lint --e{715}*/
133  SCIP_PARAMDATA* paramdata;
134 
135  paramdata = SCIPparamGetData(param);
136  assert(paramdata != NULL);
137 
138  /* use SCIPsetSetPriorityNlpi() to mark the nlpis unsorted */
140 
141  return SCIP_OKAY;
142 }
143 /** includes an NLPI in SCIP */
145  SCIP* scip, /**< SCIP data structure */
146  SCIP_NLPI* nlpi /**< NLPI data structure */
147  )
148 {
149  char paramname[SCIP_MAXSTRLEN];
150  char paramdesc[SCIP_MAXSTRLEN];
151 
152  assert(scip != NULL);
153  assert(nlpi != NULL);
154 
155  SCIP_CALL( SCIPcheckStage(scip, "SCIPincludeNlpi", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
156 
157  /* check whether NLPI is already present */
158  if( SCIPfindNlpi(scip, SCIPnlpiGetName(nlpi)) != NULL )
159  {
160  SCIPerrorMessage("NLPI <%s> already included.\n", SCIPnlpiGetName(nlpi));
161  return SCIP_INVALIDDATA;
162  }
163 
164  SCIP_CALL( SCIPsetIncludeNlpi(scip->set, nlpi) );
165 
166  /* add parameters */
167  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "nlpi/%s/priority", SCIPnlpiGetName(nlpi));
168  (void) SCIPsnprintf(paramdesc, SCIP_MAXSTRLEN, "priority of NLPI <%s>", SCIPnlpiGetName(nlpi));
169  SCIP_CALL( SCIPaddIntParam(scip, paramname, paramdesc,
170  NULL, FALSE, SCIPnlpiGetPriority(nlpi), INT_MIN/4, INT_MAX/4,
171  paramChgdNlpiPriority, (SCIP_PARAMDATA*)nlpi) ); /*lint !e740*/
172 
173  /* pass message handler (may be NULL) */
175 
176  return SCIP_OKAY;
177 }
178 
179 /** returns the NLPI of the given name, or NULL if not existing */
181  SCIP* scip, /**< SCIP data structure */
182  const char* name /**< name of NLPI */
183  )
184 {
185  assert(scip != NULL);
186  assert(scip->set != NULL);
187  assert(name != NULL);
188 
189  return SCIPsetFindNlpi(scip->set, name);
190 }
191 
192 /** returns the array of currently available NLPIs (sorted by priority) */
194  SCIP* scip /**< SCIP data structure */
195  )
196 {
197  assert(scip != NULL);
198  assert(scip->set != NULL);
199 
200  SCIPsetSortNlpis(scip->set);
201 
202  return scip->set->nlpis;
203 }
204 
205 /** returns the number of currently available NLPIs */
207  SCIP* scip /**< SCIP data structure */
208  )
209 {
210  assert(scip != NULL);
211  assert(scip->set != NULL);
212 
213  return scip->set->nnlpis;
214 }
215 
216 /** sets the priority of an NLPI */
218  SCIP* scip, /**< SCIP data structure */
219  SCIP_NLPI* nlpi, /**< NLPI */
220  int priority /**< new priority of the NLPI */
221  )
222 {
223  assert(scip != NULL);
224  assert(scip->set != NULL);
225 
226  SCIPsetSetPriorityNlpi(scip->set, nlpi, priority);
227 
228  return SCIP_OKAY;
229 }
230 
231 /** returns whether the NLP relaxation has been enabled
232  *
233  * If the NLP relaxation is enabled, then SCIP will construct the NLP relaxation when the solving process is about to begin.
234  * To check whether an NLP is existing, use SCIPisNLPConstructed().
235  *
236  * @pre This method can be called if SCIP is in one of the following stages:
237  * - \ref SCIP_STAGE_INITPRESOLVE
238  * - \ref SCIP_STAGE_PRESOLVING
239  * - \ref SCIP_STAGE_EXITPRESOLVE
240  * - \ref SCIP_STAGE_PRESOLVED
241  * - \ref SCIP_STAGE_INITSOLVE
242  * - \ref SCIP_STAGE_SOLVING
243  *
244  * @see SCIPenableNLP
245  */
247  SCIP* scip /**< SCIP data structure */
248  )
249 {
250  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPisNLPEnabled", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
251 
252  return scip->transprob->nlpenabled;
253 }
254 
255 /** marks that there are constraints that are representable by nonlinear rows
256  *
257  * This method should be called by a constraint handler if it has constraints that have a representation as nonlinear rows.
258  *
259  * The function should be called before the branch-and-bound process is initialized, e.g., when presolve is exiting.
260  *
261  * @pre This method can be called if SCIP is in one of the following stages:
262  * - \ref SCIP_STAGE_INITPRESOLVE
263  * - \ref SCIP_STAGE_PRESOLVING
264  * - \ref SCIP_STAGE_EXITPRESOLVE
265  * - \ref SCIP_STAGE_PRESOLVED
266  * - \ref SCIP_STAGE_INITSOLVE
267  * - \ref SCIP_STAGE_SOLVING
268  */
270  SCIP* scip /**< SCIP data structure */
271  )
272 {
273  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPenableNLP", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
274 
275  scip->transprob->nlpenabled = TRUE;
276 }
277 
278 /** returns, whether an NLP has been constructed
279  *
280  * @pre This method can be called if SCIP is in one of the following stages:
281  * - \ref SCIP_STAGE_INITSOLVE
282  * - \ref SCIP_STAGE_SOLVING
283  */
285  SCIP* scip /**< SCIP data structure */
286  )
287 {
288  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPisNLPConstructed", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
289 
290  return (scip->nlp != NULL);
291 }
292 
293 /** returns whether the NLP has a continuous variable in a nonlinear term
294  *
295  * @pre This method can be called if SCIP is in one of the following stages:
296  * - \ref SCIP_STAGE_INITSOLVE
297  * - \ref SCIP_STAGE_SOLVING
298  */
300  SCIP* scip /**< SCIP data structure */
301  )
302 {
303  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPhasNLPContinuousNonlinearity", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
304 
305  if( scip->nlp == NULL )
306  {
307  SCIPerrorMessage("NLP has not been not constructed.\n");
308  SCIPABORT();
309  return FALSE; /*lint !e527*/
310  }
311 
313 }
314 
315 /** gets current NLP variables along with the current number of NLP variables
316  *
317  * @pre This method can be called if SCIP is in one of the following stages:
318  * - \ref SCIP_STAGE_INITSOLVE
319  * - \ref SCIP_STAGE_SOLVING
320  */
322  SCIP* scip, /**< SCIP data structure */
323  SCIP_VAR*** vars, /**< pointer to store the array of NLP variables, or NULL */
324  int* nvars /**< pointer to store the number of NLP variables, or NULL */
325  )
326 {
327  SCIP_CALL( SCIPcheckStage(scip, "SCIPgetNLPVarsData", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
328 
329  if( scip->nlp != NULL )
330  {
331  if( vars != NULL )
332  *vars = SCIPnlpGetVars(scip->nlp);
333  if( nvars != NULL )
334  *nvars = SCIPnlpGetNVars(scip->nlp);
335  }
336  else
337  {
338  SCIPerrorMessage("NLP has not been constructed.\n");
339  return SCIP_INVALIDCALL;
340  }
341 
342  return SCIP_OKAY;
343 }
344 
345 /** gets array with variables of the NLP
346  *
347  * @pre This method can be called if SCIP is in one of the following stages:
348  * - \ref SCIP_STAGE_INITSOLVE
349  * - \ref SCIP_STAGE_SOLVING
350  */
352  SCIP* scip /**< SCIP data structure */
353  )
354 {
356 
357  if( scip->nlp == NULL )
358  {
359  SCIPerrorMessage("NLP has not been constructed.\n");
360  SCIPABORT();
361  return NULL; /*lint !e527*/
362  }
363 
364  return SCIPnlpGetVars(scip->nlp);
365 }
366 
367 /** gets current number of variables in NLP
368  *
369  * @pre This method can be called if SCIP is in one of the following stages:
370  * - \ref SCIP_STAGE_INITSOLVE
371  * - \ref SCIP_STAGE_SOLVING
372  */
374  SCIP* scip /**< SCIP data structure */
375  )
376 {
377  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetNNLPVars", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
378 
379  if( scip->nlp == NULL )
380  {
381  SCIPerrorMessage("NLP has not been constructed.\n");
382  SCIPABORT();
383  return 0; /*lint !e527*/
384  }
385 
386  return SCIPnlpGetNVars(scip->nlp);
387 }
388 
389 /** computes for each variables the number of NLP rows in which the variable appears in a nonlinear var
390  *
391  * @pre This method can be called if SCIP is in one of the following stages:
392  * - \ref SCIP_STAGE_INITSOLVE
393  * - \ref SCIP_STAGE_SOLVING
394  */
396  SCIP* scip, /**< SCIP data structure */
397  int* nlcount /**< an array of length at least SCIPnlpGetNVars() to store nonlinearity counts of variables */
398  )
399 {
400  SCIP_CALL( SCIPcheckStage(scip, "SCIPgetNLPVarsNonlinearity", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
401 
402  if( scip->nlp == NULL )
403  {
404  SCIPerrorMessage("NLP has not been constructed.\n");
405  return SCIP_INVALIDCALL;
406  }
407 
408  SCIP_CALL( SCIPnlpGetVarsNonlinearity(scip->nlp, nlcount) );
409 
410  return SCIP_OKAY;
411 }
412 
413 /** returns dual solution values associated with lower bounds of NLP variables
414  *
415  * @pre This method can be called if SCIP is in one of the following stages:
416  * - \ref SCIP_STAGE_INITSOLVE
417  * - \ref SCIP_STAGE_SOLVING
418  */
420  SCIP* scip /**< SCIP data structure */
421  )
422 {
423  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetNLPVarsLbDualsol", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
424 
425  if( scip->nlp == NULL )
426  {
427  SCIPerrorMessage("NLP has not been constructed.\n");
428  SCIPABORT();
429  return NULL; /*lint !e527*/
430  }
431 
432  return SCIPnlpGetVarsLbDualsol(scip->nlp);
433 }
434 
435 /** returns dual solution values associated with upper bounds of NLP variables
436  *
437  * @pre This method can be called if SCIP is in one of the following stages:
438  * - \ref SCIP_STAGE_INITSOLVE
439  * - \ref SCIP_STAGE_SOLVING
440  */
442  SCIP* scip /**< SCIP data structure */
443  )
444 {
445  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetNLPVarsUbDualsol", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
446 
447  if( scip->nlp == NULL )
448  {
449  SCIPerrorMessage("NLP has not been constructed.\n");
450  SCIPABORT();
451  return NULL; /*lint !e527*/
452  }
453 
454  return SCIPnlpGetVarsUbDualsol(scip->nlp);
455 }
456 
457 /** gets current NLP nonlinear rows along with the current number of NLP nonlinear rows
458  *
459  * @pre This method can be called if SCIP is in one of the following stages:
460  * - \ref SCIP_STAGE_INITSOLVE
461  * - \ref SCIP_STAGE_SOLVING
462  */
464  SCIP* scip, /**< SCIP data structure */
465  SCIP_NLROW*** nlrows, /**< pointer to store the array of NLP nonlinear rows, or NULL */
466  int* nnlrows /**< pointer to store the number of NLP nonlinear rows, or NULL */
467  )
468 {
469  SCIP_CALL( SCIPcheckStage(scip, "SCIPgetNLPNlRowsData", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
470 
471  if( scip->nlp == NULL )
472  {
473  SCIPerrorMessage("NLP has not been constructed.\n");
474  return SCIP_INVALIDCALL;
475  }
476 
477  if( nlrows != NULL )
478  *nlrows = SCIPnlpGetNlRows(scip->nlp);
479  if( nnlrows != NULL )
480  *nnlrows = SCIPnlpGetNNlRows(scip->nlp);
481 
482  return SCIP_OKAY;
483 }
484 
485 /** gets array with nonlinear rows of the NLP
486  *
487  * @pre This method can be called if SCIP is in one of the following stages:
488  * - \ref SCIP_STAGE_INITSOLVE
489  * - \ref SCIP_STAGE_SOLVING
490  */
492  SCIP* scip /**< SCIP data structure */
493  )
494 {
495  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetNLPNlRows", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
496 
497  if( scip->nlp == NULL )
498  {
499  SCIPerrorMessage("NLP has not been constructed.\n");
500  SCIPABORT();
501  return NULL; /*lint !e527*/
502  }
503 
504  return SCIPnlpGetNlRows(scip->nlp);
505 }
506 
507 /** gets current number of nonlinear rows in NLP
508  *
509  * @pre This method can be called if SCIP is in one of the following stages:
510  * - \ref SCIP_STAGE_INITSOLVE
511  * - \ref SCIP_STAGE_SOLVING
512  */
514  SCIP* scip /**< SCIP data structure */
515  )
516 {
517  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetNNLPNlRows", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
518 
519  if( scip->nlp == NULL )
520  {
521  SCIPerrorMessage("NLP has not been constructed.\n");
522  SCIPABORT();
523  return 0; /*lint !e527*/
524  }
525 
526  return SCIPnlpGetNNlRows(scip->nlp);
527 }
528 
529 /** adds a nonlinear row to the NLP. This row is captured by the NLP.
530  *
531  * @pre This method can be called if SCIP is in one of the following stages:
532  * - \ref SCIP_STAGE_INITSOLVE
533  * - \ref SCIP_STAGE_SOLVING
534  */
536  SCIP* scip, /**< SCIP data structure */
537  SCIP_NLROW* nlrow /**< nonlinear row to add to NLP */
538  )
539 {
540  SCIP_CALL( SCIPcheckStage(scip, "SCIPaddNlRow", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
541 
542  if( scip->nlp == NULL )
543  {
544  SCIPerrorMessage("NLP has not been constructed.\n");
545  return SCIP_INVALIDCALL;
546  }
547 
548  SCIP_CALL( SCIPnlpAddNlRow(scip->nlp, SCIPblkmem(scip), scip->set, scip->stat, nlrow) );
549 
550  return SCIP_OKAY;
551 }
552 
553 /** makes sure that the NLP of the current node is flushed
554  *
555  * @pre This method can be called if SCIP is in one of the following stages:
556  * - \ref SCIP_STAGE_INITSOLVE
557  * - \ref SCIP_STAGE_SOLVING
558  */
560  SCIP* scip /**< SCIP data structure */
561  )
562 {
563  SCIP_CALL( SCIPcheckStage(scip, "SCIPflushNLP", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
564 
565  if( scip->nlp == NULL )
566  {
567  SCIPerrorMessage("NLP has not been constructed.\n");
568  return SCIP_INVALIDCALL;
569  }
570 
571  SCIP_CALL( SCIPnlpFlush(scip->nlp, scip->mem->probmem, scip->set) );
572 
573  return SCIP_OKAY;
574 }
575 
576 /** sets or clears initial primal guess for NLP solution (start point for NLP solver)
577  *
578  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
579  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
580  *
581  * @pre This method can be called if SCIP is in one of the following stages:
582  * - \ref SCIP_STAGE_INITSOLVE
583  * - \ref SCIP_STAGE_SOLVING
584  */
586  SCIP* scip, /**< SCIP data structure */
587  SCIP_Real* initialguess /**< values of initial guess (corresponding to variables from SCIPgetNLPVarsData), or NULL to use no start point */
588  )
589 {
590  SCIP_CALL( SCIPcheckStage(scip, "SCIPsetNLPInitialGuess", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
591 
592  if( scip->nlp == NULL )
593  {
594  SCIPerrorMessage("NLP has not been constructed.\n");
595  return SCIP_INVALIDCALL;
596  }
597 
598  SCIP_CALL( SCIPnlpSetInitialGuess(scip->nlp, SCIPblkmem(scip), initialguess) );
599 
600  return SCIP_OKAY;
601 }
602 
603 /** sets initial primal guess for NLP solution (start point for NLP solver)
604  *
605  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
606  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
607  *
608  * @pre This method can be called if SCIP is in one of the following stages:
609  * - \ref SCIP_STAGE_INITSOLVE
610  * - \ref SCIP_STAGE_SOLVING
611  */
613  SCIP* scip, /**< SCIP data structure */
614  SCIP_SOL* sol /**< solution which values should be taken as initial guess, or NULL for LP solution */
615  )
616 {
617  SCIP_Real* vals;
618 
619  SCIP_CALL( SCIPcheckStage(scip, "SCIPsetNLPInitialGuessSol", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
620 
621  if( scip->nlp == NULL )
622  {
623  SCIPerrorMessage("NLP has not been constructed.\n");
624  return SCIP_INVALIDCALL;
625  }
626 
627  SCIP_CALL( SCIPallocBufferArray(scip, &vals, SCIPnlpGetNVars(scip->nlp)) );
628  SCIP_CALL( SCIPgetSolVals(scip, sol, SCIPnlpGetNVars(scip->nlp), SCIPnlpGetVars(scip->nlp), vals) );
629  SCIP_CALL( SCIPnlpSetInitialGuess(scip->nlp, SCIPblkmem(scip), vals) );
630  SCIPfreeBufferArray(scip, &vals);
631 
632  return SCIP_OKAY;
633 }
634 
635 /** solves the current NLP
636  *
637  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
638  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
639  *
640  * @pre This method can be called if SCIP is in one of the following stages:
641  * - \ref SCIP_STAGE_INITSOLVE
642  * - \ref SCIP_STAGE_SOLVING
643  */
645  SCIP* scip /**< SCIP data structure */
646  )
647 {
648  SCIP_CALL( SCIPcheckStage(scip, "SCIPsolveNLP", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
649 
650  if( scip->nlp == NULL )
651  {
652  SCIPerrorMessage("NLP has not been constructed.\n");
653  return SCIP_INVALIDCALL;
654  }
655 
656  SCIP_CALL( SCIPnlpSolve(scip->nlp, SCIPblkmem(scip), scip->set, scip->messagehdlr, scip->stat) );
657 
658  return SCIP_OKAY;
659 }
660 
661 /** gets solution status of current NLP
662  *
663  * @pre This method can be called if SCIP is in one of the following stages:
664  * - \ref SCIP_STAGE_INITSOLVE
665  * - \ref SCIP_STAGE_SOLVING
666  */
668  SCIP* scip /**< SCIP data structure */
669  )
670 {
671  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetNLPSolstat", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
672 
673  if( scip->nlp == NULL )
674  {
675  SCIPerrorMessage("NLP has not been constructed.\n");
676  SCIPABORT();
677  return SCIP_NLPSOLSTAT_UNKNOWN; /*lint !e527*/
678  }
679 
680  return SCIPnlpGetSolstat(scip->nlp);
681 }
682 
683 /** gets termination status of last NLP solve
684  *
685  * @pre This method can be called if SCIP is in one of the following stages:
686  * - \ref SCIP_STAGE_INITSOLVE
687  * - \ref SCIP_STAGE_SOLVING
688  */
690  SCIP* scip /**< SCIP data structure */
691  )
692 {
693  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetNLPTermstat", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
694 
695  if( scip->nlp == NULL )
696  {
697  SCIPerrorMessage("NLP has not been constructed.\n");
698  SCIPABORT();
699  return SCIP_NLPTERMSTAT_OTHER; /*lint !e527*/
700  }
701 
702  return SCIPnlpGetTermstat(scip->nlp);
703 }
704 
705 /** gives statistics (number of iterations, solving time, ...) of last NLP solve
706  *
707  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
708  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
709  *
710  * @pre This method can be called if SCIP is in one of the following stages:
711  * - \ref SCIP_STAGE_INITSOLVE
712  * - \ref SCIP_STAGE_SOLVING
713  */
715  SCIP* scip, /**< SCIP data structure */
716  SCIP_NLPSTATISTICS* statistics /**< pointer to store statistics */
717  )
718 {
719  SCIP_CALL( SCIPcheckStage(scip, "SCIPgetNLPStatistics", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
720 
721  if( scip->nlp == NULL )
722  {
723  SCIPerrorMessage("NLP has not been constructed.\n");
724  return SCIP_INVALIDCALL;
725  }
726 
727  SCIP_CALL( SCIPnlpGetStatistics(scip->nlp, statistics) );
728 
729  return SCIP_OKAY;
730 }
731 
732 /** gets objective value of current NLP
733  *
734  * @pre This method can be called if SCIP is in one of the following stages:
735  * - \ref SCIP_STAGE_INITSOLVE
736  * - \ref SCIP_STAGE_SOLVING
737  */
739  SCIP* scip /**< SCIP data structure */
740  )
741 {
742  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetNLPObjval", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
743 
744  if( scip->nlp != NULL )
745  {
746  return SCIPnlpGetObjval(scip->nlp);
747  }
748  else
749  {
750  SCIPerrorMessage("NLP has not been constructed.\n");
751  return SCIP_INVALID;
752  }
753 }
754 
755 /** indicates whether a feasible solution for the current NLP is available
756  * thus, returns whether the solution status <= feasible
757  *
758  * @pre This method can be called if SCIP is in one of the following stages:
759  * - \ref SCIP_STAGE_INITSOLVE
760  * - \ref SCIP_STAGE_SOLVING
761  */
763  SCIP* scip /**< SCIP data structure */
764  )
765 {
766  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPhasNLPSolution", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
767 
768  if( scip->nlp == NULL )
769  {
770  SCIPerrorMessage("NLP has not been constructed.\n");
771  SCIPABORT();
772  return FALSE; /*lint !e527*/
773  }
774 
775  return SCIPnlpHasSolution(scip->nlp);
776 }
777 
778 /** gets fractional variables of last NLP solution along with solution values and fractionalities
779  *
780  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
781  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
782  *
783  * @pre This method can be called if SCIP is in one of the following stages:
784  * - \ref SCIP_STAGE_INITSOLVE
785  * - \ref SCIP_STAGE_SOLVING
786  */
788  SCIP* scip, /**< SCIP data structure */
789  SCIP_VAR*** fracvars, /**< pointer to store the array of NLP fractional variables, or NULL */
790  SCIP_Real** fracvarssol, /**< pointer to store the array of NLP fractional variables solution values, or NULL */
791  SCIP_Real** fracvarsfrac, /**< pointer to store the array of NLP fractional variables fractionalities, or NULL */
792  int* nfracvars, /**< pointer to store the number of NLP fractional variables , or NULL */
793  int* npriofracvars /**< pointer to store the number of NLP fractional variables with maximal branching priority, or NULL */
794  )
795 {
796  SCIP_CALL( SCIPcheckStage(scip, "SCIPgetNLPFracVars", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
797 
798  if( scip->nlp == NULL )
799  {
800  SCIPerrorMessage("NLP has not been constructed.\n");
801  return SCIP_INVALIDCALL;
802  }
803 
804  SCIP_CALL( SCIPnlpGetFracVars(scip->nlp, SCIPblkmem(scip), scip->set, scip->stat, fracvars, fracvarssol, fracvarsfrac, nfracvars, npriofracvars) );
805 
806  return SCIP_OKAY;
807 }
808 
809 /** gets integer parameter of NLP
810  *
811  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
812  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
813  *
814  * @pre This method can be called if SCIP is in one of the following stages:
815  * - \ref SCIP_STAGE_INITSOLVE
816  * - \ref SCIP_STAGE_SOLVING
817  */
819  SCIP* scip, /**< SCIP data structure */
820  SCIP_NLPPARAM type, /**< parameter number */
821  int* ival /**< pointer to store the parameter value */
822  )
823 {
824  SCIP_CALL( SCIPcheckStage(scip, "SCIPgetNLPIntPar", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
825 
826  if( scip->nlp == NULL )
827  {
828  SCIPerrorMessage("NLP has not been constructed.\n");
829  return SCIP_INVALIDCALL;
830  }
831 
832  SCIP_CALL( SCIPnlpGetIntPar(scip->nlp, type, ival) );
833 
834  return SCIP_OKAY;
835 }
836 
837 /** sets integer parameter of NLP
838  *
839  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
840  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
841  *
842  * @pre This method can be called if SCIP is in one of the following stages:
843  * - \ref SCIP_STAGE_INITSOLVE
844  * - \ref SCIP_STAGE_SOLVING
845  */
847  SCIP* scip, /**< SCIP data structure */
848  SCIP_NLPPARAM type, /**< parameter number */
849  int ival /**< parameter value */
850  )
851 {
852  SCIP_CALL( SCIPcheckStage(scip, "SCIPsetNLPIntPar", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
853 
854  if( scip->nlp == NULL )
855  {
856  SCIPerrorMessage("NLP has not been constructed.\n");
857  return SCIP_INVALIDCALL;
858  }
859 
860  SCIP_CALL( SCIPnlpSetIntPar(scip->nlp, type, ival) );
861 
862  return SCIP_OKAY;
863 }
864 
865 /** gets floating point parameter of NLP
866  *
867  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
868  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
869  *
870  * @pre This method can be called if SCIP is in one of the following stages:
871  * - \ref SCIP_STAGE_INITSOLVE
872  * - \ref SCIP_STAGE_SOLVING
873  */
875  SCIP* scip, /**< SCIP data structure */
876  SCIP_NLPPARAM type, /**< parameter number */
877  SCIP_Real* dval /**< pointer to store the parameter value */
878  )
879 {
880  SCIP_CALL( SCIPcheckStage(scip, "SCIPgetNLPRealPar", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
881 
882  if( scip->nlp == NULL )
883  {
884  SCIPerrorMessage("NLP has not been constructed.\n");
885  return SCIP_INVALIDCALL;
886  }
887 
888  SCIP_CALL( SCIPnlpGetRealPar(scip->nlp, type, dval) );
889 
890  return SCIP_OKAY;
891 }
892 
893 /** sets floating point parameter of NLP
894  *
895  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
896  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
897  *
898  * @pre This method can be called if SCIP is in one of the following stages:
899  * - \ref SCIP_STAGE_INITSOLVE
900  * - \ref SCIP_STAGE_SOLVING
901  */
903  SCIP* scip, /**< SCIP data structure */
904  SCIP_NLPPARAM type, /**< parameter number */
905  SCIP_Real dval /**< parameter value */
906  )
907 {
908  SCIP_CALL( SCIPcheckStage(scip, "SCIPsetNLPRealPar", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
909 
910  if( scip->nlp == NULL )
911  {
912  SCIPerrorMessage("NLP has not been constructed.\n");
913  return SCIP_INVALIDCALL;
914  }
915 
916  SCIP_CALL( SCIPnlpSetRealPar(scip->nlp, type, dval) );
917 
918  return SCIP_OKAY;
919 }
920 
921 /** gets string parameter of NLP
922  *
923  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
924  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
925  *
926  * @pre This method can be called if SCIP is in one of the following stages:
927  * - \ref SCIP_STAGE_INITSOLVE
928  * - \ref SCIP_STAGE_SOLVING
929  */
931  SCIP* scip, /**< SCIP data structure */
932  SCIP_NLPPARAM type, /**< parameter number */
933  const char** sval /**< pointer to store the parameter value */
934  )
935 {
936  SCIP_CALL( SCIPcheckStage(scip, "SCIPgetNLPStringPar", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
937 
938  if( scip->nlp == NULL )
939  {
940  SCIPerrorMessage("NLP has not been constructed.\n");
941  return SCIP_INVALIDCALL;
942  }
943 
944  SCIP_CALL( SCIPnlpGetStringPar(scip->nlp, type, sval) );
945 
946  return SCIP_OKAY;
947 }
948 
949 /** sets string parameter of NLP
950  *
951  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
952  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
953  *
954  * @pre This method can be called if SCIP is in one of the following stages:
955  * - \ref SCIP_STAGE_INITSOLVE
956  * - \ref SCIP_STAGE_SOLVING
957  */
959  SCIP* scip, /**< SCIP data structure */
960  SCIP_NLPPARAM type, /**< parameter number */
961  const char* sval /**< parameter value */
962  )
963 {
964  SCIP_CALL( SCIPcheckStage(scip, "SCIPsetNLPStringPar", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
965 
966  if( scip->nlp == NULL )
967  {
968  SCIPerrorMessage("NLP has not been constructed.\n");
969  return SCIP_INVALIDCALL;
970  }
971 
972  SCIP_CALL( SCIPnlpSetStringPar(scip->nlp, type, sval) );
973 
974  return SCIP_OKAY;
975 }
976 
977 /** writes current NLP to a file
978  *
979  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
980  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
981  *
982  * @pre This method can be called if SCIP is in one of the following stages:
983  * - \ref SCIP_STAGE_INITSOLVE
984  * - \ref SCIP_STAGE_SOLVING
985  */
987  SCIP* scip, /**< SCIP data structure */
988  const char* filename /**< file name */
989  )
990 {
991  SCIP_CALL( SCIPcheckStage(scip, "SCIPwriteNLP", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
992 
993  if( scip->nlp == NULL )
994  {
995  SCIPerrorMessage("NLP has not been constructed.\n");
996  return SCIP_INVALIDCALL;
997  }
998 
999  SCIP_CALL( SCIPnlpWrite(scip->nlp, scip->set, scip->messagehdlr, filename) );
1000 
1001  return SCIP_OKAY;
1002 }
1003 
1004 /** gets the NLP interface and problem used by the SCIP NLP;
1005  * with the NLPI and its problem you can use all of the methods defined in nlpi/nlpi.h;
1006  *
1007  * @warning You have to make sure, that the full internal state of the NLPI does not change or is recovered completely
1008  * after the end of the method that uses the NLPI. In particular, if you manipulate the NLP or its solution
1009  * (e.g. by calling one of the SCIPnlpiAdd...() or the SCIPnlpiSolve() method), you have to check in advance
1010  * whether the NLP is currently solved. If this is the case, you have to make sure, the internal solution
1011  * status is recovered completely at the end of your method. Additionally you have to resolve the NLP with
1012  * SCIPnlpiSolve() in order to reinstall the internal solution status.
1013  *
1014  * @warning Make also sure, that all parameter values that you have changed are set back to their original values.
1015  *
1016  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1017  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1018  *
1019  * @pre This method can be called if SCIP is in one of the following stages:
1020  * - \ref SCIP_STAGE_INITSOLVE
1021  * - \ref SCIP_STAGE_SOLVING
1022  */
1024  SCIP* scip, /**< SCIP data structure */
1025  SCIP_NLPI** nlpi, /**< pointer to store the NLP solver interface */
1026  SCIP_NLPIPROBLEM** nlpiproblem /**< pointer to store the NLP solver interface problem */
1027  )
1028 {
1029  assert(nlpi != NULL);
1030  assert(nlpiproblem != NULL);
1031 
1032  SCIP_CALL( SCIPcheckStage(scip, "SCIPgetNLPI", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
1033 
1034  if( scip->nlp == NULL )
1035  {
1036  SCIPerrorMessage("NLP has not been constructed.\n");
1037  return SCIP_INVALIDCALL;
1038  }
1039 
1040  *nlpi = SCIPnlpGetNLPI(scip->nlp);
1041  *nlpiproblem = SCIPnlpGetNLPIProblem(scip->nlp);
1042 
1043  return SCIP_OKAY;
1044 }
1045 
1046 
1047 /*
1048  * NLP diving methods
1049  */
1050 
1051 /**@name NLP Diving Methods */
1052 /**@{ */
1053 
1054 /** initiates NLP diving making methods SCIPchgVarObjDiveNLP(), SCIPchgVarBoundsDiveNLP(), SCIPchgVarsBoundsDiveNLP(), and SCIPsolveDiveNLP() available
1055  *
1056  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1057  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1058  *
1059  * @pre This method can be called if SCIP is in one of the following stages:
1060  * - \ref SCIP_STAGE_INITSOLVE
1061  * - \ref SCIP_STAGE_SOLVING
1062  */
1064  SCIP* scip /**< SCIP data structure */
1065  )
1066 {
1067  SCIP_CALL( SCIPcheckStage(scip, "SCIPstartDiveNLP", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
1068 
1069  if( scip->nlp == NULL )
1070  {
1071  SCIPerrorMessage("NLP has not been constructed.\n");
1072  return SCIP_INVALIDCALL;
1073  }
1074 
1075  SCIP_CALL( SCIPnlpStartDive(scip->nlp, SCIPblkmem(scip), scip->set) );
1076 
1077  return SCIP_OKAY;
1078 }
1079 
1080 /** ends NLP diving
1081  *
1082  * Resets changes made by SCIPchgVarObjDiveNLP(), SCIPchgVarBoundsDiveNLP(), and SCIPchgVarsBoundsDiveNLP().
1083  *
1084  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1085  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1086  *
1087  * @pre This method can be called if SCIP is in one of the following stages:
1088  * - \ref SCIP_STAGE_INITSOLVE
1089  * - \ref SCIP_STAGE_SOLVING
1090  */
1092  SCIP* scip /**< SCIP data structure */
1093  )
1094 {
1095  SCIP_CALL( SCIPcheckStage(scip, "SCIPendDiveNLP", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
1096 
1097  if( scip->nlp == NULL )
1098  {
1099  SCIPerrorMessage("NLP has not been constructed.\n");
1100  return SCIP_INVALIDCALL;
1101  }
1102 
1103  SCIP_CALL( SCIPnlpEndDive(scip->nlp, SCIPblkmem(scip), scip->set) );
1104 
1105  return SCIP_OKAY;
1106 }
1107 
1108 /** changes linear objective coefficient of a variable in diving NLP
1109  *
1110  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1111  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1112  *
1113  * @pre This method can be called if SCIP is in one of the following stages:
1114  * - \ref SCIP_STAGE_INITSOLVE
1115  * - \ref SCIP_STAGE_SOLVING
1116  */
1118  SCIP* scip, /**< SCIP data structure */
1119  SCIP_VAR* var, /**< variable which coefficient to change */
1120  SCIP_Real coef /**< new value for coefficient */
1121  )
1122 {
1123  SCIP_CALL( SCIPcheckStage(scip, "SCIPchgVarObjDiveNLP", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
1124 
1125  assert( var->scip == scip );
1126 
1127  if( scip->nlp == NULL )
1128  {
1129  SCIPerrorMessage("NLP has not been constructed.\n");
1130  return SCIP_INVALIDCALL;
1131  }
1132 
1133  SCIP_CALL( SCIPnlpChgVarObjDive(scip->nlp, SCIPblkmem(scip), scip->set, scip->stat, var, coef) );
1134 
1135  return SCIP_OKAY;
1136 }
1137 
1138 /** changes bounds of a variable in diving NLP
1139  *
1140  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1141  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1142  *
1143  * @pre This method can be called if SCIP is in one of the following stages:
1144  * - \ref SCIP_STAGE_INITSOLVE
1145  * - \ref SCIP_STAGE_SOLVING
1146  */
1148  SCIP* scip, /**< SCIP data structure */
1149  SCIP_VAR* var, /**< variable which bounds to change */
1150  SCIP_Real lb, /**< new lower bound */
1151  SCIP_Real ub /**< new upper bound */
1152  )
1153 {
1154  SCIP_CALL( SCIPcheckStage(scip, "SCIPchgVarBoundsDiveNLP", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
1155 
1156  assert( var->scip == scip );
1157 
1158  if( scip->nlp == NULL )
1159  {
1160  SCIPerrorMessage("NLP has not been constructed.\n");
1161  return SCIP_INVALIDCALL;
1162  }
1163 
1164  SCIP_CALL( SCIPnlpChgVarBoundsDive(scip->nlp, var, lb, ub) );
1165 
1166  return SCIP_OKAY;
1167 }
1168 
1169 /** changes bounds of a set of variables in diving NLP
1170  *
1171  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1172  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1173  *
1174  * @pre This method can be called if SCIP is in one of the following stages:
1175  * - \ref SCIP_STAGE_INITSOLVE
1176  * - \ref SCIP_STAGE_SOLVING
1177  */
1179  SCIP* scip, /**< SCIP data structure */
1180  int nvars, /**< number of variables which bounds to changes */
1181  SCIP_VAR** vars, /**< variables which bounds to change */
1182  SCIP_Real* lbs, /**< new lower bounds */
1183  SCIP_Real* ubs /**< new upper bounds */
1184  )
1185 {
1186  SCIP_CALL( SCIPcheckStage(scip, "SCIPchgVarsBoundsDiveNLP", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
1187 
1188  if( scip->nlp == NULL )
1189  {
1190  SCIPerrorMessage("NLP has not been constructed.\n");
1191  return SCIP_INVALIDCALL;
1192  }
1193 
1194  SCIP_CALL( SCIPnlpChgVarsBoundsDive(scip->nlp, scip->set, nvars, vars, lbs, ubs) );
1195 
1196  return SCIP_OKAY;
1197 }
1198 
1199 /** solves diving NLP
1200  *
1201  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1202  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1203  *
1204  * @pre This method can be called if SCIP is in one of the following stages:
1205  * - \ref SCIP_STAGE_INITSOLVE
1206  * - \ref SCIP_STAGE_SOLVING
1207  */
1209  SCIP* scip /**< SCIP data structure */
1210  )
1211 {
1212  SCIP_CALL( SCIPcheckStage(scip, "SCIPsolveDiveNLP", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
1213 
1214  if( scip->nlp == NULL )
1215  {
1216  SCIPerrorMessage("NLP has not been constructed.\n");
1217  return SCIP_INVALIDCALL;
1218  }
1219 
1220  SCIP_CALL( SCIPnlpSolveDive(scip->nlp, SCIPblkmem(scip), scip->set, scip->messagehdlr, scip->stat) );
1221 
1222  return SCIP_OKAY;
1223 }
1224 
1225 /**@} */
1226 
1227 
1228 /*
1229  * NLP nonlinear row methods
1230  */
1231 
1232 /** creates and captures an NLP row
1233  *
1234  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1235  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1236  *
1237  * @pre This method can be called if SCIP is in one of the following stages:
1238  * - \ref SCIP_STAGE_PRESOLVED
1239  * - \ref SCIP_STAGE_INITSOLVE
1240  * - \ref SCIP_STAGE_SOLVING
1241  */
1243  SCIP* scip, /**< SCIP data structure */
1244  SCIP_NLROW** nlrow, /**< buffer to store pointer to nonlinear row */
1245  const char* name, /**< name of nonlinear row */
1246  SCIP_Real constant, /**< constant */
1247  int nlinvars, /**< number of linear variables */
1248  SCIP_VAR** linvars, /**< linear variables, or NULL if nlinvars == 0 */
1249  SCIP_Real* lincoefs, /**< linear coefficients, or NULL if nlinvars == 0 */
1250  int nquadvars, /**< number variables in quadratic terms */
1251  SCIP_VAR** quadvars, /**< variables in quadratic terms, or NULL if nquadvars == 0 */
1252  int nquadelems, /**< number of elements in quadratic term */
1253  SCIP_QUADELEM* quadelems, /**< elements (i.e., monomials) in quadratic term, or NULL if nquadelems == 0 */
1254  SCIP_EXPRTREE* expression, /**< nonlinear expression, or NULL */
1255  SCIP_Real lhs, /**< left hand side */
1256  SCIP_Real rhs, /**< right hand side */
1257  SCIP_EXPRCURV curvature /**< curvature of the nonlinear row */
1258  )
1259 {
1260  SCIP_CALL( SCIPcheckStage(scip, "SCIPcreateNlRow", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
1261 
1262  SCIP_CALL( SCIPnlrowCreate(nlrow, scip->mem->probmem, scip->set,
1263  name, constant, nlinvars, linvars, lincoefs, nquadvars, quadvars, nquadelems, quadelems, expression, lhs, rhs, curvature) );
1264 
1265  return SCIP_OKAY;
1266 }
1267 
1268 /** creates and captures an NLP nonlinear row without any coefficients
1269  *
1270  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1271  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1272  *
1273  * @pre This method can be called if SCIP is in one of the following stages:
1274  * - \ref SCIP_STAGE_PRESOLVED
1275  * - \ref SCIP_STAGE_INITSOLVE
1276  * - \ref SCIP_STAGE_SOLVING
1277  */
1279  SCIP* scip, /**< SCIP data structure */
1280  SCIP_NLROW** nlrow, /**< pointer to nonlinear row */
1281  const char* name, /**< name of nonlinear row */
1282  SCIP_Real lhs, /**< left hand side */
1283  SCIP_Real rhs /**< right hand side */
1284  )
1285 {
1286  SCIP_CALL( SCIPcheckStage(scip, "SCIPcreateEmptyNlRow", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
1287 
1288  SCIP_CALL( SCIPnlrowCreate(nlrow, scip->mem->probmem, scip->set,
1289  name, 0.0, 0, NULL, NULL, 0, NULL, 0, NULL, NULL, lhs, rhs, SCIP_EXPRCURV_UNKNOWN) );
1290 
1291  return SCIP_OKAY;
1292 }
1293 
1294 /** creates and captures an NLP row from a linear row
1295  *
1296  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1297  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1298  *
1299  * @pre This method can be called if SCIP is in one of the following stages:
1300  * - \ref SCIP_STAGE_PRESOLVED
1301  * - \ref SCIP_STAGE_INITSOLVE
1302  * - \ref SCIP_STAGE_SOLVING
1303  */
1305  SCIP* scip, /**< SCIP data structure */
1306  SCIP_NLROW** nlrow, /**< pointer to nonlinear row */
1307  SCIP_ROW* row /**< the linear row to copy */
1308  )
1309 {
1310  SCIP_CALL( SCIPcheckStage(scip, "SCIPcreateNlRowFromRow", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
1311 
1312  SCIP_CALL( SCIPnlrowCreateFromRow(nlrow, scip->mem->probmem, scip->set, row) );
1313 
1314  return SCIP_OKAY;
1315 }
1316 
1317 /** increases usage counter of NLP nonlinear row
1318  *
1319  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1320  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1321  *
1322  * @pre This method can be called if SCIP is in one of the following stages:
1323  * - \ref SCIP_STAGE_PRESOLVED
1324  * - \ref SCIP_STAGE_INITSOLVE
1325  * - \ref SCIP_STAGE_SOLVING
1326  */
1328  SCIP* scip, /**< SCIP data structure */
1329  SCIP_NLROW* nlrow /**< nonlinear row to capture */
1330  )
1331 {
1332  SCIP_CALL( SCIPcheckStage(scip, "SCIPcaptureNlRow", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
1333 
1334  SCIPnlrowCapture(nlrow);
1335 
1336  return SCIP_OKAY;
1337 }
1338 
1339 /** decreases usage counter of NLP nonlinear row, and frees memory if necessary
1340  *
1341  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1342  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1343  *
1344  * @pre This method can be called if SCIP is in one of the following stages:
1345  * - \ref SCIP_STAGE_PRESOLVED
1346  * - \ref SCIP_STAGE_INITSOLVE
1347  * - \ref SCIP_STAGE_SOLVING
1348  * - \ref SCIP_STAGE_EXITSOLVE
1349  */
1351  SCIP* scip, /**< SCIP data structure */
1352  SCIP_NLROW** nlrow /**< pointer to nonlinear row */
1353  )
1354 {
1355  SCIP_CALL( SCIPcheckStage(scip, "SCIPreleaseNlRow", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE) );
1356 
1357  SCIP_CALL( SCIPnlrowRelease(nlrow, scip->mem->probmem, scip->set) );
1358 
1359  return SCIP_OKAY;
1360 }
1361 
1362 /** changes left hand side of NLP nonlinear row
1363  *
1364  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1365  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1366  *
1367  * @pre This method can be called if SCIP is in one of the following stages:
1368  * - \ref SCIP_STAGE_PRESOLVED
1369  * - \ref SCIP_STAGE_INITSOLVE
1370  * - \ref SCIP_STAGE_SOLVING
1371  */
1373  SCIP* scip, /**< SCIP data structure */
1374  SCIP_NLROW* nlrow, /**< NLP nonlinear row */
1375  SCIP_Real lhs /**< new left hand side */
1376  )
1377 {
1378  SCIP_CALL( SCIPcheckStage(scip, "SCIPchgNlRowLhs", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
1379 
1380  SCIP_CALL( SCIPnlrowChgLhs(nlrow, scip->set, scip->stat, scip->nlp, lhs) );
1381 
1382  return SCIP_OKAY;
1383 }
1384 
1385 /** changes right hand side of NLP nonlinear row
1386  *
1387  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1388  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1389  *
1390  * @pre This method can be called if SCIP is in one of the following stages:
1391  * - \ref SCIP_STAGE_PRESOLVED
1392  * - \ref SCIP_STAGE_INITSOLVE
1393  * - \ref SCIP_STAGE_SOLVING
1394  */
1396  SCIP* scip, /**< SCIP data structure */
1397  SCIP_NLROW* nlrow, /**< NLP nonlinear row */
1398  SCIP_Real rhs /**< new right hand side */
1399  )
1400 {
1401  SCIP_CALL( SCIPcheckStage(scip, "SCIPchgNlRowRhs", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
1402 
1403  SCIP_CALL( SCIPnlrowChgRhs(nlrow, scip->set, scip->stat, scip->nlp, rhs) );
1404 
1405  return SCIP_OKAY;
1406 }
1407 
1408 /** changes constant of NLP nonlinear row
1409  *
1410  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1411  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1412  *
1413  * @pre This method can be called if SCIP is in one of the following stages:
1414  * - \ref SCIP_STAGE_PRESOLVED
1415  * - \ref SCIP_STAGE_INITSOLVE
1416  * - \ref SCIP_STAGE_SOLVING
1417  */
1419  SCIP* scip, /**< SCIP data structure */
1420  SCIP_NLROW* nlrow, /**< NLP row */
1421  SCIP_Real constant /**< new value for constant */
1422  )
1423 {
1424  SCIP_CALL( SCIPcheckStage(scip, "SCIPchgNlRowConstant", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
1425 
1426  SCIP_CALL( SCIPnlrowChgConstant(nlrow, scip->set, scip->stat, scip->nlp, constant) );
1427 
1428  return SCIP_OKAY;
1429 }
1430 
1431 /** adds variable with a linear coefficient to the nonlinear row
1432  *
1433  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1434  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1435  *
1436  * @pre This method can be called if SCIP is in one of the following stages:
1437  * - \ref SCIP_STAGE_PRESOLVED
1438  * - \ref SCIP_STAGE_INITSOLVE
1439  * - \ref SCIP_STAGE_SOLVING
1440  */
1442  SCIP* scip, /**< SCIP data structure */
1443  SCIP_NLROW* nlrow, /**< NLP row */
1444  SCIP_VAR* var, /**< problem variable */
1445  SCIP_Real val /**< value of coefficient in linear part of row */
1446  )
1447 {
1448  SCIP_CALL( SCIPcheckStage(scip, "SCIPaddLinearCoefToNlRow", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
1449 
1450  SCIP_CALL( SCIPnlrowAddLinearCoef(nlrow, scip->mem->probmem, scip->set, scip->stat, scip->nlp, var, val) );
1451 
1452  return SCIP_OKAY;
1453 }
1454 
1455 /** adds variables with linear coefficients to the row
1456  *
1457  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1458  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1459  *
1460  * @pre This method can be called if SCIP is in one of the following stages:
1461  * - \ref SCIP_STAGE_PRESOLVED
1462  * - \ref SCIP_STAGE_INITSOLVE
1463  * - \ref SCIP_STAGE_SOLVING
1464  */
1466  SCIP* scip, /**< SCIP data structure */
1467  SCIP_NLROW* nlrow, /**< NLP row */
1468  int nvars, /**< number of variables to add to the row */
1469  SCIP_VAR** vars, /**< problem variables to add */
1470  SCIP_Real* vals /**< values of coefficients in linear part of row */
1471  )
1472 {
1473  int v;
1474 
1475  assert(nvars == 0 || vars != NULL);
1476  assert(nvars == 0 || vals != NULL);
1477 
1478  SCIP_CALL( SCIPcheckStage(scip, "SCIPaddLinearCoefsToNlRow", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
1479 
1480  /* add the variables to the row */
1481  for( v = 0; v < nvars; ++v )
1482  {
1483  SCIP_CALL( SCIPnlrowAddLinearCoef(nlrow, scip->mem->probmem, scip->set, scip->stat, scip->nlp, vars[v], vals[v]) );
1484  }
1485 
1486  return SCIP_OKAY;
1487 }
1488 
1489 /** changes linear coefficient of a variables in a row
1490  *
1491  * Setting the coefficient to 0.0 means that it is removed from the row
1492  * the variable does not need to exists before.
1493  *
1494  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1495  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1496  *
1497  * @pre This method can be called if SCIP is in one of the following stages:
1498  * - \ref SCIP_STAGE_PRESOLVED
1499  * - \ref SCIP_STAGE_INITSOLVE
1500  * - \ref SCIP_STAGE_SOLVING
1501  */
1503  SCIP* scip, /**< SCIP data structure */
1504  SCIP_NLROW* nlrow, /**< NLP row */
1505  SCIP_VAR* var, /**< variable */
1506  SCIP_Real coef /**< new value of coefficient */
1507  )
1508 {
1509  assert(var != NULL);
1510 
1511  SCIP_CALL( SCIPcheckStage(scip, "SCIPchgNlRowLinearCoef", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
1512 
1513  SCIP_CALL( SCIPnlrowChgLinearCoef(nlrow, scip->mem->probmem, scip->set, scip->stat, scip->nlp, var, coef) );
1514 
1515  return SCIP_OKAY;
1516 }
1517 
1518 /** adds quadratic variable to the nonlinear row
1519  *
1520  * After adding a quadratic variable, it can be used to add quadratic elements.
1521  *
1522  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1523  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1524  *
1525  * @pre This method can be called if SCIP is in one of the following stages:
1526  * - \ref SCIP_STAGE_PRESOLVED
1527  * - \ref SCIP_STAGE_INITSOLVE
1528  * - \ref SCIP_STAGE_SOLVING
1529  */
1531  SCIP* scip, /**< SCIP data structure */
1532  SCIP_NLROW* nlrow, /**< NLP row */
1533  SCIP_VAR* var /**< problem variable */
1534  )
1535 {
1536  SCIP_CALL( SCIPcheckStage(scip, "SCIPaddQuadVarToNlRow", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
1537 
1538  SCIP_CALL( SCIPnlrowAddQuadVar(nlrow, scip->mem->probmem, scip->set, var) );
1539 
1540  return SCIP_OKAY;
1541 }
1542 
1543 /** adds quadratic variables to the nonlinear row
1544  *
1545  * After adding quadratic variables, they can be used to add quadratic elements.
1546  *
1547  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1548  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1549  *
1550  * @pre This method can be called if SCIP is in one of the following stages:
1551  * - \ref SCIP_STAGE_PRESOLVED
1552  * - \ref SCIP_STAGE_INITSOLVE
1553  * - \ref SCIP_STAGE_SOLVING
1554  */
1556  SCIP* scip, /**< SCIP data structure */
1557  SCIP_NLROW* nlrow, /**< NLP row */
1558  int nvars, /**< number of problem variables */
1559  SCIP_VAR** vars /**< problem variables */
1560  )
1561 {
1562  int v;
1563 
1564  assert(nvars == 0 || vars != NULL);
1565 
1566  SCIP_CALL( SCIPcheckStage(scip, "SCIPaddQuadVarsToNlRow", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
1567 
1568  SCIP_CALL( SCIPnlrowEnsureQuadVarsSize(nlrow, scip->mem->probmem, scip->set, SCIPnlrowGetNQuadVars(nlrow) + nvars) );
1569  for( v = 0; v < nvars; ++v )
1570  {
1571  SCIP_CALL( SCIPnlrowAddQuadVar(nlrow, scip->mem->probmem, scip->set, vars[v]) );
1572  }
1573 
1574  return SCIP_OKAY;
1575 }
1576 
1577 /** add a quadratic element to the nonlinear row
1578  *
1579  * Variable indices of the quadratic element need to be relative to quadratic variables array of row.
1580  *
1581  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1582  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1583  *
1584  * @pre This method can be called if SCIP is in one of the following stages:
1585  * - \ref SCIP_STAGE_PRESOLVED
1586  * - \ref SCIP_STAGE_INITSOLVE
1587  * - \ref SCIP_STAGE_SOLVING
1588  */
1590  SCIP* scip, /**< SCIP data structure */
1591  SCIP_NLROW* nlrow, /**< NLP row */
1592  SCIP_QUADELEM quadelem /**< quadratic element */
1593  )
1594 {
1595  SCIP_CALL( SCIPcheckStage(scip, "SCIPaddQuadElementToNlRow", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
1596 
1597  SCIP_CALL( SCIPnlrowAddQuadElement(nlrow, scip->mem->probmem, scip->set, scip->stat, scip->nlp, quadelem) );
1598 
1599  /* invalidate curvature */
1600  if( quadelem.coef != 0.0 )
1602 
1603  return SCIP_OKAY;
1604 }
1605 
1606 /** adds quadratic elements to the nonlinear row
1607  *
1608  * Variable indices of the quadratic elements need to be relative to quadratic variables array of row.
1609  *
1610  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1611  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1612  *
1613  * @pre This method can be called if SCIP is in one of the following stages:
1614  * - \ref SCIP_STAGE_PRESOLVED
1615  * - \ref SCIP_STAGE_INITSOLVE
1616  * - \ref SCIP_STAGE_SOLVING
1617  */
1619  SCIP* scip, /**< SCIP data structure */
1620  SCIP_NLROW* nlrow, /**< NLP row */
1621  int nquadelems, /**< number of quadratic elements */
1622  SCIP_QUADELEM* quadelems /**< quadratic elements */
1623  )
1624 {
1625  int v;
1626 
1627  assert(nquadelems == 0 || quadelems != NULL);
1628 
1629  SCIP_CALL( SCIPcheckStage(scip, "SCIPaddQuadElementsToNlRow", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
1630 
1631  SCIP_CALL( SCIPnlrowEnsureQuadElementsSize(nlrow, scip->mem->probmem, scip->set, SCIPnlrowGetNQuadElems(nlrow) + nquadelems) );
1632  for( v = 0; v < nquadelems; ++v )
1633  {
1634  SCIP_CALL( SCIPnlrowAddQuadElement(nlrow, scip->mem->probmem, scip->set, scip->stat, scip->nlp, quadelems[v]) );
1635  }
1636 
1637  /* invalidate curvature */
1639 
1640  return SCIP_OKAY;
1641 }
1642 
1643 /** changes coefficient in quadratic part of a row
1644  *
1645  * Setting the coefficient in the quadelement to 0.0 means that it is removed from the row
1646  * the element does not need to exists before.
1647  *
1648  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1649  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1650  *
1651  * @pre This method can be called if SCIP is in one of the following stages:
1652  * - \ref SCIP_STAGE_PRESOLVED
1653  * - \ref SCIP_STAGE_INITSOLVE
1654  * - \ref SCIP_STAGE_SOLVING
1655  */
1657  SCIP* scip, /**< SCIP data structure */
1658  SCIP_NLROW* nlrow, /**< NLP row */
1659  SCIP_QUADELEM quadelement /**< new quadratic element, or update for existing one */
1660  )
1661 {
1662  SCIP_CALL( SCIPcheckStage(scip, "SCIPchgNlRowQuadElement", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
1663 
1664  SCIP_CALL( SCIPnlrowChgQuadElem(nlrow, scip->mem->probmem, scip->set, scip->stat, scip->nlp, quadelement) );
1665 
1666  return SCIP_OKAY;
1667 }
1668 
1669 /** sets or deletes expression tree in the nonlinear row
1670  *
1671  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1672  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1673  *
1674  * @pre This method can be called if SCIP is in one of the following stages:
1675  * - \ref SCIP_STAGE_PRESOLVED
1676  * - \ref SCIP_STAGE_INITSOLVE
1677  * - \ref SCIP_STAGE_SOLVING
1678  */
1680  SCIP* scip, /**< SCIP data structure */
1681  SCIP_NLROW* nlrow, /**< NLP row */
1682  SCIP_EXPRTREE* exprtree /**< expression tree, or NULL */
1683  )
1684 {
1685  SCIP_CALL( SCIPcheckStage(scip, "SCIPsetNlRowExprtree", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
1686 
1687  SCIP_CALL( SCIPnlrowChgExprtree(nlrow, scip->mem->probmem, scip->set, scip->stat, scip->nlp, exprtree) );
1688 
1689  /* invalidate curvature */
1691 
1692  return SCIP_OKAY;
1693 }
1694 
1695 /** sets a parameter of expression tree in the nonlinear row
1696  *
1697  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1698  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1699  *
1700  * @pre This method can be called if SCIP is in one of the following stages:
1701  * - \ref SCIP_STAGE_PRESOLVED
1702  * - \ref SCIP_STAGE_INITSOLVE
1703  * - \ref SCIP_STAGE_SOLVING
1704  */
1706  SCIP* scip, /**< SCIP data structure */
1707  SCIP_NLROW* nlrow, /**< NLP row */
1708  int paramidx, /**< index of parameter in expression tree */
1709  SCIP_Real paramval /**< new value of parameter in expression tree */
1710  )
1711 {
1712  SCIP_CALL( SCIPcheckStage(scip, "SCIPsetNlRowExprtreeParam", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
1713 
1714  SCIP_CALL( SCIPnlrowChgExprtreeParam(nlrow, scip->mem->probmem, scip->set, scip->stat, scip->nlp, paramidx, paramval) );
1715 
1716  return SCIP_OKAY;
1717 }
1718 
1719 /** sets parameters of expression tree in the nonlinear row
1720  *
1721  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1722  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1723  *
1724  * @pre This method can be called if SCIP is in one of the following stages:
1725  * - \ref SCIP_STAGE_PRESOLVED
1726  * - \ref SCIP_STAGE_INITSOLVE
1727  * - \ref SCIP_STAGE_SOLVING
1728  */
1730  SCIP* scip, /**< SCIP data structure */
1731  SCIP_NLROW* nlrow, /**< NLP row */
1732  SCIP_Real* paramvals /**< new values of parameter in expression tree */
1733  )
1734 {
1735  SCIP_CALL( SCIPcheckStage(scip, "SCIPsetNlRowExprtreeParams", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
1736 
1737  SCIP_CALL( SCIPnlrowChgExprtreeParams(nlrow, scip->mem->probmem, scip->set, scip->stat, scip->nlp, paramvals) );
1738 
1739  return SCIP_OKAY;
1740 }
1741 
1742 /** recalculates the activity of a nonlinear row in the last NLP solution
1743  *
1744  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1745  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1746  *
1747  * @pre This method can be called if SCIP is in one of the following stages:
1748  * - \ref SCIP_STAGE_PRESOLVED
1749  * - \ref SCIP_STAGE_INITSOLVE
1750  * - \ref SCIP_STAGE_SOLVING
1751  */
1753  SCIP* scip, /**< SCIP data structure */
1754  SCIP_NLROW* nlrow /**< NLP nonlinear row */
1755  )
1756 {
1757  SCIP_CALL( SCIPcheckStage(scip, "SCIPrecalcNlRowNLPActivity", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
1758 
1759  if( scip->nlp == NULL )
1760  {
1761  SCIPerrorMessage("do not have NLP for computing NLP activity\n");
1762  return SCIP_INVALIDCALL;
1763  }
1764 
1765  SCIP_CALL( SCIPnlrowRecalcNLPActivity(nlrow, scip->set, scip->stat, scip->nlp) );
1766 
1767  return SCIP_OKAY;
1768 }
1769 
1770 /** returns the activity of a nonlinear row in the last NLP solution
1771  *
1772  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1773  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1774  *
1775  * @pre This method can be called if SCIP is in one of the following stages:
1776  * - \ref SCIP_STAGE_INITSOLVE
1777  * - \ref SCIP_STAGE_SOLVING
1778  */
1780  SCIP* scip, /**< SCIP data structure */
1781  SCIP_NLROW* nlrow, /**< NLP nonlinear row */
1782  SCIP_Real* activity /**< pointer to store activity value */
1783  )
1784 {
1785  SCIP_CALL( SCIPcheckStage(scip, "SCIPgetNlRowNLPActivity", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
1786 
1787  if( scip->nlp == NULL )
1788  {
1789  SCIPerrorMessage("do not have NLP for computing NLP activity\n");
1790  return SCIP_INVALIDCALL;
1791  }
1792 
1793  SCIP_CALL( SCIPnlrowGetNLPActivity(nlrow, scip->set, scip->stat, scip->nlp, activity) );
1794 
1795  return SCIP_OKAY;
1796 }
1797 
1798 /** gives the feasibility of a nonlinear row in the last NLP solution: negative value means infeasibility
1799  *
1800  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1801  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1802  *
1803  * @pre This method can be called if SCIP is in one of the following stages:
1804  * - \ref SCIP_STAGE_INITSOLVE
1805  * - \ref SCIP_STAGE_SOLVING
1806  */
1808  SCIP* scip, /**< SCIP data structure */
1809  SCIP_NLROW* nlrow, /**< NLP nonlinear row */
1810  SCIP_Real* feasibility /**< pointer to store feasibility value */
1811  )
1812 {
1813  SCIP_CALL( SCIPcheckStage(scip, "SCIPgetNlRowNLPFeasibility", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
1814 
1815  if( scip->nlp == NULL )
1816  {
1817  SCIPerrorMessage("do not have NLP for computing NLP feasibility\n");
1818  return SCIP_INVALIDCALL;
1819  }
1820 
1821  SCIP_CALL( SCIPnlrowGetNLPFeasibility(nlrow, scip->set, scip->stat, scip->nlp, feasibility) );
1822 
1823  return SCIP_OKAY;
1824 }
1825 
1826 /** recalculates the activity of a nonlinear row for the current pseudo solution
1827  *
1828  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1829  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1830  *
1831  * @pre This method can be called if SCIP is in one of the following stages:
1832  * - \ref SCIP_STAGE_INITSOLVE
1833  * - \ref SCIP_STAGE_SOLVING
1834  */
1836  SCIP* scip, /**< SCIP data structure */
1837  SCIP_NLROW* nlrow /**< NLP nonlinear row */
1838  )
1839 {
1840  SCIP_CALL( SCIPcheckStage(scip, "SCIPrecalcNlRowPseudoActivity", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
1841 
1842  SCIP_CALL( SCIPnlrowRecalcPseudoActivity(nlrow, scip->set, scip->stat) );
1843 
1844  return SCIP_OKAY;
1845 }
1846 
1847 /** gives the activity of a nonlinear row for the current pseudo solution
1848  *
1849  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1850  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1851  *
1852  * @pre This method can be called if SCIP is in one of the following stages:
1853  * - \ref SCIP_STAGE_INITSOLVE
1854  * - \ref SCIP_STAGE_SOLVING
1855  */
1857  SCIP* scip, /**< SCIP data structure */
1858  SCIP_NLROW* nlrow, /**< NLP nonlinear row */
1859  SCIP_Real* pseudoactivity /**< pointer to store pseudo activity value */
1860  )
1861 {
1862  SCIP_CALL( SCIPcheckStage(scip, "SCIPgetNlRowPseudoActivity", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
1863 
1864  SCIP_CALL( SCIPnlrowGetPseudoActivity(nlrow, scip->set, scip->stat, pseudoactivity) );
1865 
1866  return SCIP_OKAY;
1867 }
1868 
1869 /** gives the feasibility of a nonlinear row for the current pseudo solution: negative value means infeasibility
1870  *
1871  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1872  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1873  *
1874  * @pre This method can be called if SCIP is in one of the following stages:
1875  * - \ref SCIP_STAGE_INITSOLVE
1876  * - \ref SCIP_STAGE_SOLVING
1877  */
1879  SCIP* scip, /**< SCIP data structure */
1880  SCIP_NLROW* nlrow, /**< NLP nonlinear row */
1881  SCIP_Real* pseudofeasibility /**< pointer to store pseudo feasibility value */
1882  )
1883 {
1884  SCIP_CALL( SCIPcheckStage(scip, "SCIPgetNlRowPseudoFeasibility", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
1885 
1886  SCIP_CALL( SCIPnlrowGetPseudoFeasibility(nlrow, scip->set, scip->stat, pseudofeasibility) );
1887 
1888  return SCIP_OKAY;
1889 }
1890 
1891 /** recalculates the activity of a nonlinear row in the last NLP or pseudo solution
1892  *
1893  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1894  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1895  *
1896  * @pre This method can be called if SCIP is in one of the following stages:
1897  * - \ref SCIP_STAGE_INITSOLVE
1898  * - \ref SCIP_STAGE_SOLVING
1899  */
1901  SCIP* scip, /**< SCIP data structure */
1902  SCIP_NLROW* nlrow /**< NLP nonlinear row */
1903  )
1904 {
1905  SCIP_CALL( SCIPcheckStage(scip, "SCIPrecalcNlRowActivity", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
1906 
1907  if( scip->nlp != NULL && SCIPnlpHasCurrentNodeNLP(scip->nlp) && SCIPnlpHasSolution(scip->nlp) )
1908  {
1909  SCIP_CALL( SCIPnlrowRecalcNLPActivity(nlrow, scip->set, scip->stat, scip->nlp) );
1910  }
1911  else
1912  {
1913  SCIP_CALL( SCIPnlrowRecalcPseudoActivity(nlrow, scip->set, scip->stat) );
1914  }
1915 
1916  return SCIP_OKAY;
1917 }
1918 
1919 /** gives the activity of a nonlinear row in the last NLP or pseudo solution
1920  *
1921  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1922  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1923  *
1924  * @pre This method can be called if SCIP is in one of the following stages:
1925  * - \ref SCIP_STAGE_INITSOLVE
1926  * - \ref SCIP_STAGE_SOLVING
1927  */
1929  SCIP* scip, /**< SCIP data structure */
1930  SCIP_NLROW* nlrow, /**< NLP nonlinear row */
1931  SCIP_Real* activity /**< pointer to store activity value */
1932  )
1933 {
1934  SCIP_CALL( SCIPcheckStage(scip, "SCIPgetNlRowActivity", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
1935 
1936  if( scip->nlp != NULL && SCIPnlpHasCurrentNodeNLP(scip->nlp) && SCIPnlpHasSolution(scip->nlp) )
1937  {
1938  SCIP_CALL( SCIPnlrowGetNLPActivity(nlrow, scip->set, scip->stat, scip->nlp, activity) );
1939  }
1940  else
1941  {
1942  SCIP_CALL( SCIPnlrowGetPseudoActivity(nlrow, scip->set, scip->stat, activity) );
1943  }
1944 
1945  return SCIP_OKAY;
1946 }
1947 
1948 /** gives the feasibility of a nonlinear row in the last NLP or pseudo solution
1949  *
1950  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1951  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1952  *
1953  * @pre This method can be called if SCIP is in one of the following stages:
1954  * - \ref SCIP_STAGE_INITSOLVE
1955  * - \ref SCIP_STAGE_SOLVING
1956  */
1958  SCIP* scip, /**< SCIP data structure */
1959  SCIP_NLROW* nlrow, /**< NLP nonlinear row */
1960  SCIP_Real* feasibility /**< pointer to store feasibility value */
1961  )
1962 {
1963  SCIP_CALL( SCIPcheckStage(scip, "SCIPgetNlRowFeasibility", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
1964 
1965  if( scip->nlp != NULL && SCIPnlpHasCurrentNodeNLP(scip->nlp) && SCIPnlpHasSolution(scip->nlp) )
1966  {
1967  SCIP_CALL( SCIPnlrowGetNLPFeasibility(nlrow, scip->set, scip->stat, scip->nlp, feasibility) );
1968  }
1969  else
1970  {
1971  SCIP_CALL( SCIPnlrowGetPseudoFeasibility(nlrow, scip->set, scip->stat, feasibility) );
1972  }
1973 
1974  return SCIP_OKAY;
1975 }
1976 
1977 /** gives the activity of a nonlinear row for the given primal solution or NLP solution or pseudo solution
1978  *
1979  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1980  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1981  *
1982  * @pre This method can be called if SCIP is in one of the following stages:
1983  * - \ref SCIP_STAGE_INITSOLVE
1984  * - \ref SCIP_STAGE_SOLVING
1985  */
1987  SCIP* scip, /**< SCIP data structure */
1988  SCIP_NLROW* nlrow, /**< NLP nonlinear row */
1989  SCIP_SOL* sol, /**< primal CIP solution, or NULL for NLP solution of pseudo solution */
1990  SCIP_Real* activity /**< pointer to store activity value */
1991  )
1992 {
1993  SCIP_CALL( SCIPcheckStage(scip, "SCIPgetNlRowSolActivity", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
1994 
1995  if( sol != NULL )
1996  {
1997  SCIP_CALL( SCIPnlrowGetSolActivity(nlrow, scip->set, scip->stat, sol, activity) );
1998  }
1999  else if( scip->nlp != NULL && SCIPnlpHasCurrentNodeNLP(scip->nlp) && SCIPnlpHasSolution(scip->nlp) )
2000  {
2001  SCIP_CALL( SCIPnlrowGetNLPActivity(nlrow, scip->set, scip->stat, scip->nlp, activity) );
2002  }
2003  else
2004  {
2005  SCIP_CALL( SCIPnlrowGetPseudoActivity(nlrow, scip->set, scip->stat, activity) );
2006  }
2007 
2008  return SCIP_OKAY;
2009 }
2010 
2011 /** gives the feasibility of a nonlinear row for the given primal solution
2012  *
2013  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
2014  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
2015  *
2016  * @pre This method can be called if SCIP is in one of the following stages:
2017  * - \ref SCIP_STAGE_INITSOLVE
2018  * - \ref SCIP_STAGE_SOLVING
2019  */
2021  SCIP* scip, /**< SCIP data structure */
2022  SCIP_NLROW* nlrow, /**< NLP nonlinear row */
2023  SCIP_SOL* sol, /**< primal CIP solution */
2024  SCIP_Real* feasibility /**< pointer to store feasibility value */
2025  )
2026 {
2027  SCIP_CALL( SCIPcheckStage(scip, "SCIPgetNlRowSolFeasibility", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
2028 
2029  if( sol != NULL )
2030  {
2031  SCIP_CALL( SCIPnlrowGetSolFeasibility(nlrow, scip->set, scip->stat, sol, feasibility) );
2032  }
2033  else if( scip->nlp != NULL && SCIPnlpHasCurrentNodeNLP(scip->nlp) && SCIPnlpHasSolution(scip->nlp) )
2034  {
2035  SCIP_CALL( SCIPnlrowGetNLPFeasibility(nlrow, scip->set, scip->stat, scip->nlp, feasibility) );
2036  }
2037  else
2038  {
2039  SCIP_CALL( SCIPnlrowGetPseudoFeasibility(nlrow, scip->set, scip->stat, feasibility) );
2040  }
2041 
2042  return SCIP_OKAY;
2043 }
2044 
2045 /** gives the minimal and maximal activity of a nonlinear row w.r.t. the variable's bounds
2046  *
2047  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
2048  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
2049  *
2050  * @pre This method can be called if SCIP is in one of the following stages:
2051  * - \ref SCIP_STAGE_PRESOLVED
2052  * - \ref SCIP_STAGE_INITSOLVE
2053  * - \ref SCIP_STAGE_SOLVING
2054  */
2056  SCIP* scip, /**< SCIP data structure */
2057  SCIP_NLROW* nlrow, /**< NLP row */
2058  SCIP_Real* minactivity, /**< buffer to store minimal activity, or NULL */
2059  SCIP_Real* maxactivity /**< buffer to store maximal activity, or NULL */
2060  )
2061 {
2062  SCIP_CALL( SCIPcheckStage(scip, "SCIPgetNlRowActivityBounds", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
2063 
2064  SCIP_CALL( SCIPnlrowGetActivityBounds(nlrow, scip->set, scip->stat, minactivity, maxactivity) );
2065 
2066  return SCIP_OKAY;
2067 }
2068 
2069 /** output nonlinear row to file stream
2070  *
2071  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
2072  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
2073  *
2074  * @pre This method can be called if SCIP is in one of the following stages:
2075  * - \ref SCIP_STAGE_PRESOLVED
2076  * - \ref SCIP_STAGE_INITSOLVE
2077  * - \ref SCIP_STAGE_SOLVING
2078  */
2080  SCIP* scip, /**< SCIP data structure */
2081  SCIP_NLROW* nlrow, /**< NLP row */
2082  FILE* file /**< output file (or NULL for standard output) */
2083  )
2084 {
2085  assert(nlrow != NULL);
2086 
2087  SCIP_CALL( SCIPcheckStage(scip, "SCIPprintNlRow", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
2088 
2089  SCIP_CALL( SCIPnlrowPrint(nlrow, scip->messagehdlr, file) );
2090 
2091  return SCIP_OKAY;
2092 }
SCIP_RETCODE SCIPaddLinearCoefsToNlRow(SCIP *scip, SCIP_NLROW *nlrow, int nvars, SCIP_VAR **vars, SCIP_Real *vals)
Definition: scip_nlp.c:1465
SCIP_RETCODE SCIPnlpSetRealPar(SCIP_NLP *nlp, SCIP_NLPPARAM type, SCIP_Real dval)
Definition: nlp.c:6075
internal methods for separators
SCIP_STAT * stat
Definition: struct_scip.h:69
SCIP_RETCODE SCIPnlrowGetPseudoFeasibility(SCIP_NLROW *nlrow, SCIP_SET *set, SCIP_STAT *stat, SCIP_Real *pseudofeasibility)
Definition: nlp.c:3054
int SCIPgetNNLPNlRows(SCIP *scip)
Definition: scip_nlp.c:513
SCIP_RETCODE SCIPgetNlRowPseudoActivity(SCIP *scip, SCIP_NLROW *nlrow, SCIP_Real *pseudoactivity)
Definition: scip_nlp.c:1856
#define NULL
Definition: def.h:239
internal methods for managing events
enum SCIP_NlpTermStat SCIP_NLPTERMSTAT
Definition: type_nlpi.h:84
SCIP_RETCODE SCIPnlrowPrint(SCIP_NLROW *nlrow, SCIP_MESSAGEHDLR *messagehdlr, FILE *file)
Definition: nlp.c:2290
default message handler
SCIP_RETCODE SCIPnlrowChgRhs(SCIP_NLROW *nlrow, SCIP_SET *set, SCIP_STAT *stat, SCIP_NLP *nlp, SCIP_Real rhs)
Definition: nlp.c:2813
SCIP_Bool SCIPisNLPConstructed(SCIP *scip)
Definition: scip_nlp.c:284
trivialnegation primal heuristic
internal methods for storing primal CIP solutions
SCIP_Real * SCIPnlpGetVarsLbDualsol(SCIP_NLP *nlp)
Definition: nlp.c:5908
SCIP_VAR ** SCIPgetNLPVars(SCIP *scip)
Definition: scip_nlp.c:351
methods to interpret (evaluate) an expression tree "fast"
SCIP_RETCODE SCIPgetNLPIntPar(SCIP *scip, SCIP_NLPPARAM type, int *ival)
Definition: scip_nlp.c:818
internal methods for branch and bound tree
SCIP_NLPI * SCIPsetFindNlpi(SCIP_SET *set, const char *name)
Definition: set.c:4936
SCIP_RETCODE SCIPgetNLPNlRowsData(SCIP *scip, SCIP_NLROW ***nlrows, int *nnlrows)
Definition: scip_nlp.c:463
public methods for memory management
SCIP_RETCODE SCIPnlrowAddQuadElement(SCIP_NLROW *nlrow, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_NLP *nlp, SCIP_QUADELEM elem)
Definition: nlp.c:2608
void SCIPnlrowCapture(SCIP_NLROW *nlrow)
Definition: nlp.c:2345
SCIP_PARAMDATA * SCIPparamGetData(SCIP_PARAM *param)
Definition: paramset.c:661
methods for implications, variable bounds, and cliques
SCIP_Real * SCIPgetNLPVarsUbDualsol(SCIP *scip)
Definition: scip_nlp.c:441
#define SCIP_MAXSTRLEN
Definition: def.h:260
int SCIPnlpiGetPriority(SCIP_NLPI *nlpi)
Definition: nlpi.c:763
SCIP_RETCODE SCIPnlrowRelease(SCIP_NLROW **nlrow, BMS_BLKMEM *blkmem, SCIP_SET *set)
Definition: nlp.c:2357
internal methods for clocks and timing issues
struct SCIP_ParamData SCIP_PARAMDATA
Definition: type_paramset.h:76
SCIP_RETCODE SCIPchgNlRowRhs(SCIP *scip, SCIP_NLROW *nlrow, SCIP_Real rhs)
Definition: scip_nlp.c:1395
internal methods for NLPI solver interfaces
SCIP_RETCODE SCIPnlrowEnsureQuadVarsSize(SCIP_NLROW *nlrow, BMS_BLKMEM *blkmem, SCIP_SET *set, int num)
Definition: nlp.c:2525
SCIP_NLPSOLSTAT SCIPgetNLPSolstat(SCIP *scip)
Definition: scip_nlp.c:667
SCIP_RETCODE SCIPsetNlRowExprtreeParam(SCIP *scip, SCIP_NLROW *nlrow, int paramidx, SCIP_Real paramval)
Definition: scip_nlp.c:1705
interface methods for specific LP solvers
SCIP_RETCODE SCIPchgVarObjDiveNLP(SCIP *scip, SCIP_VAR *var, SCIP_Real coef)
Definition: scip_nlp.c:1117
internal methods for displaying statistics tables
SCIP_RETCODE SCIPnlpGetStatistics(SCIP_NLP *nlp, SCIP_NLPSTATISTICS *statistics)
Definition: nlp.c:5998
SCIP_RETCODE SCIPsetNlRowExprtree(SCIP *scip, SCIP_NLROW *nlrow, SCIP_EXPRTREE *exprtree)
Definition: scip_nlp.c:1679
SCIP_RETCODE SCIPchgNlRowLinearCoef(SCIP *scip, SCIP_NLROW *nlrow, SCIP_VAR *var, SCIP_Real coef)
Definition: scip_nlp.c:1502
#define FALSE
Definition: def.h:65
SCIP_RETCODE SCIPnlpSolveDive(SCIP_NLP *nlp, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, SCIP_STAT *stat)
Definition: nlp.c:6359
SCIP_RETCODE SCIPnlpGetVarsNonlinearity(SCIP_NLP *nlp, int *nlcount)
Definition: nlp.c:5811
methods for the aggregation rows
SCIP_Bool SCIPhasNLPContinuousNonlinearity(SCIP *scip)
Definition: scip_nlp.c:299
internal methods for Benders&#39; decomposition
SCIP_RETCODE SCIPaddQuadElementToNlRow(SCIP *scip, SCIP_NLROW *nlrow, SCIP_QUADELEM quadelem)
Definition: scip_nlp.c:1589
int SCIPsnprintf(char *t, int len, const char *s,...)
Definition: misc.c:10017
#define TRUE
Definition: def.h:64
SCIP_RETCODE SCIPnlrowEnsureQuadElementsSize(SCIP_NLROW *nlrow, BMS_BLKMEM *blkmem, SCIP_SET *set, int num)
Definition: nlp.c:2584
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:53
SCIP_RETCODE SCIPsolveNLP(SCIP *scip)
Definition: scip_nlp.c:644
methods commonly used by primal heuristics
SCIP_RETCODE SCIPnlpChgVarsBoundsDive(SCIP_NLP *nlp, SCIP_SET *set, int nvars, SCIP_VAR **vars, SCIP_Real *lbs, SCIP_Real *ubs)
Definition: nlp.c:6307
int SCIPnlrowGetNQuadVars(SCIP_NLROW *nlrow)
Definition: nlp.c:3276
internal methods for branching rules and branching candidate storage
const char * SCIPnlpiGetName(SCIP_NLPI *nlpi)
Definition: nlpi.c:743
datastructures for concurrent solvers
SCIP_NLPTERMSTAT SCIPnlpGetTermstat(SCIP_NLP *nlp)
Definition: nlp.c:5988
SCIP_RETCODE SCIPsetIncludeNlpi(SCIP_SET *set, SCIP_NLPI *nlpi)
Definition: set.c:4913
SCIP_RETCODE SCIPnlrowChgExprtreeParams(SCIP_NLROW *nlrow, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_NLP *nlp, SCIP_Real *paramvals)
Definition: nlp.c:2751
SCIP_RETCODE SCIPnlpiSetMessageHdlr(SCIP_NLPI *nlpi, SCIP_MESSAGEHDLR *messagehdlr)
Definition: nlpi.c:720
SCIP_RETCODE SCIPgetNlRowSolActivity(SCIP *scip, SCIP_NLROW *nlrow, SCIP_SOL *sol, SCIP_Real *activity)
Definition: scip_nlp.c:1986
SCIP_RETCODE SCIPgetNLPVarsNonlinearity(SCIP *scip, int *nlcount)
Definition: scip_nlp.c:395
SCIP_RETCODE SCIPflushNLP(SCIP *scip)
Definition: scip_nlp.c:559
enum SCIP_NlpParam SCIP_NLPPARAM
Definition: type_nlpi.h:56
SCIP_RETCODE SCIPsetNLPIntPar(SCIP *scip, SCIP_NLPPARAM type, int ival)
Definition: scip_nlp.c:846
internal methods for handling parameter settings
SCIP_PROB * transprob
Definition: struct_scip.h:87
SCIP_RETCODE SCIPsetNLPStringPar(SCIP *scip, SCIP_NLPPARAM type, const char *sval)
Definition: scip_nlp.c:958
methods for creating output for visualization tools (VBC, BAK)
nodereopt branching rule
SCIP_RETCODE SCIPnlpGetIntPar(SCIP_NLP *nlp, SCIP_NLPPARAM type, int *ival)
Definition: nlp.c:6025
#define SCIPfreeBufferArray(scip, ptr)
Definition: scip_mem.h:142
SCIP_RETCODE SCIPnlrowChgQuadElem(SCIP_NLROW *nlrow, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_NLP *nlp, SCIP_QUADELEM elem)
Definition: nlp.c:2657
SCIP_RETCODE SCIPaddIntParam(SCIP *scip, const char *name, const char *desc, int *valueptr, SCIP_Bool isadvanced, int defaultvalue, int minvalue, int maxvalue, SCIP_DECL_PARAMCHGD((*paramchgd)), SCIP_PARAMDATA *paramdata)
Definition: scip_param.c:155
SCIP_RETCODE SCIPaddLinearCoefToNlRow(SCIP *scip, SCIP_NLROW *nlrow, SCIP_VAR *var, SCIP_Real val)
Definition: scip_nlp.c:1441
internal methods for LP management
SCIP_NLROW ** SCIPgetNLPNlRows(SCIP *scip)
Definition: scip_nlp.c:491
SCIP_RETCODE SCIPnlrowChgLhs(SCIP_NLROW *nlrow, SCIP_SET *set, SCIP_STAT *stat, SCIP_NLP *nlp, SCIP_Real lhs)
Definition: nlp.c:2793
SCIP_RETCODE SCIPnlrowGetNLPFeasibility(SCIP_NLROW *nlrow, SCIP_SET *set, SCIP_STAT *stat, SCIP_NLP *nlp, SCIP_Real *feasibility)
Definition: nlp.c:2953
internal methods for branching and inference history
internal methods for collecting primal CIP solutions and primal informations
SCIP_RETCODE SCIPcreateNlRowFromRow(SCIP *scip, SCIP_NLROW **nlrow, SCIP_ROW *row)
Definition: scip_nlp.c:1304
int SCIPnlrowGetNQuadElems(SCIP_NLROW *nlrow)
Definition: nlp.c:3323
internal methods for propagators
SCIP_NLPI ** nlpis
Definition: struct_set.h:89
SCIP_RETCODE SCIPnlrowAddQuadVar(SCIP_NLROW *nlrow, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_VAR *var)
Definition: nlp.c:2549
SCIP_RETCODE SCIPnlpStartDive(SCIP_NLP *nlp, BMS_BLKMEM *blkmem, SCIP_SET *set)
Definition: nlp.c:6128
SCIP_Bool SCIPnlpHasContinuousNonlinearity(SCIP_NLP *nlp)
Definition: nlp.c:5870
SCIP_Real coef
Definition: type_expr.h:104
public methods for handling parameter settings
SCIP_MEM * mem
Definition: struct_scip.h:61
int SCIPgetNNLPVars(SCIP *scip)
Definition: scip_nlp.c:373
SCIP_NLPTERMSTAT SCIPgetNLPTermstat(SCIP *scip)
Definition: scip_nlp.c:689
git hash methods
void SCIPsetSetPriorityNlpi(SCIP_SET *set, SCIP_NLPI *nlpi, int priority)
Definition: set.c:4970
SCIP_RETCODE SCIPsetNlRowExprtreeParams(SCIP *scip, SCIP_NLROW *nlrow, SCIP_Real *paramvals)
Definition: scip_nlp.c:1729
SCIP_RETCODE SCIPsolveDiveNLP(SCIP *scip)
Definition: scip_nlp.c:1208
internal methods for storing and manipulating the main problem
#define SCIPerrorMessage
Definition: pub_message.h:45
SCIP_RETCODE SCIPchgNlRowQuadElement(SCIP *scip, SCIP_NLROW *nlrow, SCIP_QUADELEM quadelement)
Definition: scip_nlp.c:1656
SCIP_RETCODE SCIPrecalcNlRowPseudoActivity(SCIP *scip, SCIP_NLROW *nlrow)
Definition: scip_nlp.c:1835
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:2487
SCIP_RETCODE SCIPaddNlRow(SCIP *scip, SCIP_NLROW *nlrow)
Definition: scip_nlp.c:535
SCIP_RETCODE SCIPwriteNLP(SCIP *scip, const char *filename)
Definition: scip_nlp.c:986
methods for block memory pools and memory buffers
enum SCIP_NlpSolStat SCIP_NLPSOLSTAT
Definition: type_nlpi.h:69
SCIP_RETCODE SCIPgetSolVals(SCIP *scip, SCIP_SOL *sol, int nvars, SCIP_VAR **vars, SCIP_Real *vals)
Definition: scip_sol.c:1447
SCIP_RETCODE SCIPnlpGetRealPar(SCIP_NLP *nlp, SCIP_NLPPARAM type, SCIP_Real *dval)
Definition: nlp.c:6058
SCIP_RETCODE SCIPreleaseNlRow(SCIP *scip, SCIP_NLROW **nlrow)
Definition: scip_nlp.c:1350
SCIP_RETCODE SCIPnlrowGetPseudoActivity(SCIP_NLROW *nlrow, SCIP_SET *set, SCIP_STAT *stat, SCIP_Real *pseudoactivity)
Definition: nlp.c:3028
register additional core functionality that is designed as plugins
SCIP_RETCODE SCIPcheckStage(SCIP *scip, const char *method, SCIP_Bool init, SCIP_Bool problem, SCIP_Bool transforming, SCIP_Bool transformed, SCIP_Bool initpresolve, SCIP_Bool presolving, SCIP_Bool exitpresolve, SCIP_Bool presolved, SCIP_Bool initsolve, SCIP_Bool solving, SCIP_Bool solved, SCIP_Bool exitsolve, SCIP_Bool freetrans, SCIP_Bool freescip)
Definition: debug.c:1933
BMS_BLKMEM * SCIPblkmem(SCIP *scip)
Definition: scip_mem.c:128
SCIP_RETCODE SCIPchgVarBoundsDiveNLP(SCIP *scip, SCIP_VAR *var, SCIP_Real lb, SCIP_Real ub)
Definition: scip_nlp.c:1147
int SCIPnlpGetNNlRows(SCIP_NLP *nlp)
Definition: nlp.c:5938
SCIP_Real SCIPnlpGetObjval(SCIP_NLP *nlp)
Definition: nlp.c:5588
internal methods for presolvers
SCIP_NLROW ** SCIPnlpGetNlRows(SCIP_NLP *nlp)
Definition: nlp.c:5928
SCIP_RETCODE SCIPnlrowGetSolFeasibility(SCIP_NLROW *nlrow, SCIP_SET *set, SCIP_STAT *stat, SCIP_SOL *sol, SCIP_Real *feasibility)
Definition: nlp.c:3159
SCIP_RETCODE SCIPgetNLPRealPar(SCIP *scip, SCIP_NLPPARAM type, SCIP_Real *dval)
Definition: scip_nlp.c:874
internal methods for NLP management
SCIP_RETCODE SCIPnlpSetIntPar(SCIP_NLP *nlp, SCIP_NLPPARAM type, int ival)
Definition: nlp.c:6042
SCIP_RETCODE SCIPgetNlRowActivityBounds(SCIP *scip, SCIP_NLROW *nlrow, SCIP_Real *minactivity, SCIP_Real *maxactivity)
Definition: scip_nlp.c:2055
SCIP_Bool SCIPisNLPEnabled(SCIP *scip)
Definition: scip_nlp.c:246
internal miscellaneous methods
SCIP_RETCODE SCIPsetNLPInitialGuess(SCIP *scip, SCIP_Real *initialguess)
Definition: scip_nlp.c:585
int SCIPgetNNlpis(SCIP *scip)
Definition: scip_nlp.c:206
SCIP_RETCODE SCIPsetNLPInitialGuessSol(SCIP *scip, SCIP_SOL *sol)
Definition: scip_nlp.c:612
internal methods for node selectors and node priority queues
internal methods for variable pricers
internal methods for global SCIP settings
internal methods for storing conflicts
#define SCIP_CALL(x)
Definition: def.h:351
SCIP_RETCODE SCIPgetNLPI(SCIP *scip, SCIP_NLPI **nlpi, SCIP_NLPIPROBLEM **nlpiproblem)
Definition: scip_nlp.c:1023
SCIP_RETCODE SCIPrecalcNlRowActivity(SCIP *scip, SCIP_NLROW *nlrow)
Definition: scip_nlp.c:1900
SCIP main data structure.
SCIP_RETCODE SCIPnlpSetInitialGuess(SCIP_NLP *nlp, BMS_BLKMEM *blkmem, SCIP_Real *initguess)
Definition: nlp.c:5707
internal methods for storing priced variables
SCIP_RETCODE SCIPgetNLPStringPar(SCIP *scip, SCIP_NLPPARAM type, const char **sval)
Definition: scip_nlp.c:930
SCIP_RETCODE SCIPnlrowCreateFromRow(SCIP_NLROW **nlrow, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_ROW *row)
Definition: nlp.c:2185
internal methods for relaxators
SCIP_RETCODE SCIPnlpChgVarObjDive(SCIP_NLP *nlp, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_VAR *var, SCIP_Real coef)
Definition: nlp.c:6219
internal methods for storing separated cuts
SCIP_RETCODE SCIPnlrowChgConstant(SCIP_NLROW *nlrow, SCIP_SET *set, SCIP_STAT *stat, SCIP_NLP *nlp, SCIP_Real constant)
Definition: nlp.c:2773
SCIP_RETCODE SCIPnlpChgVarBoundsDive(SCIP_NLP *nlp, SCIP_VAR *var, SCIP_Real lb, SCIP_Real ub)
Definition: nlp.c:6279
SCIP_RETCODE SCIPnlrowChgExprtreeParam(SCIP_NLROW *nlrow, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_NLP *nlp, int paramidx, SCIP_Real paramval)
Definition: nlp.c:2728
public methods for NLP management
SCIP_RETCODE SCIPchgNlRowLhs(SCIP *scip, SCIP_NLROW *nlrow, SCIP_Real lhs)
Definition: scip_nlp.c:1372
methods commonly used for presolving
methods for catching the user CTRL-C interrupt
internal methods for problem variables
data structures and methods for collecting reoptimization information
the function declarations for the synchronization store
SCIP_RETCODE SCIPsetNLPRealPar(SCIP *scip, SCIP_NLPPARAM type, SCIP_Real dval)
Definition: scip_nlp.c:902
SCIP_RETCODE SCIPnlpWrite(SCIP_NLP *nlp, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, const char *fname)
Definition: nlp.c:5740
#define SCIPallocBufferArray(scip, ptr, num)
Definition: scip_mem.h:130
SCIP_RETCODE SCIPgetNlRowFeasibility(SCIP *scip, SCIP_NLROW *nlrow, SCIP_Real *feasibility)
Definition: scip_nlp.c:1957
public data structures and miscellaneous methods
SCIP_RETCODE SCIPincludeNlpi(SCIP *scip, SCIP_NLPI *nlpi)
Definition: scip_nlp.c:144
SCIP_RETCODE SCIPnlpEndDive(SCIP_NLP *nlp, BMS_BLKMEM *blkmem, SCIP_SET *set)
Definition: nlp.c:6158
internal methods for user interface dialog
#define SCIP_Bool
Definition: def.h:62
SCIP_RETCODE SCIPgetNLPStatistics(SCIP *scip, SCIP_NLPSTATISTICS *statistics)
Definition: scip_nlp.c:714
SCIP_RETCODE SCIPchgNlRowConstant(SCIP *scip, SCIP_NLROW *nlrow, SCIP_Real constant)
Definition: scip_nlp.c:1418
SCIP_Bool SCIPnlpHasCurrentNodeNLP(SCIP_NLP *nlp)
Definition: nlp.c:5284
SCIP_RETCODE SCIPrecalcNlRowNLPActivity(SCIP *scip, SCIP_NLROW *nlrow)
Definition: scip_nlp.c:1752
SCIP_NLPSOLSTAT SCIPnlpGetSolstat(SCIP_NLP *nlp)
Definition: nlp.c:5978
SCIP_RETCODE SCIPnlrowCreate(SCIP_NLROW **nlrow, BMS_BLKMEM *blkmem, SCIP_SET *set, const char *name, SCIP_Real constant, int nlinvars, SCIP_VAR **linvars, SCIP_Real *lincoefs, int nquadvars, SCIP_VAR **quadvars, int nquadelems, SCIP_QUADELEM *quadelems, SCIP_EXPRTREE *exprtree, SCIP_Real lhs, SCIP_Real rhs, SCIP_EXPRCURV curvature)
Definition: nlp.c:2001
SCIP_RETCODE SCIPnlpAddNlRow(SCIP_NLP *nlp, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_NLROW *nlrow)
Definition: nlp.c:5441
internal methods for input file readers
SCIP_RETCODE SCIPnlpFlush(SCIP_NLP *nlp, BMS_BLKMEM *blkmem, SCIP_SET *set)
Definition: nlp.c:5524
SCIP_RETCODE SCIPgetNLPVarsData(SCIP *scip, SCIP_VAR ***vars, int *nvars)
Definition: scip_nlp.c:321
SCIP_RETCODE SCIPchgVarsBoundsDiveNLP(SCIP *scip, int nvars, SCIP_VAR **vars, SCIP_Real *lbs, SCIP_Real *ubs)
Definition: scip_nlp.c:1178
void SCIPsetSortNlpis(SCIP_SET *set)
Definition: set.c:4956
SCIP_RETCODE SCIPgetNlRowPseudoFeasibility(SCIP *scip, SCIP_NLROW *nlrow, SCIP_Real *pseudofeasibility)
Definition: scip_nlp.c:1878
SCIP_RETCODE SCIPgetNlRowActivity(SCIP *scip, SCIP_NLROW *nlrow, SCIP_Real *activity)
Definition: scip_nlp.c:1928
methods for debugging
SCIP_RETCODE SCIPnlrowGetNLPActivity(SCIP_NLROW *nlrow, SCIP_SET *set, SCIP_STAT *stat, SCIP_NLP *nlp, SCIP_Real *activity)
Definition: nlp.c:2926
SCIP_RETCODE SCIPnlrowChgExprtree(SCIP_NLROW *nlrow, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_NLP *nlp, SCIP_EXPRTREE *exprtree)
Definition: nlp.c:2689
int SCIPnlpGetNVars(SCIP_NLP *nlp)
Definition: nlp.c:5801
SCIP_RETCODE SCIPcreateEmptyNlRow(SCIP *scip, SCIP_NLROW **nlrow, const char *name, SCIP_Real lhs, SCIP_Real rhs)
Definition: scip_nlp.c:1278
SCIP_RETCODE SCIPcaptureNlRow(SCIP *scip, SCIP_NLROW *nlrow)
Definition: scip_nlp.c:1327
reoptsols primal heuristic
SCIP_RETCODE SCIPnlrowGetActivityBounds(SCIP_NLROW *nlrow, SCIP_SET *set, SCIP_STAT *stat, SCIP_Real *minactivity, SCIP_Real *maxactivity)
Definition: nlp.c:3180
internal methods for storing cuts in a cut pool
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:5627
Constraint handler for linear constraints in their most general form, .
SCIP_Real * SCIPgetNLPVarsLbDualsol(SCIP *scip)
Definition: scip_nlp.c:419
SCIP_RETCODE SCIPnlrowGetSolActivity(SCIP_NLROW *nlrow, SCIP_SET *set, SCIP_STAT *stat, SCIP_SOL *sol, SCIP_Real *activity)
Definition: nlp.c:3074
SCIP * scip
Definition: struct_var.h:201
helper functions for concurrent scip solvers
SCIP_RETCODE SCIPnlpSolve(SCIP_NLP *nlp, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, SCIP_STAT *stat)
Definition: nlp.c:5561
int SCIPparamGetInt(SCIP_PARAM *param)
Definition: paramset.c:716
public methods for nonlinear relaxations
void SCIPenableNLP(SCIP *scip)
Definition: scip_nlp.c:269
internal methods for return codes for SCIP methods
SCIP_Bool SCIPhasNLPSolution(SCIP *scip)
Definition: scip_nlp.c:762
enum SCIP_ExprCurv SCIP_EXPRCURV
Definition: type_expr.h:95
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:2406
SCIP_RETCODE SCIPaddQuadVarToNlRow(SCIP *scip, SCIP_NLROW *nlrow, SCIP_VAR *var)
Definition: scip_nlp.c:1530
BMS_BLKMEM * probmem
Definition: struct_mem.h:40
SCIP_RETCODE SCIPaddQuadVarsToNlRow(SCIP *scip, SCIP_NLROW *nlrow, int nvars, SCIP_VAR **vars)
Definition: scip_nlp.c:1555
SCIP_Bool nlpenabled
Definition: struct_prob.h:80
SCIP_NLPIPROBLEM * SCIPnlpGetNLPIProblem(SCIP_NLP *nlp)
Definition: nlp.c:5958
SCIP_RETCODE SCIPgetNlRowSolFeasibility(SCIP *scip, SCIP_NLROW *nlrow, SCIP_SOL *sol, SCIP_Real *feasibility)
Definition: scip_nlp.c:2020
public methods for solutions
internal methods for conflict analysis
static SCIP_DECL_PARAMCHGD(paramChgdNlpiPriority)
Definition: scip_nlp.c:131
SCIP_NLPI * SCIPfindNlpi(SCIP *scip, const char *name)
Definition: scip_nlp.c:180
internal methods for tree compressions
internal methods for main solving loop and node processing
SCIP_RETCODE SCIPendDiveNLP(SCIP *scip)
Definition: scip_nlp.c:1091
SCIP_SET * set
Definition: struct_scip.h:62
SCIP_RETCODE SCIPnlrowRecalcNLPActivity(SCIP_NLROW *nlrow, SCIP_SET *set, SCIP_STAT *stat, SCIP_NLP *nlp)
Definition: nlp.c:2849
public methods for message output
SCIP_RETCODE SCIPgetNLPFracVars(SCIP *scip, SCIP_VAR ***fracvars, SCIP_Real **fracvarssol, SCIP_Real **fracvarsfrac, int *nfracvars, int *npriofracvars)
Definition: scip_nlp.c:787
SCIP_MESSAGEHDLR * messagehdlr
Definition: struct_scip.h:65
default user interface dialog
#define SCIP_Real
Definition: def.h:150
internal methods for problem statistics
SCIP_RETCODE SCIPgetNlRowNLPFeasibility(SCIP *scip, SCIP_NLROW *nlrow, SCIP_Real *feasibility)
Definition: scip_nlp.c:1807
SCIP_NLP * nlp
Definition: struct_scip.h:81
#define SCIP_INVALID
Definition: def.h:170
int nnlpis
Definition: struct_set.h:130
internal methods for constraints and constraint handlers
SCIP_NLPI * SCIPnlpGetNLPI(SCIP_NLP *nlp)
Definition: nlp.c:5948
SCIP_RETCODE SCIPnlpSetStringPar(SCIP_NLP *nlp, SCIP_NLPPARAM type, const char *sval)
Definition: nlp.c:6108
SCIP_RETCODE SCIPprintNlRow(SCIP *scip, SCIP_NLROW *nlrow, FILE *file)
Definition: scip_nlp.c:2079
SCIP_VAR ** SCIPnlpGetVars(SCIP_NLP *nlp)
Definition: nlp.c:5791
declarations for XML parsing
build flags methods
SCIP_RETCODE SCIPsetNlpiPriority(SCIP *scip, SCIP_NLPI *nlpi, int priority)
Definition: scip_nlp.c:217
SCIP_RETCODE SCIPnlpGetStringPar(SCIP_NLP *nlp, SCIP_NLPPARAM type, const char **sval)
Definition: nlp.c:6091
SCIP_Real SCIPgetNLPObjval(SCIP *scip)
Definition: scip_nlp.c:738
SCIP_RETCODE SCIPstartDiveNLP(SCIP *scip)
Definition: scip_nlp.c:1063
SCIP_NLPI ** SCIPgetNlpis(SCIP *scip)
Definition: scip_nlp.c:193
SCIP_Real * SCIPnlpGetVarsUbDualsol(SCIP_NLP *nlp)
Definition: nlp.c:5918
common defines and data types used in all packages of SCIP
SCIP_RETCODE SCIPcreateNlRow(SCIP *scip, SCIP_NLROW **nlrow, const char *name, SCIP_Real constant, int nlinvars, SCIP_VAR **linvars, SCIP_Real *lincoefs, int nquadvars, SCIP_VAR **quadvars, int nquadelems, SCIP_QUADELEM *quadelems, SCIP_EXPRTREE *expression, SCIP_Real lhs, SCIP_Real rhs, SCIP_EXPRCURV curvature)
Definition: scip_nlp.c:1242
#define SCIP_CALL_ABORT(x)
Definition: def.h:330
internal methods for primal heuristics
SCIP_RETCODE SCIPgetNlRowNLPActivity(SCIP *scip, SCIP_NLROW *nlrow, SCIP_Real *activity)
Definition: scip_nlp.c:1779
#define SCIPABORT()
Definition: def.h:323
SCIP_RETCODE SCIPnlrowRecalcPseudoActivity(SCIP_NLROW *nlrow, SCIP_SET *set, SCIP_STAT *stat)
Definition: nlp.c:2973
SCIP_Bool SCIPnlpHasSolution(SCIP_NLP *nlp)
Definition: nlp.c:6015
void SCIPnlrowSetCurvature(SCIP_NLROW *nlrow, SCIP_EXPRCURV curvature)
Definition: nlp.c:3403
internal methods for Benders&#39; decomposition cuts
SCIP_RETCODE SCIPaddQuadElementsToNlRow(SCIP *scip, SCIP_NLROW *nlrow, int nquadelems, SCIP_QUADELEM *quadelems)
Definition: scip_nlp.c:1618
internal methods for displaying runtime statistics
OFINS - Objective Function Induced Neighborhood Search - a primal heuristic for reoptimization.