Scippy

    SCIP

    Solving Constraint Integer Programs

    scip_prop.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-2025 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 scip_prop.h
    26 * @ingroup PUBLICCOREAPI
    27 * @brief public methods for propagator plugins
    28 * @author Tobias Achterberg
    29 * @author Timo Berthold
    30 * @author Thorsten Koch
    31 * @author Alexander Martin
    32 * @author Marc Pfetsch
    33 * @author Kati Wolter
    34 * @author Gregor Hendel
    35 * @author Leona Gottwald
    36 */
    37
    38/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
    39
    40#ifndef __SCIP_SCIP_PROP_H__
    41#define __SCIP_SCIP_PROP_H__
    42
    43
    44#include "scip/def.h"
    45#include "scip/type_lp.h"
    46#include "scip/type_prop.h"
    47#include "scip/type_result.h"
    48#include "scip/type_retcode.h"
    49#include "scip/type_scip.h"
    50#include "scip/type_timing.h"
    51#include "scip/type_var.h"
    52
    53#ifdef __cplusplus
    54extern "C" {
    55#endif
    56
    57/**@addtogroup PublicPropagatorMethods
    58 *
    59 * @{
    60 */
    61
    62/** creates a propagator and includes it in SCIP.
    63 *
    64
    65 * @note method has all propagator callbacks as arguments and is thus changed every time a new
    66 * callback is added in future releases; consider using SCIPincludePropBasic() and setter functions
    67 * if you seek for a method which is less likely to change in future releases
    68 */
    69SCIP_EXPORT
    71 SCIP* scip, /**< SCIP data structure */
    72 const char* name, /**< name of propagator */
    73 const char* desc, /**< description of propagator */
    74 int priority, /**< priority of the propagator (>= 0: before, < 0: after constraint handlers) */
    75 int freq, /**< frequency for calling propagator */
    76 SCIP_Bool delay, /**< should propagator be delayed, if other propagators found reductions? */
    77 SCIP_PROPTIMING timingmask, /**< positions in the node solving loop where propagator should be executed */
    78 int presolpriority, /**< presolving priority of the propagator (>= 0: before, < 0: after constraint handlers) */
    79 int presolmaxrounds, /**< maximal number of presolving rounds the propagator participates in (-1: no limit) */
    80 SCIP_PRESOLTIMING presoltiming, /**< timing mask of the propagator's presolving method */
    81 SCIP_DECL_PROPCOPY ((*propcopy)), /**< copy method of propagator or NULL if you don't want to copy your plugin into sub-SCIPs */
    82 SCIP_DECL_PROPFREE ((*propfree)), /**< destructor of propagator */
    83 SCIP_DECL_PROPINIT ((*propinit)), /**< initialize propagator */
    84 SCIP_DECL_PROPEXIT ((*propexit)), /**< deinitialize propagator */
    85 SCIP_DECL_PROPINITPRE ((*propinitpre)), /**< presolving initialization method of propagator */
    86 SCIP_DECL_PROPEXITPRE ((*propexitpre)), /**< presolving deinitialization method of propagator */
    87 SCIP_DECL_PROPINITSOL ((*propinitsol)), /**< solving process initialization method of propagator */
    88 SCIP_DECL_PROPEXITSOL ((*propexitsol)), /**< solving process deinitialization method of propagator */
    89 SCIP_DECL_PROPPRESOL ((*proppresol)), /**< presolving method */
    90 SCIP_DECL_PROPEXEC ((*propexec)), /**< execution method of propagator */
    91 SCIP_DECL_PROPRESPROP ((*propresprop)), /**< propagation conflict resolving method */
    92 SCIP_PROPDATA* propdata /**< propagator data */
    93 );
    94
    95/** creates a propagator and includes it in SCIP. All non-fundamental (or optional) callbacks will be set to NULL.
    96 * Optional callbacks can be set via specific setter functions, see SCIPsetPropInit(), SCIPsetPropExit(),
    97 * SCIPsetPropCopy(), SCIPsetPropFree(), SCIPsetPropInitsol(), SCIPsetPropExitsol(),
    98 * SCIPsetPropInitpre(), SCIPsetPropExitpre(), SCIPsetPropPresol(), and SCIPsetPropResprop().
    99 *
    100 * @pre This method can be called if SCIP is in one of the following stages:
    101 * - \ref SCIP_STAGE_INIT
    102 * - \ref SCIP_STAGE_PROBLEM
    103 *
    104 * @note if you want to set all callbacks with a single method call, consider using SCIPincludeProp() instead
    105 */
    106SCIP_EXPORT
    108 SCIP* scip, /**< SCIP data structure */
    109 SCIP_PROP** propptr, /**< reference to a propagator pointer, or NULL */
    110 const char* name, /**< name of propagator */
    111 const char* desc, /**< description of propagator */
    112 int priority, /**< priority of the propagator (>= 0: before, < 0: after constraint handlers) */
    113 int freq, /**< frequency for calling propagator */
    114 SCIP_Bool delay, /**< should propagator be delayed, if other propagators found reductions? */
    115 SCIP_PROPTIMING timingmask, /**< positions in the node solving loop where propagators should be executed */
    116 SCIP_DECL_PROPEXEC ((*propexec)), /**< execution method of propagator */
    117 SCIP_PROPDATA* propdata /**< propagator data */
    118 );
    119
    120/** sets copy method of propagator */
    121SCIP_EXPORT
    123 SCIP* scip, /**< SCIP data structure */
    124 SCIP_PROP* prop, /**< propagator */
    125 SCIP_DECL_PROPCOPY ((*propcopy)) /**< copy method of propagator or NULL if you don't want to copy your plugin into sub-SCIPs */
    126 );
    127
    128/** sets destructor method of propagator */
    129SCIP_EXPORT
    131 SCIP* scip, /**< SCIP data structure */
    132 SCIP_PROP* prop, /**< propagator */
    133 SCIP_DECL_PROPFREE ((*propfree)) /**< destructor of propagator */
    134 );
    135
    136/** sets initialization method of propagator */
    137SCIP_EXPORT
    139 SCIP* scip, /**< SCIP data structure */
    140 SCIP_PROP* prop, /**< propagator */
    141 SCIP_DECL_PROPINIT ((*propinit)) /**< initialize propagator */
    142 );
    143
    144/** sets deinitialization method of propagator */
    145SCIP_EXPORT
    147 SCIP* scip, /**< SCIP data structure */
    148 SCIP_PROP* prop, /**< propagator */
    149 SCIP_DECL_PROPEXIT ((*propexit)) /**< deinitialize propagator */
    150 );
    151
    152/** sets solving process initialization method of propagator */
    153SCIP_EXPORT
    155 SCIP* scip, /**< SCIP data structure */
    156 SCIP_PROP* prop, /**< propagator */
    157 SCIP_DECL_PROPINITSOL((*propinitsol)) /**< solving process initialization method of propagator */
    158 );
    159
    160/** sets solving process deinitialization method of propagator */
    161SCIP_EXPORT
    163 SCIP* scip, /**< SCIP data structure */
    164 SCIP_PROP* prop, /**< propagator */
    165 SCIP_DECL_PROPEXITSOL ((*propexitsol)) /**< solving process deinitialization method of propagator */
    166 );
    167
    168/** sets preprocessing initialization method of propagator */
    169SCIP_EXPORT
    171 SCIP* scip, /**< SCIP data structure */
    172 SCIP_PROP* prop, /**< propagator */
    173 SCIP_DECL_PROPINITPRE((*propinitpre)) /**< preprocessing initialization method of propagator */
    174 );
    175
    176/** sets preprocessing deinitialization method of propagator */
    177SCIP_EXPORT
    179 SCIP* scip, /**< SCIP data structure */
    180 SCIP_PROP* prop, /**< propagator */
    181 SCIP_DECL_PROPEXITPRE((*propexitpre)) /**< preprocessing deinitialization method of propagator */
    182 );
    183
    184/** sets presolving method of propagator */
    185SCIP_EXPORT
    187 SCIP* scip, /**< SCIP data structure */
    188 SCIP_PROP* prop, /**< propagator */
    189 SCIP_DECL_PROPPRESOL((*proppresol)), /**< presolving method of propagator */
    190 int presolpriority, /**< presolving priority of the propagator (>= 0: before, < 0: after constraint handlers) */
    191 int presolmaxrounds, /**< maximal number of presolving rounds the propagator participates in (-1: no limit) */
    192 SCIP_PRESOLTIMING presoltiming /**< timing mask of the propagator's presolving method */
    193 );
    194
    195/** sets propagation conflict resolving callback of propagator */
    196SCIP_EXPORT
    198 SCIP* scip, /**< SCIP data structure */
    199 SCIP_PROP* prop, /**< propagator */
    200 SCIP_DECL_PROPRESPROP ((*propresprop)) /**< propagation conflict resolving callback */
    201 );
    202
    203/** returns the propagator of the given name, or NULL if not existing */
    204SCIP_EXPORT
    206 SCIP* scip, /**< SCIP data structure */
    207 const char* name /**< name of propagator */
    208 );
    209
    210/** returns the array of currently available propagators */
    211SCIP_EXPORT
    213 SCIP* scip /**< SCIP data structure */
    214 );
    215
    216/** returns the number of currently available propagators */
    217SCIP_EXPORT
    218int SCIPgetNProps(
    219 SCIP* scip /**< SCIP data structure */
    220 );
    221
    222/** sets the priority of a propagator */
    223SCIP_EXPORT
    225 SCIP* scip, /**< SCIP data structure */
    226 SCIP_PROP* prop, /**< propagator */
    227 int priority /**< new priority of the propagator */
    228 );
    229
    230/** sets the presolving priority of a propagator */
    231SCIP_EXPORT
    233 SCIP* scip, /**< SCIP data structure */
    234 SCIP_PROP* prop, /**< propagator */
    235 int presolpriority /**< new presol priority of the propagator */
    236 );
    237
    238/** @} */
    239
    240#ifdef __cplusplus
    241}
    242#endif
    243
    244#endif
    common defines and data types used in all packages of SCIP
    #define SCIP_Bool
    Definition: def.h:91
    SCIP_PROP * SCIPfindProp(SCIP *scip, const char *name)
    Definition: scip_prop.c:333
    SCIP_RETCODE SCIPsetPropPriority(SCIP *scip, SCIP_PROP *prop, int priority)
    Definition: scip_prop.c:370
    SCIP_RETCODE SCIPsetPropInitsol(SCIP *scip, SCIP_PROP *prop, SCIP_DECL_PROPINITSOL((*propinitsol)))
    Definition: scip_prop.c:219
    SCIP_RETCODE SCIPsetPropResprop(SCIP *scip, SCIP_PROP *prop, SCIP_DECL_PROPRESPROP((*propresprop)))
    Definition: scip_prop.c:316
    SCIP_RETCODE SCIPsetPropPresolPriority(SCIP *scip, SCIP_PROP *prop, int presolpriority)
    Definition: scip_prop.c:385
    int SCIPgetNProps(SCIP *scip)
    Definition: scip_prop.c:359
    SCIP_RETCODE SCIPsetPropPresol(SCIP *scip, SCIP_PROP *prop, SCIP_DECL_PROPPRESOL((*proppresol)), int presolpriority, int presolmaxrounds, SCIP_PRESOLTIMING presoltiming)
    Definition: scip_prop.c:283
    SCIP_RETCODE SCIPsetPropExitpre(SCIP *scip, SCIP_PROP *prop, SCIP_DECL_PROPEXITPRE((*propexitpre)))
    Definition: scip_prop.c:267
    SCIP_RETCODE SCIPsetPropExit(SCIP *scip, SCIP_PROP *prop, SCIP_DECL_PROPEXIT((*propexit)))
    Definition: scip_prop.c:203
    SCIP_RETCODE SCIPsetPropInit(SCIP *scip, SCIP_PROP *prop, SCIP_DECL_PROPINIT((*propinit)))
    Definition: scip_prop.c:187
    SCIP_RETCODE SCIPincludeProp(SCIP *scip, const char *name, const char *desc, int priority, int freq, SCIP_Bool delay, SCIP_PROPTIMING timingmask, int presolpriority, int presolmaxrounds, SCIP_PRESOLTIMING presoltiming, SCIP_DECL_PROPCOPY((*propcopy)), SCIP_DECL_PROPFREE((*propfree)), SCIP_DECL_PROPINIT((*propinit)), SCIP_DECL_PROPEXIT((*propexit)), SCIP_DECL_PROPINITPRE((*propinitpre)), SCIP_DECL_PROPEXITPRE((*propexitpre)), SCIP_DECL_PROPINITSOL((*propinitsol)), SCIP_DECL_PROPEXITSOL((*propexitsol)), SCIP_DECL_PROPPRESOL((*proppresol)), SCIP_DECL_PROPEXEC((*propexec)), SCIP_DECL_PROPRESPROP((*propresprop)), SCIP_PROPDATA *propdata)
    Definition: scip_prop.c:66
    SCIP_RETCODE SCIPsetPropInitpre(SCIP *scip, SCIP_PROP *prop, SCIP_DECL_PROPINITPRE((*propinitpre)))
    Definition: scip_prop.c:251
    SCIP_RETCODE SCIPsetPropFree(SCIP *scip, SCIP_PROP *prop, SCIP_DECL_PROPFREE((*propfree)))
    Definition: scip_prop.c:171
    SCIP_PROP ** SCIPgetProps(SCIP *scip)
    Definition: scip_prop.c:346
    SCIP_RETCODE SCIPsetPropCopy(SCIP *scip, SCIP_PROP *prop, SCIP_DECL_PROPCOPY((*propcopy)))
    Definition: scip_prop.c:155
    SCIP_RETCODE SCIPsetPropExitsol(SCIP *scip, SCIP_PROP *prop, SCIP_DECL_PROPEXITSOL((*propexitsol)))
    Definition: scip_prop.c:235
    SCIP_RETCODE SCIPincludePropBasic(SCIP *scip, SCIP_PROP **propptr, const char *name, const char *desc, int priority, int freq, SCIP_Bool delay, SCIP_PROPTIMING timingmask, SCIP_DECL_PROPEXEC((*propexec)), SCIP_PROPDATA *propdata)
    Definition: scip_prop.c:118
    type definitions for LP management
    type definitions for propagators
    #define SCIP_DECL_PROPCOPY(x)
    Definition: type_prop.h:61
    #define SCIP_DECL_PROPEXITPRE(x)
    Definition: type_prop.h:114
    #define SCIP_DECL_PROPINITSOL(x)
    Definition: type_prop.h:129
    #define SCIP_DECL_PROPINIT(x)
    Definition: type_prop.h:77
    #define SCIP_DECL_PROPFREE(x)
    Definition: type_prop.h:69
    #define SCIP_DECL_PROPEXITSOL(x)
    Definition: type_prop.h:141
    #define SCIP_DECL_PROPEXIT(x)
    Definition: type_prop.h:85
    #define SCIP_DECL_PROPPRESOL(x)
    Definition: type_prop.h:193
    #define SCIP_DECL_PROPINITPRE(x)
    Definition: type_prop.h:99
    #define SCIP_DECL_PROPRESPROP(x)
    Definition: type_prop.h:258
    struct SCIP_PropData SCIP_PROPDATA
    Definition: type_prop.h:52
    #define SCIP_DECL_PROPEXEC(x)
    Definition: type_prop.h:217
    result codes for SCIP callback methods
    type definitions for return codes for SCIP methods
    enum SCIP_Retcode SCIP_RETCODE
    Definition: type_retcode.h:63
    type definitions for SCIP's main datastructure
    timing definitions for SCIP
    unsigned int SCIP_PROPTIMING
    Definition: type_timing.h:75
    unsigned int SCIP_PRESOLTIMING
    Definition: type_timing.h:61
    type definitions for problem variables