Scippy

SCIP

Solving Constraint Integer Programs

expr_varidx.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 2002-2022 Zuse Institute Berlin */
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 expr_varidx.h
26  * @ingroup EXPRHDLRS
27  * @brief handler for variable index expressions
28  * @author Benjamin Mueller
29  */
30 
31 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
32 
33 #ifndef __SCIP_EXPR_VARIDX_H__
34 #define __SCIP_EXPR_VARIDX_H__
35 
36 
37 #include "scip/type_scip.h"
38 #include "scip/type_expr.h"
39 
40 #ifdef __cplusplus
41 extern "C" {
42 #endif
43 
44 /** creates the handler for variable index expressions and includes it into SCIP
45  *
46  * @ingroup ExprhdlrIncludes
47  */
48 SCIP_EXPORT
50  SCIP* scip /**< SCIP data structure */
51  );
52 
53 /**@addtogroup EXPRHDLRS
54  *
55  * @{
56  *
57  * @name Index variable expression
58  *
59  * This expression handler handles a variable that is given by a variable index. It cannot have children.
60  *
61  * This expression handler is used for expressions that are passed to a NLP solver via the NLPI.
62  * @{
63  */
64 
65 /** creates a variable index expression */
66 SCIP_EXPORT
68  SCIP* scip, /**< SCIP data structure */
69  SCIP_EXPR** expr, /**< pointer where to store expression */
70  int varidx, /**< variable index to represent */
71  SCIP_DECL_EXPR_OWNERCREATE((*ownercreate)), /**< function to call to create ownerdata */
72  void* ownercreatedata /**< data to pass to ownercreate */
73  );
74 
75 /** indicates whether expression is varidx expression */
76 SCIP_EXPORT
78  SCIP* scip, /**< SCIP data structure */
79  SCIP_EXPR* expr /**< expression */
80  );
81 
82 /** gives the index stored in a varidx expression */
83 SCIP_EXPORT
85  SCIP_EXPR* expr /**< varindex expression */
86  );
87 
88 /** sets the index stored in a varidx expression */
89 SCIP_EXPORT
91  SCIP_EXPR* expr, /**< varindex expression */
92  int newindex /**< new index */
93  );
94 
95 /** @}
96  * @}
97  */
98 
99 #ifdef __cplusplus
100 }
101 #endif
102 
103 #endif /* __SCIP_EXPR_VARIDX_H__ */
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:63
type definitions for SCIP&#39;s main datastructure
SCIP_RETCODE SCIPincludeExprhdlrVaridx(SCIP *scip)
Definition: expr_varidx.c:191
#define SCIP_Bool
Definition: def.h:93
#define SCIP_DECL_EXPR_OWNERCREATE(x)
Definition: type_expr.h:140
void SCIPsetIndexExprVaridx(SCIP_EXPR *expr, int newindex)
Definition: expr_varidx.c:277
type and macro definitions related to algebraic expressions
SCIP_Bool SCIPisExprVaridx(SCIP *scip, SCIP_EXPR *expr)
Definition: expr_varidx.c:251
int SCIPgetIndexExprVaridx(SCIP_EXPR *expr)
Definition: expr_varidx.c:266
SCIP_RETCODE SCIPcreateExprVaridx(SCIP *scip, SCIP_EXPR **expr, int varidx, SCIP_DECL_EXPR_OWNERCREATE((*ownercreate)), void *ownercreatedata)
Definition: expr_varidx.c:219