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-2024 Zuse Institute Berlin (ZIB) */
7/* */
8/* Licensed under the Apache License, Version 2.0 (the "License"); */
9/* you may not use this file except in compliance with the License. */
10/* You may obtain a copy of the License at */
11/* */
12/* http://www.apache.org/licenses/LICENSE-2.0 */
13/* */
14/* Unless required by applicable law or agreed to in writing, software */
15/* distributed under the License is distributed on an "AS IS" BASIS, */
16/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */
17/* See the License for the specific language governing permissions and */
18/* limitations under the License. */
19/* */
20/* You should have received a copy of the Apache-2.0 license */
21/* along with SCIP; see the file LICENSE. If not visit scipopt.org. */
22/* */
23/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
24
25/**@file pub_nlp.h
26 * @ingroup PUBLICCOREAPI
27 * @brief public methods for NLP management
28 * @author Thorsten Gellermann
29 * @author Stefan Vigerske
30 */
31
32/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
33
34#ifndef __SCIP_PUB_NLP_H__
35#define __SCIP_PUB_NLP_H__
36
37#include <stdio.h>
38
39#include "scip/def.h"
40#include "scip/type_message.h"
42#include "scip/type_set.h"
43#include "scip/type_stat.h"
44#include "scip/type_nlp.h"
45#include "scip/type_var.h"
46#include "scip/type_sol.h"
47#include "scip/type_expr.h"
48#include "scip/type_nlpi.h"
49
50#ifdef NDEBUG
51#include "scip/struct_nlp.h"
52#endif
53
54#ifdef __cplusplus
55extern "C" {
56#endif
57
58/**@addtogroup PublicNLRowMethods
59 *
60 * @{
61 */
62
63/** gets constant */
64SCIP_EXPORT
66 SCIP_NLROW* nlrow /**< NLP row */
67 );
68
69/** gets number of variables of linear part */
70SCIP_EXPORT
72 SCIP_NLROW* nlrow /**< NLP row */
73 );
74
75/** gets array with variables of linear part */
76SCIP_EXPORT
78 SCIP_NLROW* nlrow /**< NLP row */
79 );
80
81/** gets array with coefficients in linear part */
82SCIP_EXPORT
84 SCIP_NLROW* nlrow /**< NLP row */
85 );
86
87/** gets expression */
88SCIP_EXPORT
90 SCIP_NLROW* nlrow /**< NLP row */
91 );
92
93/** returns the left hand side of a nonlinear row */
94SCIP_EXPORT
96 SCIP_NLROW* nlrow /**< NLP row */
97 );
98
99/** returns the right hand side of a nonlinear row */
100SCIP_EXPORT
102 SCIP_NLROW* nlrow /**< NLP row */
103 );
104
105/** returns the curvature of a nonlinear row */
106SCIP_EXPORT
108 SCIP_NLROW* nlrow /**< NLP row */
109 );
110
111/** returns the name of a nonlinear row */
112SCIP_EXPORT
113const char* SCIPnlrowGetName(
114 SCIP_NLROW* nlrow /**< NLP row */
115 );
116
117/** gets position of a nonlinear row in current NLP, or -1 if not in NLP */
118SCIP_EXPORT
120 SCIP_NLROW* nlrow /**< NLP row */
121 );
122
123/** returns TRUE iff row is member of current NLP */
124SCIP_EXPORT
126 SCIP_NLROW* nlrow /**< NLP row */
127 );
128
129/** gets the dual NLP solution of a nlrow
130 *
131 * 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
132 */
133SCIP_EXPORT
135 SCIP_NLROW* nlrow /**< NLP row */
136 );
137
138#ifdef NDEBUG
139/* If NDEBUG is defined, the function calls are overwritten by defines to reduce the number of function calls and
140 * speed up the algorithms.
141 */
142#define SCIPnlrowGetConstant(nlrow) (nlrow)->constant
143#define SCIPnlrowGetNLinearVars(nlrow) (nlrow)->nlinvars
144#define SCIPnlrowGetLinearVars(nlrow) (nlrow)->linvars
145#define SCIPnlrowGetLinearCoefs(nlrow) (nlrow)->lincoefs
146#define SCIPnlrowGetExpr(nlrow) (nlrow)->expr
147#define SCIPnlrowGetLhs(nlrow) (nlrow)->lhs
148#define SCIPnlrowGetRhs(nlrow) (nlrow)->rhs
149#define SCIPnlrowGetCurvature(nlrow) (nlrow)->curvature
150#define SCIPnlrowGetName(nlrow) (nlrow)->name
151#define SCIPnlrowGetNLPPos(nlrow) (nlrow)->nlpindex
152#define SCIPnlrowIsInNLP(nlrow) ((nlrow)->nlpindex != -1)
153#define SCIPnlrowGetDualsol(nlrow) ((nlrow)->nlpiindex >= 0 ? (nlrow)->dualsol : 0.0)
154#endif
155
156/**@} */
157
158#ifdef __cplusplus
159}
160#endif
161
162#endif /* __SCIP_PUB_NLP_H__ */
common defines and data types used in all packages of SCIP
#define SCIP_Bool
Definition: def.h:91
#define SCIP_Real
Definition: def.h:173
const char * SCIPnlrowGetName(SCIP_NLROW *nlrow)
Definition: nlp.c:1936
SCIP_Real SCIPnlrowGetRhs(SCIP_NLROW *nlrow)
Definition: nlp.c:1917
SCIP_Real SCIPnlrowGetLhs(SCIP_NLROW *nlrow)
Definition: nlp.c:1907
SCIP_EXPRCURV SCIPnlrowGetCurvature(SCIP_NLROW *nlrow)
Definition: nlp.c:1927
int SCIPnlrowGetNLPPos(SCIP_NLROW *nlrow)
Definition: nlp.c:1946
int SCIPnlrowGetNLinearVars(SCIP_NLROW *nlrow)
Definition: nlp.c:1867
SCIP_VAR ** SCIPnlrowGetLinearVars(SCIP_NLROW *nlrow)
Definition: nlp.c:1877
SCIP_Real SCIPnlrowGetDualsol(SCIP_NLROW *nlrow)
Definition: nlp.c:1969
SCIP_Real SCIPnlrowGetConstant(SCIP_NLROW *nlrow)
Definition: nlp.c:1857
SCIP_EXPR * SCIPnlrowGetExpr(SCIP_NLROW *nlrow)
Definition: nlp.c:1897
SCIP_Bool SCIPnlrowIsInNLP(SCIP_NLROW *nlrow)
Definition: nlp.c:1956
SCIP_Real * SCIPnlrowGetLinearCoefs(SCIP_NLROW *nlrow)
Definition: nlp.c:1887
memory allocation routines
datastructures for NLP management
type and macro definitions related to algebraic expressions
SCIP_EXPRCURV
Definition: type_expr.h:61
type definitions for message output methods
type definitions for NLP management
type definitions for NLP solver interfaces
type definitions for global SCIP settings
type definitions for storing primal CIP solutions
type definitions for problem statistics
type definitions for problem variables