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 (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 email to scip@zib.de. */
13 /* */
14 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
15 
16 /**@file expr_varidx.h
17  * @ingroup EXPRHDLRS
18  * @brief handler for variable index expressions
19  * @author Benjamin Mueller
20  */
21 
22 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
23 
24 #ifndef __SCIP_EXPR_VARIDX_H__
25 #define __SCIP_EXPR_VARIDX_H__
26 
27 
28 #include "scip/type_scip.h"
29 #include "scip/type_expr.h"
30 
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
34 
35 /** creates the handler for variable index expressions and includes it into SCIP
36  *
37  * @ingroup ExprhdlrIncludes
38  */
39 SCIP_EXPORT
41  SCIP* scip /**< SCIP data structure */
42  );
43 
44 /**@addtogroup EXPRHDLRS
45  *
46  * @{
47  *
48  * @name Index variable expression
49  *
50  * This expression handler handles a variable that is given by a variable index. It cannot have children.
51  *
52  * This expression handler is used for expressions that are passed to a NLP solver via the NLPI.
53  * @{
54  */
55 
56 /** creates a variable index expression */
57 SCIP_EXPORT
59  SCIP* scip, /**< SCIP data structure */
60  SCIP_EXPR** expr, /**< pointer where to store expression */
61  int varidx, /**< variable index to represent */
62  SCIP_DECL_EXPR_OWNERCREATE((*ownercreate)), /**< function to call to create ownerdata */
63  void* ownercreatedata /**< data to pass to ownercreate */
64  );
65 
66 /** indicates whether expression is varidx expression */
67 SCIP_EXPORT
69  SCIP* scip, /**< SCIP data structure */
70  SCIP_EXPR* expr /**< expression */
71  );
72 
73 /** gives the index stored in a varidx expression */
74 SCIP_EXPORT
76  SCIP_EXPR* expr /**< varindex expression */
77  );
78 
79 /** sets the index stored in a varidx expression */
80 SCIP_EXPORT
82  SCIP_EXPR* expr, /**< varindex expression */
83  int newindex /**< new index */
84  );
85 
86 /** @}
87  * @}
88  */
89 
90 #ifdef __cplusplus
91 }
92 #endif
93 
94 #endif /* __SCIP_EXPR_VARIDX_H__ */
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:54
type definitions for SCIP&#39;s main datastructure
SCIP_RETCODE SCIPincludeExprhdlrVaridx(SCIP *scip)
Definition: expr_varidx.c:182
#define SCIP_Bool
Definition: def.h:84
#define SCIP_DECL_EXPR_OWNERCREATE(x)
Definition: type_expr.h:131
void SCIPsetIndexExprVaridx(SCIP_EXPR *expr, int newindex)
Definition: expr_varidx.c:268
type and macro definitions related to algebraic expressions
SCIP_Bool SCIPisExprVaridx(SCIP *scip, SCIP_EXPR *expr)
Definition: expr_varidx.c:242
int SCIPgetIndexExprVaridx(SCIP_EXPR *expr)
Definition: expr_varidx.c:257
SCIP_RETCODE SCIPcreateExprVaridx(SCIP *scip, SCIP_EXPR **expr, int varidx, SCIP_DECL_EXPR_OWNERCREATE((*ownercreate)), void *ownercreatedata)
Definition: expr_varidx.c:210