Scippy

SCIP

Solving Constraint Integer Programs

pub_nlp.h
Go to the documentation of this file.
1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2 /* */
3 /* This file is part of the program and library */
4 /* SCIP --- Solving Constraint Integer Programs */
5 /* */
6 /* Copyright (C) 2002-2022 Konrad-Zuse-Zentrum */
7 /* fuer Informationstechnik Berlin */
8 /* */
9 /* SCIP is distributed under the terms of the ZIB Academic License. */
10 /* */
11 /* You should have received a copy of the ZIB Academic License */
12 /* along with SCIP; see the file COPYING. If not visit scipopt.org. */
13 /* */
14 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
15 
16 /**@file pub_nlp.h
17  * @ingroup PUBLICCOREAPI
18  * @brief public methods for NLP management
19  * @author Thorsten Gellermann
20  * @author Stefan Vigerske
21  */
22 
23 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
24 
25 #ifndef __SCIP_PUB_NLP_H__
26 #define __SCIP_PUB_NLP_H__
27 
28 #include <stdio.h>
29 
30 #include "scip/def.h"
31 #include "scip/type_message.h"
32 #include "blockmemshell/memory.h"
33 #include "scip/type_set.h"
34 #include "scip/type_stat.h"
35 #include "scip/type_nlp.h"
36 #include "scip/type_var.h"
37 #include "scip/type_sol.h"
38 #include "scip/type_expr.h"
39 #include "scip/type_nlpi.h"
40 
41 #ifdef NDEBUG
42 #include "scip/struct_nlp.h"
43 #endif
44 
45 #ifdef __cplusplus
46 extern "C" {
47 #endif
48 
49 /**@addtogroup PublicNLRowMethods
50  *
51  * @{
52  */
53 
54 /** gets constant */
55 SCIP_EXPORT
57  SCIP_NLROW* nlrow /**< NLP row */
58  );
59 
60 /** gets number of variables of linear part */
61 SCIP_EXPORT
63  SCIP_NLROW* nlrow /**< NLP row */
64  );
65 
66 /** gets array with variables of linear part */
67 SCIP_EXPORT
69  SCIP_NLROW* nlrow /**< NLP row */
70  );
71 
72 /** gets array with coefficients in linear part */
73 SCIP_EXPORT
75  SCIP_NLROW* nlrow /**< NLP row */
76  );
77 
78 /** gets expression */
79 SCIP_EXPORT
81  SCIP_NLROW* nlrow /**< NLP row */
82  );
83 
84 /** returns the left hand side of a nonlinear row */
85 SCIP_EXPORT
87  SCIP_NLROW* nlrow /**< NLP row */
88  );
89 
90 /** returns the right hand side of a nonlinear row */
91 SCIP_EXPORT
93  SCIP_NLROW* nlrow /**< NLP row */
94  );
95 
96 /** returns the curvature of a nonlinear row */
97 SCIP_EXPORT
99  SCIP_NLROW* nlrow /**< NLP row */
100  );
101 
102 /** sets the curvature of a nonlinear row */
103 SCIP_EXPORT
105  SCIP_NLROW* nlrow, /**< NLP row */
106  SCIP_EXPRCURV curvature /**< curvature of NLP row */
107  );
108 
109 /** returns the name of a nonlinear row */
110 SCIP_EXPORT
111 const char* SCIPnlrowGetName(
112  SCIP_NLROW* nlrow /**< NLP row */
113  );
114 
115 /** gets position of a nonlinear row in current NLP, or -1 if not in NLP */
116 SCIP_EXPORT
118  SCIP_NLROW* nlrow /**< NLP row */
119  );
120 
121 /** returns TRUE iff row is member of current NLP */
122 SCIP_EXPORT
124  SCIP_NLROW* nlrow /**< NLP row */
125  );
126 
127 /** gets the dual NLP solution of a nlrow
128  *
129  * for a ranged constraint, the dual value is positive if the right hand side is active and negative if the left hand side is active
130  */
131 SCIP_EXPORT
133  SCIP_NLROW* nlrow /**< NLP row */
134  );
135 
136 #ifdef NDEBUG
137 /* If NDEBUG is defined, the function calls are overwritten by defines to reduce the number of function calls and
138  * speed up the algorithms.
139  */
140 #define SCIPnlrowGetConstant(nlrow) (nlrow)->constant
141 #define SCIPnlrowGetNLinearVars(nlrow) (nlrow)->nlinvars
142 #define SCIPnlrowGetLinearVars(nlrow) (nlrow)->linvars
143 #define SCIPnlrowGetLinearCoefs(nlrow) (nlrow)->lincoefs
144 #define SCIPnlrowGetExpr(nlrow) (nlrow)->expr
145 #define SCIPnlrowGetLhs(nlrow) (nlrow)->lhs
146 #define SCIPnlrowGetRhs(nlrow) (nlrow)->rhs
147 #define SCIPnlrowGetCurvature(nlrow) (nlrow)->curvature
148 #define SCIPnlrowSetCurvature(nlrow, curvature_) (nlrow)->curvature = curvature_
149 #define SCIPnlrowGetName(nlrow) (nlrow)->name
150 #define SCIPnlrowGetNLPPos(nlrow) (nlrow)->nlpindex
151 #define SCIPnlrowIsInNLP(nlrow) ((nlrow)->nlpindex != -1)
152 #define SCIPnlrowGetDualsol(nlrow) ((nlrow)->nlpiindex >= 0 ? (nlrow)->dualsol : 0.0)
153 #endif
154 
155 /**@} */
156 
157 #ifdef __cplusplus
158 }
159 #endif
160 
161 #endif /* __SCIP_PUB_NLP_H__ */
type definitions for NLP management
SCIP_VAR ** SCIPnlrowGetLinearVars(SCIP_NLROW *nlrow)
Definition: nlp.c:1774
const char * SCIPnlrowGetName(SCIP_NLROW *nlrow)
Definition: nlp.c:1843
type definitions for global SCIP settings
SCIP_Real SCIPnlrowGetRhs(SCIP_NLROW *nlrow)
Definition: nlp.c:1814
datastructures for NLP management
int SCIPnlrowGetNLinearVars(SCIP_NLROW *nlrow)
Definition: nlp.c:1764
SCIP_EXPRCURV SCIPnlrowGetCurvature(SCIP_NLROW *nlrow)
Definition: nlp.c:1824
int SCIPnlrowGetNLPPos(SCIP_NLROW *nlrow)
Definition: nlp.c:1853
type definitions for problem statistics
SCIP_Bool SCIPnlrowIsInNLP(SCIP_NLROW *nlrow)
Definition: nlp.c:1863
SCIP_Real SCIPnlrowGetDualsol(SCIP_NLROW *nlrow)
Definition: nlp.c:1876
type definitions for problem variables
#define SCIP_Bool
Definition: def.h:84
SCIP_EXPRCURV
Definition: type_expr.h:48
type definitions for storing primal CIP solutions
SCIP_Real * SCIPnlrowGetLinearCoefs(SCIP_NLROW *nlrow)
Definition: nlp.c:1784
type and macro definitions related to algebraic expressions
#define SCIP_Real
Definition: def.h:177
type definitions for message output methods
common defines and data types used in all packages of SCIP
SCIP_Real SCIPnlrowGetConstant(SCIP_NLROW *nlrow)
Definition: nlp.c:1754
SCIP_Real SCIPnlrowGetLhs(SCIP_NLROW *nlrow)
Definition: nlp.c:1804
void SCIPnlrowSetCurvature(SCIP_NLROW *nlrow, SCIP_EXPRCURV curvature)
Definition: nlp.c:1833
SCIP_EXPR * SCIPnlrowGetExpr(SCIP_NLROW *nlrow)
Definition: nlp.c:1794
type definitions for NLP solver interfaces
memory allocation routines