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-2022 Konrad-Zuse-Zentrum */
7 /* fuer Informationstechnik Berlin */
8 /* */
9 /* SCIP is distributed under the terms of the ZIB Academic License. */
10 /* */
11 /* You should have received a copy of the ZIB Academic License */
12 /* along with SCIP; see the file COPYING. If not visit scipopt.org. */
13 /* */
14 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
15 
16 /**@file scip_nlp.c
17  * @ingroup OTHER_CFILES
18  * @brief public methods for nonlinear relaxation
19  * @author Thorsten Gellermann
20  * @author Stefan Vigerske
21  *
22  * @todo check all SCIP_STAGE_* switches, and include the new stages TRANSFORMED and INITSOLVE
23  */
24 
25 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
26 
27 #include "blockmemshell/memory.h"
28 #include "scip/nlpi.h"
29 #include "scip/debug.h"
30 #include "scip/nlp.h"
31 #include "scip/pub_message.h"
32 #include "scip/pub_misc.h"
33 #include "scip/pub_nlp.h"
34 #include "scip/pub_paramset.h"
35 #include "scip/scip_mem.h"
36 #include "scip/scip_nlp.h"
37 #include "scip/scip_param.h"
38 #include "scip/scip_sol.h"
39 #include "scip/set.h"
40 #include "scip/struct_mem.h"
41 #include "scip/struct_prob.h"
42 #include "scip/struct_scip.h"
43 #include "scip/struct_set.h"
44 #include "scip/struct_var.h"
45 
46 /**@addtogroup PublicNLPMethods
47  * @{
48  */
49 
50 /** returns whether the NLP relaxation has been enabled
51  *
52  * If the NLP relaxation is enabled, then SCIP will construct the NLP relaxation when the solving process is about to begin.
53  * To check whether an NLP is existing, use SCIPisNLPConstructed().
54  *
55  * @pre This method can be called if SCIP is in one of the following stages:
56  * - \ref SCIP_STAGE_INITPRESOLVE
57  * - \ref SCIP_STAGE_PRESOLVING
58  * - \ref SCIP_STAGE_EXITPRESOLVE
59  * - \ref SCIP_STAGE_PRESOLVED
60  * - \ref SCIP_STAGE_INITSOLVE
61  * - \ref SCIP_STAGE_SOLVING
62  *
63  * @see SCIPenableNLP
64  */
66  SCIP* scip /**< SCIP data structure */
67  )
68 {
69  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPisNLPEnabled", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
70 
71  return scip->transprob->nlpenabled;
72 }
73 
74 /** notifies SCIP that the NLP relaxation should be initialized in INITSOLVE
75  *
76  * This method is typically called by a constraint handler that handles constraints that have a nonlinear representation as nonlinear rows, e.g., cons_nonlinear.
77  *
78  * The function should be called before the branch-and-bound process is initialized, e.g., when presolve is exiting.
79  *
80  * @pre This method can be called if SCIP is in one of the following stages:
81  * - \ref SCIP_STAGE_INITPRESOLVE
82  * - \ref SCIP_STAGE_PRESOLVING
83  * - \ref SCIP_STAGE_EXITPRESOLVE
84  * - \ref SCIP_STAGE_PRESOLVED
85  */
87  SCIP* scip /**< SCIP data structure */
88  )
89 {
91 
92  scip->transprob->nlpenabled = TRUE;
93 }
94 
95 /** returns, whether an NLP has been constructed
96  *
97  * @pre This method can be called if SCIP is in one of the following stages:
98  * - \ref SCIP_STAGE_INITSOLVE
99  * - \ref SCIP_STAGE_SOLVING
100  */
102  SCIP* scip /**< SCIP data structure */
103  )
104 {
105  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPisNLPConstructed", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
106 
107  return (scip->nlp != NULL);
108 }
109 
110 /** checks whether the NLP has a continuous variable in a nonlinear term
111  *
112  * @pre This method can be called if SCIP is in one of the following stages:
113  * - \ref SCIP_STAGE_INITSOLVE
114  * - \ref SCIP_STAGE_SOLVING
115  */
117  SCIP* scip, /**< SCIP data structure */
118  SCIP_Bool* result /**< buffer to store result */
119  )
120 {
121  SCIP_CALL( SCIPcheckStage(scip, "SCIPhasNLPContinuousNonlinearity", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
122 
123  if( scip->nlp == NULL )
124  {
125  SCIPerrorMessage("NLP has not been not constructed.\n");
126  return SCIP_ERROR;
127  }
128 
129  SCIP_CALL( SCIPnlpHasContinuousNonlinearity(scip->nlp, scip->mem->probmem, scip->set, scip->stat, result) );
130 
131  return SCIP_OKAY;
132 }
133 
134 /** gets current NLP variables along with the current number of NLP variables
135  *
136  * @pre This method can be called if SCIP is in one of the following stages:
137  * - \ref SCIP_STAGE_INITSOLVE
138  * - \ref SCIP_STAGE_SOLVING
139  */
141  SCIP* scip, /**< SCIP data structure */
142  SCIP_VAR*** vars, /**< pointer to store the array of NLP variables, or NULL */
143  int* nvars /**< pointer to store the number of NLP variables, or NULL */
144  )
145 {
146  SCIP_CALL( SCIPcheckStage(scip, "SCIPgetNLPVarsData", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
147 
148  if( scip->nlp != NULL )
149  {
150  if( vars != NULL )
151  *vars = SCIPnlpGetVars(scip->nlp);
152  if( nvars != NULL )
153  *nvars = SCIPnlpGetNVars(scip->nlp);
154  }
155  else
156  {
157  SCIPerrorMessage("NLP has not been constructed.\n");
158  return SCIP_INVALIDCALL;
159  }
160 
161  return SCIP_OKAY;
162 }
163 
164 /** gets array with variables of the NLP
165  *
166  * @pre This method can be called if SCIP is in one of the following stages:
167  * - \ref SCIP_STAGE_INITSOLVE
168  * - \ref SCIP_STAGE_SOLVING
169  */
171  SCIP* scip /**< SCIP data structure */
172  )
173 {
175 
176  if( scip->nlp == NULL )
177  {
178  SCIPerrorMessage("NLP has not been constructed.\n");
179  SCIPABORT();
180  return NULL; /*lint !e527*/
181  }
182 
183  return SCIPnlpGetVars(scip->nlp);
184 }
185 
186 /** gets current number of variables in NLP
187  *
188  * @pre This method can be called if SCIP is in one of the following stages:
189  * - \ref SCIP_STAGE_INITSOLVE
190  * - \ref SCIP_STAGE_SOLVING
191  */
193  SCIP* scip /**< SCIP data structure */
194  )
195 {
196  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetNNLPVars", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
197 
198  if( scip->nlp == NULL )
199  {
200  SCIPerrorMessage("NLP has not been constructed.\n");
201  SCIPABORT();
202  return 0; /*lint !e527*/
203  }
204 
205  return SCIPnlpGetNVars(scip->nlp);
206 }
207 
208 /** computes for each variables the number of NLP rows in which the variable appears in the nonlinear part
209  *
210  * @pre This method can be called if SCIP is in one of the following stages:
211  * - \ref SCIP_STAGE_INITSOLVE
212  * - \ref SCIP_STAGE_SOLVING
213  */
215  SCIP* scip, /**< SCIP data structure */
216  int* nlcount /**< an array of length at least SCIPnlpGetNVars() to store nonlinearity counts of variables */
217  )
218 {
219  SCIP_CALL( SCIPcheckStage(scip, "SCIPgetNLPVarsNonlinearity", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
220 
221  if( scip->nlp == NULL )
222  {
223  SCIPerrorMessage("NLP has not been constructed.\n");
224  return SCIP_INVALIDCALL;
225  }
226 
227  SCIP_CALL( SCIPnlpGetVarsNonlinearity(scip->nlp, scip->mem->probmem, scip->set, scip->stat, nlcount) );
228 
229  return SCIP_OKAY;
230 }
231 
232 /** returns dual solution values associated with lower bounds of NLP variables
233  *
234  * @pre This method can be called if SCIP is in one of the following stages:
235  * - \ref SCIP_STAGE_INITSOLVE
236  * - \ref SCIP_STAGE_SOLVING
237  */
239  SCIP* scip /**< SCIP data structure */
240  )
241 {
242  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetNLPVarsLbDualsol", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
243 
244  if( scip->nlp == NULL )
245  {
246  SCIPerrorMessage("NLP has not been constructed.\n");
247  SCIPABORT();
248  return NULL; /*lint !e527*/
249  }
250 
251  return SCIPnlpGetVarsLbDualsol(scip->nlp);
252 }
253 
254 /** returns dual solution values associated with upper bounds of NLP variables
255  *
256  * @pre This method can be called if SCIP is in one of the following stages:
257  * - \ref SCIP_STAGE_INITSOLVE
258  * - \ref SCIP_STAGE_SOLVING
259  */
261  SCIP* scip /**< SCIP data structure */
262  )
263 {
264  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetNLPVarsUbDualsol", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
265 
266  if( scip->nlp == NULL )
267  {
268  SCIPerrorMessage("NLP has not been constructed.\n");
269  SCIPABORT();
270  return NULL; /*lint !e527*/
271  }
272 
273  return SCIPnlpGetVarsUbDualsol(scip->nlp);
274 }
275 
276 /** gets current NLP nonlinear rows along with the current number of NLP nonlinear rows
277  *
278  * @pre This method can be called if SCIP is in one of the following stages:
279  * - \ref SCIP_STAGE_INITSOLVE
280  * - \ref SCIP_STAGE_SOLVING
281  */
283  SCIP* scip, /**< SCIP data structure */
284  SCIP_NLROW*** nlrows, /**< pointer to store the array of NLP nonlinear rows, or NULL */
285  int* nnlrows /**< pointer to store the number of NLP nonlinear rows, or NULL */
286  )
287 {
288  SCIP_CALL( SCIPcheckStage(scip, "SCIPgetNLPNlRowsData", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
289 
290  if( scip->nlp == NULL )
291  {
292  SCIPerrorMessage("NLP has not been constructed.\n");
293  return SCIP_INVALIDCALL;
294  }
295 
296  if( nlrows != NULL )
297  *nlrows = SCIPnlpGetNlRows(scip->nlp);
298  if( nnlrows != NULL )
299  *nnlrows = SCIPnlpGetNNlRows(scip->nlp);
300 
301  return SCIP_OKAY;
302 }
303 
304 /** gets array with nonlinear rows of the NLP
305  *
306  * @pre This method can be called if SCIP is in one of the following stages:
307  * - \ref SCIP_STAGE_INITSOLVE
308  * - \ref SCIP_STAGE_SOLVING
309  */
311  SCIP* scip /**< SCIP data structure */
312  )
313 {
314  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetNLPNlRows", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
315 
316  if( scip->nlp == NULL )
317  {
318  SCIPerrorMessage("NLP has not been constructed.\n");
319  SCIPABORT();
320  return NULL; /*lint !e527*/
321  }
322 
323  return SCIPnlpGetNlRows(scip->nlp);
324 }
325 
326 /** gets current number of nonlinear rows in NLP
327  *
328  * @pre This method can be called if SCIP is in one of the following stages:
329  * - \ref SCIP_STAGE_INITSOLVE
330  * - \ref SCIP_STAGE_SOLVING
331  */
333  SCIP* scip /**< SCIP data structure */
334  )
335 {
336  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetNNLPNlRows", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
337 
338  if( scip->nlp == NULL )
339  {
340  SCIPerrorMessage("NLP has not been constructed.\n");
341  SCIPABORT();
342  return 0; /*lint !e527*/
343  }
344 
345  return SCIPnlpGetNNlRows(scip->nlp);
346 }
347 
348 /** adds a nonlinear row to the NLP. This row is captured by the NLP.
349  *
350  * @pre This method can be called if SCIP is in one of the following stages:
351  * - \ref SCIP_STAGE_INITSOLVE
352  * - \ref SCIP_STAGE_SOLVING
353  */
355  SCIP* scip, /**< SCIP data structure */
356  SCIP_NLROW* nlrow /**< nonlinear row to add to NLP */
357  )
358 {
359  SCIP_CALL( SCIPcheckStage(scip, "SCIPaddNlRow", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
360 
361  if( scip->nlp == NULL )
362  {
363  SCIPerrorMessage("NLP has not been constructed.\n");
364  return SCIP_INVALIDCALL;
365  }
366 
367  SCIP_CALL( SCIPnlpAddNlRow(scip->nlp, SCIPblkmem(scip), scip->set, scip->stat, nlrow) );
368 
369  return SCIP_OKAY;
370 }
371 
372 /** removes a nonlinear row from the NLP
373  *
374  * This row is released in the NLP.
375  *
376  * @pre This method can be called if SCIP is in one of the following stages:
377  * - \ref SCIP_STAGE_INITSOLVE
378  * - \ref SCIP_STAGE_SOLVING
379  * - \ref SCIP_STAGE_SOLVED
380  * - \ref SCIP_STAGE_EXITSOLVE
381  */
383  SCIP* scip, /**< SCIP data structure */
384  SCIP_NLROW* nlrow /**< nonlinear row to add to NLP */
385  )
386 {
387  SCIP_CALL( SCIPcheckStage(scip, "SCIPdelNlRow", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
388 
389  if( scip->nlp == NULL )
390  {
391  SCIPerrorMessage("NLP has not been constructed.\n");
392  return SCIP_INVALIDCALL;
393  }
394 
395  SCIP_CALL( SCIPnlpDelNlRow(scip->nlp, SCIPblkmem(scip), scip->set, scip->stat, nlrow) );
396 
397  return SCIP_OKAY;
398 }
399 
400 /** makes sure that the NLP of the current node is flushed
401  *
402  * @pre This method can be called if SCIP is in one of the following stages:
403  * - \ref SCIP_STAGE_INITSOLVE
404  * - \ref SCIP_STAGE_SOLVING
405  */
407  SCIP* scip /**< SCIP data structure */
408  )
409 {
410  SCIP_CALL( SCIPcheckStage(scip, "SCIPflushNLP", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
411 
412  if( scip->nlp == NULL )
413  {
414  SCIPerrorMessage("NLP has not been constructed.\n");
415  return SCIP_INVALIDCALL;
416  }
417 
418  SCIP_CALL( SCIPnlpFlush(scip->nlp, scip->mem->probmem, scip->set, scip->stat) );
419 
420  return SCIP_OKAY;
421 }
422 
423 /** sets or clears initial primal guess for NLP solution (start point for NLP solver)
424  *
425  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
426  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
427  *
428  * @pre This method can be called if SCIP is in one of the following stages:
429  * - \ref SCIP_STAGE_INITSOLVE
430  * - \ref SCIP_STAGE_SOLVING
431  */
433  SCIP* scip, /**< SCIP data structure */
434  SCIP_Real* initialguess /**< values of initial guess (corresponding to variables from SCIPgetNLPVarsData), or NULL to use no start point */
435  )
436 {
437  SCIP_CALL( SCIPcheckStage(scip, "SCIPsetNLPInitialGuess", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
438 
439  if( scip->nlp == NULL )
440  {
441  SCIPerrorMessage("NLP has not been constructed.\n");
442  return SCIP_INVALIDCALL;
443  }
444 
445  SCIP_CALL( SCIPnlpSetInitialGuess(scip->set, scip->nlp, SCIPblkmem(scip), initialguess) );
446 
447  return SCIP_OKAY;
448 }
449 
450 /** sets initial primal guess for NLP solution (start point for NLP solver)
451  *
452  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
453  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
454  *
455  * @pre This method can be called if SCIP is in one of the following stages:
456  * - \ref SCIP_STAGE_INITSOLVE
457  * - \ref SCIP_STAGE_SOLVING
458  */
460  SCIP* scip, /**< SCIP data structure */
461  SCIP_SOL* sol /**< solution which values should be taken as initial guess, or NULL for LP solution */
462  )
463 {
464  SCIP_Real* vals;
465 
466  SCIP_CALL( SCIPcheckStage(scip, "SCIPsetNLPInitialGuessSol", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
467 
468  if( scip->nlp == NULL )
469  {
470  SCIPerrorMessage("NLP has not been constructed.\n");
471  return SCIP_INVALIDCALL;
472  }
473 
474  SCIP_CALL( SCIPallocBufferArray(scip, &vals, SCIPnlpGetNVars(scip->nlp)) );
475  SCIP_CALL( SCIPgetSolVals(scip, sol, SCIPnlpGetNVars(scip->nlp), SCIPnlpGetVars(scip->nlp), vals) );
476  SCIP_CALL( SCIPnlpSetInitialGuess(scip->set, scip->nlp, SCIPblkmem(scip), vals) );
477  SCIPfreeBufferArray(scip, &vals);
478 
479  return SCIP_OKAY;
480 }
481 
482 /** solves the current NLP (or diving NLP if in diving mode) with given parameters
483  *
484  * Typical use is
485  *
486  * SCIP_NLPPARAM nlparam = { SCIP_NLPPARAM_DEFAULT(scip); }
487  * nlpparam.iterlimit = 42;
488  * SCIP_CALL( SCIPsolveNLPParam(scip, nlpparam) );
489  *
490  * or, in one line:
491  *
492  * SCIP_CALL( SCIPsolveNLPParam(scip, (SCIP_NLPPARAM){ SCIP_NLPPARAM_DEFAULT(scip), .iterlimit = 42 }) );
493  *
494  * To get the latter, also \ref SCIPsolveNLP can be used.
495  *
496  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
497  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
498  *
499  * @pre This method can be called if SCIP is in one of the following stages:
500  * - \ref SCIP_STAGE_INITSOLVE
501  * - \ref SCIP_STAGE_SOLVING
502  */
504  SCIP* scip, /**< SCIP data structure */
505  SCIP_NLPPARAM param /**< NLP solve parameters */
506  )
507 {
508  SCIP_CALL( SCIPcheckStage(scip, "SCIPsolveNLPParam", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
509 
510  if( scip->nlp == NULL )
511  {
512  SCIPerrorMessage("NLP has not been constructed.\n");
513  return SCIP_INVALIDCALL;
514  }
515 
516  SCIP_CALL( SCIPnlpSolve(scip->nlp, SCIPblkmem(scip), scip->set, scip->messagehdlr, scip->stat, scip->primal, scip->tree, &param) );
517 
518  return SCIP_OKAY;
519 }
520 
521 #if defined(_MSC_VER) && _MSC_VER < 1800
522 /* warn that SCIPsolveNLP() macro isn't perfect with ancient MSVC */
523 #pragma message ( "Warning: designated initializers not supported by this version of MSVC. Parameters given to NLP solves may be ignored." )
524 #endif
525 
526 /** gets solution status of current NLP
527  *
528  * @pre This method can be called if SCIP is in one of the following stages:
529  * - \ref SCIP_STAGE_INITSOLVE
530  * - \ref SCIP_STAGE_SOLVING
531  */
533  SCIP* scip /**< SCIP data structure */
534  )
535 {
536  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetNLPSolstat", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
537 
538  if( scip->nlp == NULL )
539  {
540  SCIPerrorMessage("NLP has not been constructed.\n");
541  SCIPABORT();
542  return SCIP_NLPSOLSTAT_UNKNOWN; /*lint !e527*/
543  }
544 
545  return SCIPnlpGetSolstat(scip->nlp);
546 }
547 
548 /** gets termination status of last NLP solve
549  *
550  * @pre This method can be called if SCIP is in one of the following stages:
551  * - \ref SCIP_STAGE_INITSOLVE
552  * - \ref SCIP_STAGE_SOLVING
553  */
555  SCIP* scip /**< SCIP data structure */
556  )
557 {
558  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetNLPTermstat", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
559 
560  if( scip->nlp == NULL )
561  {
562  SCIPerrorMessage("NLP has not been constructed.\n");
563  SCIPABORT();
564  return SCIP_NLPTERMSTAT_OTHER; /*lint !e527*/
565  }
566 
567  return SCIPnlpGetTermstat(scip->nlp);
568 }
569 
570 /** gives statistics (number of iterations, solving time, ...) of last NLP solve
571  *
572  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
573  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
574  *
575  * @pre This method can be called if SCIP is in one of the following stages:
576  * - \ref SCIP_STAGE_INITSOLVE
577  * - \ref SCIP_STAGE_SOLVING
578  */
580  SCIP* scip, /**< SCIP data structure */
581  SCIP_NLPSTATISTICS* statistics /**< pointer to store statistics */
582  )
583 {
584  SCIP_CALL( SCIPcheckStage(scip, "SCIPgetNLPStatistics", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
585 
586  if( scip->nlp == NULL )
587  {
588  SCIPerrorMessage("NLP has not been constructed.\n");
589  return SCIP_INVALIDCALL;
590  }
591 
592  SCIP_CALL( SCIPnlpGetStatistics(scip->set, scip->nlp, statistics) );
593 
594  return SCIP_OKAY;
595 }
596 
597 /** gets objective value of current NLP
598  *
599  * @pre This method can be called if SCIP is in one of the following stages:
600  * - \ref SCIP_STAGE_INITSOLVE
601  * - \ref SCIP_STAGE_SOLVING
602  */
604  SCIP* scip /**< SCIP data structure */
605  )
606 {
607  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetNLPObjval", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
608 
609  if( scip->nlp != NULL )
610  {
611  return SCIPnlpGetObjval(scip->nlp);
612  }
613  else
614  {
615  SCIPerrorMessage("NLP has not been constructed.\n");
616  return SCIP_INVALID;
617  }
618 }
619 
620 /** indicates whether a solution for the current NLP is available
621  *
622  * The solution may be optimal, feasible, or infeasible.
623  * Thus, returns whether the NLP solution status is at most \ref SCIP_NLPSOLSTAT_LOCINFEASIBLE.
624  *
625  * @pre This method can be called if SCIP is in one of the following stages:
626  * - \ref SCIP_STAGE_INITSOLVE
627  * - \ref SCIP_STAGE_SOLVING
628  */
630  SCIP* scip /**< SCIP data structure */
631  )
632 {
633  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPhasNLPSolution", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
634 
635  if( scip->nlp == NULL )
636  {
637  SCIPerrorMessage("NLP has not been constructed.\n");
638  SCIPABORT();
639  return FALSE; /*lint !e527*/
640  }
641 
642  return SCIPnlpHasSolution(scip->nlp);
643 }
644 
645 /** gets fractional variables of last NLP solution along with solution values and fractionalities
646  *
647  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
648  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
649  *
650  * @pre This method can be called if SCIP is in one of the following stages:
651  * - \ref SCIP_STAGE_INITSOLVE
652  * - \ref SCIP_STAGE_SOLVING
653  */
655  SCIP* scip, /**< SCIP data structure */
656  SCIP_VAR*** fracvars, /**< pointer to store the array of NLP fractional variables, or NULL */
657  SCIP_Real** fracvarssol, /**< pointer to store the array of NLP fractional variables solution values, or NULL */
658  SCIP_Real** fracvarsfrac, /**< pointer to store the array of NLP fractional variables fractionalities, or NULL */
659  int* nfracvars, /**< pointer to store the number of NLP fractional variables , or NULL */
660  int* npriofracvars /**< pointer to store the number of NLP fractional variables with maximal branching priority, or NULL */
661  )
662 {
663  SCIP_CALL( SCIPcheckStage(scip, "SCIPgetNLPFracVars", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
664 
665  if( scip->nlp == NULL )
666  {
667  SCIPerrorMessage("NLP has not been constructed.\n");
668  return SCIP_INVALIDCALL;
669  }
670 
671  SCIP_CALL( SCIPnlpGetFracVars(scip->nlp, SCIPblkmem(scip), scip->set, scip->stat, fracvars, fracvarssol, fracvarsfrac, nfracvars, npriofracvars) );
672 
673  return SCIP_OKAY;
674 }
675 
676 /** writes current NLP to a file
677  *
678  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
679  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
680  *
681  * @pre This method can be called if SCIP is in one of the following stages:
682  * - \ref SCIP_STAGE_INITSOLVE
683  * - \ref SCIP_STAGE_SOLVING
684  */
686  SCIP* scip, /**< SCIP data structure */
687  const char* filename /**< file name */
688  )
689 {
690  SCIP_CALL( SCIPcheckStage(scip, "SCIPwriteNLP", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
691 
692  if( scip->nlp == NULL )
693  {
694  SCIPerrorMessage("NLP has not been constructed.\n");
695  return SCIP_INVALIDCALL;
696  }
697 
698  SCIP_CALL( SCIPnlpWrite(scip->nlp, scip->mem->probmem, scip->set, scip->stat, scip->messagehdlr, filename) );
699 
700  return SCIP_OKAY;
701 }
702 
703 /** gets the NLP interface and problem used by the SCIP NLP
704  *
705  * @warning With the NLPI and its problem, all methods defined in \ref scip_nlpi.h and \ref pub_nlpi.h can be used.
706  * It needs to be ensured that the full internal state of the NLPI does not change or is recovered completely
707  * after the end of the method that uses the NLPI. In particular, if the NLP or its solution is manipulated
708  * (e.g. by calling one of the SCIPaddNlpi...() or the SCIPsolveNlpi() method), one has to check in advance
709  * whether the NLP is currently solved. If this is the case, one has to make sure that the internal solution
710  * status is recovered completely again. Additionally one has to resolve the NLP with
711  * SCIPsolveNlpi() in order to reinstall the internal solution status.
712  *
713  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
714  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
715  *
716  * @pre This method can be called if SCIP is in one of the following stages:
717  * - \ref SCIP_STAGE_INITSOLVE
718  * - \ref SCIP_STAGE_SOLVING
719  */
721  SCIP* scip, /**< SCIP data structure */
722  SCIP_NLPI** nlpi, /**< pointer to store the NLP solver interface */
723  SCIP_NLPIPROBLEM** nlpiproblem /**< pointer to store the NLP solver interface problem */
724  )
725 {
726  assert(nlpi != NULL);
727  assert(nlpiproblem != NULL);
728 
729  SCIP_CALL( SCIPcheckStage(scip, "SCIPgetNLPI", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
730 
731  if( scip->nlp == NULL )
732  {
733  SCIPerrorMessage("NLP has not been constructed.\n");
734  return SCIP_INVALIDCALL;
735  }
736 
737  *nlpi = SCIPnlpGetNLPI(scip->nlp);
738  *nlpiproblem = SCIPnlpGetNLPIProblem(scip->nlp);
739 
740  return SCIP_OKAY;
741 }
742 
743 /** @} */
744 
745 /**@addtogroup PublicNLPDiveMethods
746  * @{ */
747 
748 /** initiates NLP diving
749  *
750  * Makes functions SCIPchgVarObjDiveNLP(), SCIPchgVarBoundsDiveNLP() and SCIPchgVarsBoundsDiveNLP() available.
751  * Further, SCIPsolveNLP() can be used to solve the diving NLP.
752  *
753  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
754  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
755  *
756  * @pre This method can be called if SCIP is in one of the following stages:
757  * - \ref SCIP_STAGE_INITSOLVE
758  * - \ref SCIP_STAGE_SOLVING
759  */
761  SCIP* scip /**< SCIP data structure */
762  )
763 {
764  SCIP_CALL( SCIPcheckStage(scip, "SCIPstartDiveNLP", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
765 
766  if( scip->nlp == NULL )
767  {
768  SCIPerrorMessage("NLP has not been constructed.\n");
769  return SCIP_INVALIDCALL;
770  }
771 
772  SCIP_CALL( SCIPnlpStartDive(scip->nlp, SCIPblkmem(scip), scip->set, scip->stat) );
773 
774  return SCIP_OKAY;
775 }
776 
777 /** ends NLP diving
778  *
779  * Resets changes made by SCIPchgVarObjDiveNLP(), SCIPchgVarBoundsDiveNLP(), and SCIPchgVarsBoundsDiveNLP().
780  *
781  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
782  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
783  *
784  * @pre This method can be called if SCIP is in one of the following stages:
785  * - \ref SCIP_STAGE_INITSOLVE
786  * - \ref SCIP_STAGE_SOLVING
787  */
789  SCIP* scip /**< SCIP data structure */
790  )
791 {
792  SCIP_CALL( SCIPcheckStage(scip, "SCIPendDiveNLP", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
793 
794  if( scip->nlp == NULL )
795  {
796  SCIPerrorMessage("NLP has not been constructed.\n");
797  return SCIP_INVALIDCALL;
798  }
799 
800  SCIP_CALL( SCIPnlpEndDive(scip->nlp, SCIPblkmem(scip), scip->set, scip->stat) );
801 
802  return SCIP_OKAY;
803 }
804 
805 /** changes linear objective coefficient of a variable in diving NLP
806  *
807  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
808  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
809  *
810  * @pre This method can be called if SCIP is in one of the following stages:
811  * - \ref SCIP_STAGE_INITSOLVE
812  * - \ref SCIP_STAGE_SOLVING
813  */
815  SCIP* scip, /**< SCIP data structure */
816  SCIP_VAR* var, /**< variable which coefficient to change */
817  SCIP_Real coef /**< new value for coefficient */
818  )
819 {
820  SCIP_CALL( SCIPcheckStage(scip, "SCIPchgVarObjDiveNLP", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
821 
822  assert( var->scip == scip );
823 
824  if( scip->nlp == NULL )
825  {
826  SCIPerrorMessage("NLP has not been constructed.\n");
827  return SCIP_INVALIDCALL;
828  }
829 
830  SCIP_CALL( SCIPnlpChgVarObjDive(scip->nlp, SCIPblkmem(scip), scip->set, scip->stat, var, coef) );
831 
832  return SCIP_OKAY;
833 }
834 
835 /** changes bounds of a variable in diving NLP
836  *
837  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
838  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
839  *
840  * @pre This method can be called if SCIP is in one of the following stages:
841  * - \ref SCIP_STAGE_INITSOLVE
842  * - \ref SCIP_STAGE_SOLVING
843  */
845  SCIP* scip, /**< SCIP data structure */
846  SCIP_VAR* var, /**< variable which bounds to change */
847  SCIP_Real lb, /**< new lower bound */
848  SCIP_Real ub /**< new upper bound */
849  )
850 {
851  SCIP_CALL( SCIPcheckStage(scip, "SCIPchgVarBoundsDiveNLP", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
852 
853  assert( var->scip == scip );
854 
855  if( scip->nlp == NULL )
856  {
857  SCIPerrorMessage("NLP has not been constructed.\n");
858  return SCIP_INVALIDCALL;
859  }
860 
861  SCIP_CALL( SCIPnlpChgVarBoundsDive(scip->set, scip->nlp, var, lb, ub) );
862 
863  return SCIP_OKAY;
864 }
865 
866 /** changes bounds of a set of variables in diving NLP
867  *
868  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
869  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
870  *
871  * @pre This method can be called if SCIP is in one of the following stages:
872  * - \ref SCIP_STAGE_INITSOLVE
873  * - \ref SCIP_STAGE_SOLVING
874  */
876  SCIP* scip, /**< SCIP data structure */
877  int nvars, /**< number of variables which bounds to changes */
878  SCIP_VAR** vars, /**< variables which bounds to change */
879  SCIP_Real* lbs, /**< new lower bounds */
880  SCIP_Real* ubs /**< new upper bounds */
881  )
882 {
883  SCIP_CALL( SCIPcheckStage(scip, "SCIPchgVarsBoundsDiveNLP", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
884 
885  if( scip->nlp == NULL )
886  {
887  SCIPerrorMessage("NLP has not been constructed.\n");
888  return SCIP_INVALIDCALL;
889  }
890 
891  SCIP_CALL( SCIPnlpChgVarsBoundsDive(scip->nlp, scip->set, nvars, vars, lbs, ubs) );
892 
893  return SCIP_OKAY;
894 }
895 
896 /** @} */
897 
898 /**@addtogroup PublicNLRowMethods
899  * @{
900  */
901 
902 /** creates and captures a nonlinear row
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_PRESOLVED
909  * - \ref SCIP_STAGE_INITSOLVE
910  * - \ref SCIP_STAGE_SOLVING
911  */
913  SCIP* scip, /**< SCIP data structure */
914  SCIP_NLROW** nlrow, /**< buffer to store pointer to nonlinear row */
915  const char* name, /**< name of nonlinear row */
916  SCIP_Real constant, /**< constant */
917  int nlinvars, /**< number of linear variables */
918  SCIP_VAR** linvars, /**< linear variables, or NULL if nlinvars == 0 */
919  SCIP_Real* lincoefs, /**< linear coefficients, or NULL if nlinvars == 0 */
920  SCIP_EXPR* expr, /**< nonlinear expression, or NULL */
921  SCIP_Real lhs, /**< left hand side */
922  SCIP_Real rhs, /**< right hand side */
923  SCIP_EXPRCURV curvature /**< curvature of the nonlinear row */
924  )
925 {
926  SCIP_CALL( SCIPcheckStage(scip, "SCIPcreateNlRow", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
927 
928  SCIP_CALL( SCIPnlrowCreate(nlrow, scip->mem->probmem, scip->set, scip->stat,
929  name, constant, nlinvars, linvars, lincoefs, expr, lhs, rhs, curvature) );
930 
931  return SCIP_OKAY;
932 }
933 
934 /** creates and captures a nonlinear row without any coefficients
935  *
936  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
937  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
938  *
939  * @pre This method can be called if SCIP is in one of the following stages:
940  * - \ref SCIP_STAGE_PRESOLVED
941  * - \ref SCIP_STAGE_INITSOLVE
942  * - \ref SCIP_STAGE_SOLVING
943  */
945  SCIP* scip, /**< SCIP data structure */
946  SCIP_NLROW** nlrow, /**< pointer to nonlinear row */
947  const char* name, /**< name of nonlinear row */
948  SCIP_Real lhs, /**< left hand side */
949  SCIP_Real rhs /**< right hand side */
950  )
951 {
952  SCIP_CALL( SCIPcheckStage(scip, "SCIPcreateEmptyNlRow", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
953 
954  SCIP_CALL( SCIPnlrowCreate(nlrow, scip->mem->probmem, scip->set, scip->stat,
955  name, 0.0, 0, NULL, NULL, NULL, lhs, rhs, SCIP_EXPRCURV_UNKNOWN) );
956 
957  return SCIP_OKAY;
958 }
959 
960 /** creates and captures a nonlinear row from a linear row
961  *
962  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
963  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
964  *
965  * @pre This method can be called if SCIP is in one of the following stages:
966  * - \ref SCIP_STAGE_PRESOLVED
967  * - \ref SCIP_STAGE_INITSOLVE
968  * - \ref SCIP_STAGE_SOLVING
969  */
971  SCIP* scip, /**< SCIP data structure */
972  SCIP_NLROW** nlrow, /**< pointer to nonlinear row */
973  SCIP_ROW* row /**< the linear row to copy */
974  )
975 {
976  SCIP_CALL( SCIPcheckStage(scip, "SCIPcreateNlRowFromRow", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
977 
978  SCIP_CALL( SCIPnlrowCreateFromRow(nlrow, scip->mem->probmem, scip->set, scip->stat, row) );
979 
980  return SCIP_OKAY;
981 }
982 
983 /** increases usage counter of a nonlinear row
984  *
985  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
986  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
987  *
988  * @pre This method can be called if SCIP is in one of the following stages:
989  * - \ref SCIP_STAGE_PRESOLVED
990  * - \ref SCIP_STAGE_INITSOLVE
991  * - \ref SCIP_STAGE_SOLVING
992  */
994  SCIP* scip, /**< SCIP data structure */
995  SCIP_NLROW* nlrow /**< nonlinear row to capture */
996  )
997 {
998  SCIP_CALL( SCIPcheckStage(scip, "SCIPcaptureNlRow", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
999 
1000  SCIPnlrowCapture(nlrow);
1001 
1002  return SCIP_OKAY;
1003 }
1004 
1005 /** decreases usage counter of a nonlinear row, and frees memory if necessary
1006  *
1007  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1008  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1009  *
1010  * @pre This method can be called if SCIP is in one of the following stages:
1011  * - \ref SCIP_STAGE_PRESOLVED
1012  * - \ref SCIP_STAGE_INITSOLVE
1013  * - \ref SCIP_STAGE_SOLVING
1014  * - \ref SCIP_STAGE_EXITSOLVE
1015  */
1017  SCIP* scip, /**< SCIP data structure */
1018  SCIP_NLROW** nlrow /**< pointer to nonlinear row */
1019  )
1020 {
1021  SCIP_CALL( SCIPcheckStage(scip, "SCIPreleaseNlRow", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE) );
1022 
1023  SCIP_CALL( SCIPnlrowRelease(nlrow, scip->mem->probmem, scip->set, scip->stat) );
1024 
1025  return SCIP_OKAY;
1026 }
1027 
1028 /** changes left hand side of a nonlinear row
1029  *
1030  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1031  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1032  *
1033  * @pre This method can be called if SCIP is in one of the following stages:
1034  * - \ref SCIP_STAGE_PRESOLVED
1035  * - \ref SCIP_STAGE_INITSOLVE
1036  * - \ref SCIP_STAGE_SOLVING
1037  */
1039  SCIP* scip, /**< SCIP data structure */
1040  SCIP_NLROW* nlrow, /**< NLP nonlinear row */
1041  SCIP_Real lhs /**< new left hand side */
1042  )
1043 {
1044  SCIP_CALL( SCIPcheckStage(scip, "SCIPchgNlRowLhs", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
1045 
1046  SCIP_CALL( SCIPnlrowChgLhs(nlrow, scip->set, scip->stat, scip->nlp, lhs) );
1047 
1048  return SCIP_OKAY;
1049 }
1050 
1051 /** changes right hand side of a nonlinear row
1052  *
1053  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1054  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1055  *
1056  * @pre This method can be called if SCIP is in one of the following stages:
1057  * - \ref SCIP_STAGE_PRESOLVED
1058  * - \ref SCIP_STAGE_INITSOLVE
1059  * - \ref SCIP_STAGE_SOLVING
1060  */
1062  SCIP* scip, /**< SCIP data structure */
1063  SCIP_NLROW* nlrow, /**< NLP nonlinear row */
1064  SCIP_Real rhs /**< new right hand side */
1065  )
1066 {
1067  SCIP_CALL( SCIPcheckStage(scip, "SCIPchgNlRowRhs", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
1068 
1069  SCIP_CALL( SCIPnlrowChgRhs(nlrow, scip->set, scip->stat, scip->nlp, rhs) );
1070 
1071  return SCIP_OKAY;
1072 }
1073 
1074 /** changes constant of a nonlinear row
1075  *
1076  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1077  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1078  *
1079  * @pre This method can be called if SCIP is in one of the following stages:
1080  * - \ref SCIP_STAGE_PRESOLVED
1081  * - \ref SCIP_STAGE_INITSOLVE
1082  * - \ref SCIP_STAGE_SOLVING
1083  */
1085  SCIP* scip, /**< SCIP data structure */
1086  SCIP_NLROW* nlrow, /**< NLP row */
1087  SCIP_Real constant /**< new value for constant */
1088  )
1089 {
1090  SCIP_CALL( SCIPcheckStage(scip, "SCIPchgNlRowConstant", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
1091 
1092  SCIP_CALL( SCIPnlrowChgConstant(nlrow, scip->set, scip->stat, scip->nlp, constant) );
1093 
1094  return SCIP_OKAY;
1095 }
1096 
1097 /** adds variable with a linear coefficient to a nonlinear row
1098  *
1099  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1100  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1101  *
1102  * @pre This method can be called if SCIP is in one of the following stages:
1103  * - \ref SCIP_STAGE_PRESOLVED
1104  * - \ref SCIP_STAGE_INITSOLVE
1105  * - \ref SCIP_STAGE_SOLVING
1106  */
1108  SCIP* scip, /**< SCIP data structure */
1109  SCIP_NLROW* nlrow, /**< NLP row */
1110  SCIP_VAR* var, /**< problem variable */
1111  SCIP_Real val /**< value of coefficient in linear part of row */
1112  )
1113 {
1114  SCIP_CALL( SCIPcheckStage(scip, "SCIPaddLinearCoefToNlRow", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
1115 
1116  SCIP_CALL( SCIPnlrowAddLinearCoef(nlrow, scip->mem->probmem, scip->set, scip->stat, scip->nlp, var, val) );
1117 
1118  return SCIP_OKAY;
1119 }
1120 
1121 /** adds variables with linear coefficients to a row
1122  *
1123  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1124  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1125  *
1126  * @pre This method can be called if SCIP is in one of the following stages:
1127  * - \ref SCIP_STAGE_PRESOLVED
1128  * - \ref SCIP_STAGE_INITSOLVE
1129  * - \ref SCIP_STAGE_SOLVING
1130  */
1132  SCIP* scip, /**< SCIP data structure */
1133  SCIP_NLROW* nlrow, /**< NLP row */
1134  int nvars, /**< number of variables to add to the row */
1135  SCIP_VAR** vars, /**< problem variables to add */
1136  SCIP_Real* vals /**< values of coefficients in linear part of row */
1137  )
1138 {
1139  int v;
1140 
1141  assert(nvars == 0 || vars != NULL);
1142  assert(nvars == 0 || vals != NULL);
1143 
1144  SCIP_CALL( SCIPcheckStage(scip, "SCIPaddLinearCoefsToNlRow", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
1145 
1146  /* add the variables to the row */
1147  for( v = 0; v < nvars; ++v )
1148  {
1149  SCIP_CALL( SCIPnlrowAddLinearCoef(nlrow, scip->mem->probmem, scip->set, scip->stat, scip->nlp, vars[v], vals[v]) );
1150  }
1151 
1152  return SCIP_OKAY;
1153 }
1154 
1155 /** changes linear coefficient of a variables in a nonlinear row
1156  *
1157  * Setting the coefficient to 0.0 means that it is removed from the row.
1158  * The variable does not need to exists before.
1159  *
1160  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1161  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1162  *
1163  * @pre This method can be called if SCIP is in one of the following stages:
1164  * - \ref SCIP_STAGE_PRESOLVED
1165  * - \ref SCIP_STAGE_INITSOLVE
1166  * - \ref SCIP_STAGE_SOLVING
1167  */
1169  SCIP* scip, /**< SCIP data structure */
1170  SCIP_NLROW* nlrow, /**< NLP row */
1171  SCIP_VAR* var, /**< variable */
1172  SCIP_Real coef /**< new value of coefficient */
1173  )
1174 {
1175  assert(var != NULL);
1176 
1177  SCIP_CALL( SCIPcheckStage(scip, "SCIPchgNlRowLinearCoef", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
1178 
1179  SCIP_CALL( SCIPnlrowChgLinearCoef(nlrow, scip->mem->probmem, scip->set, scip->stat, scip->nlp, var, coef) );
1180 
1181  return SCIP_OKAY;
1182 }
1183 
1184 /** sets or deletes expression in a nonlinear row
1185  *
1186  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1187  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1188  *
1189  * @pre This method can be called if SCIP is in one of the following stages:
1190  * - \ref SCIP_STAGE_PRESOLVED
1191  * - \ref SCIP_STAGE_INITSOLVE
1192  * - \ref SCIP_STAGE_SOLVING
1193  */
1195  SCIP* scip, /**< SCIP data structure */
1196  SCIP_NLROW* nlrow, /**< NLP row */
1197  SCIP_EXPR* expr /**< expression, or NULL */
1198  )
1199 {
1200  SCIP_CALL( SCIPcheckStage(scip, "SCIPsetNlRowExpr", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
1201 
1202  SCIP_CALL( SCIPnlrowChgExpr(nlrow, scip->mem->probmem, scip->set, scip->stat, scip->nlp, expr) );
1203 
1204  /* invalidate curvature */
1206 
1207  return SCIP_OKAY;
1208 }
1209 
1210 /** recalculates the activity of a nonlinear row in the last NLP solution
1211  *
1212  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1213  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1214  *
1215  * @pre This method can be called if SCIP is in one of the following stages:
1216  * - \ref SCIP_STAGE_PRESOLVED
1217  * - \ref SCIP_STAGE_INITSOLVE
1218  * - \ref SCIP_STAGE_SOLVING
1219  */
1221  SCIP* scip, /**< SCIP data structure */
1222  SCIP_NLROW* nlrow /**< NLP nonlinear row */
1223  )
1224 {
1225  SCIP_CALL( SCIPcheckStage(scip, "SCIPrecalcNlRowNLPActivity", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
1226 
1227  if( scip->nlp == NULL )
1228  {
1229  SCIPerrorMessage("do not have NLP for computing NLP activity\n");
1230  return SCIP_INVALIDCALL;
1231  }
1232 
1233  SCIP_CALL( SCIPnlrowRecalcNLPActivity(nlrow, scip->mem->probmem, scip->set, scip->stat, scip->primal, scip->tree, scip->nlp) );
1234 
1235  return SCIP_OKAY;
1236 }
1237 
1238 /** returns the activity of a nonlinear row in the last NLP solution
1239  *
1240  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1241  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1242  *
1243  * @pre This method can be called if SCIP is in one of the following stages:
1244  * - \ref SCIP_STAGE_INITSOLVE
1245  * - \ref SCIP_STAGE_SOLVING
1246  */
1248  SCIP* scip, /**< SCIP data structure */
1249  SCIP_NLROW* nlrow, /**< NLP nonlinear row */
1250  SCIP_Real* activity /**< pointer to store activity value */
1251  )
1252 {
1253  SCIP_CALL( SCIPcheckStage(scip, "SCIPgetNlRowNLPActivity", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
1254 
1255  if( scip->nlp == NULL )
1256  {
1257  SCIPerrorMessage("do not have NLP for computing NLP activity\n");
1258  return SCIP_INVALIDCALL;
1259  }
1260 
1261  SCIP_CALL( SCIPnlrowGetNLPActivity(nlrow, scip->mem->probmem, scip->set, scip->stat, scip->primal, scip->tree, scip->nlp, activity) );
1262 
1263  return SCIP_OKAY;
1264 }
1265 
1266 /** gives the feasibility of a nonlinear row in the last NLP solution: negative value means infeasibility
1267  *
1268  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1269  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1270  *
1271  * @pre This method can be called if SCIP is in one of the following stages:
1272  * - \ref SCIP_STAGE_INITSOLVE
1273  * - \ref SCIP_STAGE_SOLVING
1274  */
1276  SCIP* scip, /**< SCIP data structure */
1277  SCIP_NLROW* nlrow, /**< NLP nonlinear row */
1278  SCIP_Real* feasibility /**< pointer to store feasibility value */
1279  )
1280 {
1281  SCIP_CALL( SCIPcheckStage(scip, "SCIPgetNlRowNLPFeasibility", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
1282 
1283  if( scip->nlp == NULL )
1284  {
1285  SCIPerrorMessage("do not have NLP for computing NLP feasibility\n");
1286  return SCIP_INVALIDCALL;
1287  }
1288 
1289  SCIP_CALL( SCIPnlrowGetNLPFeasibility(nlrow, scip->mem->probmem, scip->set, scip->stat, scip->primal, scip->tree, scip->nlp, feasibility) );
1290 
1291  return SCIP_OKAY;
1292 }
1293 
1294 /** recalculates the activity of a nonlinear row for the current pseudo solution
1295  *
1296  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1297  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1298  *
1299  * @pre This method can be called if SCIP is in one of the following stages:
1300  * - \ref SCIP_STAGE_INITSOLVE
1301  * - \ref SCIP_STAGE_SOLVING
1302  */
1304  SCIP* scip, /**< SCIP data structure */
1305  SCIP_NLROW* nlrow /**< NLP nonlinear row */
1306  )
1307 {
1308  SCIP_CALL( SCIPcheckStage(scip, "SCIPrecalcNlRowPseudoActivity", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
1309 
1310  SCIP_CALL( SCIPnlrowRecalcPseudoActivity(nlrow, scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->primal, scip->tree, scip->lp) );
1311 
1312  return SCIP_OKAY;
1313 }
1314 
1315 /** gives the activity of a nonlinear row for the current pseudo solution
1316  *
1317  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1318  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1319  *
1320  * @pre This method can be called if SCIP is in one of the following stages:
1321  * - \ref SCIP_STAGE_INITSOLVE
1322  * - \ref SCIP_STAGE_SOLVING
1323  */
1325  SCIP* scip, /**< SCIP data structure */
1326  SCIP_NLROW* nlrow, /**< NLP nonlinear row */
1327  SCIP_Real* pseudoactivity /**< pointer to store pseudo activity value */
1328  )
1329 {
1330  SCIP_CALL( SCIPcheckStage(scip, "SCIPgetNlRowPseudoActivity", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
1331 
1332  SCIP_CALL( SCIPnlrowGetPseudoActivity(nlrow, scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->primal, scip->tree, scip->lp, pseudoactivity) );
1333 
1334  return SCIP_OKAY;
1335 }
1336 
1337 /** gives the feasibility of a nonlinear row for the current pseudo solution: negative value means infeasibility
1338  *
1339  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1340  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1341  *
1342  * @pre This method can be called if SCIP is in one of the following stages:
1343  * - \ref SCIP_STAGE_INITSOLVE
1344  * - \ref SCIP_STAGE_SOLVING
1345  */
1347  SCIP* scip, /**< SCIP data structure */
1348  SCIP_NLROW* nlrow, /**< NLP nonlinear row */
1349  SCIP_Real* pseudofeasibility /**< pointer to store pseudo feasibility value */
1350  )
1351 {
1352  SCIP_CALL( SCIPcheckStage(scip, "SCIPgetNlRowPseudoFeasibility", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
1353 
1354  SCIP_CALL( SCIPnlrowGetPseudoFeasibility(nlrow, scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->primal, scip->tree, scip->lp, pseudofeasibility) );
1355 
1356  return SCIP_OKAY;
1357 }
1358 
1359 /** recalculates the activity of a nonlinear row in the last NLP or pseudo solution
1360  *
1361  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1362  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1363  *
1364  * @pre This method can be called if SCIP is in one of the following stages:
1365  * - \ref SCIP_STAGE_INITSOLVE
1366  * - \ref SCIP_STAGE_SOLVING
1367  */
1369  SCIP* scip, /**< SCIP data structure */
1370  SCIP_NLROW* nlrow /**< NLP nonlinear row */
1371  )
1372 {
1373  SCIP_CALL( SCIPcheckStage(scip, "SCIPrecalcNlRowActivity", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
1374 
1375  if( scip->nlp != NULL && SCIPnlpHasCurrentNodeNLP(scip->nlp) && SCIPnlpHasSolution(scip->nlp) )
1376  {
1377  SCIP_CALL( SCIPnlrowRecalcNLPActivity(nlrow, scip->mem->probmem, scip->set, scip->stat, scip->primal, scip->tree, scip->nlp) );
1378  }
1379  else
1380  {
1381  SCIP_CALL( SCIPnlrowRecalcPseudoActivity(nlrow, scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->primal, scip->tree, scip->lp) );
1382  }
1383 
1384  return SCIP_OKAY;
1385 }
1386 
1387 /** gives the activity of a nonlinear row in the last NLP or pseudo solution
1388  *
1389  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1390  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1391  *
1392  * @pre This method can be called if SCIP is in one of the following stages:
1393  * - \ref SCIP_STAGE_INITSOLVE
1394  * - \ref SCIP_STAGE_SOLVING
1395  */
1397  SCIP* scip, /**< SCIP data structure */
1398  SCIP_NLROW* nlrow, /**< NLP nonlinear row */
1399  SCIP_Real* activity /**< pointer to store activity value */
1400  )
1401 {
1402  SCIP_CALL( SCIPcheckStage(scip, "SCIPgetNlRowActivity", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
1403 
1404  if( scip->nlp != NULL && SCIPnlpHasCurrentNodeNLP(scip->nlp) && SCIPnlpHasSolution(scip->nlp) )
1405  {
1406  SCIP_CALL( SCIPnlrowGetNLPActivity(nlrow, scip->mem->probmem, scip->set, scip->stat, scip->primal, scip->tree, scip->nlp, activity) );
1407  }
1408  else
1409  {
1410  SCIP_CALL( SCIPnlrowGetPseudoActivity(nlrow, scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->primal, scip->tree, scip->lp, activity) );
1411  }
1412 
1413  return SCIP_OKAY;
1414 }
1415 
1416 /** gives the feasibility of a nonlinear row in the last NLP or pseudo solution
1417  *
1418  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1419  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1420  *
1421  * @pre This method can be called if SCIP is in one of the following stages:
1422  * - \ref SCIP_STAGE_INITSOLVE
1423  * - \ref SCIP_STAGE_SOLVING
1424  */
1426  SCIP* scip, /**< SCIP data structure */
1427  SCIP_NLROW* nlrow, /**< NLP nonlinear row */
1428  SCIP_Real* feasibility /**< pointer to store feasibility value */
1429  )
1430 {
1431  SCIP_CALL( SCIPcheckStage(scip, "SCIPgetNlRowFeasibility", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
1432 
1433  if( scip->nlp != NULL && SCIPnlpHasCurrentNodeNLP(scip->nlp) && SCIPnlpHasSolution(scip->nlp) )
1434  {
1435  SCIP_CALL( SCIPnlrowGetNLPFeasibility(nlrow, scip->mem->probmem, scip->set, scip->stat, scip->primal, scip->tree, scip->nlp, feasibility) );
1436  }
1437  else
1438  {
1439  SCIP_CALL( SCIPnlrowGetPseudoFeasibility(nlrow, scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->primal, scip->tree, scip->lp, feasibility) );
1440  }
1441 
1442  return SCIP_OKAY;
1443 }
1444 
1445 /** gives the activity of a nonlinear row for the given primal solution or NLP solution or pseudo solution
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_INITSOLVE
1452  * - \ref SCIP_STAGE_SOLVING
1453  */
1455  SCIP* scip, /**< SCIP data structure */
1456  SCIP_NLROW* nlrow, /**< NLP nonlinear row */
1457  SCIP_SOL* sol, /**< primal CIP solution, or NULL for NLP solution of pseudo solution */
1458  SCIP_Real* activity /**< pointer to store activity value */
1459  )
1460 {
1461  SCIP_CALL( SCIPcheckStage(scip, "SCIPgetNlRowSolActivity", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
1462 
1463  if( sol != NULL )
1464  {
1465  SCIP_CALL( SCIPnlrowGetSolActivity(nlrow, scip->mem->probmem, scip->set, scip->stat, sol, activity) );
1466  }
1467  else if( scip->nlp != NULL && SCIPnlpHasCurrentNodeNLP(scip->nlp) && SCIPnlpHasSolution(scip->nlp) )
1468  {
1469  SCIP_CALL( SCIPnlrowGetNLPActivity(nlrow, scip->mem->probmem, scip->set, scip->stat, scip->primal, scip->tree, scip->nlp, activity) );
1470  }
1471  else
1472  {
1473  SCIP_CALL( SCIPnlrowGetPseudoActivity(nlrow, scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->primal, scip->tree, scip->lp, activity) );
1474  }
1475 
1476  return SCIP_OKAY;
1477 }
1478 
1479 /** gives the feasibility of a nonlinear row for the given primal solution
1480  *
1481  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1482  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1483  *
1484  * @pre This method can be called if SCIP is in one of the following stages:
1485  * - \ref SCIP_STAGE_INITSOLVE
1486  * - \ref SCIP_STAGE_SOLVING
1487  */
1489  SCIP* scip, /**< SCIP data structure */
1490  SCIP_NLROW* nlrow, /**< NLP nonlinear row */
1491  SCIP_SOL* sol, /**< primal CIP solution */
1492  SCIP_Real* feasibility /**< pointer to store feasibility value */
1493  )
1494 {
1495  SCIP_CALL( SCIPcheckStage(scip, "SCIPgetNlRowSolFeasibility", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
1496 
1497  if( sol != NULL )
1498  {
1499  SCIP_CALL( SCIPnlrowGetSolFeasibility(nlrow, scip->mem->probmem, scip->set, scip->stat, sol, feasibility) );
1500  }
1501  else if( scip->nlp != NULL && SCIPnlpHasCurrentNodeNLP(scip->nlp) && SCIPnlpHasSolution(scip->nlp) )
1502  {
1503  SCIP_CALL( SCIPnlrowGetNLPFeasibility(nlrow, scip->mem->probmem, scip->set, scip->stat, scip->primal, scip->tree, scip->nlp, feasibility) );
1504  }
1505  else
1506  {
1507  SCIP_CALL( SCIPnlrowGetPseudoFeasibility(nlrow, scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->primal, scip->tree, scip->lp, feasibility) );
1508  }
1509 
1510  return SCIP_OKAY;
1511 }
1512 
1513 /** gives the minimal and maximal activity of a nonlinear row w.r.t. the variable's bounds
1514  *
1515  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1516  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1517  *
1518  * @pre This method can be called if SCIP is in one of the following stages:
1519  * - \ref SCIP_STAGE_PRESOLVED
1520  * - \ref SCIP_STAGE_INITSOLVE
1521  * - \ref SCIP_STAGE_SOLVING
1522  */
1524  SCIP* scip, /**< SCIP data structure */
1525  SCIP_NLROW* nlrow, /**< NLP row */
1526  SCIP_Real* minactivity, /**< buffer to store minimal activity, or NULL */
1527  SCIP_Real* maxactivity /**< buffer to store maximal activity, or NULL */
1528  )
1529 {
1530  SCIP_CALL( SCIPcheckStage(scip, "SCIPgetNlRowActivityBounds", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
1531 
1532  SCIP_CALL( SCIPnlrowGetActivityBounds(nlrow, scip->mem->probmem, scip->set, scip->stat, minactivity, maxactivity) );
1533 
1534  return SCIP_OKAY;
1535 }
1536 
1537 /** prints a nonlinear row to file stream
1538  *
1539  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1540  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1541  *
1542  * @pre This method can be called if SCIP is in one of the following stages:
1543  * - \ref SCIP_STAGE_PRESOLVED
1544  * - \ref SCIP_STAGE_INITSOLVE
1545  * - \ref SCIP_STAGE_SOLVING
1546  */
1548  SCIP* scip, /**< SCIP data structure */
1549  SCIP_NLROW* nlrow, /**< NLP row */
1550  FILE* file /**< output file (or NULL for standard output) */
1551  )
1552 {
1553  assert(nlrow != NULL);
1554 
1555  SCIP_CALL( SCIPcheckStage(scip, "SCIPprintNlRow", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
1556 
1557  SCIP_CALL( SCIPnlrowPrint(nlrow, scip->mem->probmem, scip->set, scip->stat, scip->messagehdlr, file) );
1558 
1559  return SCIP_OKAY;
1560 }
1561 
1562 /** @} */
SCIP_RETCODE SCIPaddLinearCoefsToNlRow(SCIP *scip, SCIP_NLROW *nlrow, int nvars, SCIP_VAR **vars, SCIP_Real *vals)
Definition: scip_nlp.c:1131
SCIP_RETCODE SCIPnlpEndDive(SCIP_NLP *nlp, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat)
Definition: nlp.c:4464
SCIP_STAT * stat
Definition: struct_scip.h:70
int SCIPgetNNLPNlRows(SCIP *scip)
Definition: scip_nlp.c:332
SCIP_RETCODE SCIPgetNlRowPseudoActivity(SCIP *scip, SCIP_NLROW *nlrow, SCIP_Real *pseudoactivity)
Definition: scip_nlp.c:1324
enum SCIP_NlpTermStat SCIP_NLPTERMSTAT
Definition: type_nlpi.h:185
SCIP_Bool SCIPisNLPConstructed(SCIP *scip)
Definition: scip_nlp.c:101
SCIP_Real * SCIPnlpGetVarsLbDualsol(SCIP_NLP *nlp)
Definition: nlp.c:4308
public methods for SCIP parameter handling
SCIP_RETCODE SCIPnlpChgVarBoundsDive(SCIP_SET *set, SCIP_NLP *nlp, SCIP_VAR *var, SCIP_Real lb, SCIP_Real ub)
Definition: nlp.c:4583
SCIP_RETCODE SCIPgetNLPNlRowsData(SCIP *scip, SCIP_NLROW ***nlrows, int *nnlrows)
Definition: scip_nlp.c:282
public methods for memory management
SCIP_RETCODE SCIPnlpDelNlRow(SCIP_NLP *nlp, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_NLROW *nlrow)
Definition: nlp.c:3881
SCIP_RETCODE SCIPnlrowRecalcPseudoActivity(SCIP_NLROW *nlrow, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *prob, SCIP_PRIMAL *primal, SCIP_TREE *tree, SCIP_LP *lp)
Definition: nlp.c:1505
SCIP_RETCODE SCIPchgNlRowRhs(SCIP *scip, SCIP_NLROW *nlrow, SCIP_Real rhs)
Definition: scip_nlp.c:1061
internal methods for NLP solver interfaces
SCIP_PRIMAL * primal
Definition: struct_scip.h:85
SCIP_NLPSOLSTAT SCIPgetNLPSolstat(SCIP *scip)
Definition: scip_nlp.c:532
SCIP_RETCODE SCIPnlrowAddLinearCoef(SCIP_NLROW *nlrow, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_NLP *nlp, SCIP_VAR *var, SCIP_Real val)
Definition: nlp.c:1159
SCIP_RETCODE SCIPchgVarObjDiveNLP(SCIP *scip, SCIP_VAR *var, SCIP_Real coef)
Definition: scip_nlp.c:814
SCIP_RETCODE SCIPchgNlRowLinearCoef(SCIP *scip, SCIP_NLROW *nlrow, SCIP_VAR *var, SCIP_Real coef)
Definition: scip_nlp.c:1168
SCIP_RETCODE SCIPnlrowChgExpr(SCIP_NLROW *nlrow, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_NLP *nlp, SCIP_EXPR *expr)
Definition: nlp.c:1278
SCIP_RETCODE SCIPnlrowGetNLPFeasibility(SCIP_NLROW *nlrow, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_PRIMAL *primal, SCIP_TREE *tree, SCIP_NLP *nlp, SCIP_Real *feasibility)
Definition: nlp.c:1482
SCIP_RETCODE SCIPnlrowCreate(SCIP_NLROW **nlrow, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, const char *name, SCIP_Real constant, int nlinvars, SCIP_VAR **linvars, SCIP_Real *lincoefs, SCIP_EXPR *expr, SCIP_Real lhs, SCIP_Real rhs, SCIP_EXPRCURV curvature)
Definition: nlp.c:833
#define FALSE
Definition: def.h:87
SCIP_RETCODE SCIPnlpSetInitialGuess(SCIP_SET *set, SCIP_NLP *nlp, BMS_BLKMEM *blkmem, SCIP_Real *initguess)
Definition: nlp.c:4102
SCIP_RETCODE SCIPnlrowRecalcNLPActivity(SCIP_NLROW *nlrow, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_PRIMAL *primal, SCIP_TREE *tree, SCIP_NLP *nlp)
Definition: nlp.c:1400
#define TRUE
Definition: def.h:86
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:54
SCIP_RETCODE SCIPnlpChgVarsBoundsDive(SCIP_NLP *nlp, SCIP_SET *set, int nvars, SCIP_VAR **vars, SCIP_Real *lbs, SCIP_Real *ubs)
Definition: nlp.c:4612
SCIP_NLPTERMSTAT SCIPnlpGetTermstat(SCIP_NLP *nlp)
Definition: nlp.c:4388
SCIP_RETCODE SCIPgetNlRowSolActivity(SCIP *scip, SCIP_NLROW *nlrow, SCIP_SOL *sol, SCIP_Real *activity)
Definition: scip_nlp.c:1454
SCIP_Real * SCIPgetNLPVarsLbDualsol(SCIP *scip)
Definition: scip_nlp.c:238
SCIP_RETCODE SCIPgetNLPVarsNonlinearity(SCIP *scip, int *nlcount)
Definition: scip_nlp.c:214
SCIP_RETCODE SCIPflushNLP(SCIP *scip)
Definition: scip_nlp.c:406
SCIP_PROB * transprob
Definition: struct_scip.h:89
#define SCIPfreeBufferArray(scip, ptr)
Definition: scip_mem.h:127
SCIP_RETCODE SCIPnlrowChgLhs(SCIP_NLROW *nlrow, SCIP_SET *set, SCIP_STAT *stat, SCIP_NLP *nlp, SCIP_Real lhs)
Definition: nlp.c:1345
SCIP_RETCODE SCIPnlpGetStatistics(SCIP_SET *set, SCIP_NLP *nlp, SCIP_NLPSTATISTICS *statistics)
Definition: nlp.c:4398
SCIP_RETCODE SCIPaddLinearCoefToNlRow(SCIP *scip, SCIP_NLROW *nlrow, SCIP_VAR *var, SCIP_Real val)
Definition: scip_nlp.c:1107
SCIP_RETCODE SCIPnlrowChgRhs(SCIP_NLROW *nlrow, SCIP_SET *set, SCIP_STAT *stat, SCIP_NLP *nlp, SCIP_Real rhs)
Definition: nlp.c:1365
SCIP_RETCODE SCIPcreateNlRowFromRow(SCIP *scip, SCIP_NLROW **nlrow, SCIP_ROW *row)
Definition: scip_nlp.c:970
SCIP_RETCODE SCIPnlrowChgConstant(SCIP_NLROW *nlrow, SCIP_SET *set, SCIP_STAT *stat, SCIP_NLP *nlp, SCIP_Real constant)
Definition: nlp.c:1325
SCIP_RETCODE SCIPnlrowGetActivityBounds(SCIP_NLROW *nlrow, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_Real *minactivity, SCIP_Real *maxactivity)
Definition: nlp.c:1679
public methods for handling parameter settings
SCIP_MEM * mem
Definition: struct_scip.h:62
int SCIPgetNNLPVars(SCIP *scip)
Definition: scip_nlp.c:192
SCIP_NLPTERMSTAT SCIPgetNLPTermstat(SCIP *scip)
Definition: scip_nlp.c:554
void SCIPnlrowCapture(SCIP_NLROW *nlrow)
Definition: nlp.c:1077
#define SCIPerrorMessage
Definition: pub_message.h:55
SCIP_RETCODE SCIPrecalcNlRowPseudoActivity(SCIP *scip, SCIP_NLROW *nlrow)
Definition: scip_nlp.c:1303
SCIP_RETCODE SCIPaddNlRow(SCIP *scip, SCIP_NLROW *nlrow)
Definition: scip_nlp.c:354
SCIP_RETCODE SCIPwriteNLP(SCIP *scip, const char *filename)
Definition: scip_nlp.c:685
enum SCIP_NlpSolStat SCIP_NLPSOLSTAT
Definition: type_nlpi.h:159
SCIP_RETCODE SCIPgetSolVals(SCIP *scip, SCIP_SOL *sol, int nvars, SCIP_VAR **vars, SCIP_Real *vals)
Definition: scip_sol.c:1389
SCIP_RETCODE SCIPhasNLPContinuousNonlinearity(SCIP *scip, SCIP_Bool *result)
Definition: scip_nlp.c:116
SCIP_RETCODE SCIPreleaseNlRow(SCIP *scip, SCIP_NLROW **nlrow)
Definition: scip_nlp.c:1016
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:2177
BMS_BLKMEM * SCIPblkmem(SCIP *scip)
Definition: scip_mem.c:48
SCIP_RETCODE SCIPchgVarBoundsDiveNLP(SCIP *scip, SCIP_VAR *var, SCIP_Real lb, SCIP_Real ub)
Definition: scip_nlp.c:844
int SCIPnlpGetNNlRows(SCIP_NLP *nlp)
Definition: nlp.c:4338
SCIP_Real SCIPnlpGetObjval(SCIP_NLP *nlp)
Definition: nlp.c:3978
SCIP_NLROW ** SCIPnlpGetNlRows(SCIP_NLP *nlp)
Definition: nlp.c:4328
internal methods for NLP management
SCIP_RETCODE SCIPgetNlRowActivityBounds(SCIP *scip, SCIP_NLROW *nlrow, SCIP_Real *minactivity, SCIP_Real *maxactivity)
Definition: scip_nlp.c:1523
SCIP_Bool SCIPisNLPEnabled(SCIP *scip)
Definition: scip_nlp.c:65
#define NULL
Definition: lpi_spx1.cpp:155
SCIP_RETCODE SCIPsetNLPInitialGuess(SCIP *scip, SCIP_Real *initialguess)
Definition: scip_nlp.c:432
SCIP_RETCODE SCIPsetNLPInitialGuessSol(SCIP *scip, SCIP_SOL *sol)
Definition: scip_nlp.c:459
internal methods for global SCIP settings
#define SCIP_CALL(x)
Definition: def.h:384
SCIP_RETCODE SCIPgetNLPI(SCIP *scip, SCIP_NLPI **nlpi, SCIP_NLPIPROBLEM **nlpiproblem)
Definition: scip_nlp.c:720
SCIP_RETCODE SCIPrecalcNlRowActivity(SCIP *scip, SCIP_NLROW *nlrow)
Definition: scip_nlp.c:1368
SCIP main data structure.
SCIP_NLROW ** SCIPgetNLPNlRows(SCIP *scip)
Definition: scip_nlp.c:310
SCIP_RETCODE SCIPnlpSolve(SCIP_NLP *nlp, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, SCIP_STAT *stat, SCIP_PRIMAL *primal, SCIP_TREE *tree, SCIP_NLPPARAM *nlpparam)
Definition: nlp.c:3951
SCIP_RETCODE SCIPnlrowChgLinearCoef(SCIP_NLROW *nlrow, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_NLP *nlp, SCIP_VAR *var, SCIP_Real coef)
Definition: nlp.c:1240
SCIP_RETCODE SCIPnlpChgVarObjDive(SCIP_NLP *nlp, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_VAR *var, SCIP_Real coef)
Definition: nlp.c:4526
SCIP_RETCODE SCIPnlrowGetPseudoActivity(SCIP_NLROW *nlrow, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *prob, SCIP_PRIMAL *primal, SCIP_TREE *tree, SCIP_LP *lp, SCIP_Real *pseudoactivity)
Definition: nlp.c:1552
public methods for NLP management
SCIP_RETCODE SCIPchgNlRowLhs(SCIP *scip, SCIP_NLROW *nlrow, SCIP_Real lhs)
Definition: scip_nlp.c:1038
SCIP_Real * SCIPgetNLPVarsUbDualsol(SCIP *scip)
Definition: scip_nlp.c:260
#define SCIPallocBufferArray(scip, ptr, num)
Definition: scip_mem.h:115
SCIP_RETCODE SCIPgetNlRowFeasibility(SCIP *scip, SCIP_NLROW *nlrow, SCIP_Real *feasibility)
Definition: scip_nlp.c:1425
public data structures and miscellaneous methods
#define SCIP_Bool
Definition: def.h:84
SCIP_RETCODE SCIPgetNLPStatistics(SCIP *scip, SCIP_NLPSTATISTICS *statistics)
Definition: scip_nlp.c:579
SCIP_RETCODE SCIPnlpHasContinuousNonlinearity(SCIP_NLP *nlp, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_Bool *result)
Definition: nlp.c:4265
SCIP_RETCODE SCIPchgNlRowConstant(SCIP *scip, SCIP_NLROW *nlrow, SCIP_Real constant)
Definition: scip_nlp.c:1084
SCIP_RETCODE SCIPnlrowGetNLPActivity(SCIP_NLROW *nlrow, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_PRIMAL *primal, SCIP_TREE *tree, SCIP_NLP *nlp, SCIP_Real *activity)
Definition: nlp.c:1452
SCIP_Bool SCIPnlpHasCurrentNodeNLP(SCIP_NLP *nlp)
Definition: nlp.c:3664
SCIP_RETCODE SCIPrecalcNlRowNLPActivity(SCIP *scip, SCIP_NLROW *nlrow)
Definition: scip_nlp.c:1220
SCIP_NLPSOLSTAT SCIPnlpGetSolstat(SCIP_NLP *nlp)
Definition: nlp.c:4378
SCIP_EXPRCURV
Definition: type_expr.h:48
SCIP_RETCODE SCIPnlpAddNlRow(SCIP_NLP *nlp, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_NLROW *nlrow)
Definition: nlp.c:3825
SCIP_RETCODE SCIPnlrowGetPseudoFeasibility(SCIP_NLROW *nlrow, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *prob, SCIP_PRIMAL *primal, SCIP_TREE *tree, SCIP_LP *lp, SCIP_Real *pseudofeasibility)
Definition: nlp.c:1583
SCIP_RETCODE SCIPgetNLPVarsData(SCIP *scip, SCIP_VAR ***vars, int *nvars)
Definition: scip_nlp.c:140
SCIP_RETCODE SCIPchgVarsBoundsDiveNLP(SCIP *scip, int nvars, SCIP_VAR **vars, SCIP_Real *lbs, SCIP_Real *ubs)
Definition: scip_nlp.c:875
SCIP_RETCODE SCIPgetNlRowPseudoFeasibility(SCIP *scip, SCIP_NLROW *nlrow, SCIP_Real *pseudofeasibility)
Definition: scip_nlp.c:1346
SCIP_RETCODE SCIPgetNlRowActivity(SCIP *scip, SCIP_NLROW *nlrow, SCIP_Real *activity)
Definition: scip_nlp.c:1396
methods for debugging
SCIP_RETCODE SCIPnlpStartDive(SCIP_NLP *nlp, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat)
Definition: nlp.c:4433
datastructures for block memory pools and memory buffers
SCIP_RETCODE SCIPcreateNlRow(SCIP *scip, SCIP_NLROW **nlrow, const char *name, SCIP_Real constant, int nlinvars, SCIP_VAR **linvars, SCIP_Real *lincoefs, SCIP_EXPR *expr, SCIP_Real lhs, SCIP_Real rhs, SCIP_EXPRCURV curvature)
Definition: scip_nlp.c:912
int SCIPnlpGetNVars(SCIP_NLP *nlp)
Definition: nlp.c:4201
SCIP_RETCODE SCIPcreateEmptyNlRow(SCIP *scip, SCIP_NLROW **nlrow, const char *name, SCIP_Real lhs, SCIP_Real rhs)
Definition: scip_nlp.c:944
SCIP_RETCODE SCIPcaptureNlRow(SCIP *scip, SCIP_NLROW *nlrow)
Definition: scip_nlp.c:993
SCIP_RETCODE SCIPnlpGetFracVars(SCIP_NLP *nlp, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_VAR ***fracvars, SCIP_Real **fracvarssol, SCIP_Real **fracvarsfrac, int *nfracvars, int *npriofracvars)
Definition: nlp.c:4022
SCIP_RETCODE SCIPnlrowCreateFromRow(SCIP_NLROW **nlrow, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_ROW *row)
Definition: nlp.c:967
SCIP * scip
Definition: struct_var.h:279
SCIP_RETCODE SCIPsetNlRowExpr(SCIP *scip, SCIP_NLROW *nlrow, SCIP_EXPR *expr)
Definition: scip_nlp.c:1194
SCIP_RETCODE SCIPdelNlRow(SCIP *scip, SCIP_NLROW *nlrow)
Definition: scip_nlp.c:382
public methods for nonlinear relaxation
void SCIPenableNLP(SCIP *scip)
Definition: scip_nlp.c:86
datastructures for storing and manipulating the main problem
SCIP_RETCODE SCIPsolveNLPParam(SCIP *scip, SCIP_NLPPARAM param)
Definition: scip_nlp.c:503
SCIP_Bool SCIPhasNLPSolution(SCIP *scip)
Definition: scip_nlp.c:629
SCIP_RETCODE SCIPnlpFlush(SCIP_NLP *nlp, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat)
Definition: nlp.c:3913
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:4358
SCIP_RETCODE SCIPgetNlRowSolFeasibility(SCIP *scip, SCIP_NLROW *nlrow, SCIP_SOL *sol, SCIP_Real *feasibility)
Definition: scip_nlp.c:1488
public methods for solutions
SCIP_RETCODE SCIPendDiveNLP(SCIP *scip)
Definition: scip_nlp.c:788
SCIP_SET * set
Definition: struct_scip.h:63
SCIP_RETCODE SCIPnlpGetVarsNonlinearity(SCIP_NLP *nlp, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, int *nlcount)
Definition: nlp.c:4211
public methods for message output
datastructures for problem variables
SCIP_RETCODE SCIPnlpWrite(SCIP_NLP *nlp, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_MESSAGEHDLR *messagehdlr, const char *fname)
Definition: nlp.c:4138
SCIP_RETCODE SCIPgetNLPFracVars(SCIP *scip, SCIP_VAR ***fracvars, SCIP_Real **fracvarssol, SCIP_Real **fracvarsfrac, int *nfracvars, int *npriofracvars)
Definition: scip_nlp.c:654
SCIP_MESSAGEHDLR * messagehdlr
Definition: struct_scip.h:66
#define SCIP_Real
Definition: def.h:177
SCIP_RETCODE SCIPgetNlRowNLPFeasibility(SCIP *scip, SCIP_NLROW *nlrow, SCIP_Real *feasibility)
Definition: scip_nlp.c:1275
SCIP_NLP * nlp
Definition: struct_scip.h:83
#define SCIP_INVALID
Definition: def.h:197
SCIP_NLPI * SCIPnlpGetNLPI(SCIP_NLP *nlp)
Definition: nlp.c:4348
SCIP_RETCODE SCIPprintNlRow(SCIP *scip, SCIP_NLROW *nlrow, FILE *file)
Definition: scip_nlp.c:1547
SCIP_RETCODE SCIPnlrowRelease(SCIP_NLROW **nlrow, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat)
Definition: nlp.c:1089
SCIP_VAR ** SCIPnlpGetVars(SCIP_NLP *nlp)
Definition: nlp.c:4191
SCIP_TREE * tree
Definition: struct_scip.h:86
SCIP_RETCODE SCIPnlrowGetSolActivity(SCIP_NLROW *nlrow, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_SOL *sol, SCIP_Real *activity)
Definition: nlp.c:1608
SCIP_Real SCIPgetNLPObjval(SCIP *scip)
Definition: scip_nlp.c:603
SCIP_RETCODE SCIPstartDiveNLP(SCIP *scip)
Definition: scip_nlp.c:760
SCIP_Real * SCIPnlpGetVarsUbDualsol(SCIP_NLP *nlp)
Definition: nlp.c:4318
#define SCIP_CALL_ABORT(x)
Definition: def.h:363
SCIP_RETCODE SCIPgetNlRowNLPActivity(SCIP *scip, SCIP_NLROW *nlrow, SCIP_Real *activity)
Definition: scip_nlp.c:1247
SCIP_LP * lp
Definition: struct_scip.h:82
#define SCIPABORT()
Definition: def.h:356
SCIP_Bool SCIPnlpHasSolution(SCIP_NLP *nlp)
Definition: nlp.c:4419
datastructures for global SCIP settings
void SCIPnlrowSetCurvature(SCIP_NLROW *nlrow, SCIP_EXPRCURV curvature)
Definition: nlp.c:1833
SCIP_RETCODE SCIPnlrowGetSolFeasibility(SCIP_NLROW *nlrow, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_SOL *sol, SCIP_Real *feasibility)
Definition: nlp.c:1657
SCIP_RETCODE SCIPnlrowPrint(SCIP_NLROW *nlrow, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_MESSAGEHDLR *messagehdlr, FILE *file)
Definition: nlp.c:1030
SCIP_VAR ** SCIPgetNLPVars(SCIP *scip)
Definition: scip_nlp.c:170
memory allocation routines