Skip to content
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* This file is part of the program and library */
/* SCIP --- Solving Constraint Integer Programs */
/* */
/* Copyright (C) 2002-2020 Konrad-Zuse-Zentrum */
/* fuer Informationstechnik Berlin */
/* */
/* SCIP is distributed under the terms of the ZIB Academic License. */
/* */
/* You should have received a copy of the ZIB Academic License */
/* along with SCIP; see the file COPYING. If not visit scipopt.org. */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/**@file reader_rlp.h
* @ingroup FILEREADERS
* @brief RLP file reader (LP format with generic variables and row names)
* @author Stefan Heinz
*/
/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
#ifndef __SCIP_READER_RLP_H__
#define __SCIP_READER_RLP_H__
#include "scip/def.h"
#include "scip/type_retcode.h"
#include "scip/type_scip.h"
#ifdef __cplusplus
extern "C" {
#endif
/** includes the rlp file reader into SCIP
*
* @ingroup FileReaderIncludes
*/
SCIP_EXPORT
SCIP_RETCODE SCIPincludeReaderRlp(
SCIP* scip /**< SCIP data structure */
);
#ifdef __cplusplus
}
#endif
#endif
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* This file is part of the program and library */
/* SCIP --- Solving Constraint Integer Programs */
/* */
/* Copyright (C) 2002-2020 Konrad-Zuse-Zentrum */
/* fuer Informationstechnik Berlin */
/* */
/* SCIP is distributed under the terms of the ZIB Academic License. */
/* */
/* You should have received a copy of the ZIB Academic License */
/* along with SCIP; see the file COPYING. If not visit scipopt.org. */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/**@file reader_smps.h
* @ingroup FILEREADERS
* @brief SMPS file reader - SMPS files lists the cor, tim and sto files for a single instance to be read
* @author Stephen J. Maher
*
* This is a reader for the reading the core, time and stochastic files of a stochastic programming instance
* in SMPS format.
* The three files that must be listed in the smps file are:
* - .cor
* - .tim
* - .sto
* The order of the files is not important. It is just necessary that all three are provided.
*
* Details regarding the SMPS file format can be found at:
* Birge, J. R.; Dempster, M. A.; Gassmann, H. I.; Gunn, E.; King, A. J. & Wallace, S. W.
* A standard input format for multiperiod stochastic linear programs
* IIASA, Laxenburg, Austria, WP-87-118, 1987
*
* An example of an smps file looks as follows.
*
* @verbinclude pltexpA2_6.smps
*/
/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
#ifndef __SCIP_READER_SMPS_H__
#define __SCIP_READER_SMPS_H__
#include "scip/def.h"
#include "scip/type_retcode.h"
#include "scip/type_scip.h"
#ifdef __cplusplus
extern "C" {
#endif
/** includes the smps file reader into SCIP
*
* @ingroup FileReaderIncludes
*/
SCIP_EXPORT
SCIP_RETCODE SCIPincludeReaderSmps(
SCIP* scip /**< SCIP data structure */
);
#ifdef __cplusplus
}
#endif
#endif
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* This file is part of the program and library */
/* SCIP --- Solving Constraint Integer Programs */
/* */
/* Copyright (C) 2002-2020 Konrad-Zuse-Zentrum */
/* fuer Informationstechnik Berlin */
/* */
/* SCIP is distributed under the terms of the ZIB Academic License. */
/* */
/* You should have received a copy of the ZIB Academic License */
/* along with SCIP; see the file COPYING. If not visit scipopt.org. */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/**@file reader_sol.h
* @ingroup FILEREADERS
* @brief file reader for primal solutions
* @author Tobias Achterberg
* @author Marc Pfetsch
*
* This reader handles solutions in two formats:
*
* - <b>SCIP raw format</b>@n
* The format is as follows:@n@n
* line 1: "solution status: <status>"@n
* line 2: "objective value: <value>"@n
* line 3+i: \<variable name\> \<value\> (obj: \<objective coefficient of variable\>)
* @n@n
* Only nonzero values need to be listed.
* @par
* Example:
* @code
* solution status: optimal
* objective value: 1
* x1 1 (obj:1)
* x2 1 (obj:0)
* @endcode
* - <b>XML format</b>@n
* This format is used by CPLEX, for example. For reading we require a section of @p
* \<variables\>. Each entry in this section consists of@n
* \<variable name="<name>" index="<number>" value="<value>"/>
* @par
* Example:
* @code
* <?xml version = "1.0" standalone="yes"?>
* <variables>
* <variable name="x1" index="1" value="1"/>
* <variable name="x2" index="2" value="1"/>
* </variables>
* </xml>
* @endcode
*/
/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
#ifndef __SCIP_READER_SOL_H__
#define __SCIP_READER_SOL_H__
#include "scip/def.h"
#include "scip/type_retcode.h"
#include "scip/type_scip.h"
#ifdef __cplusplus
extern "C" {
#endif
/** includes the sol file reader into SCIP
*
* @ingroup FileReaderIncludes
*/
SCIP_EXPORT
SCIP_RETCODE SCIPincludeReaderSol(
SCIP* scip /**< SCIP data structure */
);
#ifdef __cplusplus
}
#endif
#endif
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* This file is part of the program and library */
/* SCIP --- Solving Constraint Integer Programs */
/* */
/* Copyright (C) 2002-2020 Konrad-Zuse-Zentrum */
/* fuer Informationstechnik Berlin */
/* */
/* SCIP is distributed under the terms of the ZIB Academic License. */
/* */
/* You should have received a copy of the ZIB Academic License */
/* along with SCIP; see the file COPYING. If not visit scipopt.org. */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/**@file reader_sto.h
* @ingroup FILEREADERS
* @brief STO file reader - the stochastic information of an instance in SMPS format
* @author Stephen J. Maher
*
* This is a reader for the stochastic information of a stochastic programming instance in SMPS format.
* The three files that must be read are:
* - .cor
* - .tim
* - .sto
*
* Alternatively, it is possible to create a .smps file with the relative path to the .cor, .tim and .sto files.
* A file reader is available for the .smps file.
*
* Details regarding the SMPS file format can be found at:
* Birge, J. R.; Dempster, M. A.; Gassmann, H. I.; Gunn, E.; King, A. J. & Wallace, S. W.
* A standard input format for multiperiod stochastic linear programs
* IIASA, Laxenburg, Austria, WP-87-118, 1987
*
*/
/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
#ifndef __SCIP_READER_STO_H__
#define __SCIP_READER_STO_H__
#include "scip/def.h"
#include "scip/type_cons.h"
#include "scip/type_prob.h"
#include "scip/type_result.h"
#include "scip/type_retcode.h"
#include "scip/type_scip.h"
#include "scip/type_var.h"
#ifdef __cplusplus
extern "C" {
#endif
/** includes the sto file reader into SCIP
*
* @ingroup FileReaderIncludes
*/
SCIP_EXPORT
SCIP_RETCODE SCIPincludeReaderSto(
SCIP* scip /**< SCIP data structure */
);
/**@addtogroup FILEREADERS
*
* @{
*/
/** reads the stochastic information for a stochastic program that is in SMPS format */
SCIP_EXPORT
SCIP_RETCODE SCIPreadSto(
SCIP* scip, /**< SCIP data structure */
const char* filename, /**< full path and name of file to read, or NULL if stdin should be used */
SCIP_RESULT* result /**< pointer to store the result of the file reading call */
);
/** writes problem to file */
SCIP_EXPORT
SCIP_RETCODE SCIPwriteSto(
SCIP* scip, /**< SCIP data structure */
FILE* file, /**< output file, or NULL if standard output should be used */
const char* name, /**< problem name */
SCIP_Bool transformed, /**< TRUE iff problem is the transformed problem */
SCIP_OBJSENSE objsense, /**< objective sense */
SCIP_Real objscale, /**< scalar applied to objective function; external objective value is
* extobj = objsense * objscale * (intobj + objoffset) */
SCIP_Real objoffset, /**< objective offset from bound shifting and fixing */
SCIP_VAR** vars, /**< array with active variables ordered binary, integer, implicit, continuous */
int nvars, /**< number of active variables in the problem */
int nbinvars, /**< number of binary variables */
int nintvars, /**< number of general integer variables */
int nimplvars, /**< number of implicit integer variables */
int ncontvars, /**< number of continuous variables */
SCIP_CONS** conss, /**< array with constraints of the problem */
int nconss, /**< number of constraints in the problem */
SCIP_RESULT* result /**< pointer to store the result of the file writing call */
);
/** returns the total number of scenarios added to the problem */
SCIP_EXPORT
int SCIPstoGetNScenarios(
SCIP* scip /**< SCIP data structure */
);
/** @} */
#ifdef __cplusplus
}
#endif
#endif
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* This file is part of the program and library */
/* SCIP --- Solving Constraint Integer Programs */
/* */
/* Copyright (C) 2002-2020 Konrad-Zuse-Zentrum */
/* fuer Informationstechnik Berlin */
/* */
/* SCIP is distributed under the terms of the ZIB Academic License. */
/* */
/* You should have received a copy of the ZIB Academic License */
/* along with SCIP; see the file COPYING. If not visit scipopt.org. */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/**@file reader_tim.h
* @ingroup FILEREADERS
* @brief TIM file reader - the stage information for a stochastic programming instance in SMPS format
* @author Stephen J. Maher
*
* This is a reader for the time file of a stochastic programming instance in SMPS format.
* The three files that must be read are:
* - .cor
* - .tim
* - .sto
*
* Alternatively, it is possible to create a .smps file with the relative path to the .cor, .tim and .sto files.
* A file reader is available for the .smps file.
*
* Details regarding the SMPS file format can be found at:
* Birge, J. R.; Dempster, M. A.; Gassmann, H. I.; Gunn, E.; King, A. J. & Wallace, S. W.
* A standard input format for multiperiod stochastic linear programs
* IIASA, Laxenburg, Austria, WP-87-118, 1987
*
*/
/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
#ifndef __SCIP_READER_TIM_H__
#define __SCIP_READER_TIM_H__
#include "scip/def.h"
#include "scip/type_cons.h"
#include "scip/type_reader.h"
#include "scip/type_result.h"
#include "scip/type_retcode.h"
#include "scip/type_scip.h"
#include "scip/type_var.h"
#ifdef __cplusplus
extern "C" {
#endif
/** includes the tim file reader into SCIP
*
* @ingroup FileReaderIncludes
*/
SCIP_EXPORT
SCIP_RETCODE SCIPincludeReaderTim(
SCIP* scip /**< SCIP data structure */
);
/**@addtogroup FILEREADERS
*
* @{
*/
/** reads the stage information for a stochastic programming instance in SMPS format */
SCIP_EXPORT
SCIP_RETCODE SCIPreadTim(
SCIP* scip, /**< SCIP data structure */
const char* filename, /**< full path and name of file to read, or NULL if stdin should be used */
SCIP_RESULT* result /**< pointer to store the result of the file reading call */
);
/** @} */
/*
* Interface methods for the cor and sto files
*/
/* return whether the tim file has been read */
SCIP_EXPORT
SCIP_Bool SCIPtimHasRead(
SCIP_READER* reader /**< the file reader itself */
);
/* returns the number of stages */
SCIP_EXPORT
int SCIPtimGetNStages(
SCIP* scip /**< SCIP data structure */
);
/* returns the name for a given stage */
SCIP_EXPORT
const char* SCIPtimGetStageName(
SCIP* scip, /**< SCIP data structure */
int stagenum /**< the number of the requested stage */
);
/* returns the stage name for a given constraint name */
const char* SCIPtimConsGetStageName(
SCIP* scip, /**< SCIP data structure */
const char* consname /**< the constraint to search for */
);
/* returns the number for a given stage */
SCIP_EXPORT
int SCIPtimFindStage(
SCIP* scip, /**< SCIP data structure */
const char* stage /**< the name of the requested stage */
);
/* returns the array of variables for a given stage */
SCIP_EXPORT
SCIP_VAR** SCIPtimGetStageVars(
SCIP* scip, /**< SCIP data structure */
int stagenum /**< the number of the requested stage */
);
/* returns an array of constraints for a given stage */
SCIP_EXPORT
SCIP_CONS** SCIPtimGetStageConss(
SCIP* scip, /**< SCIP data structure */
int stagenum /**< the number of the requested stage */
);
/* returns the number of variables for a given stage */
SCIP_EXPORT
int SCIPtimGetStageNVars(
SCIP* scip, /**< SCIP data structure */
int stagenum /**< the number of the requested stage */
);
/* returns the number of constraints for a given stage */
SCIP_EXPORT
int SCIPtimGetStageNConss(
SCIP* scip, /**< SCIP data structure */
int stagenum /**< the number of the requested stage */
);
#ifdef __cplusplus
}
#endif
#endif
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* This file is part of the program and library */
/* SCIP --- Solving Constraint Integer Programs */
/* */
/* Copyright (C) 2002-2020 Konrad-Zuse-Zentrum */
/* fuer Informationstechnik Berlin */
/* */
/* SCIP is distributed under the terms of the ZIB Academic License. */
/* */
/* You should have received a copy of the ZIB Academic License */
/* along with SCIP; see the file COPYING. If not visit scipopt.org. */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/**@file reader_wbo.h
* @ingroup FILEREADERS
* @brief WBO file reader (LP format with generic variables and row names)
* @author Michael Winkler
*
* This file reader parses the @a wbo format by using the @a opb reader. For a detailed description of this format
* see http://www.cril.univ-artois.fr/PB10/format.pdf .
*/
/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
#ifndef __SCIP_READER_WBO_H__
#define __SCIP_READER_WBO_H__
#include "scip/def.h"
#include "scip/type_retcode.h"
#include "scip/type_scip.h"
#ifdef __cplusplus
extern "C" {
#endif
/** includes the wbo file reader into SCIP
*
* @ingroup FileReaderIncludes
*/
SCIP_EXPORT
SCIP_RETCODE SCIPincludeReaderWbo(
SCIP* scip /**< SCIP data structure */
);
#ifdef __cplusplus
}
#endif
#endif
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* This file is part of the program and library */
/* SCIP --- Solving Constraint Integer Programs */
/* */
/* Copyright (C) 2002-2020 Konrad-Zuse-Zentrum */
/* fuer Informationstechnik Berlin */
/* */
/* SCIP is distributed under the terms of the ZIB Academic License. */
/* */
/* You should have received a copy of the ZIB Academic License */
/* along with SCIP; see the file COPYING. If not visit scipopt.org. */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/**@file reader_xyz.h
* @ingroup FILEREADERS
* @brief XYZ file reader
* @author Tobias Achterberg
*/
/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
#ifndef __SCIP_READER_XYZ_H__
#define __SCIP_READER_XYZ_H__
#include "scip/scip.h"
#ifdef __cplusplus
extern "C" {
#endif
/** includes the xyz file reader into SCIP
*
* @ingroup FileReaderIncludes
*/
SCIP_EXPORT
SCIP_RETCODE SCIPincludeReaderXyz(
SCIP* scip /**< SCIP data structure */
);
#ifdef __cplusplus
}
#endif
#endif
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* This file is part of the program and library */
/* SCIP --- Solving Constraint Integer Programs */
/* */
/* Copyright (C) 2002-2020 Konrad-Zuse-Zentrum */
/* fuer Informationstechnik Berlin */
/* */
/* SCIP is distributed under the terms of the ZIB Academic License. */
/* */
/* You should have received a copy of the ZIB Academic License */
/* along with SCIP; see the file COPYING. If not visit scipopt.org. */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/**@file reader_zpl.h
* @ingroup FILEREADERS
* @brief ZIMPL model file reader
* @author Tobias Achterberg
*
* This reader allows to read input in <a href="http://zimpl.zib.de">ZIMPL</a> format. See the web
* page for a definition and documentation.
*/
/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
#ifndef __SCIP_READER_ZPL_H__
#define __SCIP_READER_ZPL_H__
#include "scip/def.h"
#include "scip/type_retcode.h"
#include "scip/type_scip.h"
#ifdef __cplusplus
extern "C" {
#endif
/** includes the zpl file reader into SCIP
*
* @ingroup FileReaderIncludes
*/
SCIP_EXPORT
SCIP_RETCODE SCIPincludeReaderZpl(
SCIP* scip /**< SCIP data structure */
);
#ifdef __cplusplus
}
#endif
#endif
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* This file is part of the program and library */
/* SCIP --- Solving Constraint Integer Programs */
/* */
/* Copyright (C) 2002-2020 Konrad-Zuse-Zentrum */
/* fuer Informationstechnik Berlin */
/* */
/* SCIP is distributed under the terms of the ZIB Academic License. */
/* */
/* You should have received a copy of the ZIB Academic License */
/* along with SCIP; see the file COPYING. If not visit scipopt.org. */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/**@file relax.h
* @ingroup INTERNALAPI
* @brief internal methods for relaxators
* @author Tobias Achterberg
*/
/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
#ifndef __SCIP_RELAX_H__
#define __SCIP_RELAX_H__
#include "scip/def.h"
#include "blockmemshell/memory.h"
#include "scip/type_primal.h"
#include "scip/type_relax.h"
#include "scip/type_result.h"
#include "scip/type_retcode.h"
#include "scip/type_set.h"
#include "scip/type_sol.h"
#include "scip/type_stat.h"
#include "scip/type_tree.h"
#include "scip/type_var.h"
#include "scip/pub_relax.h"
#ifdef __cplusplus
extern "C" {
#endif
/** copies the given relaxator to a new scip */
SCIP_RETCODE SCIPrelaxCopyInclude(
SCIP_RELAX* relax, /**< relaxator */
SCIP_SET* set /**< SCIP_SET of SCIP to copy to */
);
/** creates a relaxator */
SCIP_RETCODE SCIPrelaxCreate(
SCIP_RELAX** relax, /**< pointer to relaxator data structure */
SCIP_SET* set, /**< global SCIP settings */
SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
BMS_BLKMEM* blkmem, /**< block memory for parameter settings */
const char* name, /**< name of relaxator */
const char* desc, /**< description of relaxator */
int priority, /**< priority of the relaxator (negative: after LP, non-negative: before LP) */
int freq, /**< frequency for calling relaxator */
SCIP_DECL_RELAXCOPY ((*relaxcopy)), /**< copy method of relaxator or NULL if you don't want to copy your plugin into sub-SCIPs */
SCIP_DECL_RELAXFREE ((*relaxfree)), /**< destructor of relaxator */
SCIP_DECL_RELAXINIT ((*relaxinit)), /**< initialize relaxator */
SCIP_DECL_RELAXEXIT ((*relaxexit)), /**< deinitialize relaxator */
SCIP_DECL_RELAXINITSOL((*relaxinitsol)), /**< solving process initialization method of relaxator */
SCIP_DECL_RELAXEXITSOL((*relaxexitsol)), /**< solving process deinitialization method of relaxator */
SCIP_DECL_RELAXEXEC ((*relaxexec)), /**< execution method of relaxator */
SCIP_RELAXDATA* relaxdata /**< relaxator data */
);
/** calls destructor and frees memory of relaxator */
SCIP_RETCODE SCIPrelaxFree(
SCIP_RELAX** relax, /**< pointer to relaxator data structure */
SCIP_SET* set /**< global SCIP settings */
);
/** initializes relaxator */
SCIP_RETCODE SCIPrelaxInit(
SCIP_RELAX* relax, /**< relaxator */
SCIP_SET* set /**< global SCIP settings */
);
/** calls exit method of relaxator */
SCIP_RETCODE SCIPrelaxExit(
SCIP_RELAX* relax, /**< relaxator */
SCIP_SET* set /**< global SCIP settings */
);
/** informs relaxator that the branch and bound process is being started */
SCIP_RETCODE SCIPrelaxInitsol(
SCIP_RELAX* relax, /**< relaxator */
SCIP_SET* set /**< global SCIP settings */
);
/** informs relaxator that the branch and bound process data is being freed */
SCIP_RETCODE SCIPrelaxExitsol(
SCIP_RELAX* relax, /**< relaxator */
SCIP_SET* set /**< global SCIP settings */
);
/** calls execution method of relaxator */
SCIP_RETCODE SCIPrelaxExec(
SCIP_RELAX* relax, /**< relaxator */
SCIP_SET* set, /**< global SCIP settings */
SCIP_TREE* tree, /**< branch and bound tree */
SCIP_STAT* stat, /**< dynamic problem statistics */
int depth, /**< depth of current node */
SCIP_Real* lowerbound, /**< pointer to lower bound computed by the relaxator */
SCIP_RESULT* result /**< pointer to store the result of the callback method */
);
/** sets priority of relaxator */
void SCIPrelaxSetPriority(
SCIP_RELAX* relax, /**< relaxator */
SCIP_SET* set, /**< global SCIP settings */
int priority /**< new priority of the relaxator */
);
/** set copy callback of relaxation handler */
void SCIPrelaxSetCopy(
SCIP_RELAX* relax, /**< relaxation handler */
SCIP_DECL_RELAXCOPY ((*relaxcopy)) /**< copy method of relaxation handler */
);
/** set destructor callback of relaxation handler */
void SCIPrelaxSetFree(
SCIP_RELAX* relax, /**< relaxation handler */
SCIP_DECL_RELAXFREE ((*relaxfree)) /**< destructor of relaxation handler */
);
/** set initialization callback of relaxation handler */
void SCIPrelaxSetInit(
SCIP_RELAX* relax, /**< relaxation handler */
SCIP_DECL_RELAXINIT ((*relaxinit)) /**< initialize relaxation handler */
);
/** set deinitialization callback of relaxation handler */
void SCIPrelaxSetExit(
SCIP_RELAX* relax, /**< relaxation handler */
SCIP_DECL_RELAXEXIT ((*relaxexit)) /**< deinitialize relaxation handler */
);
/** set solving process initialization callback of relaxation handler */
void SCIPrelaxSetInitsol(
SCIP_RELAX* relax, /**< relaxation handler */
SCIP_DECL_RELAXINITSOL((*relaxinitsol)) /**< solving process initialization method of relaxation handler */
);
/** set solving process deinitialization callback of relaxation handler */
void SCIPrelaxSetExitsol(
SCIP_RELAX* relax, /**< relaxation handler */
SCIP_DECL_RELAXEXITSOL((*relaxexitsol)) /**< solving process deinitialization callback relaxation handler */
);
/** returns whether the relaxation was completely solved at the current node */
SCIP_Bool SCIPrelaxIsSolved(
SCIP_RELAX* relax, /**< relaxator */
SCIP_STAT* stat /**< dynamic problem statistics */
);
/*
* methods for the global relaxation data
*/
/** enables or disables all clocks of \p relax, depending on the value of the flag */
void SCIPrelaxEnableOrDisableClocks(
SCIP_RELAX* relax, /**< the relaxation handler for which all clocks should be enabled or disabled */
SCIP_Bool enable /**< should the clocks of the relaxation handler be enabled? */
);
/** creates global relaxation data */
SCIP_RETCODE SCIPrelaxationCreate(
SCIP_RELAXATION** relaxation, /**< global relaxation data */
BMS_BLKMEM* blkmem, /**< block memory */
SCIP_SET* set, /**< global SCIP settings */
SCIP_STAT* stat, /**< problem statistics data */
SCIP_PRIMAL* primal, /**< primal data */
SCIP_TREE* tree /**< branch and bound tree */
);
/** frees global relaxation data */
SCIP_RETCODE SCIPrelaxationFree(
SCIP_RELAXATION** relaxation /**< global relaxation data */
);
/** sets the relaxsolzero flag in the relaxation data to the given value */
void SCIPrelaxationSetSolZero(
SCIP_RELAXATION* relaxation, /**< global relaxation data */
SCIP_Bool iszero /**< are all values of the relaxation solution set to zero? */
);
/** returns whether the global relaxation solution is cleared and all values are set to zero */
SCIP_Bool SCIPrelaxationIsSolZero(
SCIP_RELAXATION* relaxation /**< global relaxation data */
);
/** sets the relaxsolvalid and includeslp flags in the relaxation data to the given values */
void SCIPrelaxationSetSolValid(
SCIP_RELAXATION* relaxation, /**< global relaxation data */
SCIP_Bool isvalid, /**< is the stored solution valid? */
SCIP_Bool includeslp /**< does the relaxator contain all cuts in the LP? */
);
/** returns whether the global relaxation solution is valid */
SCIP_Bool SCIPrelaxationIsSolValid(
SCIP_RELAXATION* relaxation /**< global relaxation data */
);
/** returns whether the global relaxation solution was computed by a relaxator which included all LP cuts */
SCIP_Bool SCIPrelaxationIsLpIncludedForSol(
SCIP_RELAXATION* relaxation /**< global relaxation data */
);
/** sets the objective value of the global relaxation solution */
void SCIPrelaxationSetSolObj(
SCIP_RELAXATION* relaxation, /**< global relaxation data */
SCIP_Real obj /**< objective value */
);
/** returns the objective value of the global relaxation solution w.r.t. the transformed problem */
SCIP_Real SCIPrelaxationGetSolObj(
SCIP_RELAXATION* relaxation /**< global relaxation data */
);
/** adds the given value to the global relaxation solution's objective value */
void SCIPrelaxationSolObjAdd(
SCIP_RELAXATION* relaxation, /**< global relaxation data */
SCIP_Real val /**< value to add to the objective value */
);
/** updates objective value of current relaxation solution after change of objective coefficient */
void SCIPrelaxationUpdateVarObj(
SCIP_RELAXATION* relaxation, /**< global relaxation data */
SCIP_SET* set, /**< global SCIP settings */
SCIP_VAR* var, /**< variable with changed objective coefficient */
SCIP_Real oldobj, /**< old objective coefficient */
SCIP_Real newobj /**< new objective coefficient */
);
/** store the most recent relaxation handler \p relax responsible for the solution */
void SCIPrelaxationSetSolRelax(
SCIP_RELAXATION* relaxation, /**< global relaxation data */
SCIP_RELAX* relax /**< relaxation handler responsible for the most recent relaxation solution */
);
/** returns the most recent relaxation handler responsible for the solution, or NULL if unspecified */
SCIP_RELAX* SCIPrelaxationGetSolRelax(
SCIP_RELAXATION* relaxation /**< global relaxation data */
);
#ifdef __cplusplus
}
#endif
#endif
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* This file is part of the program and library */
/* SCIP --- Solving Constraint Integer Programs */
/* */
/* Copyright (C) 2002-2020 Konrad-Zuse-Zentrum */
/* fuer Informationstechnik Berlin */
/* */
/* SCIP is distributed under the terms of the ZIB Academic License. */
/* */
/* You should have received a copy of the ZIB Academic License */
/* along with SCIP; see the file COPYING. If not visit scipopt.org. */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/**@file relax_xyz.h
* @ingroup RELAXATORS
* @brief xyz relaxator
* @author Tobias Achterberg
*/
/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
#ifndef __SCIP_RELAX_XYZ_H__
#define __SCIP_RELAX_XYZ_H__
#include "scip/scip.h"
#ifdef __cplusplus
extern "C" {
#endif
/** creates the xyz relaxator and includes it in SCIP */
SCIP_EXPORT
SCIP_RETCODE SCIPincludeRelaxXyz(
SCIP* scip /**< SCIP data structure */
);
#ifdef __cplusplus
}
#endif
#endif
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* This file is part of the program and library */
/* SCIP --- Solving Constraint Integer Programs */
/* */
/* Copyright (C) 2002-2020 Konrad-Zuse-Zentrum */
/* fuer Informationstechnik Berlin */
/* */
/* SCIP is distributed under the terms of the ZIB Academic License. */
/* */
/* You should have received a copy of the ZIB Academic License */
/* along with SCIP; see the file COPYING. If not visit scipopt.org. */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/**@file reopt.h
* @ingroup INTERNALAPI
* @brief data structures and methods for collecting reoptimization information
* @author Jakob Witzig
*/
/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
#ifndef __SCIP_REOPT_H__
#define __SCIP_REOPT_H__
#include "blockmemshell/memory.h"
#include "scip/def.h"
#include "scip/pub_reopt.h"
#include "scip/type_branch.h"
#include "scip/type_cutpool.h"
#include "scip/type_misc.h"
#include "scip/type_primal.h"
#include "scip/type_prob.h"
#include "scip/type_retcode.h"
#include "scip/type_reopt.h"
#include "scip/type_sepastore.h"
#include "scip/type_set.h"
#include "scip/type_stat.h"
#include "scip/struct_reopt.h"
#include "scip/struct_var.h"
#include "scip/struct_history.h"
#ifdef __cplusplus
extern "C" {
#endif
/** creates reopt data */
SCIP_RETCODE SCIPreoptCreate(
SCIP_REOPT** reopt, /**< pointer to reoptimization data structure */
SCIP_SET* set, /**< global SCIP settings */
BMS_BLKMEM* blkmem /**< block memory */
);
/** frees reopt data */
SCIP_RETCODE SCIPreoptFree(
SCIP_REOPT** reopt, /**< reoptimization data structure */
SCIP_SET* set, /**< global SCIP settings */
SCIP_PRIMAL* origprimal, /**< original primal */
BMS_BLKMEM* blkmem /**< block memory */
);
/* release all variables and constraints captured during reoptimization */
SCIP_RETCODE SCIPreoptReleaseData(
SCIP_REOPT* reopt, /**< pointer to reoptimization data structure */
SCIP_SET* set, /**< global SCIP settings */
BMS_BLKMEM* blkmem /**< block memory */
);
/** returns the number of constraints added by the reoptimization plug-in */
int SCIPreoptGetNAddedConss(
SCIP_REOPT* reopt, /**< reoptimization data */
SCIP_NODE* node /**< node of the search tree */
);
/** add a solution to the solution tree */
SCIP_RETCODE SCIPreoptAddSol(
SCIP_REOPT* reopt, /**< reoptimization data */
SCIP_SET* set, /**< global SCIP settings */
SCIP_STAT* stat, /**< dynamic problem statistics */
SCIP_PRIMAL* origprimal, /**< original primal */
BMS_BLKMEM* blkmem, /**< block memory */
SCIP_SOL* sol, /**< solution to add */
SCIP_Bool bestsol, /**< is the current solution an optimal solution? */
SCIP_Bool* added, /**< pointer to store the information if the soltion was added */
SCIP_VAR** vars, /**< variable array */
int nvars, /**< number of variables */
int run /**< number of the current run (1,2,...) */
);
/** add optimal solution */
SCIP_RETCODE SCIPreoptAddOptSol(
SCIP_REOPT* reopt, /**< reoptimization data structure */
SCIP_SOL* sol, /**< solution to add */
BMS_BLKMEM* blkmem, /**< block memory */
SCIP_SET* set, /**< global SCIP settings */
SCIP_STAT* stat, /**< dynamic problem statistics */
SCIP_PRIMAL* origprimal, /**< original primal */
SCIP_VAR** vars, /**< original problem variables */
int nvars /**< number of original problem variables */
);
/** add a run */
SCIP_RETCODE SCIPreoptAddRun(
SCIP_REOPT* reopt, /**< reoptimization data sturcture */
SCIP_SET* set, /**< global SCIP settings */
BMS_BLKMEM* blkmem, /**< block memory */
SCIP_VAR** origvars, /**< original problem variables */
int norigvars, /**< number of original variables */
int size /**< number of expected solutions */
);
/** get the number of checked solutions during the reoptimization process */
int SCIPreoptGetNCheckedSols(
SCIP_REOPT* reopt /**< reoptimization data */
);
/** update the number of checked solutions during the reoptimization process */
void SCIPreoptAddNCheckedSols(
SCIP_REOPT* reopt, /**< reoptimization data */
int ncheckedsols /**< number of updated solutions */
);
/** get the number of checked solutions during the reoptimization process */
int SCIPreoptGetNImprovingSols(
SCIP_REOPT* reopt /**< reoptimization data */
);
/** update the number of checked solutions during the reoptimization process */
void SCIPreoptAddNImprovingSols(
SCIP_REOPT* reopt, /**< reoptimization data */
int nimprovingsols /**< number of improving solutions */
);
/** returns number of solutions stored in the solution tree of a given run */
int SCIPreoptGetNSolsRun(
SCIP_REOPT* reopt, /**< reoptimization data */
int run /**< number of the run (1,2,..) */
);
/** returns number of all solutions of all runs */
int SCIPreoptGetNSols(
SCIP_REOPT* reopt /**< reoptimization data */
);
/** return the stored solutions of a given run */
SCIP_RETCODE SCIPreoptGetSolsRun(
SCIP_REOPT* reopt, /**< reopt data */
int run, /**< number of the run (1,2,...) */
SCIP_SOL** sols, /**< array of solutions to fill */
int solssize, /**< length of the array */
int* nsols /**< pointer to store the number of added solutions */
);
/** returns the number of saved solutions overall runs */
int SCIPreoptGetNSavedSols(
SCIP_REOPT* reopt /**< reoptimization data */
);
/** Check if the reoptimization process should be (locally) restarted.
*
* First, we check whether the current node is the root node, e.g., node == NULL. In this case, we do not need to calculate
* the similarity again. We trigger a restart if
* 1. the objective function has changed too much, or
* 2. the number of stored nodes is exceeded, or
* 3. the last n optimal solutions were found by heur_reoptsols (in this case, the stored tree was only needed to
* prove the optimality and this can probably be done faster by solving from scratch).
*
* If the current node is different to the root node we calculate the local similarity, i.e., exclude all variables
* that are already fixed at the given node.
*/
SCIP_RETCODE SCIPreoptCheckRestart(
SCIP_REOPT* reopt, /**< reopt data */
SCIP_SET* set, /**< global SCIP settings */
BMS_BLKMEM* blkmem, /**< block memory */
SCIP_NODE* node, /**< current node of the branch and bound tree (or NULL) */
SCIP_VAR** transvars, /**< transformed problem variables */
int ntransvars, /**< number of transformed problem variables */
SCIP_Bool* restart /**< pointer to store if the reoptimization process should be restarted */
);
/** returns the similarity to the previous objective function */
SCIP_Real SCIPreoptGetSimToPrevious(
SCIP_REOPT* reopt /**< reoptimization data */
);
/** returns the similarity to the first objective functions */
SCIP_Real SCIPreoptGetSimToFirst(
SCIP_REOPT* reopt /**< reoptimization data */
);
/** return the similarity between two of objective functions of two given runs */
SCIP_Real SCIPreoptGetSimilarity(
SCIP_REOPT* reopt, /**< reoptimization data structure */
SCIP_SET* set, /**< global SCIP settings */
int run1, /**< number of the first run */
int run2, /**< number of the second run */
SCIP_VAR** origvars, /**< original problem variables */
int norigvars /**< number of original problem variables */
);
/** returns the best solution of the last run */
SCIP_SOL* SCIPreoptGetLastBestSol(
SCIP_REOPT* reopt /**< reoptimization data */
);
/** returns the node of the reoptimization tree corresponding to the unique @p id */
SCIP_REOPTNODE* SCIPreoptGetReoptnode(
SCIP_REOPT* reopt, /**< reoptimization data structure */
unsigned int id /**< unique id */
);
/** returns the coefficent of variable with index @p idx in run @p run */
SCIP_Real SCIPreoptGetOldObjCoef(
SCIP_REOPT* reopt, /**< reopt data */
int run, /**< number of the run */
int idx /**< problem index of variable */
);
/** return the best solution of a given run
*
* @note the returned solution is part of the original space.
*/
SCIP_SOL* SCIPreoptGetBestSolRun(
SCIP_REOPT* reopt, /**< reoptimization data structure */
int run /**< number of the run (1,2,...) */
);
/** reset solving specific paramters */
SCIP_RETCODE SCIPreoptReset(
SCIP_REOPT* reopt, /**< reoptimization data structure */
SCIP_SET* set, /**< global SCIP settings */
BMS_BLKMEM* blkmem /**< block memory */
);
/** reset marks of stored solutions to not updated */
void SCIPreoptResetSolMarks(
SCIP_REOPT* reopt /**< reoptimization data */
);
/** returns the number of stored nodes */
int SCIPreoptGetNNodes(
SCIP_REOPT* reopt, /**< reoptimization data */
SCIP_NODE* node /**< node of the search tree */
);
/** save information that given node is infeasible */
SCIP_RETCODE SCIPreoptAddInfNode(
SCIP_REOPT* reopt, /**< reoptimization data */
SCIP_SET* set, /**< global SCIP settings */
BMS_BLKMEM* blkmem, /**< block memory */
SCIP_NODE* node /**< node of the search tree */
);
/** check the reason for cut off a node and if necessary store the node */
SCIP_RETCODE SCIPreoptCheckCutoff(
SCIP_REOPT* reopt, /**< reoptimization data structure */
SCIP_SET* set, /**< global SCIP settings */
BMS_BLKMEM* blkmem, /**< block memery */
SCIP_NODE* node, /**< node of the search tree */
SCIP_EVENTTYPE eventtype, /**< eventtype */
SCIP_LP* lp, /**< LP data */
SCIP_LPSOLSTAT lpsolstat, /**< solution status of the LP */
SCIP_Bool isrootnode, /**< the node is the root */
SCIP_Bool isfocusnode, /**< the node is the current focus node */
SCIP_Real lowerbound, /**< lower bound of the node */
int effectiverootdepth /**< effective root depth */
);
/** store bound change based on dual information */
SCIP_RETCODE SCIPreoptAddDualBndchg(
SCIP_REOPT* reopt, /**< reoptimization data structure */
SCIP_SET* set, /**< global SCIP settings */
BMS_BLKMEM* blkmem, /**< block memory */
SCIP_NODE* node, /**< node of the search tree */
SCIP_VAR* var, /**< variables */
SCIP_Real newval, /**< new bound */
SCIP_Real oldval /**< old bound */
);
/** returns the number of bound changes based on dual information */
int SCIPreoptGetNDualBndchgs(
SCIP_REOPT* reopt, /**< reoptimization data */
SCIP_NODE* node /**< node of the search tree */
);
/** returns the number of leaf nodes of the subtree induced by @p node (of the whole tree if node == NULL) */
int SCIPreoptGetNLeaves(
SCIP_REOPT* reopt, /**< reoptimization data */
SCIP_NODE* node /**< node of the search tree */
);
/** returns the child nodes of @p node that need to be reoptimized next or NULL if @p node is a leaf */
SCIP_RETCODE SCIPreoptGetChildIDs(
SCIP_REOPT* reopt, /**< reoptimization data structure */
SCIP_SET* set, /**< global SCIP settings */
BMS_BLKMEM* blkmem, /**< block memory */
SCIP_NODE* node, /**< node of the search tree */
unsigned int* childs, /**< array to store the child ids */
int childssize, /**< size of the childs array */
int* nchilds /**< pointer to store the number of child nodes */
);
/** returns all leaves of the subtree induced by @p node */
SCIP_RETCODE SCIPreoptGetLeaves(
SCIP_REOPT* reopt, /**< reoptimization data */
SCIP_NODE* node, /**< node of the search tree */
unsigned int* leaves, /**< array to the the ids */
int leavessize, /**< size of leaves array */
int* nleaves /**< pointer to store the number of leaf node */
);
/** returns the time needed to store the nodes for reoptimization */
SCIP_Real SCIPreoptGetSavingtime(
SCIP_REOPT* reopt /**< reoptimization data */
);
/** store a global constraint that should be added at the beginning of the next iteration */
SCIP_RETCODE SCIPreoptAddGlbCons(
SCIP_REOPT* reopt, /**< reoptimization data */
SCIP_VAR** vars, /**< array to store the variables of the constraint */
SCIP_Real* vals, /**< array to store the coefficients of the variables */
int nvars, /**< pointer to store the size of the constraints */
BMS_BLKMEM* blkmem /**< block memory */
);
/** add the stored constraints globally to the problem */
SCIP_RETCODE SCIPreoptApplyGlbConss(
SCIP* scip, /**< SCIP data structure */
SCIP_REOPT* reopt, /**< reoptimization data structure */
SCIP_SET* set, /**< global SCIP settings */
SCIP_STAT* stat, /**< dynamic problem statistics */
BMS_BLKMEM* blkmem /**< block memory */
);
/** add the stored cuts to the separation storage */
SCIP_RETCODE SCIPreoptApplyCuts(
SCIP_REOPT* reopt, /**< reoptimization data structure */
SCIP_NODE* node, /**< current focus node */
SCIP_SEPASTORE* sepastore, /**< separation storage */
SCIP_CUTPOOL* cutpool, /**< global cutpool */
BMS_BLKMEM* blkmem, /**< block memory */
SCIP_SET* set, /**< global SCIP settings */
SCIP_STAT* stat, /**< dynamic problem statistics */
SCIP_EVENTQUEUE* eventqueue, /**< event queue */
SCIP_EVENTFILTER* eventfilter, /**< event filter */
SCIP_LP* lp, /**< current LP */
SCIP_Bool root /**< bool whether the current node is the root */
);
/** check if the LP of the given node should be solved or not */
SCIP_Bool SCIPreoptGetSolveLP(
SCIP_REOPT* reopt, /**< reoptimization data structure */
SCIP_SET* set, /**< global SCIP settings */
SCIP_NODE* node /**< node of the current search tree */
);
/** reactivate the given @p reoptnode and split them into several nodes if necessary */
SCIP_RETCODE SCIPreoptApply(
SCIP_REOPT* reopt, /**< reoptimization data structure */
SCIP* scip, /**< SCIP data structure */
SCIP_SET* set, /**< global SCIP settings */
SCIP_STAT* stat, /**< dynamic problem statistics */
SCIP_PROB* transprob, /**< transformed problem */
SCIP_PROB* origprob, /**< original problem */
SCIP_TREE* tree, /**< branching tree */
SCIP_LP* lp, /**< current LP */
SCIP_BRANCHCAND* branchcand, /**< branching candidate */
SCIP_EVENTQUEUE* eventqueue, /**< event queue */
SCIP_CLIQUETABLE* cliquetable, /**< clique table */
BMS_BLKMEM* blkmem, /**< block memory */
SCIP_REOPTNODE* reoptnode, /**< node of the reoptimization tree to reactivate */
unsigned int id, /**< id of the node to reactivate */
SCIP_Real estimate, /**< estimate of the child nodes that should be created */
SCIP_NODE** childnodes, /**< array to store the created child nodes */
int* ncreatedchilds, /**< pointer to store number of created child nodes */
int* naddedconss, /**< pointer to store number of generated constraints */
int childnodessize, /**< available size of childnodes array */
SCIP_Bool* success /**< pointer store the result */
);
/** delete a node stored in the reoptimization tree */
SCIP_RETCODE SCIPreoptDeleteNode(
SCIP_REOPT* reopt, /**< reoptimization data */
SCIP_SET* set, /**< global SCIP settings */
unsigned int id, /**< id of the node */
BMS_BLKMEM* blkmem /**< block memory */
);
/** reset the stored information abound bound changes based on dual information */
SCIP_RETCODE SCIPreoptResetDualBndchgs(
SCIP_REOPT* reopt, /**< reoptimization data */
SCIP_NODE* node, /**< node of the search tree */
BMS_BLKMEM* blkmem /**< block memory */
);
/** splits the root into several nodes and moves the child nodes of the root to one of the created nodes */
SCIP_RETCODE SCIPreoptSplitRoot(
SCIP_REOPT* reopt, /**< reoptimization data structure */
SCIP_TREE* tree, /**< branch and bound tree */
SCIP_SET* set, /**< global SCIP settings */
SCIP_STAT* stat, /**< dynamic SCIP statistics */
BMS_BLKMEM* blkmem, /**< block memory */
int* ncreatedchilds, /**< pointer to store the number of created nodes */
int* naddedconss /**< pointer to store the number added constraints */
);
/** reset the complete tree and set the given search frontier */
SCIP_RETCODE SCIPreoptApplyCompression(
SCIP_REOPT* reopt, /**< reoptimization data structure */
SCIP_SET* set, /**< global SCIP settings */
BMS_BLKMEM* blkmem, /**< block memory */
SCIP_REOPTNODE** representatives, /**< array of representatives */
int nrepresentatives, /**< number of representatives */
SCIP_Bool* success /**< pointer to store if the method was successful */
);
/** add all unprocessed nodes to the reoptimization tree */
SCIP_RETCODE SCIPreoptSaveOpenNodes(
SCIP_REOPT* reopt, /**< reoptimization data structure */
SCIP_SET* set, /**< global SCIP settings */
SCIP_LP* lp, /**< LP data */
BMS_BLKMEM* blkmem, /**< block memory */
SCIP_NODE** leaves, /**< array of open leave nodes */
int nleaves, /**< number of open leave nodes */
SCIP_NODE** childs, /**< array of open children nodes */
int nchilds, /**< number of open leave nodes */
SCIP_NODE** siblings, /**< array of open sibling nodes */
int nsiblings /**< number of open leave nodes */
);
/** merges the variable history of the current run with the stored history */
SCIP_RETCODE SCIPreoptMergeVarHistory(
SCIP_REOPT* reopt, /**< reoptimization data structure */
SCIP_SET* set, /**< global SCIP settings */
SCIP_STAT* stat, /**< dynamic problem statistics */
SCIP_VAR** vars, /**< original problem variables */
int nvars /**< number of original problem variables */
);
/** updates the variable history */
SCIP_RETCODE SCIPreoptUpdateVarHistory(
SCIP_REOPT* reopt, /**< reoptimization data structure */
SCIP_SET* set, /**< global SCIP settings */
SCIP_STAT* stat, /**< dynamic problem statistics */
BMS_BLKMEM* blkmem, /**< block memory */
SCIP_VAR** vars, /**< variable array */
int nvars /**< number of variables */
);
/*
* methods for reoptnode
*/
/** initialize an empty node */
void SCIPreoptnodeInit(
SCIP_REOPTNODE* reoptnode, /**< node of the reopttree */
SCIP_SET* set /**< global SCIP settings */
);
/** reset the given reoptimization node */
SCIP_RETCODE SCIPreoptnodeReset(
SCIP_REOPT* reopt, /**< reoptimization data structure */
SCIP_SET* set, /**< global SCIP settings */
BMS_BLKMEM* blkmem, /**< block memory */
SCIP_REOPTNODE* reoptnode /**< reoptimization node */
);
/** delete the given reoptimization node */
SCIP_RETCODE SCIPreoptnodeDelete(
SCIP_REOPTNODE** reoptnode, /**< pointer of reoptnode */
BMS_BLKMEM* blkmem /**< block memory */
);
/** add a variable to a given reoptnode */
SCIP_RETCODE SCIPreoptnodeAddBndchg(
SCIP_REOPTNODE* reoptnode, /**< node of the reopttree */
SCIP_SET* set, /**< global SCIP settings */
BMS_BLKMEM* blkmem, /**< block memory */
SCIP_VAR* var, /**< variable to add */
SCIP_Real val, /**< value of the variable */
SCIP_BOUNDTYPE boundtype /**< boundtype of the variable */
);
/** add a constraint to a given reoptnode */
SCIP_RETCODE SCIPreoptnodeAddCons(
SCIP_REOPTNODE* reoptnode, /**< node of the reopttree */
SCIP_SET* set, /**< global SCIP settings */
BMS_BLKMEM* blkmem, /**< block memory */
SCIP_VAR** vars, /**< variables which are part of the constraint */
SCIP_Real* bounds, /**< bounds of the variables */
SCIP_BOUNDTYPE* boundtypes, /**< boundtypes of the varibales (or NULL is the constraint is a cut) */
SCIP_Real lhs, /**< lhs of the constraint */
SCIP_Real rhs, /**< rhs of the constraint */
int nvars, /**< number of variables */
REOPT_CONSTYPE constype, /**< type of the constraint */
SCIP_Bool linear /**< the given constraint has a linear representation */
);
/** return the branching path of the given node in the reoptimization tree */
void SCIPreoptnodeGetPath(
SCIP_REOPT* reopt, /**< reoptimization data structure */
SCIP_REOPTNODE* reoptnode, /**< node of the reoptimization tree */
SCIP_VAR** vars, /**< array for variables */
SCIP_Real* vals, /**< array for values */
SCIP_BOUNDTYPE* boundtypes, /**< array for bound types */
int varssize, /**< size of arrays vars, vals, and boundtypes */
int* nbndchgs, /**< pointer to store the number of bound changes */
int* nbndchgsafterdual /**< pointer to store the number of bound changes applied after
* the first dual reduction at the given node */
);
/** add a constraint to the reoptimization data structure */
SCIP_RETCODE SCIPreoptAddCons(
SCIP_REOPT* reopt, /**< reoptimization data structure */
SCIP_SET* set, /**< global SCIP settings */
BMS_BLKMEM* blkmem, /**< block memory */
SCIP_CONS* cons /**< constraint to add */
);
/** save global lower and upper bounds
*
* @note this method can only called once, i.e., after fishing presolving of the first problem
*/
SCIP_RETCODE SCIPreoptSaveGlobalBounds(
SCIP_REOPT* reopt, /**< reoptimization data structure */
SCIP_PROB* transprob, /**< transformed problem data */
BMS_BLKMEM* blkmem /**< block memory */
);
/** save active constraints
*
* @note this method can only called once, i.e., after fishing presolving of the first problem
*/
SCIP_RETCODE SCIPreoptSaveActiveConss(
SCIP_REOPT* reopt, /**< reoptimization data structure */
SCIP_SET* set, /**< global SCIP settings */
SCIP_PROB* transprob, /**< transformed problem data */
BMS_BLKMEM* blkmem /**< block memory */
);
/** installs global lower and upper bounds */
SCIP_RETCODE SCIPreoptInstallBounds(
SCIP_REOPT* reopt, /**< reoptimization data structure */
SCIP_SET* set, /**< global SCIP settings */
SCIP_STAT* stat, /**< dynamic SCIP statistics */
SCIP_PROB* transprob, /**< transformed problem data */
SCIP_LP* lp, /**< current LP data */
SCIP_BRANCHCAND* branchcand, /**< branching candidate storage */
SCIP_EVENTQUEUE* eventqueue, /**< event queue */
SCIP_CLIQUETABLE* cliquetable, /**< clique table data structure */
BMS_BLKMEM* blkmem /**< block memory */
);
/** reactivate globally valid constraints that were deactivated and necessary to ensure correctness */
SCIP_RETCODE SCIPreoptResetActiveConss(
SCIP_REOPT* reopt, /**< reoptimization data structure */
SCIP_SET* set, /**< global SCIP settings */
SCIP_STAT* stat /**< dynamic SCIP statistics */
);
/** returns whether a constraint is necessary to ensure correctness and cannot be deleted */
SCIP_Bool SCIPreoptConsCanBeDeleted(
SCIP_REOPT* reopt, /**< reoptimization data structure */
SCIP_CONS* cons /**< problem constraint */
);
#ifdef __cplusplus
}
#endif
#endif
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* This file is part of the program and library */
/* SCIP --- Solving Constraint Integer Programs */
/* */
/* Copyright (C) 2002-2020 Konrad-Zuse-Zentrum */
/* fuer Informationstechnik Berlin */
/* */
/* SCIP is distributed under the terms of the ZIB Academic License. */
/* */
/* You should have received a copy of the ZIB Academic License */
/* along with SCIP; see the file COPYING. If not visit scipopt.org. */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/**@file retcode.h
* @ingroup INTERNALAPI
* @brief internal methods for return codes for SCIP methods
* @author Tobias Achterberg
*/
/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
#ifndef __SCIP_RETCODE_H__
#define __SCIP_RETCODE_H__
#include <stdio.h>
#include "scip/pub_message.h"
#ifdef __cplusplus
extern "C" {
#endif
/** prints error message for return code */
void SCIPretcodePrint(
SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
FILE* file, /**< file stream to write error message */
SCIP_RETCODE retcode /**< SCIP return code causing the error */
);
/** prints error message for return code via error message */
void SCIPretcodePrintError(
SCIP_RETCODE retcode /**< SCIP return code causing the error */
);
#ifdef __cplusplus
}
#endif
#endif
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* This file is part of the program and library */
/* SCIP --- Solving Constraint Integer Programs */
/* */
/* Copyright (C) 2002-2020 Konrad-Zuse-Zentrum */
/* fuer Informationstechnik Berlin */
/* */
/* SCIP is distributed under the terms of the ZIB Academic License. */
/* */
/* You should have received a copy of the ZIB Academic License */
/* along with SCIP; see the file COPYING. If not visit scipopt.org. */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/**@file scip.h
* @ingroup PUBLICCOREAPI
* @brief SCIP callable library
* @author Tobias Achterberg
* @author Timo Berthold
* @author Thorsten Koch
* @author Alexander Martin
* @author Marc Pfetsch
* @author Kati Wolter
*/
/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
#ifndef __SCIP_SCIP_H__
#define __SCIP_SCIP_H__
#include <stdio.h>
#include "scip/def.h"
#include "blockmemshell/memory.h"
#include "scip/type_retcode.h"
#include "scip/type_result.h"
#include "scip/type_clock.h"
#include "scip/type_misc.h"
#include "scip/type_timing.h"
#include "scip/type_paramset.h"
#include "scip/type_event.h"
#include "scip/type_lp.h"
#include "scip/type_nlp.h"
#include "scip/type_var.h"
#include "scip/type_prob.h"
#include "scip/type_tree.h"
#include "scip/type_scip.h"
#include "scip/type_bandit.h"
#include "scip/type_branch.h"
#include "scip/type_conflict.h"
#include "scip/type_cons.h"
#include "scip/type_dialog.h"
#include "scip/type_disp.h"
#include "scip/type_heur.h"
#include "scip/type_compr.h"
#include "scip/type_history.h"
#include "scip/type_nodesel.h"
#include "scip/type_presol.h"
#include "scip/type_pricer.h"
#include "scip/type_reader.h"
#include "scip/type_relax.h"
#include "scip/type_reopt.h"
#include "scip/type_sepa.h"
#include "scip/type_table.h"
#include "scip/type_prop.h"
#include "nlpi/type_nlpi.h"
#include "scip/type_concsolver.h"
#include "scip/type_syncstore.h"
#include "scip/type_benders.h"
#include "scip/type_benderscut.h"
/* include public interfaces, s.t. the user only needs to include scip.h */
#include "scip/pub_bandit.h"
#include "scip/pub_benders.h"
#include "scip/pub_benderscut.h"
#include "scip/pub_branch.h"
#include "scip/pub_conflict.h"
#include "scip/pub_cons.h"
#include "scip/pub_cutpool.h"
#include "scip/pub_dcmp.h"
#include "scip/pub_dialog.h"
#include "scip/pub_disp.h"
#include "scip/pub_event.h"
#include "scip/pub_fileio.h"
#include "scip/pub_heur.h"
#include "scip/pub_compr.h"
#include "scip/pub_history.h"
#include "scip/pub_implics.h"
#include "scip/pub_lp.h"
#include "scip/pub_nlp.h"
#include "scip/pub_matrix.h"
#include "scip/pub_message.h"
#include "scip/pub_misc.h"
#include "scip/pub_nodesel.h"
#include "scip/pub_paramset.h"
#include "scip/pub_presol.h"
#include "scip/pub_pricer.h"
#include "scip/pub_reader.h"
#include "scip/pub_relax.h"
#include "scip/pub_reopt.h"
#include "scip/pub_sepa.h"
#include "scip/pub_prop.h"
#include "scip/pub_sol.h"
#include "scip/pub_table.h"
#include "scip/pub_tree.h"
#include "scip/pub_var.h"
#include "lpi/lpi.h"
#include "nlpi/pub_expr.h"
/* include global presolving, cuts, and heuristics methods */
#include "scip/presolve.h"
#include "scip/cuts.h"
#include "scip/heuristics.h"
#include "scip/scip_bandit.h"
#include "scip/scip_benders.h"
#include "scip/scip_branch.h"
#include "scip/scip_compr.h"
#include "scip/scip_concurrent.h"
#include "scip/scip_conflict.h"
#include "scip/scip_cons.h"
#include "scip/scip_copy.h"
#include "scip/scip_cut.h"
#include "scip/scip_datastructures.h"
#include "scip/scip_debug.h"
#include "scip/scip_dcmp.h"
#include "scip/scip_dialog.h"
#include "scip/scip_disp.h"
#include "scip/scip_event.h"
#include "scip/scip_expr.h"
#include "scip/scip_general.h"
#include "scip/scip_heur.h"
#include "scip/scip_lp.h"
#include "scip/scip_mem.h"
#include "scip/scip_message.h"
#include "scip/scip_nlp.h"
#include "scip/scip_nodesel.h"
#include "scip/scip_nonlinear.h"
#include "scip/scip_numerics.h"
#include "scip/scip_param.h"
#include "scip/scip_presol.h"
#include "scip/scip_pricer.h"
#include "scip/scip_prob.h"
#include "scip/scip_probing.h"
#include "scip/scip_prop.h"
#include "scip/scip_randnumgen.h"
#include "scip/scip_reader.h"
#include "scip/scip_relax.h"
#include "scip/scip_reopt.h"
#include "scip/scip_sepa.h"
#include "scip/scip_sol.h"
#include "scip/scip_solve.h"
#include "scip/scip_solvingstats.h"
#include "scip/scip_table.h"
#include "scip/scip_timing.h"
#include "scip/scip_tree.h"
#include "scip/scip_validation.h"
#include "scip/scip_var.h"
#endif
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* This file is part of the program and library */
/* SCIP --- Solving Constraint Integer Programs */
/* */
/* Copyright (C) 2002-2020 Konrad-Zuse-Zentrum */
/* fuer Informationstechnik Berlin */
/* */
/* SCIP is distributed under the terms of the ZIB Academic License. */
/* */
/* You should have received a copy of the ZIB Academic License */
/* along with SCIP; see the file COPYING. If not visit scipopt.org. */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/**@file scip_bandit.h
* @ingroup PUBLICCOREAPI
* @brief public methods for bandit algorithms
* @author Tobias Achterberg
* @author Timo Berthold
* @author Thorsten Koch
* @author Alexander Martin
* @author Marc Pfetsch
* @author Kati Wolter
* @author Gregor Hendel
* @author Leona Gottwald
*/
/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
#ifndef __SCIP_SCIP_BANDIT_H__
#define __SCIP_SCIP_BANDIT_H__
#include "scip/def.h"
#include "scip/type_bandit.h"
#include "scip/type_retcode.h"
#include "scip/type_scip.h"
#ifdef __cplusplus
extern "C" {
#endif
/**@addtogroup PublicBanditMethods
*
* @{
*/
/** includes a bandit algorithm virtual function table */
SCIP_EXPORT
SCIP_RETCODE SCIPincludeBanditvtable(
SCIP* scip, /**< SCIP data structure */
SCIP_BANDITVTABLE** banditvtable, /**< bandit algorithm virtual function table */
const char* name, /**< a name for the algorithm represented by this vtable */
SCIP_DECL_BANDITFREE ((*banditfree)), /**< callback to free bandit specific data structures */
SCIP_DECL_BANDITSELECT((*banditselect)), /**< selection callback for bandit selector */
SCIP_DECL_BANDITUPDATE((*banditupdate)), /**< update callback for bandit algorithms */
SCIP_DECL_BANDITRESET ((*banditreset)) /**< update callback for bandit algorithms */
);
/** returns the bandit virtual function table of the given name, or NULL if not existing */
SCIP_EXPORT
SCIP_BANDITVTABLE* SCIPfindBanditvtable(
SCIP* scip, /**< SCIP data structure */
const char* name /**< name of bandit algorithm virtual function table */
);
/** calls destructor and frees memory of bandit algorithm */
SCIP_EXPORT
SCIP_RETCODE SCIPfreeBandit(
SCIP* scip, /**< SCIP data structure */
SCIP_BANDIT** bandit /**< pointer to bandit algorithm data structure */
);
/** reset the bandit algorithm */
SCIP_EXPORT
SCIP_RETCODE SCIPresetBandit(
SCIP* scip, /**< SCIP data structure */
SCIP_BANDIT* bandit, /**< pointer to bandit algorithm data structure */
SCIP_Real* priorities, /**< priorities for every action, or NULL if not needed */
unsigned int seed /**< initial random seed for bandit selection */
);
/** @} */
#ifdef __cplusplus
}
#endif
#endif