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