Scippy

SCIP

Solving Constraint Integer Programs

expr_entropy.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_entropy.h
17  * @ingroup EXPRHDLRS
18  * @brief handler for -x*log(x) expressions
19  * @author Benjamin Mueller
20  * @author Fabian Wegscheider
21  */
22 
23 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
24 
25 #ifndef __SCIP_EXPR_ENTROPY_H__
26 #define __SCIP_EXPR_ENTROPY_H__
27 
28 
29 #include "scip/scip.h"
30 #include "scip/type_expr.h"
31 
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
35 
36 /** creates the handler for entropy expressions and includes it into SCIP
37  *
38  * @ingroup ExprhdlrIncludes
39  */
40 SCIP_EXPORT
42  SCIP* scip /**< SCIP data structure */
43  );
44 
45 /**@addtogroup EXPRHDLRS
46  *
47  * @{
48  *
49  * @name Entropy value expression
50  *
51  * This expression handler provides the entropy function, that is,
52  * \f[
53  * x \mapsto \begin{cases}
54  * -x\log(x), & \mathrm{if} x > 0,\\
55  * 0, & \mathrm{if} x = 0, \\
56  * \mathrm{undefined}, & \mathrm{else}.
57  * \end{cases}
58  * \f]
59  *
60  * @{
61  */
62 
63 /** creates an entropy expression */
64 SCIP_EXPORT
66  SCIP* scip, /**< SCIP data structure */
67  SCIP_EXPR** expr, /**< pointer where to store expression */
68  SCIP_EXPR* child, /**< child expression */
69  SCIP_DECL_EXPR_OWNERCREATE((*ownercreate)), /**< function to call to create ownerdata */
70  void* ownercreatedata /**< data to pass to ownercreate */
71  );
72 
73 /** indicates whether expression is of entropy-type */
74 SCIP_EXPORT
76  SCIP* scip, /**< SCIP data structure */
77  SCIP_EXPR* expr /**< expression */
78  );
79 
80 /** @}
81  * @}
82  */
83 
84 #ifdef __cplusplus
85 }
86 #endif
87 
88 #endif /* __SCIP_EXPR_ENTROPY_H__ */
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:54
SCIP_Bool SCIPisExprEntropy(SCIP *scip, SCIP_EXPR *expr)
Definition: expr_entropy.c:701
SCIP_RETCODE SCIPcreateExprEntropy(SCIP *scip, SCIP_EXPR **expr, SCIP_EXPR *child, SCIP_DECL_EXPR_OWNERCREATE((*ownercreate)), void *ownercreatedata)
Definition: expr_entropy.c:674
#define SCIP_Bool
Definition: def.h:84
#define SCIP_DECL_EXPR_OWNERCREATE(x)
Definition: type_expr.h:131
type and macro definitions related to algebraic expressions
SCIP_RETCODE SCIPincludeExprhdlrEntropy(SCIP *scip)
Definition: expr_entropy.c:642
SCIP callable library.