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 pub_message.h
* @ingroup PUBLICCOREAPI
* @brief public methods for message output
* @author Tobias Achterberg
* @author Stefan Heinz
*/
/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
#ifndef __SCIP_PUB_MESSAGE_H__
#define __SCIP_PUB_MESSAGE_H__
#include <stdarg.h>
#include <string.h>
#include "scip/def.h"
#include "scip/type_message.h"
#ifdef NDEBUG
#include "scip/struct_message.h"
#endif
#ifdef __cplusplus
extern "C" {
#endif
/** define to identify SCIP version with thread-safe version of message handlers */
#define SCIP_THREADSAFE_MESSAGEHDLRS
/** define to get the filename of __FILE__ */
#if defined(_WIN32) || defined(_WIN64)
/*lint -e613*/
#define __FILENAME__ (strrchr("\\" __FILE__, '\\') + 1)
#else
/*lint -e613*/
#define __FILENAME__ (strrchr("/" __FILE__, '/') + 1)
#endif
/** prints an error message */
#define SCIPerrorMessage SCIPmessagePrintErrorHeader(__FILENAME__, __LINE__); \
SCIPmessagePrintError
/** define used in blockmemshell/memory.c */
#define printErrorHeader SCIPmessagePrintErrorHeader
#define printError SCIPmessagePrintError
#ifdef SCIP_DEBUG
/** executes command only if SCIP_DEBUG flag is set */
#define SCIPdebug(x) x
/** prints a debugging message if SCIP_DEBUG flag is set - also consider using SCIPdebugMsg/SCIPsetDebugMsg */
#define SCIPdebugMessage printf("[%s:%d] debug: ", __FILENAME__, __LINE__), printf
/** executes printf command only if SCIP_DEBUG flag is set */
#define SCIPdebugPrintf printf
/** executes SCIPprintCons() and prints termination symbol ";\n" only if SCIP_DEBUG flag is set */
#define SCIPdebugPrintCons(scip,cons,file) do \
{ \
SCIP_CALL_ABORT( SCIPprintCons((scip), (cons), (file)) ); \
SCIPinfoMessage((scip), (file), ";\n"); \
} \
while( FALSE )
#else
/** executes command only if SCIP_DEBUG flag is set */
#define SCIPdebug(x) /**/
/** prints a debugging message if SCIP_DEBUG flag is set - also consider using SCIPdebugMsg/SCIPsetDebugMsg */
#define SCIPdebugMessage while( FALSE ) /*lint -e{530}*/ printf
/** executes printf command only if SCIP_DEBUG flag is set */
#define SCIPdebugPrintf while( FALSE ) /*lint -e{530}*/ printf
/** executes SCIPprintCons() and prints termination symbol ";\n" only if SCIP_DEBUG flag is set */
#define SCIPdebugPrintCons(x,y,z) /**/
#endif
#ifdef SCIP_STATISTIC
/** executes command only if SCIP_STATISTIC flag is set */
#define SCIPstatistic(x) x
/** prints a statistic message if SCIP_STATISTIC flag is set */
#define SCIPstatisticMessage printf("[%s:%d] statistic: ", __FILENAME__, __LINE__), printf
/** executes printf command only if SCIP_STATISTIC flag is set */
#define SCIPstatisticPrintf printf
#else
/** executes command only if SCIP_STATISTIC flag is set */
#define SCIPstatistic(x) /**/
/** prints a statistic message if SCIP_STATISTIC flag is set */
#define SCIPstatisticMessage while( FALSE ) /*lint -e{530}*/ printf
/** executes printf command only if SCIP_STATISTIC flag is set */
#define SCIPstatisticPrintf while( FALSE ) /*lint -e{530}*/ printf
#endif
/** Creates and captures a message handler which deals with warning, information, and dialog (interactive shell) methods.
*
* Use SCIPsetMessagehdlr() to make SCIP aware of the created message handler.
* @note The message handler does not handle error messages. For that see SCIPmessageSetErrorPrinting()
* @note Creating a message handler automatically captures it.
*/
SCIP_EXPORT
SCIP_RETCODE SCIPmessagehdlrCreate(
SCIP_MESSAGEHDLR** messagehdlr, /**< pointer to store the message handler */
SCIP_Bool bufferedoutput, /**< should the output be buffered up to the next newline? */
const char* filename, /**< name of log file, or NULL for no log */
SCIP_Bool quiet, /**< should screen messages be suppressed? */
SCIP_DECL_MESSAGEWARNING((*messagewarning)),/**< warning message print method of message handler */
SCIP_DECL_MESSAGEDIALOG((*messagedialog)),/**< dialog message print method of message handler */
SCIP_DECL_MESSAGEINFO ((*messageinfo)), /**< info message print method of message handler */
SCIP_DECL_MESSAGEHDLRFREE((*messagehdlrfree)), /**< destructor of message handler to free message handler data */
SCIP_MESSAGEHDLRDATA* messagehdlrdata /**< message handler data */
);
/** captures message handler */
SCIP_EXPORT
void SCIPmessagehdlrCapture(
SCIP_MESSAGEHDLR* messagehdlr /**< message handler, or NULL */
);
/** releases message handler */
SCIP_EXPORT
SCIP_RETCODE SCIPmessagehdlrRelease(
SCIP_MESSAGEHDLR** messagehdlr /**< pointer to the message handler */
);
/** sets the user data of the message handler */
SCIP_EXPORT
SCIP_RETCODE SCIPmessagehdlrSetData(
SCIP_MESSAGEHDLR* messagehdlr, /**< message handler; must not be NULL */
SCIP_MESSAGEHDLRDATA* messagehdlrdata /**< new message handler data to attach to the handler */
);
/** sets the log file name for the message handler */
SCIP_EXPORT
void SCIPmessagehdlrSetLogfile(
SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
const char* filename /**< log file name where to copy messages into, or NULL */
);
/** sets the messages handler to be quiet */
SCIP_EXPORT
void SCIPmessagehdlrSetQuiet(
SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
SCIP_Bool quiet /**< should screen messages be suppressed? */
);
/** prints a message, acting like the printf() command */
SCIP_EXPORT
void SCIPmessagePrintInfo(
SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
const char* formatstr, /**< format string like in printf() function */
... /**< format arguments line in printf() function */
);
/** prints a message, acting like the vprintf() command */
SCIP_EXPORT
void SCIPmessageVPrintInfo(
SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
const char* formatstr, /**< format string like in printf() function */
va_list ap /**< variable argument list */
);
/** prints a message into a file, acting like the fprintf() command */
SCIP_EXPORT
void SCIPmessageFPrintInfo(
SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
FILE* file, /**< file stream to print into, or NULL for stdout */
const char* formatstr, /**< format string like in printf() function */
... /**< format arguments line in printf() function */
);
/** prints a message into a file, acting like the vfprintf() command */
SCIP_EXPORT
void SCIPmessageVFPrintInfo(
SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
FILE* file, /**< file stream to print into, or NULL for stdout */
const char* formatstr, /**< format string like in printf() function */
va_list ap /**< variable argument list */
);
/** prints a warning message, acting like the printf() command */
SCIP_EXPORT
void SCIPmessagePrintWarning(
SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
const char* formatstr, /**< format string like in printf() function */
... /**< format arguments line in printf() function */
);
/** prints a warning message, acting like the vprintf() command */
SCIP_EXPORT
void SCIPmessageVPrintWarning(
SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
const char* formatstr, /**< format string like in printf() function */
va_list ap /**< variable argument list */
);
/** prints a warning message into a file, acting like the fprintf() command */
SCIP_EXPORT
void SCIPmessageFPrintWarning(
SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
const char* formatstr, /**< format string like in printf() function */
... /**< format arguments line in printf() function */
);
/** prints a warning message into a file, acting like the vfprintf() command */
SCIP_EXPORT
void SCIPmessageVFPrintWarning(
SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
const char* formatstr, /**< format string like in printf() function */
va_list ap /**< variable argument list */
);
/** prints a dialog message that requests user interaction, acting like the printf() command */
SCIP_EXPORT
void SCIPmessagePrintDialog(
SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
const char* formatstr, /**< format string like in printf() function */
... /**< format arguments line in printf() function */
);
/** prints a dialog message that requests user interaction, acting like the vprintf() command */
SCIP_EXPORT
void SCIPmessageVPrintDialog(
SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
const char* formatstr, /**< format string like in printf() function */
va_list ap /**< variable argument list */
);
/** prints a dialog message that requests user interaction into a file, acting like the fprintf() command */
SCIP_EXPORT
void SCIPmessageFPrintDialog(
SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
FILE* file, /**< file stream to print into, or NULL for stdout */
const char* formatstr, /**< format string like in printf() function */
... /**< format arguments line in printf() function */
);
/** prints a dialog message that requests user interaction into a file, acting like the vfprintf() command */
SCIP_EXPORT
void SCIPmessageVFPrintDialog(
SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
FILE* file, /**< file stream to print into, or NULL for stdout */
const char* formatstr, /**< format string like in printf() function */
va_list ap /**< variable argument list */
);
/** prints a message depending on the verbosity level, acting like the printf() command */
SCIP_EXPORT
void SCIPmessagePrintVerbInfo(
SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
SCIP_VERBLEVEL verblevel, /**< current verbosity level */
SCIP_VERBLEVEL msgverblevel, /**< verbosity level of this message */
const char* formatstr, /**< format string like in printf() function */
... /**< format arguments line in printf() function */
);
/** prints a message depending on the verbosity level, acting like the vprintf() command */
SCIP_EXPORT
void SCIPmessageVPrintVerbInfo(
SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
SCIP_VERBLEVEL verblevel, /**< current verbosity level */
SCIP_VERBLEVEL msgverblevel, /**< verbosity level of this message */
const char* formatstr, /**< format string like in printf() function */
va_list ap /**< variable argument list */
);
/** prints a message into a file depending on the verbosity level, acting like the fprintf() command */
SCIP_EXPORT
void SCIPmessageFPrintVerbInfo(
SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
SCIP_VERBLEVEL verblevel, /**< current verbosity level */
SCIP_VERBLEVEL msgverblevel, /**< verbosity level of this message */
FILE* file, /**< file stream to print into, or NULL for stdout */
const char* formatstr, /**< format string like in printf() function */
... /**< format arguments line in printf() function */
);
/** prints a message into a file depending on the verbosity level, acting like the vfprintf() command */
SCIP_EXPORT
void SCIPmessageVFPrintVerbInfo(
SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
SCIP_VERBLEVEL verblevel, /**< current verbosity level */
SCIP_VERBLEVEL msgverblevel, /**< verbosity level of this message */
FILE* file, /**< file stream to print into, or NULL for stdout */
const char* formatstr, /**< format string like in printf() function */
va_list ap /**< variable argument list */
);
/** prints the header with source file location for an error message using the static message handler */
SCIP_EXPORT
void SCIPmessagePrintErrorHeader(
const char* sourcefile, /**< name of the source file that called the function */
int sourceline /**< line in the source file where the function was called */
);
/** prints an error message, acting like the printf() command using the static message handler */
SCIP_EXPORT
void SCIPmessagePrintError(
const char* formatstr, /**< format string like in printf() function */
... /**< format arguments line in printf() function */
);
/** prints an error message, acting like the vprintf() command using the static message handler */
SCIP_EXPORT
void SCIPmessageVPrintError(
const char* formatstr, /**< format string like in printf() function */
va_list ap /**< variable argument list */
);
/** Method to set the error printing method. Setting the error printing method to NULL will suspend all error methods.
*
* @note The error printing method is a static variable. This means that all occurring errors are handled via this method.
*/
SCIP_EXPORT
void SCIPmessageSetErrorPrinting(
SCIP_DECL_ERRORPRINTING((*errorPrinting)),/**< error message print method of message handler, or NULL */
void* data /**< data pointer which will be passed to the error printing method, or NULL */
);
/** Method to set the error printing method to default version prints everything the stderr.
*
* @note The error printing method is a static variable. This means that all occurring errors are handled via this method.
*/
SCIP_EXPORT
void SCIPmessageSetErrorPrintingDefault(
void
);
/** returns the user data of the message handler */
SCIP_EXPORT
SCIP_MESSAGEHDLRDATA* SCIPmessagehdlrGetData(
SCIP_MESSAGEHDLR* messagehdlr /**< message handler */
);
/** returns the log file or NULL for stdout */
SCIP_EXPORT
FILE* SCIPmessagehdlrGetLogfile(
SCIP_MESSAGEHDLR* messagehdlr /**< message handler */
);
/** returns TRUE if the message handler is set to be quiet */
SCIP_EXPORT
SCIP_Bool SCIPmessagehdlrIsQuiet(
SCIP_MESSAGEHDLR* messagehdlr /**< message handler */
);
#ifdef NDEBUG
/* In optimized mode, the function calls are overwritten by defines to reduce the number of function calls and
* speed up the algorithms.
*/
#define SCIPmessagehdlrGetData(messagehdlr) ((messagehdlr) != NULL) ? messagehdlr->messagehdlrdata : NULL
#define SCIPmessagehdlrGetLogfile(messagehdlr) ((messagehdlr) == NULL ? NULL : (messagehdlr)->logfile)
#define SCIPmessagehdlrIsQuiet(messagehdlr) ((messagehdlr) == NULL || (messagehdlr)->quiet)
#endif
#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 pub_misc.h
* @ingroup PUBLICCOREAPI
* @brief public data structures and miscellaneous methods
* @author Tobias Achterberg
* @author Gerald Gamrath
* @author Stefan Heinz
* @author Gregor Hendel
* @author Michael Winkler
* @author Kati Wolter
*
* This file contains a bunch of data structures and miscellaneous methods:
*
* - \ref DataStructures "Data structures"
* - \ref MiscellaneousMethods "Miscellaneous Methods"
*/
/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
#ifndef __SCIP_PUB_MISC_H__
#define __SCIP_PUB_MISC_H__
/* on SunOS, the function finite(a) (for the SCIPisFinite macro below) is declared in ieeefp.h */
#ifdef __sun
#include <ieeefp.h>
#endif
#include <math.h>
#include "scip/def.h"
#include "blockmemshell/memory.h"
#include "scip/type_retcode.h"
#include "scip/type_misc.h"
#include "scip/type_message.h"
#include "scip/type_var.h"
#include "scip/pub_misc_select.h"
#include "scip/pub_misc_sort.h"
#include "scip/pub_misc_linear.h"
/* in optimized mode some of the function are handled via defines, for that the structs are needed */
#ifdef NDEBUG
#include "scip/struct_misc.h"
#endif
#ifdef __cplusplus
extern "C" {
#endif
/*
* methods for statistical tests
*/
/**@defgroup STATISTICALTESTS Statistical tests
* @ingroup MiscellaneousMethods
* @brief public methods for statistical tests
*
* Below are the public methods for statistical tests inside of \SCIP
*
* @{
*/
/** get critical value of a Student-T distribution for a given number of degrees of freedom at a confidence level */
SCIP_EXPORT
SCIP_Real SCIPstudentTGetCriticalValue(
SCIP_CONFIDENCELEVEL clevel, /**< (one-sided) confidence level */
int df /**< degrees of freedom */
);
/** compute a t-value for the hypothesis that x and y are from the same population; Assuming that
* x and y represent normally distributed random samples with equal variance, the returned value
* comes from a Student-T distribution with countx + county - 2 degrees of freedom; this
* value can be compared with a critical value (see also SCIPstudentTGetCriticalValue()) at
* a predefined confidence level for checking if x and y significantly differ in location
*/
SCIP_EXPORT
SCIP_Real SCIPcomputeTwoSampleTTestValue(
SCIP_Real meanx, /**< the mean of the first distribution */
SCIP_Real meany, /**< the mean of the second distribution */
SCIP_Real variancex, /**< the variance of the x-distribution */
SCIP_Real variancey, /**< the variance of the y-distribution */
SCIP_Real countx, /**< number of samples of x */
SCIP_Real county /**< number of samples of y */
);
/** returns the value of the Gauss error function evaluated at a given point */
SCIP_EXPORT
SCIP_Real SCIPerf(
SCIP_Real x /**< value to evaluate */
);
/** get critical value of a standard normal distribution at a given confidence level */
SCIP_EXPORT
SCIP_Real SCIPnormalGetCriticalValue(
SCIP_CONFIDENCELEVEL clevel /**< (one-sided) confidence level */
);
/** calculates the cumulative distribution P(-infinity <= x <= value) that a normally distributed
* random variable x takes a value between -infinity and parameter \p value.
*
* The distribution is given by the respective mean and deviation. This implementation
* uses the error function erf().
*/
SCIP_EXPORT
SCIP_Real SCIPnormalCDF(
SCIP_Real mean, /**< the mean value of the distribution */
SCIP_Real variance, /**< the square of the deviation of the distribution */
SCIP_Real value /**< the upper limit of the calculated distribution integral */
);
/**@} */
/**@defgroup Regression Linear Regression
* @ingroup MiscellaneousMethods
* @brief methods for linear regression
*
* Below are the public methods for incremental linear regression of observations pairs \f$(X_i,Y_i), i=1\dots,n\f$
*
* @{
*/
/** returns the number of observations of this regression */
SCIP_EXPORT
int SCIPregressionGetNObservations(
SCIP_REGRESSION* regression /**< regression data structure */
);
/** return the current slope of the regression */
SCIP_EXPORT
SCIP_Real SCIPregressionGetSlope(
SCIP_REGRESSION* regression /**< regression data structure */
);
/** get the current y-intercept of the regression */
SCIP_EXPORT
SCIP_Real SCIPregressionGetIntercept(
SCIP_REGRESSION* regression /**< regression data structure */
);
/** removes an observation (x,y) from the regression */
SCIP_EXPORT
void SCIPregressionRemoveObservation(
SCIP_REGRESSION* regression, /**< regression data structure */
SCIP_Real x, /**< X of observation */
SCIP_Real y /**< Y of the observation */
);
/** update regression by a new observation (x,y) */
SCIP_EXPORT
void SCIPregressionAddObservation(
SCIP_REGRESSION* regression, /**< regression data structure */
SCIP_Real x, /**< X of observation */
SCIP_Real y /**< Y of the observation */
);
/** reset regression data structure */
SCIP_EXPORT
void SCIPregressionReset(
SCIP_REGRESSION* regression /**< regression data structure */
);
/** creates and resets a regression */
SCIP_EXPORT
SCIP_RETCODE SCIPregressionCreate(
SCIP_REGRESSION** regression /**< regression data structure */
);
/** frees a regression */
SCIP_EXPORT
void SCIPregressionFree(
SCIP_REGRESSION** regression /**< regression data structure */
);
/**@} */
/*
*/
/**@defgroup GMLgraph GML Graphical Printing
* @ingroup MiscellaneousMethods
* @brief GML graph printing methods
*
* For a detailed format decription see http://docs.yworks.com/yfiles/doc/developers-guide/gml.html
*
* @{
*/
/** writes a node section to the given graph file */
SCIP_EXPORT
void SCIPgmlWriteNode(
FILE* file, /**< file to write to */
unsigned int id, /**< id of the node */
const char* label, /**< label of the node */
const char* nodetype, /**< type of the node, or NULL */
const char* fillcolor, /**< color of the node's interior, or NULL */
const char* bordercolor /**< color of the node's border, or NULL */
);
/** writes a node section including weight to the given graph file */
SCIP_EXPORT
void SCIPgmlWriteNodeWeight(
FILE* file, /**< file to write to */
unsigned int id, /**< id of the node */
const char* label, /**< label of the node */
const char* nodetype, /**< type of the node, or NULL */
const char* fillcolor, /**< color of the node's interior, or NULL */
const char* bordercolor, /**< color of the node's border, or NULL */
SCIP_Real weight /**< weight of node */
);
/** writes an edge section to the given graph file */
SCIP_EXPORT
void SCIPgmlWriteEdge(
FILE* file, /**< file to write to */
unsigned int source, /**< source node id of the node */
unsigned int target, /**< target node id of the edge */
const char* label, /**< label of the edge, or NULL */
const char* color /**< color of the edge, or NULL */
);
/** writes an arc section to the given graph file */
SCIP_EXPORT
void SCIPgmlWriteArc(
FILE* file, /**< file to write to */
unsigned int source, /**< source node id of the node */
unsigned int target, /**< target node id of the edge */
const char* label, /**< label of the edge, or NULL */
const char* color /**< color of the edge, or NULL */
);
/** writes the starting line to a GML graph file, does not open a file */
SCIP_EXPORT
void SCIPgmlWriteOpening(
FILE* file, /**< file to write to */
SCIP_Bool directed /**< is the graph directed */
);
/** writes the ending lines to a GML graph file, does not close a file */
SCIP_EXPORT
void SCIPgmlWriteClosing(
FILE* file /**< file to close */
);
/**@} */
/*
* Sparse solution
*/
/**@defgroup SparseSol Sparse Solution
* @ingroup DataStructures
* @brief sparse storage for multiple integer solutions
*
* @{
*/
/** creates a sparse solution */
SCIP_EXPORT
SCIP_RETCODE SCIPsparseSolCreate(
SCIP_SPARSESOL** sparsesol, /**< pointer to store the created sparse solution */
SCIP_VAR** vars, /**< variables in the sparse solution, must not contain continuous variables */
int nvars, /**< number of variables to store, size of the lower and upper bound arrays */
SCIP_Bool cleared /**< should the lower and upper bound arrays be cleared (entries set to 0) */
);
/** frees sparse solution */
SCIP_EXPORT
void SCIPsparseSolFree(
SCIP_SPARSESOL** sparsesol /**< pointer to a sparse solution */
);
/** returns the variables in the given sparse solution */
SCIP_EXPORT
SCIP_VAR** SCIPsparseSolGetVars(
SCIP_SPARSESOL* sparsesol /**< a sparse solution */
);
/** returns the number of variables in the given sparse solution */
SCIP_EXPORT
int SCIPsparseSolGetNVars(
SCIP_SPARSESOL* sparsesol /**< a sparse solution */
);
/** returns the the lower bound array for all variables for a given sparse solution */
SCIP_EXPORT
SCIP_Longint* SCIPsparseSolGetLbs(
SCIP_SPARSESOL* sparsesol /**< a sparse solution */
);
/** returns the the upper bound array for all variables for a given sparse solution */
SCIP_EXPORT
SCIP_Longint* SCIPsparseSolGetUbs(
SCIP_SPARSESOL* sparsesol /**< a sparse solution */
);
/** constructs the first solution of sparse solution (all variables are set to their lower bound value */
SCIP_EXPORT
void SCIPsparseSolGetFirstSol(
SCIP_SPARSESOL* sparsesol, /**< sparse solutions */
SCIP_Longint* sol, /**< array to store the first solution */
int nvars /**< number of variables */
);
/** constructs the next solution of the sparse solution and return whether there was one more or not */
SCIP_EXPORT
SCIP_Bool SCIPsparseSolGetNextSol(
SCIP_SPARSESOL* sparsesol, /**< sparse solutions */
SCIP_Longint* sol, /**< current solution array which get changed to the next solution */
int nvars /**< number of variables */
);
/**@} */
/*
* Queue
*/
/**@defgroup Queue Queue
* @ingroup DataStructures
* @brief circular FIFO queue
*
* @{
*/
/** creates a (circular) queue, best used if the size will be fixed or will not be increased that much */
SCIP_EXPORT
SCIP_RETCODE SCIPqueueCreate(
SCIP_QUEUE** queue, /**< pointer to the new queue */
int initsize, /**< initial number of available element slots */
SCIP_Real sizefac /**< memory growing factor applied, if more element slots are needed */
);
/** frees queue, but not the data elements themselves */
SCIP_EXPORT
void SCIPqueueFree(
SCIP_QUEUE** queue /**< pointer to a queue */
);
/** clears the queue, but doesn't free the data elements themselves */
SCIP_EXPORT
void SCIPqueueClear(
SCIP_QUEUE* queue /**< queue */
);
/** inserts pointer element at the end of the queue */
SCIP_EXPORT
SCIP_RETCODE SCIPqueueInsert(
SCIP_QUEUE* queue, /**< queue */
void* elem /**< element to be inserted */
);
/** inserts unsigned integer element at the end of the queue */
SCIP_EXPORT
SCIP_RETCODE SCIPqueueInsertUInt(
SCIP_QUEUE* queue, /**< queue */
unsigned int elem /**< element to be inserted */
);
/** removes and returns the first element of the queue, or NULL if no element exists */
SCIP_EXPORT
void* SCIPqueueRemove(
SCIP_QUEUE* queue /**< queue */
);
/** removes and returns the first unsigned integer element of the queue, or UNIT_MAX if no element exists */
SCIP_EXPORT
unsigned int SCIPqueueRemoveUInt(
SCIP_QUEUE* queue /**< queue */
);
/** returns the first element of the queue without removing it, or NULL if no element exists */
SCIP_EXPORT
void* SCIPqueueFirst(
SCIP_QUEUE* queue /**< queue */
);
/** returns the first unsigned integer element of the queue without removing it, or UINT_MAX if no element exists */
SCIP_EXPORT
unsigned int SCIPqueueFirstUInt(
SCIP_QUEUE* queue /**< queue */
);
/** returns whether the queue is empty */
SCIP_EXPORT
SCIP_Bool SCIPqueueIsEmpty(
SCIP_QUEUE* queue /**< queue */
);
/** returns the number of elements in the queue */
SCIP_EXPORT
int SCIPqueueNElems(
SCIP_QUEUE* queue /**< queue */
);
/**@} */
/*
* Priority Queue
*/
/**@defgroup PriorityQueue Priority Queue
* @ingroup DataStructures
* @brief priority queue with O(1) access to the minimum element
*
* @{
*/
/** creates priority queue */
SCIP_EXPORT
SCIP_RETCODE SCIPpqueueCreate(
SCIP_PQUEUE** pqueue, /**< pointer to a priority queue */
int initsize, /**< initial number of available element slots */
SCIP_Real sizefac, /**< memory growing factor applied, if more element slots are needed */
SCIP_DECL_SORTPTRCOMP((*ptrcomp)), /**< data element comparator */
SCIP_DECL_PQUEUEELEMCHGPOS((*elemchgpos)) /**< callback to act on position change of elem in priority queue, or NULL */
);
/** frees priority queue, but not the data elements themselves */
SCIP_EXPORT
void SCIPpqueueFree(
SCIP_PQUEUE** pqueue /**< pointer to a priority queue */
);
/** clears the priority queue, but doesn't free the data elements themselves */
SCIP_EXPORT
void SCIPpqueueClear(
SCIP_PQUEUE* pqueue /**< priority queue */
);
/** inserts element into priority queue */
SCIP_EXPORT
SCIP_RETCODE SCIPpqueueInsert(
SCIP_PQUEUE* pqueue, /**< priority queue */
void* elem /**< element to be inserted */
);
/** delete element at specified position, maintaining the heap property */
SCIP_EXPORT
void SCIPpqueueDelPos(
SCIP_PQUEUE* pqueue, /**< priority queue */
int pos /**< position of element that should be deleted */
);
/** removes and returns best element from the priority queue */
SCIP_EXPORT
void* SCIPpqueueRemove(
SCIP_PQUEUE* pqueue /**< priority queue */
);
/** returns the best element of the queue without removing it */
SCIP_EXPORT
void* SCIPpqueueFirst(
SCIP_PQUEUE* pqueue /**< priority queue */
);
/** returns the number of elements in the queue */
SCIP_EXPORT
int SCIPpqueueNElems(
SCIP_PQUEUE* pqueue /**< priority queue */
);
/** returns the elements of the queue; changing the returned array may destroy the queue's ordering! */
SCIP_EXPORT
void** SCIPpqueueElems(
SCIP_PQUEUE* pqueue /**< priority queue */
);
/** return the position of @p elem in the priority queue, or -1 if element is not found */
SCIP_EXPORT
int SCIPpqueueFind(
SCIP_PQUEUE* pqueue, /**< priority queue */
void* elem /**< element to be inserted */
);
/**@} */
/*
* Hash Table
*/
/**@defgroup HashTable Hash Table
* @ingroup DataStructures
* @brief hash table that resolves conflicts by probing
*
*@{
*/
/* fast 2-universal hash functions for two to seven 32bit elements with 32bit output */
#define SCIPhashSignature64(a) (UINT64_C(0x8000000000000000)>>((UINT32_C(0x9e3779b9) * ((uint32_t)(a)))>>26))
#define SCIPhashTwo(a, b) ((uint32_t)((((uint32_t)(a) + 0xd37e9a1ce2148403ULL) * ((uint32_t)(b) + 0xe5fcc163aef32782ULL) )>>32))
#define SCIPhashThree(a, b, c) ((uint32_t)((((uint32_t)(a) + 0xbd5c89185f082658ULL) * ((uint32_t)(b) + 0xe5fcc163aef32782ULL) + \
(uint32_t)(c) * 0xd37e9a1ce2148403ULL)>>32 ))
#define SCIPhashFour(a, b, c, d) ((uint32_t)((((uint32_t)(a) + 0xbd5c89185f082658ULL) * ((uint32_t)(b) + 0xe5fcc163aef32782ULL) + \
((uint32_t)(c) + 0xd37e9a1ce2148403ULL) * ((uint32_t)(d) + 0x926f2d4dc4a67218ULL))>>32 ))
#define SCIPhashFive(a, b, c, d, e) ((uint32_t)((((uint32_t)(a) + 0xbd5c89185f082658ULL) * ((uint32_t)(b) + 0xe5fcc163aef32782ULL) + \
((uint32_t)(c) + 0xd37e9a1ce2148403ULL) * ((uint32_t)(d) + 0x926f2d4dc4a67218ULL) + \
(uint32_t)(e) * 0xf48d4cd331e14327ULL)>>32 ))
#define SCIPhashSix(a, b, c, d, e, f) ((uint32_t)((((uint32_t)(a) + 0xbd5c89185f082658ULL) * ((uint32_t)(b) + 0xe5fcc163aef32782ULL) + \
((uint32_t)(c) + 0xd37e9a1ce2148403ULL) * ((uint32_t)(d) + 0x926f2d4dc4a67218ULL) + \
((uint32_t)(e) + 0xf48d4cd331e14327ULL) * ((uint32_t)(f) + 0x80791a4edfc44c75ULL))>>32 ))
#define SCIPhashSeven(a, b, c, d, e, f, g) ((uint32_t)((((uint32_t)(a) + 0xbd5c89185f082658ULL) * ((uint32_t)(b) + 0xe5fcc163aef32782ULL) + \
((uint32_t)(c) + 0xd37e9a1ce2148403ULL) * ((uint32_t)(d) + 0x926f2d4dc4a67218ULL) + \
((uint32_t)(e) + 0xf48d4cd331e14327ULL) * ((uint32_t)(f) + 0x80791a4edfc44c75ULL) + \
(uint32_t)(g) * 0x7f497d9ba3bd83c0ULL)>>32 ))
/** computes a hashcode for double precision floating point values containing
* 15 significant bits, the sign and the exponent
*/
INLINE static
uint32_t SCIPrealHashCode(double x)
{
int theexp;
return (((uint32_t)(uint16_t)(int16_t)ldexp(frexp(x, &theexp), 15))<<16) | (uint32_t)(uint16_t)theexp;
}
/** creates a hash table */
SCIP_EXPORT
SCIP_RETCODE SCIPhashtableCreate(
SCIP_HASHTABLE** hashtable, /**< pointer to store the created hash table */
BMS_BLKMEM* blkmem, /**< block memory used to store hash table entries */
int tablesize, /**< size of the hash table */
SCIP_DECL_HASHGETKEY((*hashgetkey)), /**< gets the key of the given element */
SCIP_DECL_HASHKEYEQ ((*hashkeyeq)), /**< returns TRUE iff both keys are equal */
SCIP_DECL_HASHKEYVAL((*hashkeyval)), /**< returns the hash value of the key */
void* userptr /**< user pointer */
);
/** frees the hash table */
SCIP_EXPORT
void SCIPhashtableFree(
SCIP_HASHTABLE** hashtable /**< pointer to the hash table */
);
/** removes all elements of the hash table
*
* @note From a performance point of view you should not fill and clear a hash table too often since the clearing can
* be expensive. Clearing is done by looping over all buckets and removing the hash table lists one-by-one.
*
* @deprecated Please use SCIPhashtableRemoveAll()
*/
SCIP_EXPORT
SCIP_DEPRECATED
void SCIPhashtableClear(
SCIP_HASHTABLE* hashtable /**< hash table */
);
/** inserts element in hash table (multiple inserts of same element override the previous entry) */
SCIP_EXPORT
SCIP_RETCODE SCIPhashtableInsert(
SCIP_HASHTABLE* hashtable, /**< hash table */
void* element /**< element to insert into the table */
);
/** inserts element in hash table (multiple insertion of same element is checked and results in an error) */
SCIP_EXPORT
SCIP_RETCODE SCIPhashtableSafeInsert(
SCIP_HASHTABLE* hashtable, /**< hash table */
void* element /**< element to insert into the table */
);
/** retrieve element with key from hash table, returns NULL if not existing */
SCIP_EXPORT
void* SCIPhashtableRetrieve(
SCIP_HASHTABLE* hashtable, /**< hash table */
void* key /**< key to retrieve */
);
/** returns whether the given element exists in the table */
SCIP_EXPORT
SCIP_Bool SCIPhashtableExists(
SCIP_HASHTABLE* hashtable, /**< hash table */
void* element /**< element to search in the table */
);
/** removes element from the hash table, if it exists */
SCIP_EXPORT
SCIP_RETCODE SCIPhashtableRemove(
SCIP_HASHTABLE* hashtable, /**< hash table */
void* element /**< element to remove from the table */
);
/** removes all elements of the hash table */
SCIP_EXPORT
void SCIPhashtableRemoveAll(
SCIP_HASHTABLE* hashtable /**< hash table */
);
/** returns number of hash table elements */
SCIP_EXPORT
SCIP_Longint SCIPhashtableGetNElements(
SCIP_HASHTABLE* hashtable /**< hash table */
);
/** gives the number of entries in the internal arrays of a hash table */
SCIP_EXPORT
int SCIPhashtableGetNEntries(
SCIP_HASHTABLE* hashtable /**< hash table */
);
/** gives the element at the given index or NULL if entry at that index has no element */
SCIP_EXPORT
void* SCIPhashtableGetEntry(
SCIP_HASHTABLE* hashtable, /**< hash table */
int entryidx /**< index of hash table entry */
);
/** returns the load of the given hash table in percentage */
SCIP_EXPORT
SCIP_Real SCIPhashtableGetLoad(
SCIP_HASHTABLE* hashtable /**< hash table */
);
/** prints statistics about hash table usage */
SCIP_EXPORT
void SCIPhashtablePrintStatistics(
SCIP_HASHTABLE* hashtable, /**< hash table */
SCIP_MESSAGEHDLR* messagehdlr /**< message handler */
);
/**@} */
/*
* MultiHash Table
*/
/**@defgroup MultiHash Multi Hash table
* @ingroup DataStructures
* @brief hash table that resolves conflicts by queueing, thereby allowing for duplicate entries
*
*@{
*/
/** returns a reasonable hash table size (a prime number) that is at least as large as the specified value */
SCIP_EXPORT
int SCIPcalcMultihashSize(
int minsize /**< minimal size of the hash table */
);
/** creates a multihash table */
SCIP_EXPORT
SCIP_RETCODE SCIPmultihashCreate(
SCIP_MULTIHASH** multihash, /**< pointer to store the created multihash table */
BMS_BLKMEM* blkmem, /**< block memory used to store multihash table entries */
int tablesize, /**< size of the hash table */
SCIP_DECL_HASHGETKEY((*hashgetkey)), /**< gets the key of the given element */
SCIP_DECL_HASHKEYEQ ((*hashkeyeq)), /**< returns TRUE iff both keys are equal */
SCIP_DECL_HASHKEYVAL((*hashkeyval)), /**< returns the hash value of the key */
void* userptr /**< user pointer */
);
/** frees the multihash table */
SCIP_EXPORT
void SCIPmultihashFree(
SCIP_MULTIHASH** multihash /**< pointer to the multihash table */
);
/** inserts element in multihash table (multiple inserts of same element possible)
*
* @note A pointer to a multihashlist returned by SCIPmultihashRetrieveNext() might get invalid when adding an element
* to the hash table, due to dynamic resizing.
*/
SCIP_EXPORT
SCIP_RETCODE SCIPmultihashInsert(
SCIP_MULTIHASH* multihash, /**< multihash table */
void* element /**< element to insert into the table */
);
/** inserts element in multihash table (multiple insertion of same element is checked and results in an error)
*
* @note A pointer to a multihashlist returned by SCIPmultihashRetrieveNext() might get invalid when adding a new
* element to the multihash table, due to dynamic resizing.
*/
SCIP_EXPORT
SCIP_RETCODE SCIPmultihashSafeInsert(
SCIP_MULTIHASH* multihash, /**< multihash table */
void* element /**< element to insert into the table */
);
/** retrieve element with key from multihash table, returns NULL if not existing */
SCIP_EXPORT
void* SCIPmultihashRetrieve(
SCIP_MULTIHASH* multihash, /**< multihash table */
void* key /**< key to retrieve */
);
/** retrieve element with key from multihash table, returns NULL if not existing
* can be used to retrieve all entries with the same key (one-by-one)
*
* @note The returned multimultihashlist pointer might get invalid when adding a new element to the multihash table.
*/
SCIP_EXPORT
void* SCIPmultihashRetrieveNext(
SCIP_MULTIHASH* multihash, /**< multihash table */
SCIP_MULTIHASHLIST** multihashlist, /**< input: entry in hash table list from which to start searching, or NULL
* output: entry in hash table list corresponding to element after
* retrieved one, or NULL */
void* key /**< key to retrieve */
);
/** returns whether the given element exists in the multihash table */
SCIP_EXPORT
SCIP_Bool SCIPmultihashExists(
SCIP_MULTIHASH* multihash, /**< multihash table */
void* element /**< element to search in the table */
);
/** removes element from the multihash table, if it exists */
SCIP_EXPORT
SCIP_RETCODE SCIPmultihashRemove(
SCIP_MULTIHASH* multihash, /**< multihash table */
void* element /**< element to remove from the table */
);
/** removes all elements of the multihash table
*
* @note From a performance point of view you should not fill and clear a hash table too often since the clearing can
* be expensive. Clearing is done by looping over all buckets and removing the hash table lists one-by-one.
*/
SCIP_EXPORT
void SCIPmultihashRemoveAll(
SCIP_MULTIHASH* multihash /**< multihash table */
);
/** returns number of multihash table elements */
SCIP_EXPORT
SCIP_Longint SCIPmultihashGetNElements(
SCIP_MULTIHASH* multihash /**< multihash table */
);
/** returns the load of the given multihash table in percentage */
SCIP_EXPORT
SCIP_Real SCIPmultihashGetLoad(
SCIP_MULTIHASH* multihash /**< multihash table */
);
/** prints statistics about multihash table usage */
SCIP_EXPORT
void SCIPmultihashPrintStatistics(
SCIP_MULTIHASH* multihash, /**< multihash table */
SCIP_MESSAGEHDLR* messagehdlr /**< message handler */
);
/** standard hash key comparator for string keys */
SCIP_EXPORT
SCIP_DECL_HASHKEYEQ(SCIPhashKeyEqString);
/** standard hashing function for string keys */
SCIP_EXPORT
SCIP_DECL_HASHKEYVAL(SCIPhashKeyValString);
/** gets the element as the key */
SCIP_EXPORT
SCIP_DECL_HASHGETKEY(SCIPhashGetKeyStandard);
/** returns TRUE iff both keys(pointer) are equal */
SCIP_EXPORT
SCIP_DECL_HASHKEYEQ(SCIPhashKeyEqPtr);
/** returns the hash value of the key */
SCIP_EXPORT
SCIP_DECL_HASHKEYVAL(SCIPhashKeyValPtr);
/**@} */
/*
* Hash Map
*/
/**@defgroup HashMap Hash Map
* @ingroup DataStructures
* @brief hash map to store key-value pairs (called \p origin and \p image)
*
* @{
*/
/** creates a hash map mapping pointers to pointers */
SCIP_EXPORT
SCIP_RETCODE SCIPhashmapCreate(
SCIP_HASHMAP** hashmap, /**< pointer to store the created hash map */
BMS_BLKMEM* blkmem, /**< block memory used to store hash map entries */
int mapsize /**< size of the hash map */
);
/** frees the hash map */
SCIP_EXPORT
void SCIPhashmapFree(
SCIP_HASHMAP** hashmap /**< pointer to the hash map */
);
/** inserts new origin->image pair in hash map (must not be called for already existing origins!) */
SCIP_EXPORT
SCIP_RETCODE SCIPhashmapInsert(
SCIP_HASHMAP* hashmap, /**< hash map */
void* origin, /**< origin to set image for */
void* image /**< new image for origin */
);
/** inserts new origin->image pair in hash map (must not be called for already existing origins!) */
SCIP_EXPORT
SCIP_RETCODE SCIPhashmapInsertInt(
SCIP_HASHMAP* hashmap, /**< hash map */
void* origin, /**< origin to set image for */
int image /**< new image for origin */
);
/** inserts new origin->image pair in hash map (must not be called for already existing origins!) */
SCIP_EXPORT
SCIP_RETCODE SCIPhashmapInsertReal(
SCIP_HASHMAP* hashmap, /**< hash map */
void* origin, /**< origin to set image for */
SCIP_Real image /**< new image for origin */
);
/** retrieves image of given origin from the hash map, or NULL if no image exists */
SCIP_EXPORT
void* SCIPhashmapGetImage(
SCIP_HASHMAP* hashmap, /**< hash map */
void* origin /**< origin to retrieve image for */
);
/** retrieves image of given origin from the hash map, or INT_MAX if no image exists */
SCIP_EXPORT
int SCIPhashmapGetImageInt(
SCIP_HASHMAP* hashmap, /**< hash map */
void* origin /**< origin to retrieve image for */
);
/** retrieves image of given origin from the hash map, or SCIP_INVALID if no image exists */
SCIP_EXPORT
SCIP_Real SCIPhashmapGetImageReal(
SCIP_HASHMAP* hashmap, /**< hash map */
void* origin /**< origin to retrieve image for */
);
/** sets image for given origin in the hash map, either by modifying existing origin->image pair or by appending a
* new origin->image pair
*/
SCIP_EXPORT
SCIP_RETCODE SCIPhashmapSetImage(
SCIP_HASHMAP* hashmap, /**< hash map */
void* origin, /**< origin to set image for */
void* image /**< new image for origin */
);
/** sets image for given origin in the hash map, either by modifying existing origin->image pair or by appending a
* new origin->image pair
*/
SCIP_EXPORT
SCIP_RETCODE SCIPhashmapSetImageInt(
SCIP_HASHMAP* hashmap, /**< hash map */
void* origin, /**< origin to set image for */
int image /**< new image for origin */
);
/** sets image for given origin in the hash map, either by modifying existing origin->image pair or by appending a
* new origin->image pair
*/
SCIP_EXPORT
SCIP_RETCODE SCIPhashmapSetImageReal(
SCIP_HASHMAP* hashmap, /**< hash map */
void* origin, /**< origin to set image for */
SCIP_Real image /**< new image for origin */
);
/** checks whether an image to the given origin exists in the hash map */
SCIP_EXPORT
SCIP_Bool SCIPhashmapExists(
SCIP_HASHMAP* hashmap, /**< hash map */
void* origin /**< origin to search for */
);
/** removes origin->image pair from the hash map, if it exists */
SCIP_EXPORT
SCIP_RETCODE SCIPhashmapRemove(
SCIP_HASHMAP* hashmap, /**< hash map */
void* origin /**< origin to remove from the list */
);
/** prints statistics about hash map usage */
SCIP_EXPORT
void SCIPhashmapPrintStatistics(
SCIP_HASHMAP* hashmap, /**< hash map */
SCIP_MESSAGEHDLR* messagehdlr /**< message handler */
);
/** indicates whether a hash map has no entries */
SCIP_EXPORT
SCIP_Bool SCIPhashmapIsEmpty(
SCIP_HASHMAP* hashmap /**< hash map */
);
/** gives the number of elements in a hash map */
SCIP_EXPORT
int SCIPhashmapGetNElements(
SCIP_HASHMAP* hashmap /**< hash map */
);
/** gives the number of entries in the internal arrays of a hash map */
SCIP_EXPORT
int SCIPhashmapGetNEntries(
SCIP_HASHMAP* hashmap /**< hash map */
);
/** gives the hashmap entry at the given index or NULL if entry has no element */
SCIP_EXPORT
SCIP_HASHMAPENTRY* SCIPhashmapGetEntry(
SCIP_HASHMAP* hashmap, /**< hash map */
int entryidx /**< index of hash map entry */
);
/** gives the origin of the hashmap entry */
SCIP_EXPORT
void* SCIPhashmapEntryGetOrigin(
SCIP_HASHMAPENTRY* entry /**< hash map entry */
);
/** gives the image of the hashmap entry */
SCIP_EXPORT
void* SCIPhashmapEntryGetImage(
SCIP_HASHMAPENTRY* entry /**< hash map entry */
);
/** gives the image of the hashmap entry */
SCIP_EXPORT
int SCIPhashmapEntryGetImageInt(
SCIP_HASHMAPENTRY* entry /**< hash map entry */
);
/** gives the image of the hashmap entry */
SCIP_EXPORT
SCIP_Real SCIPhashmapEntryGetImageReal(
SCIP_HASHMAPENTRY* entry /**< hash map entry */
);
/** sets pointer image of a hashmap entry */
SCIP_EXPORT
void SCIPhashmapEntrySetImage(
SCIP_HASHMAPENTRY* entry, /**< hash map entry */
void* image /**< new image */
);
/** sets integer image of a hashmap entry */
SCIP_EXPORT
void SCIPhashmapEntrySetImageInt(
SCIP_HASHMAPENTRY* entry, /**< hash map entry */
int image /**< new image */
);
/** sets real image of a hashmap entry */
SCIP_EXPORT
void SCIPhashmapEntrySetImageReal(
SCIP_HASHMAPENTRY* entry, /**< hash map entry */
SCIP_Real image /**< new image */
);
/** removes all entries in a hash map. */
SCIP_EXPORT
SCIP_RETCODE SCIPhashmapRemoveAll(
SCIP_HASHMAP* hashmap /**< hash map */
);
/**@} */
/*
* Hash Set
*/
/**@defgroup HashSet Hash Set
* @ingroup DataStructures
* @brief very lightweight hash set of pointers
*
* @{
*/
/** creates a hash set of pointers */
SCIP_EXPORT
SCIP_RETCODE SCIPhashsetCreate(
SCIP_HASHSET** hashset, /**< pointer to store the created hash set */
BMS_BLKMEM* blkmem, /**< block memory used to store hash set entries */
int size /**< initial size of the hash set; it is guaranteed that the set is not
* resized if at most that many elements are inserted */
);
/** frees the hash set */
SCIP_EXPORT
void SCIPhashsetFree(
SCIP_HASHSET** hashset, /**< pointer to the hash set */
BMS_BLKMEM* blkmem /**< block memory used to store hash set entries */
);
/** inserts new element into the hash set */
SCIP_EXPORT
SCIP_RETCODE SCIPhashsetInsert(
SCIP_HASHSET* hashset, /**< hash set */
BMS_BLKMEM* blkmem, /**< block memory used to store hash set entries */
void* element /**< element to insert */
);
/** checks whether an element exists in the hash set */
SCIP_EXPORT
SCIP_Bool SCIPhashsetExists(
SCIP_HASHSET* hashset, /**< hash set */
void* element /**< element to search for */
);
/** removes an element from the hash set, if it exists */
SCIP_EXPORT
SCIP_RETCODE SCIPhashsetRemove(
SCIP_HASHSET* hashset, /**< hash set */
void* element /**< origin to remove from the list */
);
/** prints statistics about hash set usage */
SCIP_EXPORT
void SCIPhashsetPrintStatistics(
SCIP_HASHSET* hashset, /**< hash set */
SCIP_MESSAGEHDLR* messagehdlr /**< message handler */
);
/** indicates whether a hash set has no entries */
SCIP_EXPORT
SCIP_Bool SCIPhashsetIsEmpty(
SCIP_HASHSET* hashset /**< hash set */
);
/** gives the number of elements in a hash set */
SCIP_EXPORT
int SCIPhashsetGetNElements(
SCIP_HASHSET* hashset /**< hash set */
);
/** gives the number of slots of a hash set */
SCIP_EXPORT
int SCIPhashsetGetNSlots(
SCIP_HASHSET* hashset /**< hash set */
);
/** gives the array of hash set slots; contains all elements in indetermined order and may contain NULL values */
SCIP_EXPORT
void** SCIPhashsetGetSlots(
SCIP_HASHSET* hashset /**< hash set */
);
/** removes all entries in a hash set. */
SCIP_EXPORT
void SCIPhashsetRemoveAll(
SCIP_HASHSET* hashset /**< hash set */
);
#ifdef NDEBUG
/* In optimized mode, the function calls are overwritten by defines to reduce the number of function calls and
* speed up the algorithms.
*/
#define SCIPhashsetIsEmpty(hashset) ((hashset)->nelements == 0)
#define SCIPhashsetGetNElements(hashset) ((hashset)->nelements)
#define SCIPhashsetGetNSlots(hashset) (1u << (64 - (hashset)->shift))
#define SCIPhashsetGetSlots(hashset) ((hashset)->slots)
#endif
/**@} */
/*
* Activity
*/
/**@defgroup ResourceActivity Resource Activity
* @ingroup DataStructures
* @brief ressource activity data structure
*
* @{
*/
/** create a resource activity */
SCIP_EXPORT
SCIP_RETCODE SCIPactivityCreate(
SCIP_RESOURCEACTIVITY** activity, /**< pointer to store the resource activity */
SCIP_VAR* var, /**< start time variable of the activity */
int duration, /**< duration of the activity */
int demand /**< demand of the activity */
);
/** frees a resource activity */
SCIP_EXPORT
void SCIPactivityFree(
SCIP_RESOURCEACTIVITY** activity /**< pointer to the resource activity */
);
#ifndef NDEBUG
/** returns the start time variable of the resource activity */
SCIP_EXPORT
SCIP_VAR* SCIPactivityGetVar(
SCIP_RESOURCEACTIVITY* activity /**< resource activity */
);
/** returns the duration of the resource activity */
SCIP_EXPORT
int SCIPactivityGetDuration(
SCIP_RESOURCEACTIVITY* activity /**< resource activity */
);
/** returns the demand of the resource activity */
SCIP_EXPORT
int SCIPactivityGetDemand(
SCIP_RESOURCEACTIVITY* activity /**< resource activity */
);
/** returns the energy of the resource activity */
SCIP_EXPORT
int SCIPactivityGetEnergy(
SCIP_RESOURCEACTIVITY* activity /**< resource activity */
);
#else
#define SCIPactivityGetVar(activity) ((activity)->var)
#define SCIPactivityGetDuration(activity) ((activity)->duration)
#define SCIPactivityGetDemand(activity) ((activity)->demand)
#define SCIPactivityGetEnergy(activity) ((activity)->duration * (activity)->demand)
#endif
/**@} */
/*
* Resource Profile
*/
/**@defgroup ResourceProfile Resource Profile
* @ingroup DataStructures
* @brief ressource profile data structure
*
* @{
*/
/** creates resource profile */
SCIP_EXPORT
SCIP_RETCODE SCIPprofileCreate(
SCIP_PROFILE** profile, /**< pointer to store the resource profile */
int capacity /**< resource capacity */
);
/** frees given resource profile */
SCIP_EXPORT
void SCIPprofileFree(
SCIP_PROFILE** profile /**< pointer to the resource profile */
);
/** output of the given resource profile */
SCIP_EXPORT
void SCIPprofilePrint(
SCIP_PROFILE* profile, /**< resource profile to output */
SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
FILE* file /**< output file (or NULL for standard output) */
);
/** returns the capacity of the resource profile */
SCIP_EXPORT
int SCIPprofileGetCapacity(
SCIP_PROFILE* profile /**< resource profile to use */
);
/** returns the number time points of the resource profile */
SCIP_EXPORT
int SCIPprofileGetNTimepoints(
SCIP_PROFILE* profile /**< resource profile to use */
);
/** returns the time points of the resource profile */
SCIP_EXPORT
int* SCIPprofileGetTimepoints(
SCIP_PROFILE* profile /**< resource profile to use */
);
/** returns the loads of the resource profile */
SCIP_EXPORT
int* SCIPprofileGetLoads(
SCIP_PROFILE* profile /**< resource profile to use */
);
/** returns the time point for given position of the resource profile */
SCIP_EXPORT
int SCIPprofileGetTime(
SCIP_PROFILE* profile, /**< resource profile to use */
int pos /**< position */
);
/** returns the loads of the resource profile at the given position */
SCIP_EXPORT
int SCIPprofileGetLoad(
SCIP_PROFILE* profile, /**< resource profile */
int pos /**< position */
);
/** returns if the given time point exists in the resource profile and stores the position of the given time point if it
* exists; otherwise the position of the next smaller existing time point is stored
*/
SCIP_EXPORT
SCIP_Bool SCIPprofileFindLeft(
SCIP_PROFILE* profile, /**< resource profile to search */
int timepoint, /**< time point to search for */
int* pos /**< pointer to store the position */
);
/** insert a core into resource profile; if the core is non-empty the resource profile will be updated otherwise nothing
* happens
*/
SCIP_EXPORT
SCIP_RETCODE SCIPprofileInsertCore(
SCIP_PROFILE* profile, /**< resource profile to use */
int left, /**< left side of the core */
int right, /**< right side of the core */
int height, /**< height of the core */
int* pos, /**< pointer to store the first position were it gets infeasible */
SCIP_Bool* infeasible /**< pointer to store if the core does not fit due to capacity */
);
/** subtracts the height from the resource profile during core time */
SCIP_EXPORT
SCIP_RETCODE SCIPprofileDeleteCore(
SCIP_PROFILE* profile, /**< resource profile to use */
int left, /**< left side of the core */
int right, /**< right side of the core */
int height /**< height of the core */
);
/** return the earliest possible starting point within the time interval [lb,ub] for a given core (given by its height
* and duration)
*/
SCIP_EXPORT
int SCIPprofileGetEarliestFeasibleStart(
SCIP_PROFILE* profile, /**< resource profile to use */
int est, /**< earliest starting time of the given core */
int lst, /**< latest starting time of the given core */
int duration, /**< duration of the core */
int height, /**< height of the core */
SCIP_Bool* infeasible /**< pointer store if the corer cannot be inserted */
);
/** return the latest possible starting point within the time interval [lb,ub] for a given core (given by its height and
* duration)
*/
SCIP_EXPORT
int SCIPprofileGetLatestFeasibleStart(
SCIP_PROFILE* profile, /**< resource profile to use */
int lb, /**< earliest possible start point */
int ub, /**< latest possible start point */
int duration, /**< duration of the core */
int height, /**< height of the core */
SCIP_Bool* infeasible /**< pointer store if the core cannot be inserted */
);
/**@} */
/*
* Directed graph
*/
/**@addtogroup DirectedGraph
*
* @{
*/
/** resize directed graph structure */
SCIP_EXPORT
SCIP_RETCODE SCIPdigraphResize(
SCIP_DIGRAPH* digraph, /**< directed graph */
int nnodes /**< new number of nodes */
);
/** sets the sizes of the successor lists for the nodes in a directed graph and allocates memory for the lists */
SCIP_EXPORT
SCIP_RETCODE SCIPdigraphSetSizes(
SCIP_DIGRAPH* digraph, /**< directed graph */
int* sizes /**< sizes of the successor lists */
);
/** frees given directed graph structure */
SCIP_EXPORT
void SCIPdigraphFree(
SCIP_DIGRAPH** digraph /**< pointer to the directed graph */
);
/** add (directed) arc and a related data to the directed graph structure
*
* @note if the arc is already contained, it is added a second time
*/
SCIP_EXPORT
SCIP_RETCODE SCIPdigraphAddArc(
SCIP_DIGRAPH* digraph, /**< directed graph */
int startnode, /**< start node of the arc */
int endnode, /**< start node of the arc */
void* data /**< data that should be stored for the arc; or NULL */
);
/** add (directed) arc to the directed graph structure, if it is not contained, yet
*
* @note if there already exists an arc from startnode to endnode, the new arc is not added,
* even if its data is different
*/
SCIP_EXPORT
SCIP_RETCODE SCIPdigraphAddArcSafe(
SCIP_DIGRAPH* digraph, /**< directed graph */
int startnode, /**< start node of the arc */
int endnode, /**< start node of the arc */
void* data /**< data that should be stored for the arc; or NULL */
);
/** sets the number of successors to a given value */
SCIP_EXPORT
SCIP_RETCODE SCIPdigraphSetNSuccessors(
SCIP_DIGRAPH* digraph, /**< directed graph */
int node, /**< node for which the number of successors has to be changed */
int nsuccessors /**< new number of successors */
);
/** returns the number of nodes of the given digraph */
SCIP_EXPORT
int SCIPdigraphGetNNodes(
SCIP_DIGRAPH* digraph /**< directed graph */
);
/** returns the node data, or NULL if no data exist */
SCIP_EXPORT
void* SCIPdigraphGetNodeData(
SCIP_DIGRAPH* digraph, /**< directed graph */
int node /**< node for which the node data is returned */
);
/** sets the node data */
SCIP_EXPORT
void SCIPdigraphSetNodeData(
SCIP_DIGRAPH* digraph, /**< directed graph */
void* dataptr, /**< user node data pointer, or NULL */
int node /**< node for which the node data is returned */
);
/** returns the total number of arcs in the given digraph */
SCIP_EXPORT
int SCIPdigraphGetNArcs(
SCIP_DIGRAPH* digraph /**< directed graph */
);
/** returns the number of successor nodes of the given node */
SCIP_EXPORT
int SCIPdigraphGetNSuccessors(
SCIP_DIGRAPH* digraph, /**< directed graph */
int node /**< node for which the number of outgoing arcs is returned */
);
/** returns the array of indices of the successor nodes; this array must not be changed from outside */
SCIP_EXPORT
int* SCIPdigraphGetSuccessors(
SCIP_DIGRAPH* digraph, /**< directed graph */
int node /**< node for which the array of outgoing arcs is returned */
);
/** returns the array of data corresponding to the arcs originating at the given node, or NULL if no data exist; this
* array must not be changed from outside
*/
SCIP_EXPORT
void** SCIPdigraphGetSuccessorsData(
SCIP_DIGRAPH* digraph, /**< directed graph */
int node /**< node for which the data corresponding to the outgoing arcs is returned */
);
/** identifies the articulation points in a given directed graph
* uses the helper recursive function findArticulationPointsUtil
*/
SCIP_EXPORT
SCIP_RETCODE SCIPdigraphGetArticulationPoints(
SCIP_DIGRAPH* digraph, /**< directed graph */
int** articulations, /**< array to store the sorted node indices of the computed articulation points, or NULL */
int* narticulations /**< number of the computed articulation points, or NULL */
);
/** Compute undirected connected components on the given graph.
*
* @note For each arc, its reverse is added, so the graph does not need to be the directed representation of an
* undirected graph.
*/
SCIP_EXPORT
SCIP_RETCODE SCIPdigraphComputeUndirectedComponents(
SCIP_DIGRAPH* digraph, /**< directed graph */
int minsize, /**< all components with less nodes are ignored */
int* components, /**< array with as many slots as there are nodes in the directed graph
* to store for each node the component to which it belongs
* (components are numbered 0 to ncomponents - 1); or NULL, if components
* are accessed one-by-one using SCIPdigraphGetComponent() */
int* ncomponents /**< pointer to store the number of components; or NULL, if the
* number of components is accessed by SCIPdigraphGetNComponents() */
);
/** Computes all strongly connected components of an undirected connected component with Tarjan's Algorithm.
* The resulting strongly connected components are sorted topologically (starting from the end of the
* strongcomponents array).
*
* @note In general a topological sort of the strongly connected components is not unique.
*/
SCIP_EXPORT
SCIP_RETCODE SCIPdigraphComputeDirectedComponents(
SCIP_DIGRAPH* digraph, /**< directed graph */
int compidx, /**< number of the undirected connected component */
int* strongcomponents, /**< array to store the strongly connected components
* (length >= size of the component) */
int* strongcompstartidx, /**< array to store the start indices of the strongly connected
* components (length >= size of the component) */
int* nstrongcomponents /**< pointer to store the number of strongly connected
* components */
);
/** Performes an (almost) topological sort on the undirected components of the given directed graph. The undirected
* components should be computed before using SCIPdigraphComputeUndirectedComponents().
*
* @note In general a topological sort is not unique. Note, that there might be directed cycles, that are randomly
* broken, which is the reason for having only almost topologically sorted arrays.
*/
SCIP_EXPORT
SCIP_RETCODE SCIPdigraphTopoSortComponents(
SCIP_DIGRAPH* digraph /**< directed graph */
);
/** returns the number of previously computed undirected components for the given directed graph */
SCIP_EXPORT
int SCIPdigraphGetNComponents(
SCIP_DIGRAPH* digraph /**< directed graph */
);
/** Returns the previously computed undirected component of the given number for the given directed graph.
* If the components were sorted using SCIPdigraphTopoSortComponents(), the component is (almost) topologically sorted.
*/
SCIP_EXPORT
void SCIPdigraphGetComponent(
SCIP_DIGRAPH* digraph, /**< directed graph */
int compidx, /**< number of the component to return */
int** nodes, /**< pointer to store the nodes in the component; or NULL, if not needed */
int* nnodes /**< pointer to store the number of nodes in the component;
* or NULL, if not needed */
);
/** frees the component information for the given directed graph */
SCIP_EXPORT
void SCIPdigraphFreeComponents(
SCIP_DIGRAPH* digraph /**< directed graph */
);
/** output of the given directed graph via the given message handler */
SCIP_EXPORT
void SCIPdigraphPrint(
SCIP_DIGRAPH* digraph, /**< directed graph */
SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
FILE* file /**< output file (or NULL for standard output) */
);
/** prints the given directed graph structure in GML format into the given file */
SCIP_EXPORT
void SCIPdigraphPrintGml(
SCIP_DIGRAPH* digraph, /**< directed graph */
FILE* file /**< file to write to */
);
/** output of the given directed graph via the given message handler */
SCIP_EXPORT
void SCIPdigraphPrintComponents(
SCIP_DIGRAPH* digraph, /**< directed graph */
SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
FILE* file /**< output file (or NULL for standard output) */
);
/**@} */
/*
* Binary search tree
*/
/**@defgroup BinaryTree Binary Search Tree
* @ingroup DataStructures
* @brief binary search tree data structure
*@{
*/
/** creates a binary tree node with sorting value and user data */
SCIP_EXPORT
SCIP_RETCODE SCIPbtnodeCreate(
SCIP_BT* tree, /**< binary search tree */
SCIP_BTNODE** node, /**< pointer to store the created search node */
void* dataptr /**< user node data pointer, or NULL */
);
/** frees the binary node including the rooted subtree
*
* @note The user pointer (object) is not freed. If needed, it has to be done by the user.
*/
SCIP_EXPORT
void SCIPbtnodeFree(
SCIP_BT* tree, /**< binary tree */
SCIP_BTNODE** node /**< node to be freed */
);
/** returns the user data pointer stored in that node */
SCIP_EXPORT
void* SCIPbtnodeGetData(
SCIP_BTNODE* node /**< node */
);
/** returns the parent which can be NULL if the given node is the root */
SCIP_EXPORT
SCIP_BTNODE* SCIPbtnodeGetParent(
SCIP_BTNODE* node /**< node */
);
/** returns left child which can be NULL if the given node is a leaf */
SCIP_EXPORT
SCIP_BTNODE* SCIPbtnodeGetLeftchild(
SCIP_BTNODE* node /**< node */
);
/** returns right child which can be NULL if the given node is a leaf */
SCIP_EXPORT
SCIP_BTNODE* SCIPbtnodeGetRightchild(
SCIP_BTNODE* node /**< node */
);
/** returns the sibling of the node or NULL if does not exist */
SCIP_EXPORT
SCIP_BTNODE* SCIPbtnodeGetSibling(
SCIP_BTNODE* node /**< node */
);
/** returns whether the node is a root node */
SCIP_EXPORT
SCIP_Bool SCIPbtnodeIsRoot(
SCIP_BTNODE* node /**< node */
);
/** returns whether the node is a leaf */
SCIP_EXPORT
SCIP_Bool SCIPbtnodeIsLeaf(
SCIP_BTNODE* node /**< node */
);
/** returns TRUE if the given node is left child */
SCIP_EXPORT
SCIP_Bool SCIPbtnodeIsLeftchild(
SCIP_BTNODE* node /**< node */
);
/** returns TRUE if the given node is right child */
SCIP_EXPORT
SCIP_Bool SCIPbtnodeIsRightchild(
SCIP_BTNODE* node /**< node */
);
#ifdef NDEBUG
/* In optimized mode, the function calls are overwritten by defines to reduce the number of function calls and
* speed up the algorithms.
*/
#define SCIPbtnodeGetData(node) ((node)->dataptr)
#define SCIPbtnodeGetParent(node) ((node)->parent)
#define SCIPbtnodeGetLeftchild(node) ((node)->left)
#define SCIPbtnodeGetRightchild(node) ((node)->right)
#define SCIPbtnodeGetSibling(node) ((node)->parent == NULL ? NULL : \
(node)->parent->left == (node) ? (node)->parent->right : (node)->parent->left)
#define SCIPbtnodeIsRoot(node) ((node)->parent == NULL)
#define SCIPbtnodeIsLeaf(node) ((node)->left == NULL && (node)->right == NULL)
#define SCIPbtnodeIsLeftchild(node) ((node)->parent == NULL ? FALSE : (node)->parent->left == (node) ? TRUE : FALSE)
#define SCIPbtnodeIsRightchild(node) ((node)->parent == NULL ? FALSE : (node)->parent->right == (node) ? TRUE : FALSE)
#endif
/** sets the give node data
*
* @note The old user pointer is not freed.
*/
SCIP_EXPORT
void SCIPbtnodeSetData(
SCIP_BTNODE* node, /**< node */
void* dataptr /**< node user data pointer */
);
/** sets parent node
*
* @note The old parent including the rooted subtree is not delete.
*/
SCIP_EXPORT
void SCIPbtnodeSetParent(
SCIP_BTNODE* node, /**< node */
SCIP_BTNODE* parent /**< new parent node, or NULL */
);
/** sets left child
*
* @note The old left child including the rooted subtree is not delete.
*/
SCIP_EXPORT
void SCIPbtnodeSetLeftchild(
SCIP_BTNODE* node, /**< node */
SCIP_BTNODE* left /**< new left child, or NULL */
);
/** sets right child
*
* @note The old right child including the rooted subtree is not delete.
*/
SCIP_EXPORT
void SCIPbtnodeSetRightchild(
SCIP_BTNODE* node, /**< node */
SCIP_BTNODE* right /**< new right child, or NULL */
);
/** creates an binary tree */
SCIP_EXPORT
SCIP_RETCODE SCIPbtCreate(
SCIP_BT** tree, /**< pointer to store the created binary tree */
BMS_BLKMEM* blkmem /**< block memory used to create nodes */
);
/** frees binary tree
*
* @note The user pointers (object) of the search nodes are not freed. If needed, it has to be done by the user.
*/
SCIP_EXPORT
void SCIPbtFree(
SCIP_BT** tree /**< pointer to binary tree */
);
/** prints the binary tree in GML format into the given file */
SCIP_EXPORT
void SCIPbtPrintGml(
SCIP_BT* tree, /**< binary tree */
FILE* file /**< file to write to */
);
/** returns whether the binary tree is empty (has no nodes) */
SCIP_EXPORT
SCIP_Bool SCIPbtIsEmpty(
SCIP_BT * tree /**< binary tree */
);
/** returns the root node of the binary tree or NULL if the binary tree is empty */
SCIP_EXPORT
SCIP_BTNODE* SCIPbtGetRoot(
SCIP_BT* tree /**< tree to be evaluated */
);
#ifdef NDEBUG
/* In optimized mode, the function calls are overwritten by defines to reduce the number of function calls and
* speed up the algorithms.
*/
#define SCIPbtIsEmpty(tree) (tree->root == NULL)
#define SCIPbtGetRoot(tree) (tree->root)
#endif
/** sets root node
*
* @note The old root including the rooted subtree is not delete.
*/
SCIP_EXPORT
void SCIPbtSetRoot(
SCIP_BT* tree, /**< tree to be evaluated */
SCIP_BTNODE* root /**< new root, or NULL */
);
/**@} */
/**@addtogroup DisjointSet
*
* @{
*/
/*
* disjoint set data structure
*/
/** clears the disjoint set (union find) structure \p djset */
SCIP_EXPORT
void SCIPdisjointsetClear(
SCIP_DISJOINTSET* djset /**< disjoint set (union find) data structure */
);
/** finds and returns the component identifier of this \p element */
SCIP_EXPORT
int SCIPdisjointsetFind(
SCIP_DISJOINTSET* djset, /**< disjoint set (union find) data structure */
int element /**< element to be found */
);
/** merges the components containing the elements \p p and \p q */
SCIP_EXPORT
void SCIPdisjointsetUnion(
SCIP_DISJOINTSET* djset, /**< disjoint set (union find) data structure */
int p, /**< first element */
int q, /**< second element */
SCIP_Bool forcerepofp /**< force representative of p to be new representative */
);
/** returns the number of independent components in this disjoint set (union find) data structure */
SCIP_EXPORT
int SCIPdisjointsetGetComponentCount(
SCIP_DISJOINTSET* djset /**< disjoint set (union find) data structure */
);
/** returns the size (number of nodes) of this disjoint set (union find) data structure */
SCIP_EXPORT
int SCIPdisjointsetGetSize(
SCIP_DISJOINTSET* djset /**< disjoint set (union find) data structure */
);
/** @} */
/*
* Numerical methods
*/
/**@defgroup NumericalMethods Numerical Methods
* @ingroup MiscellaneousMethods
* @brief commonly used numerical methods
*
* @{
*/
/** returns the machine epsilon: the smallest number eps > 0, for which 1.0 + eps > 1.0 */
SCIP_EXPORT
SCIP_Real SCIPcalcMachineEpsilon(
void
);
/** returns the next representable value of from in the direction of to */
SCIP_EXPORT
SCIP_Real SCIPnextafter(
SCIP_Real from, /**< value from which the next representable value should be returned */
SCIP_Real to /**< direction in which the next representable value should be returned */
);
/** calculates the greatest common divisor of the two given values */
SCIP_EXPORT
SCIP_Longint SCIPcalcGreComDiv(
SCIP_Longint val1, /**< first value of greatest common devisor calculation */
SCIP_Longint val2 /**< second value of greatest common devisor calculation */
);
/** calculates the smallest common multiple of the two given values */
SCIP_EXPORT
SCIP_Longint SCIPcalcSmaComMul(
SCIP_Longint val1, /**< first value of smallest common multiple calculation */
SCIP_Longint val2 /**< second value of smallest common multiple calculation */
);
/** calculates a binomial coefficient n over m, choose m elements out of n, maximal value will be 33 over 16 (because
* the n=33 is the last line in the Pascal's triangle where each entry fits in a 4 byte value), an error occurs due to
* big numbers or an negative value m (and m < n) and -1 will be returned
*/
SCIP_EXPORT
SCIP_Longint SCIPcalcBinomCoef(
int n, /**< number of different elements */
int m /**< number to choose out of the above */
);
/** converts a real number into a (approximate) rational representation, and returns TRUE iff the conversion was
* successful
*/
SCIP_EXPORT
SCIP_Bool SCIPrealToRational(
SCIP_Real val, /**< real value r to convert into rational number */
SCIP_Real mindelta, /**< minimal allowed difference r - q of real r and rational q = n/d */
SCIP_Real maxdelta, /**< maximal allowed difference r - q of real r and rational q = n/d */
SCIP_Longint maxdnom, /**< maximal denominator allowed */
SCIP_Longint* nominator, /**< pointer to store the nominator n of the rational number */
SCIP_Longint* denominator /**< pointer to store the denominator d of the rational number */
);
/** tries to find a value, such that all given values, if scaled with this value become integral in relative allowed
* difference in between mindelta and maxdelta
*/
SCIP_EXPORT
SCIP_RETCODE SCIPcalcIntegralScalar(
SCIP_Real* vals, /**< values to scale */
int nvals, /**< number of values to scale */
SCIP_Real mindelta, /**< minimal relative allowed difference of scaled coefficient s*c and integral i */
SCIP_Real maxdelta, /**< maximal relative allowed difference of scaled coefficient s*c and integral i */
SCIP_Longint maxdnom, /**< maximal denominator allowed in rational numbers */
SCIP_Real maxscale, /**< maximal allowed scalar */
SCIP_Real* intscalar, /**< pointer to store scalar that would make the coefficients integral, or NULL */
SCIP_Bool* success /**< stores whether returned value is valid */
);
/** given a (usually very small) interval, tries to find a rational number with simple denominator (i.e. a small
* number, probably multiplied with powers of 10) out of this interval; returns TRUE iff a valid rational
* number inside the interval was found
*/
SCIP_EXPORT
SCIP_Bool SCIPfindSimpleRational(
SCIP_Real lb, /**< lower bound of the interval */
SCIP_Real ub, /**< upper bound of the interval */
SCIP_Longint maxdnom, /**< maximal denominator allowed for resulting rational number */
SCIP_Longint* nominator, /**< pointer to store the nominator n of the rational number */
SCIP_Longint* denominator /**< pointer to store the denominator d of the rational number */
);
/** given a (usually very small) interval, selects a value inside this interval; it is tried to select a rational number
* with simple denominator (i.e. a small number, probably multiplied with powers of 10);
* if no valid rational number inside the interval was found, selects the central value of the interval
*/
SCIP_EXPORT
SCIP_Real SCIPselectSimpleValue(
SCIP_Real lb, /**< lower bound of the interval */
SCIP_Real ub, /**< upper bound of the interval */
SCIP_Longint maxdnom /**< maximal denominator allowed for resulting rational number */
);
/* The C99 standard defines the function (or macro) isfinite.
* On MacOS X, isfinite is also available.
* From the BSD world, there comes a function finite.
* On SunOS, finite is also available.
* In the MS compiler world, there is a function _finite.
* As last resort, we check whether x == x does not hold, but this works only for NaN's, not for infinities!
*/
#if _XOPEN_SOURCE >= 600 || defined(_ISOC99_SOURCE) || _POSIX_C_SOURCE >= 200112L || defined(__APPLE__)
#define SCIPisFinite isfinite
#elif defined(_BSD_SOURCE) || defined(__sun)
#define SCIPisFinite finite
#elif defined(_MSC_VER)
#define SCIPisFinite _finite
#else
#define SCIPisFinite(x) ((x) == (x))
#endif
/* In debug mode, the following methods are implemented as function calls to ensure
* type validity.
*/
/** returns the relative difference: (val1-val2)/max(|val1|,|val2|,1.0) */
SCIP_EXPORT
SCIP_Real SCIPrelDiff(
SCIP_Real val1, /**< first value to be compared */
SCIP_Real val2 /**< second value to be compared */
);
#ifdef NDEBUG
/* In optimized mode, the function calls are overwritten by defines to reduce the number of function calls and
* speed up the algorithms.
*/
#define SCIPrelDiff(val1, val2) ( ((val1)-(val2))/(MAX3(1.0,REALABS(val1),REALABS(val2))) )
#endif
/** computes the gap from the primal and the dual bound */
SCIP_EXPORT
SCIP_Real SCIPcomputeGap(
SCIP_Real eps, /**< the value treated as zero */
SCIP_Real inf, /**< the value treated as infinity */
SCIP_Real primalbound, /**< the primal bound */
SCIP_Real dualbound /**< the dual bound */
);
/**@} */
/*
* Random Numbers
*/
/**@defgroup RandomNumbers Random Numbers
* @ingroup MiscellaneousMethods
* @brief structures and methods for pseudo random number generation
*
*@{
*/
/** returns a random integer between minrandval and maxrandval
*
* @deprecated Please use SCIPrandomGetInt() to request a random integer.
*/
SCIP_EXPORT
SCIP_DEPRECATED
int SCIPgetRandomInt(
int minrandval, /**< minimal value to return */
int maxrandval, /**< maximal value to return */
unsigned int* seedp /**< pointer to seed value */
);
/** returns a random integer between minrandval and maxrandval */
SCIP_EXPORT
int SCIPrandomGetInt(
SCIP_RANDNUMGEN* randgen, /**< random number generator data */
int minrandval, /**< minimal value to return */
int maxrandval /**< maximal value to return */
);
/** draws a random subset of disjoint elements from a given set of disjoint elements;
* this implementation is suited for the case that nsubelems is considerably smaller then nelems
*/
SCIP_EXPORT
SCIP_RETCODE SCIPrandomGetSubset(
SCIP_RANDNUMGEN* randgen, /**< random number generator */
void** set, /**< original set, from which elements should be drawn */
int nelems, /**< number of elements in original set */
void** subset, /**< subset in which drawn elements should be stored */
int nsubelems /**< number of elements that should be drawn and stored */
);
/** returns a random real between minrandval and maxrandval */
SCIP_EXPORT
SCIP_Real SCIPrandomGetReal(
SCIP_RANDNUMGEN* randgen, /**< random number generator data */
SCIP_Real minrandval, /**< minimal value to return */
SCIP_Real maxrandval /**< maximal value to return */
);
/** returns a random real between minrandval and maxrandval
*
* @deprecated Please use SCIPrandomGetReal() to request a random real.
*/
SCIP_EXPORT
SCIP_DEPRECATED
SCIP_Real SCIPgetRandomReal(
SCIP_Real minrandval, /**< minimal value to return */
SCIP_Real maxrandval, /**< maximal value to return */
unsigned int* seedp /**< pointer to seed value */
);
/** draws a random subset of disjoint elements from a given set of disjoint elements;
* this implementation is suited for the case that nsubelems is considerably smaller then nelems
*
* @deprecated Please use SCIPrandomGetSubset()
*/
SCIP_EXPORT
SCIP_DEPRECATED
SCIP_RETCODE SCIPgetRandomSubset(
void** set, /**< original set, from which elements should be drawn */
int nelems, /**< number of elements in original set */
void** subset, /**< subset in which drawn elements should be stored */
int nsubelems, /**< number of elements that should be drawn and stored */
unsigned int randseed /**< seed value for random generator */
);
/**@} */
/*
* Permutations / Shuffling
*/
/**@defgroup PermutationsShuffling Permutations Shuffling
* @ingroup MiscellaneousMethods
* @brief methods for shuffling arrays
*
* @{
*/
/** swaps two ints */
SCIP_EXPORT
void SCIPswapInts(
int* value1, /**< pointer to first integer */
int* value2 /**< pointer to second integer */
);
/** swaps two real values */
SCIP_EXPORT
void SCIPswapReals(
SCIP_Real* value1, /**< pointer to first real value */
SCIP_Real* value2 /**< pointer to second real value */
);
/** swaps the addresses of two pointers */
SCIP_EXPORT
void SCIPswapPointers(
void** pointer1, /**< first pointer */
void** pointer2 /**< second pointer */
);
/** randomly shuffles parts of an integer array using the Fisher-Yates algorithm
*
* @deprecated Please use SCIPrandomPermuteIntArray()
*/
SCIP_EXPORT
SCIP_DEPRECATED
void SCIPpermuteIntArray(
int* array, /**< array to be shuffled */
int begin, /**< first included index that should be subject to shuffling
* (0 for first array entry)
*/
int end, /**< first excluded index that should not be subject to shuffling
* (array size for last array entry)
*/
unsigned int* randseed /**< seed value for the random generator */
);
/** randomly shuffles parts of an integer array using the Fisher-Yates algorithm */
SCIP_EXPORT
void SCIPrandomPermuteIntArray(
SCIP_RANDNUMGEN* randgen, /**< random number generator */
int* array, /**< array to be shuffled */
int begin, /**< first included index that should be subject to shuffling
* (0 for first array entry)
*/
int end /**< first excluded index that should not be subject to shuffling
* (array size for last array entry)
*/
);
/** randomly shuffles parts of an array using the Fisher-Yates algorithm */
SCIP_EXPORT
void SCIPrandomPermuteArray(
SCIP_RANDNUMGEN* randgen, /**< random number generator */
void** array, /**< array to be shuffled */
int begin, /**< first included index that should be subject to shuffling
* (0 for first array entry)
*/
int end /**< first excluded index that should not be subject to shuffling
* (array size for last array entry)
*/
);
/** randomly shuffles parts of an array using the Fisher-Yates algorithm
*
* @deprecated Please use SCIPrandomPermuteArray()
*/
SCIP_EXPORT
SCIP_DEPRECATED
void SCIPpermuteArray(
void** array, /**< array to be shuffled */
int begin, /**< first included index that should be subject to shuffling
* (0 for first array entry)
*/
int end, /**< first excluded index that should not be subject to shuffling
* (array size for last array entry)
*/
unsigned int* randseed /**< pointer to seed value for the random generator */
);
/**@} */
/*
* Arrays
*/
/**@defgroup Arrays Arrays
* @ingroup MiscellaneousMethods
* @brief miscellaneous methods for arrays
*
* @{
*/
/** computes set intersection (duplicates removed) of two arrays that are ordered ascendingly */
SCIP_EXPORT
SCIP_RETCODE SCIPcomputeArraysIntersection(
int* array1, /**< first array (in ascending order) */
int narray1, /**< number of entries of first array */
int* array2, /**< second array (in ascending order) */
int narray2, /**< number of entries of second array */
int* intersectarray, /**< intersection of array1 and array2
* (note: it is possible to use array1 for this input argument) */
int* nintersectarray /**< pointer to store number of entries of intersection array
* (note: it is possible to use narray1 for this input argument) */
);
/** computes set difference (duplicates removed) of two arrays that are ordered ascendingly */
SCIP_EXPORT
SCIP_RETCODE SCIPcomputeArraysSetminus(
int* array1, /**< first array (in ascending order) */
int narray1, /**< number of entries of first array */
int* array2, /**< second array (in ascending order) */
int narray2, /**< number of entries of second array */
int* setminusarray, /**< array to store entries of array1 that are not an entry of array2
* (note: it is possible to use array1 for this input argument) */
int* nsetminusarray /**< pointer to store number of entries of setminus array
* (note: it is possible to use narray1 for this input argument) */
);
/**@} */
/*
* Strings
*/
/**@defgroup StringMethods String Methods
* @ingroup MiscellaneousMethods
* @brief commonly used methods for strings
*
*@{
*/
/** copies characters from 'src' to 'dest', copying is stopped when either the 'stop' character is reached or after
* 'cnt' characters have been copied, whichever comes first.
*
* @note undefined behaviuor on overlapping arrays
*/
SCIP_EXPORT
int SCIPmemccpy(
char* dest, /**< destination pointer to copy to */
const char* src, /**< source pointer to copy to */
char stop, /**< character when found stop copying */
unsigned int cnt /**< maximal number of characters to copy too */
);
/** prints an error message containing of the given string followed by a string describing the current system error;
* prefers to use the strerror_r method, which is threadsafe; on systems where this method does not exist,
* NO_STRERROR_R should be defined (see INSTALL), in this case, srerror is used which is not guaranteed to be
* threadsafe (on SUN-systems, it actually is)
*/
SCIP_EXPORT
void SCIPprintSysError(
const char* message /**< first part of the error message, e.g. the filename */
);
/** extracts tokens from strings - wrapper method for strtok_r() */
SCIP_EXPORT
char* SCIPstrtok(
char* s, /**< string to parse */
const char* delim, /**< delimiters for parsing */
char** ptrptr /**< pointer to working char pointer - must stay the same while parsing */
);
/** translates the given string into a string where symbols ", ', and spaces are escaped with a \ prefix */
SCIP_EXPORT
void SCIPescapeString(
char* t, /**< target buffer to store escaped string */
int bufsize, /**< size of buffer t */
const char* s /**< string to transform into escaped string */
);
/** safe version of snprintf */
SCIP_EXPORT
int SCIPsnprintf(
char* t, /**< target string */
int len, /**< length of the string to copy */
const char* s, /**< source string */
... /**< further parameters */
);
/** safe version of strncpy
*
* Copies string in s to t using at most @a size-1 nonzero characters (strncpy copies size characters). It always adds
* a terminating zero char. Does not pad the remaining string with zero characters (unlike strncpy). Returns the number
* of copied nonzero characters, if the length of s is at most size - 1, and returns size otherwise. Thus, the original
* string was truncated if the return value is size.
*/
SCIP_EXPORT
int SCIPstrncpy(
char* t, /**< target string */
const char* s, /**< source string */
int size /**< maximal size of t */
);
/** extract the next token as a integer value if it is one; in case no value is parsed the endptr is set to @p str
*
* @return Returns TRUE if a value could be extracted, otherwise FALSE
*/
SCIP_EXPORT
SCIP_Bool SCIPstrToIntValue(
const char* str, /**< string to search */
int* value, /**< pointer to store the parsed value */
char** endptr /**< pointer to store the final string position if successfully parsed, otherwise @p str */
);
/** extract the next token as a double value if it is one; in case a value is parsed the endptr is set to @p str
*
* @return Returns TRUE if a value could be extracted, otherwise FALSE
*/
SCIP_EXPORT
SCIP_Bool SCIPstrToRealValue(
const char* str, /**< string to search */
SCIP_Real* value, /**< pointer to store the parsed value */
char** endptr /**< pointer to store the final string position if successfully parsed, otherwise @p str */
);
/** copies the first size characters between a start and end character of str into token, if no error occured endptr
* will point to the position after the read part, otherwise it will point to @p str
*/
SCIP_EXPORT
void SCIPstrCopySection(
const char* str, /**< string to search */
char startchar, /**< character which defines the beginning */
char endchar, /**< character which defines the ending */
char* token, /**< string to store the copy */
int size, /**< size of the token char array */
char** endptr /**< pointer to store the final string position if successfully parsed, otherwise @p str */
);
/**@} */
/*
* File methods
*/
/**@defgroup FileMethods File Methods
* @ingroup MiscellaneousMethods
* @brief commonly used file methods
*
* @{
*/
/** returns, whether the given file exists */
SCIP_EXPORT
SCIP_Bool SCIPfileExists(
const char* filename /**< file name */
);
/** splits filename into path, name, and extension */
SCIP_EXPORT
void SCIPsplitFilename(
char* filename, /**< filename to split; is destroyed (but not freed) during process */
char** path, /**< pointer to store path, or NULL if not needed */
char** name, /**< pointer to store name, or NULL if not needed */
char** extension, /**< pointer to store extension, or NULL if not needed */
char** compression /**< pointer to store compression extension, or NULL if not needed */
);
/**@} */
#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 pub_misc_linear.h
* @ingroup INTERNALAPI
* @brief internal miscellaneous methods for linear constraints
* @author Jakob Witzig
*/
/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
#ifndef __SCIP_MISC_LINEAR_H__
#define __SCIP_MISC_LINEAR_H__
#include "scip/def.h"
#include "scip/type_retcode.h"
#include "scip/type_cons.h"
#include "scip/type_lp.h"
#include "scip/type_var.h"
#ifdef __cplusplus
extern "C" {
#endif
/** returns the right-hand side of an arbitrary SCIP constraint that can be represented as a single linear constraint
*
* @note The success pointer indicates if the individual contraint handler was able to return the involved values
*/
SCIP_EXPORT
SCIP_Real SCIPconsGetRhs(
SCIP* scip, /**< SCIP data structure */
SCIP_CONS* cons, /**< constraint for which right-hand side is queried */
SCIP_Bool* success /**< pointer to store whether a valid right-hand side was returned */
);
/** returns the left-hand side of an arbitrary SCIP constraint that can be represented as a single linear constraint
*
* @note The success pointer indicates if the individual contraint handler was able to return the involved values
*/
SCIP_EXPORT
SCIP_Real SCIPconsGetLhs(
SCIP* scip, /**< SCIP data structure */
SCIP_CONS* cons, /**< constraint to get left hand side for */
SCIP_Bool* success /**< pointer to store whether a valid left-hand side was returned */
);
/** returns the value array of an arbitrary SCIP constraint that can be represented as a single linear constraint
*
* @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
* SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
*
* @note The success pointer indicates if the individual contraint handler was able to return the involved values
*/
SCIP_EXPORT
SCIP_RETCODE SCIPgetConsVals(
SCIP* scip, /**< SCIP data structure */
SCIP_CONS* cons, /**< constraint for which the coefficients are wanted */
SCIP_Real* vals, /**< array to store the coefficients of the constraint */
int varssize, /**< available slots in vals array needed to check if the array is large enough */
SCIP_Bool* success /**< pointer to store whether the coefficients are successfully copied */
);
/** returns the dual farkas solution of an arbitrary SCIP constraint that can be represented as a single linear constraint
*
* @note The success pointer indicates if the individual contraint handler was able to return the dual farkas solution
*/
SCIP_EXPORT
void SCIPconsGetDualfarkas(
SCIP* scip, /**< SCIP data structure */
SCIP_CONS* cons, /**< constraint to get left hand side for */
SCIP_Real* dualfarkas, /**< pointer to store the dual farkas solution */
SCIP_Bool* success /**< pointer to store whether the dual farkas solution is successfully returned */
);
/** returns the dual solution of an arbitrary SCIP constraint that can be represented as a single linear constraint
*
* @note The success pointer indicates if the individual contraint handler was able to return the dual solution
*/
void SCIPconsGetDualsol(
SCIP* scip, /**< SCIP data structure */
SCIP_CONS* cons, /**< constraint to get left hand side for */
SCIP_Real* dualsol, /**< pointer to store the dual solution */
SCIP_Bool* success /**< pointer to store whether the dual solution is successfully returned */
);
/** returns the row of an arbitrary SCIP constraint that can be represented as a single linear constraint
* or NULL of no row is awailable
*/
SCIP_EXPORT
SCIP_ROW* SCIPconsGetRow(
SCIP* scip, /**< SCIP data structure */
SCIP_CONS* cons /**< constraint to get left hand side for */
);
/** adds the given variable to the input constraint.
* If the constraint is setppc or logicor the value is ignored. If the constraint is knapsack, then the value is
* converted to an int. A warning is passed if the SCIP_Real is not an integer.
* TODO: Allow val to be a pointer.
*/
SCIP_RETCODE SCIPconsAddCoef(
SCIP* scip, /**< SCIP data structure */
SCIP_CONS* cons, /**< constraint for which row is queried */
SCIP_VAR* var, /**< variable of the constraint entry */
SCIP_Real val /**< the coefficient of the constraint entry */
);
#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 pub_misc_nonlinear.h
* @ingroup INTERNALAPI
* @brief internal miscellaneous methods for nonlinear constraints
* @author Stephen J. Maher
*/
/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
#ifndef __SCIP_MISC_NONLINEAR_H__
#define __SCIP_MISC_NONLINEAR_H__
#include "scip/def.h"
#include "scip/type_retcode.h"
#include "scip/type_cons.h"
#include "scip/type_var.h"
#ifdef __cplusplus
extern "C" {
#endif
/** returns the right-hand side of an arbitrary SCIP constraint that can be represented as a single nonlinear constraint
*
* @note The success pointer indicates if the individual contraint handler was able to return the involved values
*/
SCIP_Real SCIPconsNonlinearGetRhs(
SCIP* scip, /**< SCIP data structure */
SCIP_CONS* cons, /**< constraint for which right-hand side is queried */
SCIP_Bool* success /**< pointer to store whether a valid right-hand side was returned */
);
/** returns the left-hand side of an arbitrary SCIP constraint that can be represented as a single nonlinear constraint
*
* @note The success pointer indicates if the individual contraint handler was able to return the involved values
*/
SCIP_Real SCIPconsNonlinearGetLhs(
SCIP* scip, /**< SCIP data structure */
SCIP_CONS* cons, /**< constraint to get left-hand side for */
SCIP_Bool* success /**< pointer to store whether a valid left-hand side was returned */
);
/** adds the given variable to the input constraint. */
SCIP_RETCODE SCIPconsNonlinearAddLinearCoef(
SCIP* scip, /**< SCIP data structure */
SCIP_CONS* cons, /**< constraint for which row is queried */
SCIP_VAR* var, /**< variable of the constraint entry */
SCIP_Real val /**< the coefficient of the constraint entry */
);
#ifdef __cplusplus
}
#endif
#endif
Source diff could not be displayed: it is too large. Options to address this: view the blob.
Source diff could not be displayed: it is too large. Options to address this: view the blob.
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* 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 pub_nlp.h
* @ingroup PUBLICCOREAPI
* @brief public methods for NLP management
* @author Thorsten Gellermann
* @author Stefan Vigerske
*/
/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
#ifndef __SCIP_PUB_NLP_H__
#define __SCIP_PUB_NLP_H__
#include <stdio.h>
#include "scip/def.h"
#include "scip/type_message.h"
#include "blockmemshell/memory.h"
#include "scip/type_set.h"
#include "scip/type_stat.h"
#include "scip/type_nlp.h"
#include "scip/type_var.h"
#include "scip/type_sol.h"
#include "nlpi/type_expr.h"
#include "nlpi/type_nlpi.h"
#ifdef __cplusplus
extern "C" {
#endif
/**@addtogroup PublicNLPMethods
*
* @{
*/
/**@addtogroup PublicExpressionTreeMethods
*
* @{
*/
/** returns variables of expression tree */
SCIP_EXPORT
SCIP_VAR** SCIPexprtreeGetVars(
SCIP_EXPRTREE* tree /**< expression tree */
);
/** stores array of variables in expression tree */
SCIP_EXPORT
SCIP_RETCODE SCIPexprtreeSetVars(
SCIP_EXPRTREE* tree, /**< expression tree */
int nvars, /**< number of variables */
SCIP_VAR** vars /**< variables */
);
/** adds variables to the expression tree variables array */
SCIP_EXPORT
SCIP_RETCODE SCIPexprtreeAddVars(
SCIP_EXPRTREE* tree, /**< expression tree */
int nvars, /**< number of variables */
SCIP_VAR** vars /**< variables */
);
/** prints an expression tree using variable names from variables array */
SCIP_EXPORT
SCIP_RETCODE SCIPexprtreePrintWithNames(
SCIP_EXPRTREE* tree, /**< expression tree */
SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
FILE* file /**< file for printing, or NULL for stdout */
);
/** searches the variables array of an expression tree for a variable and returns its position, or -1 if not found
* Note that this is an O(n) operation!
*/
SCIP_EXPORT
int SCIPexprtreeFindVar(
SCIP_EXPRTREE* tree, /**< expression tree */
SCIP_VAR* var /**< variable to search for */
);
/**@} */
/**@addtogroup PublicNLRowMethods
*
* @{
*/
/** gets constant */
SCIP_EXPORT
SCIP_Real SCIPnlrowGetConstant(
SCIP_NLROW* nlrow /**< NLP row */
);
/** gets number of variables of linear part */
SCIP_EXPORT
int SCIPnlrowGetNLinearVars(
SCIP_NLROW* nlrow /**< NLP row */
);
/** gets array with variables of linear part */
SCIP_EXPORT
SCIP_VAR** SCIPnlrowGetLinearVars(
SCIP_NLROW* nlrow /**< NLP row */
);
/** gets array with coefficients in linear part */
SCIP_EXPORT
SCIP_Real* SCIPnlrowGetLinearCoefs(
SCIP_NLROW* nlrow /**< NLP row */
);
/** gets number of quadratic variables in quadratic part */
SCIP_EXPORT
int SCIPnlrowGetNQuadVars(
SCIP_NLROW* nlrow /**< NLP row */
);
/** gets quadratic variables in quadratic part */
SCIP_EXPORT
SCIP_VAR** SCIPnlrowGetQuadVars(
SCIP_NLROW* nlrow /**< NLP row */
);
/** gives position of variable in quadvars array of row, or -1 if not found */
SCIP_EXPORT
int SCIPnlrowSearchQuadVar(
SCIP_NLROW* nlrow, /**< nonlinear row */
SCIP_VAR* var /**< variable to search for */
);
/** gets number of quadratic elements in quadratic part */
SCIP_EXPORT
int SCIPnlrowGetNQuadElems(
SCIP_NLROW* nlrow /**< NLP row */
);
/** gets quadratic elements in quadratic part */
SCIP_EXPORT
SCIP_QUADELEM* SCIPnlrowGetQuadElems(
SCIP_NLROW* nlrow /**< NLP row */
);
/** gets array with coefficients in linear part */
SCIP_EXPORT
void SCIPnlrowGetQuadData(
SCIP_NLROW* nlrow, /**< NLP row */
int* nquadvars, /**< buffer to store number of variables in quadratic term, or NULL if not of interest */
SCIP_VAR*** quadvars, /**< buffer to store pointer to array of variables in quadratic term, or NULL if not of interest */
int* nquadelems, /**< buffer to store number of entries in quadratic term, or NULL if not of interest */
SCIP_QUADELEM** quadelems /**< buffer to store pointer to array of entries in quadratic term, or NULL if not of interest */
);
/** gets expression tree */
SCIP_EXPORT
SCIP_EXPRTREE* SCIPnlrowGetExprtree(
SCIP_NLROW* nlrow /**< NLP row */
);
/** returns the left hand side of a nonlinear row */
SCIP_EXPORT
SCIP_Real SCIPnlrowGetLhs(
SCIP_NLROW* nlrow /**< NLP row */
);
/** returns the right hand side of a nonlinear row */
SCIP_EXPORT
SCIP_Real SCIPnlrowGetRhs(
SCIP_NLROW* nlrow /**< NLP row */
);
/** returns the curvature of a nonlinear row */
SCIP_EXPORT
SCIP_EXPRCURV SCIPnlrowGetCurvature(
SCIP_NLROW* nlrow /**< NLP row */
);
/** sets the curvature of a nonlinear row */
SCIP_EXPORT
void SCIPnlrowSetCurvature(
SCIP_NLROW* nlrow, /**< NLP row */
SCIP_EXPRCURV curvature /**< curvature of NLP row */
);
/** returns the name of a nonlinear row */
SCIP_EXPORT
const char* SCIPnlrowGetName(
SCIP_NLROW* nlrow /**< NLP row */
);
/** gets position of a nonlinear row in current NLP, or -1 if not in NLP */
SCIP_EXPORT
int SCIPnlrowGetNLPPos(
SCIP_NLROW* nlrow /**< NLP row */
);
/** returns TRUE iff row is member of current NLP */
SCIP_EXPORT
SCIP_Bool SCIPnlrowIsInNLP(
SCIP_NLROW* nlrow /**< NLP row */
);
/** gets the dual NLP solution of a nlrow
* for a ranged constraint, the dual value is positive if the right hand side is active and negative if the left hand side is active
*/
SCIP_EXPORT
SCIP_Real SCIPnlrowGetDualsol(
SCIP_NLROW* nlrow /**< NLP row */
);
/**@} */
/**@} */ /* PublicNLPMethods */
#ifdef __cplusplus
}
#endif
#endif /* __SCIP_PUB_NLP_H__ */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* 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 pub_nodesel.h
* @ingroup PUBLICCOREAPI
* @brief public methods for node selectors
* @author Tobias Achterberg
*/
/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
#ifndef __SCIP_PUB_NODESEL_H__
#define __SCIP_PUB_NODESEL_H__
#include "scip/def.h"
#include "scip/type_nodesel.h"
#ifdef __cplusplus
extern "C" {
#endif
/**@addtogroup PublicNodeSelectorMethods
*
* @{
*/
/** gets name of node selector */
SCIP_EXPORT
const char* SCIPnodeselGetName(
SCIP_NODESEL* nodesel /**< node selector */
);
/** gets description of node selector */
SCIP_EXPORT
const char* SCIPnodeselGetDesc(
SCIP_NODESEL* nodesel /**< node selector */
);
/** gets priority of node selector in standard mode */
SCIP_EXPORT
int SCIPnodeselGetStdPriority(
SCIP_NODESEL* nodesel /**< node selector */
);
/** gets priority of node selector in memory saving mode */
SCIP_EXPORT
int SCIPnodeselGetMemsavePriority(
SCIP_NODESEL* nodesel /**< node selector */
);
/** gets user data of node selector */
SCIP_EXPORT
SCIP_NODESELDATA* SCIPnodeselGetData(
SCIP_NODESEL* nodesel /**< node selector */
);
/** sets user data of node selector; user has to free old data in advance! */
SCIP_EXPORT
void SCIPnodeselSetData(
SCIP_NODESEL* nodesel, /**< node selector */
SCIP_NODESELDATA* nodeseldata /**< new node selector user data */
);
/** is node selector initialized? */
SCIP_EXPORT
SCIP_Bool SCIPnodeselIsInitialized(
SCIP_NODESEL* nodesel /**< node selector */
);
/** gets time in seconds used in this node selector for setting up for next stages */
SCIP_EXPORT
SCIP_Real SCIPnodeselGetSetupTime(
SCIP_NODESEL* nodesel /**< node selector */
);
/** gets time in seconds used in this node selector */
SCIP_EXPORT
SCIP_Real SCIPnodeselGetTime(
SCIP_NODESEL* nodesel /**< node selector */
);
/** @} */
#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 pub_paramset.h
* @ingroup PUBLICCOREAPI
* @brief public methods for handling parameter settings
* @author Tobias Achterberg
*/
/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
#ifndef __SCIP_PUB_PARAMSET_H__
#define __SCIP_PUB_PARAMSET_H__
#include "scip/def.h"
#include "scip/type_paramset.h"
#include "scip/type_scip.h"
#ifdef __cplusplus
extern "C" {
#endif
/** returns type of parameter */
SCIP_EXPORT
SCIP_PARAMTYPE SCIPparamGetType(
SCIP_PARAM* param /**< parameter */
);
/** returns name of parameter */
SCIP_EXPORT
const char* SCIPparamGetName(
SCIP_PARAM* param /**< parameter */
);
/** returns description of parameter */
SCIP_EXPORT
const char* SCIPparamGetDesc(
SCIP_PARAM* param /**< parameter */
);
/** returns locally defined parameter specific data */
SCIP_EXPORT
SCIP_PARAMDATA* SCIPparamGetData(
SCIP_PARAM* param /**< parameter */
);
/** returns whether parameter is advanced */
SCIP_EXPORT
SCIP_Bool SCIPparamIsAdvanced(
SCIP_PARAM* param /**< parameter */
);
/** returns whether parameter is fixed */
SCIP_EXPORT
SCIP_Bool SCIPparamIsFixed(
SCIP_PARAM* param /**< parameter */
);
/** sets fixing status of given parameter */
SCIP_EXPORT
void SCIPparamSetFixed(
SCIP_PARAM* param, /**< parameter */
SCIP_Bool fixed /**< new fixing status of the parameter */
);
/** returns value of SCIP_Bool parameter */
SCIP_EXPORT
SCIP_Bool SCIPparamGetBool(
SCIP_PARAM* param /**< parameter */
);
/** returns default value of SCIP_Bool parameter */
SCIP_EXPORT
SCIP_Bool SCIPparamGetBoolDefault(
SCIP_PARAM* param /**< parameter */
);
/** returns value of int parameter */
SCIP_EXPORT
int SCIPparamGetInt(
SCIP_PARAM* param /**< parameter */
);
/** returns minimal value of int parameter */
SCIP_EXPORT
int SCIPparamGetIntMin(
SCIP_PARAM* param /**< parameter */
);
/** returns maximal value of int parameter */
SCIP_EXPORT
int SCIPparamGetIntMax(
SCIP_PARAM* param /**< parameter */
);
/** returns default value of int parameter */
SCIP_EXPORT
int SCIPparamGetIntDefault(
SCIP_PARAM* param /**< parameter */
);
/** returns value of SCIP_Longint parameter */
SCIP_EXPORT
SCIP_Longint SCIPparamGetLongint(
SCIP_PARAM* param /**< parameter */
);
/** returns minimal value of longint parameter */
SCIP_EXPORT
SCIP_Longint SCIPparamGetLongintMin(
SCIP_PARAM* param /**< parameter */
);
/** returns maximal value of longint parameter */
SCIP_EXPORT
SCIP_Longint SCIPparamGetLongintMax(
SCIP_PARAM* param /**< parameter */
);
/** returns default value of SCIP_Longint parameter */
SCIP_EXPORT
SCIP_Longint SCIPparamGetLongintDefault(
SCIP_PARAM* param /**< parameter */
);
/** returns value of SCIP_Real parameter */
SCIP_EXPORT
SCIP_Real SCIPparamGetReal(
SCIP_PARAM* param /**< parameter */
);
/** returns minimal value of real parameter */
SCIP_EXPORT
SCIP_Real SCIPparamGetRealMin(
SCIP_PARAM* param /**< parameter */
);
/** returns maximal value of real parameter */
SCIP_EXPORT
SCIP_Real SCIPparamGetRealMax(
SCIP_PARAM* param /**< parameter */
);
/** returns default value of SCIP_Real parameter */
SCIP_EXPORT
SCIP_Real SCIPparamGetRealDefault(
SCIP_PARAM* param /**< parameter */
);
/** returns value of char parameter */
SCIP_EXPORT
char SCIPparamGetChar(
SCIP_PARAM* param /**< parameter */
);
/** returns allowed values of char parameter, or NULL if everything is allowed */
SCIP_EXPORT
char* SCIPparamGetCharAllowedValues(
SCIP_PARAM* param /**< parameter */
);
/** returns default value of char parameter */
SCIP_EXPORT
char SCIPparamGetCharDefault(
SCIP_PARAM* param /**< parameter */
);
/** returns value of string parameter */
SCIP_EXPORT
char* SCIPparamGetString(
SCIP_PARAM* param /**< parameter */
);
/** returns default value of String parameter */
SCIP_EXPORT
char* SCIPparamGetStringDefault(
SCIP_PARAM* param /**< parameter */
);
/** returns whether the parameter is on its default setting */
SCIP_EXPORT
SCIP_Bool SCIPparamIsDefault(
SCIP_PARAM* param /**< parameter */
);
#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 pub_presol.h
* @ingroup PUBLICCOREAPI
* @brief public methods for presolvers
* @author Tobias Achterberg
*/
/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
#ifndef __SCIP_PUB_PRESOL_H__
#define __SCIP_PUB_PRESOL_H__
#include "scip/def.h"
#include "scip/type_misc.h"
#include "scip/type_presol.h"
#include "scip/type_timing.h"
#ifdef __cplusplus
extern "C" {
#endif
/**@addtogroup PublicPresolverMethods
*
* @{
*/
/** compares two presolvers w. r. to their priority */
SCIP_EXPORT
SCIP_DECL_SORTPTRCOMP(SCIPpresolComp);
/** comparison method for sorting presolvers w.r.t. to their name */
SCIP_EXPORT
SCIP_DECL_SORTPTRCOMP(SCIPpresolCompName);
/** gets user data of presolver */
SCIP_EXPORT
SCIP_PRESOLDATA* SCIPpresolGetData(
SCIP_PRESOL* presol /**< presolver */
);
/** sets user data of presolver; user has to free old data in advance! */
SCIP_EXPORT
void SCIPpresolSetData(
SCIP_PRESOL* presol, /**< presolver */
SCIP_PRESOLDATA* presoldata /**< new presolver user data */
);
/** gets name of presolver */
SCIP_EXPORT
const char* SCIPpresolGetName(
SCIP_PRESOL* presol /**< presolver */
);
/** gets description of presolver */
SCIP_EXPORT
const char* SCIPpresolGetDesc(
SCIP_PRESOL* presol /**< presolver */
);
/** gets priority of presolver */
SCIP_EXPORT
int SCIPpresolGetPriority(
SCIP_PRESOL* presol /**< presolver */
);
/** gets round limit of presolver */
SCIP_EXPORT
int SCIPpresolGetMaxrounds(
SCIP_PRESOL* presol /**< presolver */
);
/** gets the timing mask of the presolver */
SCIP_EXPORT
SCIP_PRESOLTIMING SCIPpresolGetTiming(
SCIP_PRESOL* presol /**< presolver */
);
/** sets the timing mask of the presolver */
SCIP_EXPORT
void SCIPpresolSetTiming(
SCIP_PRESOL* presol, /**< presolver */
SCIP_PRESOLTIMING timing /**< timing mask of the presolver */
);
/** is presolver initialized? */
SCIP_EXPORT
SCIP_Bool SCIPpresolIsInitialized(
SCIP_PRESOL* presol /**< presolver */
);
/** gets time in seconds used in this presolver for setting up for next stages */
SCIP_EXPORT
SCIP_Real SCIPpresolGetSetupTime(
SCIP_PRESOL* presol /**< presolver */
);
/** gets time in seconds used in this presolver */
SCIP_EXPORT
SCIP_Real SCIPpresolGetTime(
SCIP_PRESOL* presol /**< presolver */
);
/** gets number of variables fixed in presolver */
SCIP_EXPORT
int SCIPpresolGetNFixedVars(
SCIP_PRESOL* presol /**< presolver */
);
/** gets number of variables aggregated in presolver */
SCIP_EXPORT
int SCIPpresolGetNAggrVars(
SCIP_PRESOL* presol /**< presolver */
);
/** gets number of variable types changed in presolver */
SCIP_EXPORT
int SCIPpresolGetNChgVarTypes(
SCIP_PRESOL* presol /**< presolver */
);
/** gets number of bounds changed in presolver */
SCIP_EXPORT
int SCIPpresolGetNChgBds(
SCIP_PRESOL* presol /**< presolver */
);
/** gets number of holes added to domains of variables in presolver */
SCIP_EXPORT
int SCIPpresolGetNAddHoles(
SCIP_PRESOL* presol /**< presolver */
);
/** gets number of constraints deleted in presolver */
SCIP_EXPORT
int SCIPpresolGetNDelConss(
SCIP_PRESOL* presol /**< presolver */
);
/** gets number of constraints added in presolver */
SCIP_EXPORT
int SCIPpresolGetNAddConss(
SCIP_PRESOL* presol /**< presolver */
);
/** gets number of constraints upgraded in presolver */
SCIP_EXPORT
int SCIPpresolGetNUpgdConss(
SCIP_PRESOL* presol /**< presolver */
);
/** gets number of coefficients changed in presolver */
SCIP_EXPORT
int SCIPpresolGetNChgCoefs(
SCIP_PRESOL* presol /**< presolver */
);
/** gets number of constraint sides changed in presolver */
SCIP_EXPORT
int SCIPpresolGetNChgSides(
SCIP_PRESOL* presol /**< presolver */
);
/** gets number of times the presolver was called and tried to find reductions */
SCIP_EXPORT
int SCIPpresolGetNCalls(
SCIP_PRESOL* presol /**< presolver */
);
/** @} */
#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 pub_pricer.h
* @ingroup PUBLICCOREAPI
* @brief public methods for variable pricers
* @author Tobias Achterberg
*/
/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
#ifndef __SCIP_PUB_PRICER_H__
#define __SCIP_PUB_PRICER_H__
#include "scip/def.h"
#include "scip/type_misc.h"
#include "scip/type_pricer.h"
#ifdef __cplusplus
extern "C" {
#endif
/**@addtogroup PublicPricerMethods
*
* @{
*/
/** compares two pricers w. r. to their priority */
SCIP_EXPORT
SCIP_DECL_SORTPTRCOMP(SCIPpricerComp);
/** comparison method for sorting pricers w.r.t. to their name */
SCIP_EXPORT
SCIP_DECL_SORTPTRCOMP(SCIPpricerCompName);
/** gets user data of variable pricer */
SCIP_EXPORT
SCIP_PRICERDATA* SCIPpricerGetData(
SCIP_PRICER* pricer /**< variable pricer */
);
/** sets user data of variable pricer; user has to free old data in advance! */
SCIP_EXPORT
void SCIPpricerSetData(
SCIP_PRICER* pricer, /**< variable pricer */
SCIP_PRICERDATA* pricerdata /**< new variable pricer user data */
);
/** gets name of variable pricer */
SCIP_EXPORT
const char* SCIPpricerGetName(
SCIP_PRICER* pricer /**< variable pricer */
);
/** gets description of variable pricer */
SCIP_EXPORT
const char* SCIPpricerGetDesc(
SCIP_PRICER* pricer /**< variable pricer */
);
/** gets priority of variable pricer */
SCIP_EXPORT
int SCIPpricerGetPriority(
SCIP_PRICER* pricer /**< variable pricer */
);
/** gets the number of times, the pricer was called and tried to find a variable with negative reduced costs */
SCIP_EXPORT
int SCIPpricerGetNCalls(
SCIP_PRICER* pricer /**< variable pricer */
);
/** gets the number of variables with negative reduced costs found by this pricer */
SCIP_EXPORT
int SCIPpricerGetNVarsFound(
SCIP_PRICER* pricer /**< variable pricer */
);
/** gets time in seconds used in this pricer for setting up for next stages */
SCIP_EXPORT
SCIP_Real SCIPpricerGetSetupTime(
SCIP_PRICER* pricer /**< variable pricer */
);
/** gets time in seconds used in this pricer */
SCIP_EXPORT
SCIP_Real SCIPpricerGetTime(
SCIP_PRICER* pricer /**< variable pricer */
);
/** returns whether the given pricer is in use in the current problem */
SCIP_EXPORT
SCIP_Bool SCIPpricerIsActive(
SCIP_PRICER* pricer /**< variable pricer */
);
/** returns whether the pricer should be delayed until no other pricer finds a new variable */
SCIP_EXPORT
SCIP_Bool SCIPpricerIsDelayed(
SCIP_PRICER* pricer /**< variable pricer */
);
/** is variable pricer initialized? */
SCIP_EXPORT
SCIP_Bool SCIPpricerIsInitialized(
SCIP_PRICER* pricer /**< variable pricer */
);
/** @} */
#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 pub_prop.h
* @ingroup PUBLICCOREAPI
* @brief public methods for propagators
* @author Tobias Achterberg
*/
/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
#ifndef __SCIP_PUB_PROP_H__
#define __SCIP_PUB_PROP_H__
#include "scip/def.h"
#include "scip/type_misc.h"
#include "scip/type_prop.h"
#ifdef __cplusplus
extern "C" {
#endif
/**@addtogroup PublicPropagatorMethods
*
* @{
*/
/** compares two propagators w. r. to their priority */
SCIP_EXPORT
SCIP_DECL_SORTPTRCOMP(SCIPpropComp);
/** compares two propagators w. r. to their presolving priority */
SCIP_EXPORT
SCIP_DECL_SORTPTRCOMP(SCIPpropCompPresol);
/** comparison method for sorting propagators w.r.t. to their name */
SCIP_EXPORT
SCIP_DECL_SORTPTRCOMP(SCIPpropCompName);
/** gets user data of propagator */
SCIP_EXPORT
SCIP_PROPDATA* SCIPpropGetData(
SCIP_PROP* prop /**< propagator */
);
/** sets user data of propagator; user has to free old data in advance! */
SCIP_EXPORT
void SCIPpropSetData(
SCIP_PROP* prop, /**< propagator */
SCIP_PROPDATA* propdata /**< new propagator user data */
);
/** gets name of propagator */
SCIP_EXPORT
const char* SCIPpropGetName(
SCIP_PROP* prop /**< propagator */
);
/** gets description of propagator */
SCIP_EXPORT
const char* SCIPpropGetDesc(
SCIP_PROP* prop /**< propagator */
);
/** gets priority of propagator */
SCIP_EXPORT
int SCIPpropGetPriority(
SCIP_PROP* prop /**< propagator */
);
/** gets presolving priority of propagator */
SCIP_EXPORT
int SCIPpropGetPresolPriority(
SCIP_PROP* prop /**< propagator */
);
/** gets frequency of propagator */
SCIP_EXPORT
int SCIPpropGetFreq(
SCIP_PROP* prop /**< propagator */
);
/** gets time in seconds used for setting up this propagator for new stages */
SCIP_EXPORT
SCIP_Real SCIPpropGetSetupTime(
SCIP_PROP* prop /**< propagator */
);
/** sets frequency of propagator */
SCIP_EXPORT
void SCIPpropSetFreq(
SCIP_PROP* prop, /**< propagator */
int freq /**< new frequency of propagator */
);
/** gets time in seconds used in this propagator */
SCIP_EXPORT
SCIP_Real SCIPpropGetTime(
SCIP_PROP* prop /**< propagator */
);
/** gets time in seconds used in this propagator during strong branching */
SCIP_EXPORT
SCIP_Real SCIPpropGetStrongBranchPropTime(
SCIP_PROP* prop /**< propagator */
);
/** gets time in seconds used in this propagator for resolve propagation */
SCIP_EXPORT
SCIP_Real SCIPpropGetRespropTime(
SCIP_PROP* prop /**< propagator */
);
/** gets time in seconds used in this propagator for presolving */
SCIP_EXPORT
SCIP_Real SCIPpropGetPresolTime(
SCIP_PROP* prop /**< propagator */
);
/** gets the total number of times, the propagator was called */
SCIP_EXPORT
SCIP_Longint SCIPpropGetNCalls(
SCIP_PROP* prop /**< propagator */
);
/** gets the total number of times, the propagator was called for resolving a propagation */
SCIP_EXPORT
SCIP_Longint SCIPpropGetNRespropCalls(
SCIP_PROP* prop /**< propagator */
);
/** gets total number of times, this propagator detected a cutoff */
SCIP_EXPORT
SCIP_Longint SCIPpropGetNCutoffs(
SCIP_PROP* prop /**< propagator */
);
/** gets total number of domain reductions found by this propagator */
SCIP_EXPORT
SCIP_Longint SCIPpropGetNDomredsFound(
SCIP_PROP* prop /**< propagator */
);
/** should propagator be delayed, if other propagators found reductions? */
SCIP_EXPORT
SCIP_Bool SCIPpropIsDelayed(
SCIP_PROP* prop /**< propagator */
);
/** was propagator delayed at the last call? */
SCIP_EXPORT
SCIP_Bool SCIPpropWasDelayed(
SCIP_PROP* prop /**< propagator */
);
/** is propagator initialized? */
SCIP_EXPORT
SCIP_Bool SCIPpropIsInitialized(
SCIP_PROP* prop /**< propagator */
);
/** gets number of variables fixed during presolving of propagator */
SCIP_EXPORT
int SCIPpropGetNFixedVars(
SCIP_PROP* prop /**< propagator */
);
/** gets number of variables aggregated during presolving of propagator */
SCIP_EXPORT
int SCIPpropGetNAggrVars(
SCIP_PROP* prop /**< propagator */
);
/** gets number of variable types changed during presolving of propagator */
SCIP_EXPORT
int SCIPpropGetNChgVarTypes(
SCIP_PROP* prop /**< propagator */
);
/** gets number of bounds changed during presolving of propagator */
SCIP_EXPORT
int SCIPpropGetNChgBds(
SCIP_PROP* prop /**< propagator */
);
/** gets number of holes added to domains of variables during presolving of propagator */
SCIP_EXPORT
int SCIPpropGetNAddHoles(
SCIP_PROP* prop /**< propagator */
);
/** gets number of constraints deleted during presolving of propagator */
SCIP_EXPORT
int SCIPpropGetNDelConss(
SCIP_PROP* prop /**< propagator */
);
/** gets number of constraints added during presolving of propagator */
SCIP_EXPORT
int SCIPpropGetNAddConss(
SCIP_PROP* prop /**< propagator */
);
/** gets number of constraints upgraded during presolving of propagator */
SCIP_EXPORT
int SCIPpropGetNUpgdConss(
SCIP_PROP* prop /**< propagator */
);
/** gets number of coefficients changed during presolving of propagator */
SCIP_EXPORT
int SCIPpropGetNChgCoefs(
SCIP_PROP* prop /**< propagator */
);
/** gets number of constraint sides changed during presolving of propagator */
SCIP_EXPORT
int SCIPpropGetNChgSides(
SCIP_PROP* prop /**< propagator */
);
/** gets number of times the propagator was called in presolving and tried to find reductions */
SCIP_EXPORT
int SCIPpropGetNPresolCalls(
SCIP_PROP* prop /**< propagator */
);
/** returns the timing mask of the propagator */
SCIP_EXPORT
SCIP_PROPTIMING SCIPpropGetTimingmask(
SCIP_PROP* prop /**< propagator */
);
/** does the propagator perform presolving? */
SCIP_EXPORT
SCIP_Bool SCIPpropDoesPresolve(
SCIP_PROP* prop /**< propagator */
);
/** returns the timing mask of the presolving method of the propagator */
SCIP_EXPORT
SCIP_PRESOLTIMING SCIPpropGetPresolTiming(
SCIP_PROP* prop /**< propagator */
);
/** sets the timing mask of the presolving method of the propagator */
SCIP_EXPORT
void SCIPpropSetPresolTiming(
SCIP_PROP* prop, /**< propagator */
SCIP_PRESOLTIMING presoltiming /** timing mask to be set */
);
/** @} */
#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 pub_reader.h
* @ingroup PUBLICCOREAPI
* @brief public methods for input file readers
* @author Tobias Achterberg
*/
/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
#ifndef __SCIP_PUB_READER_H__
#define __SCIP_PUB_READER_H__
#include "scip/def.h"
#include "scip/type_reader.h"
#ifdef __cplusplus
extern "C" {
#endif
/**@addtogroup PublicReaderMethods
*
* @{
*/
/** gets user data of reader */
SCIP_EXPORT
SCIP_READERDATA* SCIPreaderGetData(
SCIP_READER* reader /**< reader */
);
/** sets user data of reader; user has to free old data in advance! */
SCIP_EXPORT
void SCIPreaderSetData(
SCIP_READER* reader, /**< reader */
SCIP_READERDATA* readerdata /**< new reader user data */
);
/** gets name of reader */
SCIP_EXPORT
const char* SCIPreaderGetName(
SCIP_READER* reader /**< reader */
);
/** gets description of reader */
SCIP_EXPORT
const char* SCIPreaderGetDesc(
SCIP_READER* reader /**< reader */
);
/** gets file extension of reader */
SCIP_EXPORT
const char* SCIPreaderGetExtension(
SCIP_READER* reader /**< reader */
);
/** return whether the reader can read files */
SCIP_EXPORT
SCIP_Bool SCIPreaderCanRead(
SCIP_READER* reader /**< reader */
);
/** return whether the reader can write files */
SCIP_EXPORT
SCIP_Bool SCIPreaderCanWrite(
SCIP_READER* reader /**< reader */
);
/** @} */
#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 pub_relax.h
* @ingroup PUBLICCOREAPI
* @brief public methods for relaxation handlers
* @author Tobias Achterberg
*/
/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
#ifndef __SCIP_PUB_RELAX_H__
#define __SCIP_PUB_RELAX_H__
#include "scip/def.h"
#include "scip/type_misc.h"
#include "scip/type_relax.h"
#ifdef __cplusplus
extern "C" {
#endif
/**@addtogroup PublicRelaxatorMethods
*
* @{
*/
/** compares two relaxation handlers w. r. to their priority */
SCIP_EXPORT
SCIP_DECL_SORTPTRCOMP(SCIPrelaxComp);
/** comparison method for sorting relaxators w.r.t. to their name */
SCIP_EXPORT
SCIP_DECL_SORTPTRCOMP(SCIPrelaxCompName);
/** gets user data of relaxation handler */
SCIP_EXPORT
SCIP_RELAXDATA* SCIPrelaxGetData(
SCIP_RELAX* relax /**< relaxation handler */
);
/** sets user data of relaxation handler; user has to free old data in advance! */
SCIP_EXPORT
void SCIPrelaxSetData(
SCIP_RELAX* relax, /**< relaxation handler */
SCIP_RELAXDATA* relaxdata /**< new relaxation handler user data */
);
/** gets name of relaxation handler */
SCIP_EXPORT
const char* SCIPrelaxGetName(
SCIP_RELAX* relax /**< relaxation handler */
);
/** gets description of relaxation handler */
SCIP_EXPORT
const char* SCIPrelaxGetDesc(
SCIP_RELAX* relax /**< relaxation handler */
);
/** gets priority of relaxation handler */
SCIP_EXPORT
int SCIPrelaxGetPriority(
SCIP_RELAX* relax /**< relaxation handler */
);
/** gets frequency of relaxation handler */
SCIP_EXPORT
int SCIPrelaxGetFreq(
SCIP_RELAX* relax /**< relaxation handler */
);
/** gets time in seconds used in this relaxator for setting up for next stages */
SCIP_EXPORT
SCIP_Real SCIPrelaxGetSetupTime(
SCIP_RELAX* relax /**< relaxator */
);
/** gets time in seconds used in this relaxation handler */
SCIP_EXPORT
SCIP_Real SCIPrelaxGetTime(
SCIP_RELAX* relax /**< relaxation handler */
);
/** gets the total number of times the relaxation handler was called */
SCIP_EXPORT
SCIP_Longint SCIPrelaxGetNCalls(
SCIP_RELAX* relax /**< relaxation handler */
);
/** gets the total number of times the relaxation handler cut off a node */
SCIP_EXPORT
SCIP_Longint SCIPrelaxGetNCutoffs(
SCIP_RELAX* relax /**< relaxation handler */
);
/** gets the total number of times the relaxation handler improved a node's lower bound */
SCIP_EXPORT
SCIP_Longint SCIPrelaxGetNImprovedLowerbound(
SCIP_RELAX* relax /**< relaxation handler */
);
/** gets the time in seconds spent for the execution of the relaxation handler when a node's lower bound could be improved (or a cutoff was found) */
SCIP_EXPORT
SCIP_Real SCIPrelaxGetImprovedLowerboundTime(
SCIP_RELAX* relax /**< relaxation handler */
);
/** gets the total number of times the relaxation handler added constraints */
SCIP_EXPORT
SCIP_Longint SCIPrelaxGetNAddedConss(
SCIP_RELAX* relax /**< relaxation handler */
);
/** gets the total number of times the relaxation handler reduced variable domains */
SCIP_EXPORT
SCIP_Longint SCIPrelaxGetNReducedDomains(
SCIP_RELAX* relax /**< relaxation handler */
);
/** gets the total number of times the relaxation handler separated cutting planes */
SCIP_EXPORT
SCIP_Longint SCIPrelaxGetNSeparatedCuts(
SCIP_RELAX* relax /**< relaxation handler */
);
/** is relaxation handler initialized? */
SCIP_EXPORT
SCIP_Bool SCIPrelaxIsInitialized(
SCIP_RELAX* relax /**< relaxation handler */
);
/** marks the current relaxation unsolved, s.t. the relaxation handler is called again in the next solving round */
SCIP_EXPORT
void SCIPrelaxMarkUnsolved(
SCIP_RELAX* relax /**< relaxation handler */
);
/** @} */
#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 pub_reopt.h
* @ingroup PUBLICCOREAPI
* @brief public methods for reoptimization
* @author Jakob Witzig
*/
/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
#ifndef __SCIP_PUB_REOPT_H__
#define __SCIP_PUB_REOPT_H__
#include "scip/def.h"
#include "scip/type_lp.h"
#include "scip/type_reopt.h"
#include "scip/type_var.h"
#ifdef NDEBUG
#include "scip/struct_reopt.h"
#endif
#ifdef __cplusplus
extern "C" {
#endif
/*
* ReoptNode methods
*/
/** returns the number of bound changes stored in the reoptnode */
SCIP_EXPORT
int SCIPreoptnodeGetNVars(
SCIP_REOPTNODE* reoptnode /**< node of the reoptimization tree */
);
/** returns the number of bound changes at the node stored at ID id */
SCIP_EXPORT
int SCIPreoptnodeGetNConss(
SCIP_REOPTNODE* reoptnode /**< node of the reoptimization tree */
);
/** returns the number of stored bound changes based on dual information in the reopttree at ID id */
SCIP_EXPORT
int SCIPreoptnodeGetNDualBoundChgs(
SCIP_REOPTNODE* reoptnode /**< node of the reoptimization tree */
);
/** returns the number of child nodes of @p reoptnode */
SCIP_EXPORT
int SCIPreoptnodeGetNChildren(
SCIP_REOPTNODE* reoptnode /**< node of the reoptimizzation tree */
);
/* return the lower bound stored at @p ID id */
SCIP_EXPORT
SCIP_Real SCIPreoptnodeGetLowerbound(
SCIP_REOPTNODE* reoptnode /**< node of the reoptimization tree */
);
/** returns the type of the @p reoptnode */
SCIP_EXPORT
SCIP_REOPTTYPE SCIPreoptnodeGetType(
SCIP_REOPTNODE* reoptnode /**< node of the reoptimization tree */
);
/** create the constraint which splits the node stored at ID id on the basis of the stored dual information. */
SCIP_EXPORT
void SCIPreoptnodeGetSplitCons(
SCIP_REOPTNODE* reoptnode, /**< node of the reoptimization tree */
SCIP_VAR** vars, /**< array to store the variables of the constraint */
SCIP_Real* vals, /**< array to store the coefficients of the variables */
REOPT_CONSTYPE* constype, /**< type of the constraint */
int conssize, /**< size of the arrays */
int* nvars /**< pointer to store the size of the constraints */
);
/** returns all added constraints at ID id */
SCIP_EXPORT
void SCIPreoptnodeGetConss(
SCIP_REOPTNODE* reoptnode, /**< reoptimization data structure */
SCIP_VAR*** vars, /**< 2-dim array of variables */
SCIP_Real** bounds, /**< 2-dim array of bounds */
SCIP_BOUNDTYPE** boundtypes, /**< 2-dim array of boundtypes */
int mem, /**< allocated memory for constraints */
int* nconss, /**< pointer to store the number of constraints */
int* nvars /**< pointer to store the number of variables */
);
/** set the parent id */
SCIP_EXPORT
void SCIPreoptnodeSetParentID(
SCIP_REOPTNODE* reoptnode, /**< node of the reopttree */
unsigned int parentid /**< id of the parent node */
);
/*
* Reopt methods
*/
/** returns the number of global restarts */
SCIP_EXPORT
int SCIPreoptGetNRestartsGlobal(
SCIP_REOPT* reopt /**< reoptimization data */
);
/** returns the number of local restarts in the current run */
int SCIPreoptGetNRestartsLocal(
SCIP_REOPT* reopt /**< reoptimization data structure */
);
/** returns the number of local restarts over all runs */
int SCIPreoptGetNTotalRestartsLocal(
SCIP_REOPT* reopt /**< reoptimization data structure */
);
/** returns the number of iteration with the first global restarts */
SCIP_EXPORT
int SCIPreoptGetFirstRestarts(
SCIP_REOPT* reopt /**< reoptimization data structure */
);
/** returns the number of iteration with the last global restarts */
SCIP_EXPORT
int SCIPreoptGetLastRestarts(
SCIP_REOPT* reopt /**< reoptimization data structure */
);
/** returns the number of nodes providing an improving feasible LP solution in the current run */
SCIP_EXPORT
int SCIPreoptGetNFeasNodes(
SCIP_REOPT* reopt /**< reoptimization data structure */
);
/** returns the number of nodes providing an improving feasible LP solution over all runs */
SCIP_EXPORT
int SCIPreoptGetNTotalFeasNodes(
SCIP_REOPT* reopt /**< reoptimization data structure */
);
/** returns the number of nodes that exceeded the cutoff bound in the current run */
SCIP_EXPORT
int SCIPreoptGetNPrunedNodes(
SCIP_REOPT* reopt /**< reoptimization data structure */
);
/** returns the number of nodes that exceeded the cutoff bound over all runs */
SCIP_EXPORT
int SCIPreoptGetNTotalPrunedNodes(
SCIP_REOPT* reopt /**< reoptimization data structure */
);
/** returns the number of reoptimized nodes that were cut off in the current run */
SCIP_EXPORT
int SCIPreoptGetNCutoffReoptnodes(
SCIP_REOPT* reopt /*< reoptimization data structure */
);
/** returns the number of reoptimized nodes that were cut off over all runs */
SCIP_EXPORT
int SCIPreoptGetNTotalCutoffReoptnodes(
SCIP_REOPT* reopt /*< reoptimization data structure */
);
/** returns the number of stored nodes with an infeasible LP in the current run */
SCIP_EXPORT
int SCIPreoptGetNInfNodes(
SCIP_REOPT* reopt /*< reoptimization data structure */
);
/** returns the number of stored nodes with an infeasible LP over all runs */
SCIP_EXPORT
int SCIPreoptGetNTotalInfNodes(
SCIP_REOPT* reopt /*< reoptimization data structure */
);
#ifdef NDEBUG
/* In optimized mode, the function calls are overwritten by defines to reduce the number of function calls and
* speed up the algorithms.
*/
#define SCIPreoptnodeGetNVars(reoptnode) (reoptnode->nvars)
#define SCIPreoptnodeGetNConss(reoptnode) (reoptnode->nconss)
#define SCIPreoptnodeGetNDualBoundChgs(reoptnode) (reoptnode->dualconscur->nvars)
#define SCIPreoptnodeGetNChildren(reoptnode) (reoptnode->nchilds)
#define SCIPreoptnodeGetLowerbound(reoptnode) (reoptnode->lowerbound)
#define SCIPreoptnodeGetType(reoptnode) (reoptnode->reopttype)
#define SCIPreoptGetNRestartsGlobal(reopt) (reopt->nglbrestarts)
#define SCIPreoptGetNRestartsLocal(reopt) (reopt->nlocrestarts)
#define SCIPreoptGetNTotalRestartsLocal(reopt) (reopt->ntotallocrestarts)
#define SCIPreoptGetFirstRestarts(reopt) (reopt->firstrestart)
#define SCIPreoptGetLastRestarts(reopt) (reopt->lastrestart)
#define SCIPreoptGetNFeasNodes(reopt) (reopt->reopttree->nfeasnodes)
#define SCIPreoptGetNTotalFeasNodes(reopt) (reopt->reopttree->ntotalfeasnodes)
#define SCIPreoptGetNPrunedNodes(reopt) (reopt->reopttree->nprunednodes)
#define SCIPreoptGetNTotalPrunedNodes(reopt) (reopt->reopttree->ntotalprunednodes)
#define SCIPreoptGetNCutoffReoptnodes(reopt) (reopt->reopttree->ncutoffreoptnodes)
#define SCIPreoptGetNTotalCutoffReoptnodes(reopt) (reopt->reopttree->ntotalcutoffreoptnodes)
#define SCIPreoptGetNInfNodes(reopt) (reopt->reopttree->ninfsubtrees)
#define SCIPreoptGetNTotalInfNodes(reopt) (reopt->reopttree->ntotalinfnodes)
#endif
#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 pub_sepa.h
* @ingroup PUBLICCOREAPI
* @brief public methods for separators
* @author Tobias Achterberg
*/
/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
#ifndef __SCIP_PUB_SEPA_H__
#define __SCIP_PUB_SEPA_H__
#include "scip/def.h"
#include "scip/type_misc.h"
#include "scip/type_sepa.h"
#ifdef __cplusplus
extern "C" {
#endif
/*--+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
/**@addtogroup PublicSeparatorMethods
*
* @{
*/
/** compares two separators w. r. to their priority */
SCIP_EXPORT
SCIP_DECL_SORTPTRCOMP(SCIPsepaComp);
/** comparison method for sorting separators w.r.t. to their name */
SCIP_EXPORT
SCIP_DECL_SORTPTRCOMP(SCIPsepaCompName);
/** gets user data of separator */
SCIP_EXPORT
SCIP_SEPADATA* SCIPsepaGetData(
SCIP_SEPA* sepa /**< separator */
);
/** sets user data of separator; user has to free old data in advance! */
SCIP_EXPORT
void SCIPsepaSetData(
SCIP_SEPA* sepa, /**< separator */
SCIP_SEPADATA* sepadata /**< new separator user data */
);
/** gets name of separator */
SCIP_EXPORT
const char* SCIPsepaGetName(
SCIP_SEPA* sepa /**< separator */
);
/** gets description of separator */
SCIP_EXPORT
const char* SCIPsepaGetDesc(
SCIP_SEPA* sepa /**< separator */
);
/** gets priority of separator */
SCIP_EXPORT
int SCIPsepaGetPriority(
SCIP_SEPA* sepa /**< separator */
);
/** gets frequency of separator */
SCIP_EXPORT
int SCIPsepaGetFreq(
SCIP_SEPA* sepa /**< separator */
);
/** sets frequency of separator */
SCIP_EXPORT
void SCIPsepaSetFreq(
SCIP_SEPA* sepa, /**< separator */
int freq /**< new frequency of separator */
);
/** get maximal bound distance at which the separator is called */
SCIP_EXPORT
SCIP_Real SCIPsepaGetMaxbounddist(
SCIP_SEPA* sepa /**< separator */
);
/** does the separator use a secondary SCIP instance? */
SCIP_EXPORT
SCIP_Bool SCIPsepaUsesSubscip(
SCIP_SEPA* sepa /**< separator */
);
/** gets time in seconds used in this separator for setting up for next stages */
SCIP_EXPORT
SCIP_Real SCIPsepaGetSetupTime(
SCIP_SEPA* sepa /**< separator */
);
/** gets time in seconds used in this separator */
SCIP_EXPORT
SCIP_Real SCIPsepaGetTime(
SCIP_SEPA* sepa /**< separator */
);
/** gets the total number of times, the separator was called */
SCIP_EXPORT
SCIP_Longint SCIPsepaGetNCalls(
SCIP_SEPA* sepa /**< separator */
);
/** gets the number of times, the separator was called at the current node */
SCIP_EXPORT
int SCIPsepaGetNCallsAtNode(
SCIP_SEPA* sepa /**< separator */
);
/** gets total number of times, the separator detected a cutoff */
SCIP_EXPORT
SCIP_Longint SCIPsepaGetNCutoffs(
SCIP_SEPA* sepa /**< separator */
);
/** gets the total number of cutting planes found by this separator */
SCIP_EXPORT
SCIP_Longint SCIPsepaGetNCutsFound(
SCIP_SEPA* sepa /**< separator */
);
/** gets the total number of cutting planes applied to lp */
SCIP_EXPORT
SCIP_Longint SCIPsepaGetNCutsApplied(
SCIP_SEPA* sepa /**< separator */
);
/** gets the number of cutting planes found by this separator at the current node */
SCIP_EXPORT
SCIP_Longint SCIPsepaGetNCutsFoundAtNode(
SCIP_SEPA* sepa /**< separator */
);
/** gets total number of additional constraints added by this separator */
SCIP_EXPORT
SCIP_Longint SCIPsepaGetNConssFound(
SCIP_SEPA* sepa /**< separator */
);
/** gets total number of domain reductions found by this separator */
SCIP_EXPORT
SCIP_Longint SCIPsepaGetNDomredsFound(
SCIP_SEPA* sepa /**< separator */
);
/** should separator be delayed, if other separators found cuts? */
SCIP_EXPORT
SCIP_Bool SCIPsepaIsDelayed(
SCIP_SEPA* sepa /**< separator */
);
/** was separation of the LP solution delayed at the last call? */
SCIP_EXPORT
SCIP_Bool SCIPsepaWasLPDelayed(
SCIP_SEPA* sepa /**< separator */
);
/** was separation of the primal solution delayed at the last call? */
SCIP_EXPORT
SCIP_Bool SCIPsepaWasSolDelayed(
SCIP_SEPA* sepa /**< separator */
);
/** is separator initialized? */
SCIP_EXPORT
SCIP_Bool SCIPsepaIsInitialized(
SCIP_SEPA* sepa /**< separator */
);
/** @} */
#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 pub_sol.h
* @ingroup PUBLICCOREAPI
* @brief public methods for primal CIP solutions
* @author Tobias Achterberg
* @author Timo Berthold
*/
/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
#ifndef __SCIP_PUB_SOL_H__
#define __SCIP_PUB_SOL_H__
#include "scip/def.h"
#include "scip/type_sol.h"
#include "scip/type_heur.h"
#include "scip/type_relax.h"
#ifdef NDEBUG
#include "scip/struct_sol.h"
#endif
#ifdef __cplusplus
extern "C" {
#endif
/**@addtogroup PublicSolutionMethods
*
* @{
*/
/** gets origin of solution */
SCIP_EXPORT
SCIP_SOLORIGIN SCIPsolGetOrigin(
SCIP_SOL* sol /**< primal CIP solution */
);
/** returns whether the given solution is defined on original variables */
SCIP_EXPORT
SCIP_Bool SCIPsolIsOriginal(
SCIP_SOL* sol /**< primal CIP solution */
);
/** returns whether the given solution is partial */
SCIP_EXPORT
SCIP_Bool SCIPsolIsPartial(
SCIP_SOL* sol /**< primal CIP solution */
);
/** gets objective value of primal CIP solution which lives in the original problem space */
SCIP_EXPORT
SCIP_Real SCIPsolGetOrigObj(
SCIP_SOL* sol /**< primal CIP solution */
);
/** gets clock time, when this solution was found */
SCIP_EXPORT
SCIP_Real SCIPsolGetTime(
SCIP_SOL* sol /**< primal CIP solution */
);
/** gets branch and bound run number, where this solution was found */
SCIP_EXPORT
int SCIPsolGetRunnum(
SCIP_SOL* sol /**< primal CIP solution */
);
/** gets node number of the specific branch and bound run, where this solution was found */
SCIP_EXPORT
SCIP_Longint SCIPsolGetNodenum(
SCIP_SOL* sol /**< primal CIP solution */
);
/** gets node's depth, where this solution was found */
SCIP_EXPORT
int SCIPsolGetDepth(
SCIP_SOL* sol /**< primal CIP solution */
);
/** gets information if solution was found by the LP, a primal heuristic, or a custom relaxator */
SCIP_EXPORT
SCIP_SOLTYPE SCIPsolGetType(
SCIP_SOL* sol /**< primal CIP solution */
);
/** gets heuristic that found this solution, or NULL if solution has type different than SCIP_SOLTYPE_HEUR */
SCIP_EXPORT
SCIP_HEUR* SCIPsolGetHeur(
SCIP_SOL* sol /**< primal CIP solution */
);
/** gets relaxation handler that found this solution, or NULL if solution has different type than SCIP_SOLTYPE_RELAX */
SCIP_EXPORT
SCIP_RELAX* SCIPsolGetRelax(
SCIP_SOL* sol /**< primal CIP solution */
);
/** informs the solution that it now belongs to the given primal heuristic. For convenience and backwards compatibility,
* the method accepts NULL as input for \p heur, in which case the solution type is set to SCIP_SOLTYPE_LPRELAX.
*
* @note Relaxation handlers should use SCIPsolSetRelax() instead.
*/
SCIP_EXPORT
void SCIPsolSetHeur(
SCIP_SOL* sol, /**< primal CIP solution */
SCIP_HEUR* heur /**< primal heuristic that found the solution, or NULL for LP solutions */
);
/** informs the solution that it now belongs to the given relaxation handler */
SCIP_EXPORT
void SCIPsolSetRelax(
SCIP_SOL* sol, /**< primal CIP solution */
SCIP_RELAX* relax /**< relaxator that found the solution */
);
/** informs the solution that it is an LP relaxation solution */
SCIP_EXPORT
void SCIPsolSetLPRelaxation(
SCIP_SOL* sol /**< primal CIP solution */
);
/** informs the solution that it is a solution found during strong branching */
SCIP_EXPORT
void SCIPsolSetStrongbranching(
SCIP_SOL* sol /**< primal CIP solution */
);
/** informs the solution that it originates from a pseudo solution */
SCIP_EXPORT
void SCIPsolSetPseudo(
SCIP_SOL* sol /**< primal CIP solution */
);
/** returns unique index of given solution */
SCIP_EXPORT
int SCIPsolGetIndex(
SCIP_SOL* sol /**< primal CIP solution */
);
/** get maximum absolute bound violation of solution */
SCIP_EXPORT
SCIP_Real SCIPsolGetAbsBoundViolation(
SCIP_SOL* sol /**< primal CIP solution */
);
/** get maximum relative bound violation of solution */
SCIP_EXPORT
SCIP_Real SCIPsolGetRelBoundViolation(
SCIP_SOL* sol /**< primal CIP solution */
);
/** get maximum absolute integrality violation of solution */
SCIP_EXPORT
SCIP_Real SCIPsolGetAbsIntegralityViolation(
SCIP_SOL* sol /**< primal CIP solution */
);
/** get maximum absolute LP row violation of solution */
SCIP_EXPORT
SCIP_Real SCIPsolGetAbsLPRowViolation(
SCIP_SOL* sol /**< primal CIP solution */
);
/** get maximum relative LP row violation of solution */
SCIP_EXPORT
SCIP_Real SCIPsolGetRelLPRowViolation(
SCIP_SOL* sol /**< primal CIP solution */
);
/** get maximum absolute constraint violation of solution */
SCIP_EXPORT
SCIP_Real SCIPsolGetAbsConsViolation(
SCIP_SOL* sol /**< primal CIP solution */
);
/** get maximum relative constraint violation of solution */
SCIP_EXPORT
SCIP_Real SCIPsolGetRelConsViolation(
SCIP_SOL* sol /**< primal CIP solution */
);
#ifdef NDEBUG
/* In optimized mode, the function calls are overwritten by defines to reduce the number of function calls and
* speed up the algorithms.
*/
#define SCIPsolGetOrigin(sol) ((sol)->solorigin)
#define SCIPsolIsOriginal(sol) ((sol)->solorigin == SCIP_SOLORIGIN_ORIGINAL || (sol)->solorigin == SCIP_SOLORIGIN_PARTIAL)
#define SCIPsolGetOrigObj(sol) (sol)->obj
#define SCIPsolGetTime(sol) (sol)->time
#define SCIPsolGetNodenum(sol) (sol)->nodenum
#define SCIPsolGetRunnum(sol) (sol)->runnum
#define SCIPsolGetDepth(sol) (sol)->depth
#define SCIPsolGetHeur(sol) ((sol)->type == SCIP_SOLTYPE_HEUR ? (sol)->creator.heur : NULL)
#define SCIPsolGetRelax(sol) ((sol)->type == SCIP_SOLTYPE_RELAX ? (sol)->creator.relax : NULL)
#define SCIPsolGetIndex(sol) (sol)->index
#define SCIPsolGetType(sol) (sol)->type
#define SCIPsolSetLPRelaxation(sol) ((sol)->type = SCIP_SOLTYPE_LPRELAX)
#define SCIPsolSetStrongbranching(sol) ((sol)->type = SCIP_SOLTYPE_STRONGBRANCH)
#define SCIPsolSetPseudo(sol) ((sol)->type = SCIP_SOLTYPE_PSEUDO)
#endif
/** @} */
#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 pub_table.h
* @ingroup PUBLICCOREAPI
* @brief public methods for displaying statistic tables
* @author Tristan Gally
*/
/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
#ifndef __SCIP_PUB_TABLE_H__
#define __SCIP_PUB_TABLE_H__
#include "scip/def.h"
#include "scip/type_set.h"
#include "scip/type_table.h"
#ifdef __cplusplus
extern "C" {
#endif
/**@addtogroup PublicTableMethods
*
* @{
*/
/** gets user data of statistics table */
SCIP_EXPORT
SCIP_TABLEDATA* SCIPtableGetData(
SCIP_TABLE* table /**< statistics table */
);
/** sets user data of statistics table; user has to free old data in advance! */
SCIP_EXPORT
void SCIPtableSetData(
SCIP_TABLE* table, /**< statistics table */
SCIP_TABLEDATA* tabledata /**< new statistics table user data */
);
/** gets name of statistics table */
SCIP_EXPORT
const char* SCIPtableGetName(
SCIP_TABLE* table /**< statistics table */
);
/** gets description of statistics table */
SCIP_EXPORT
const char* SCIPtableGetDesc(
SCIP_TABLE* table /**< statistics table */
);
/** gets position of statistics table */
SCIP_EXPORT
int SCIPtableGetPosition(
SCIP_TABLE* table /**< statistics table */
);
/** gets earliest stage of statistics table */
SCIP_EXPORT
SCIP_STAGE SCIPtableGetEarliestStage(
SCIP_TABLE* table /**< statistics table */
);
/** is statistics table currently active? */
SCIP_EXPORT
SCIP_Bool SCIPtableIsActive(
SCIP_TABLE* table /**< statistics table */
);
/** is statistics table initialized? */
SCIP_EXPORT
SCIP_Bool SCIPtableIsInitialized(
SCIP_TABLE* table /**< statistics table */
);
/** @} */
#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 pub_tree.h
* @ingroup PUBLICCOREAPI
* @brief public methods for branch and bound tree
* @author Tobias Achterberg
*/
/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
#ifndef __SCIP_PUB_TREE_H__
#define __SCIP_PUB_TREE_H__
#include "scip/def.h"
#include "scip/type_cons.h"
#include "scip/type_lp.h"
#include "scip/type_misc.h"
#include "scip/type_reopt.h"
#include "scip/type_retcode.h"
#include "scip/type_tree.h"
#include "scip/type_var.h"
#ifdef NDEBUG
#include "scip/struct_tree.h"
#endif
#ifdef __cplusplus
extern "C" {
#endif
/*
* Node methods
*/
/**@addtogroup PublicNodeMethods
*
* @{
*/
/** node comparator for best lower bound */
SCIP_EXPORT
SCIP_DECL_SORTPTRCOMP(SCIPnodeCompLowerbound);
/** returns the set of variable branchings that were performed in the parent node to create this node */
SCIP_EXPORT
void SCIPnodeGetParentBranchings(
SCIP_NODE* node, /**< node data */
SCIP_VAR** branchvars, /**< array of variables on which the branching has been performed in the parent node */
SCIP_Real* branchbounds, /**< array of bounds which the branching in the parent node set */
SCIP_BOUNDTYPE* boundtypes, /**< array of boundtypes which the branching in the parent node set */
int* nbranchvars, /**< number of variables on which branching has been performed in the parent node
* if this is larger than the array size, arrays should be reallocated and method should be called again */
int branchvarssize /**< available slots in arrays */
);
/** returns the set of variable branchings that were performed in all ancestor nodes (nodes on the path to the root) to create this node */
SCIP_EXPORT
void SCIPnodeGetAncestorBranchings(
SCIP_NODE* node, /**< node data */
SCIP_VAR** branchvars, /**< array of variables on which the branchings has been performed in all ancestors */
SCIP_Real* branchbounds, /**< array of bounds which the branchings in all ancestors set */
SCIP_BOUNDTYPE* boundtypes, /**< array of boundtypes which the branchings in all ancestors set */
int* nbranchvars, /**< number of variables on which branchings have been performed in all ancestors
* if this is larger than the array size, arrays should be reallocated and method should be called again */
int branchvarssize /**< available slots in arrays */
);
/** returns the set of variable branchings that were performed between the given @p node and the given @p parent node. */
SCIP_EXPORT
void SCIPnodeGetAncestorBranchingsPart(
SCIP_NODE* node, /**< node data */
SCIP_NODE* parent, /**< node data */
SCIP_VAR** branchvars, /**< array of variables on which the branchings has been performed in all ancestors */
SCIP_Real* branchbounds, /**< array of bounds which the branchings in all ancestors set */
SCIP_BOUNDTYPE* boundtypes, /**< array of boundtypes which the branchings in all ancestors set */
int* nbranchvars, /**< number of variables on which branchings have been performed in all ancestors
* if this is larger than the array size, arrays should be reallocated and method should be called again */
int branchvarssize /**< available slots in arrays */
);
/** outputs the path into given file stream in GML format */
SCIP_EXPORT
SCIP_RETCODE SCIPnodePrintAncestorBranchings(
SCIP_NODE* node, /**< node data */
FILE* file /**< file to output the path */
);
/** returns the set of variable branchings that were performed in all ancestor nodes (nodes on the path to the root) to create this node
* sorted by the nodes, starting from the current node going up to the root
*/
SCIP_EXPORT
void SCIPnodeGetAncestorBranchingPath(
SCIP_NODE* node, /**< node data */
SCIP_VAR** branchvars, /**< array of variables on which the branchings has been performed in all ancestors */
SCIP_Real* branchbounds, /**< array of bounds which the branchings in all ancestors set */
SCIP_BOUNDTYPE* boundtypes, /**< array of boundtypes which the branchings in all ancestors set */
int* nbranchvars, /**< number of variables on which branchings have been performed in all ancestors
* if this is larger than the array size, arrays should be reallocated and method
* should be called again */
int branchvarssize, /**< available slots in arrays */
int* nodeswitches, /**< marks, where in the arrays the branching decisions of the next node on the path
* start; branchings performed at the parent of node always start at position 0.
* For single variable branching, nodeswitches[i] = i holds */
int* nnodes, /**< number of nodes in the nodeswitch array */
int nodeswitchsize /**< available slots in node switch array */
);
/** checks for two nodes whether they share the same root path, i.e., whether one is an ancestor of the other */
SCIP_EXPORT
SCIP_Bool SCIPnodesSharePath(
SCIP_NODE* node1, /**< node data */
SCIP_NODE* node2 /**< node data */
);
/** finds the common ancestor node of two given nodes */
SCIP_EXPORT
SCIP_NODE* SCIPnodesGetCommonAncestor(
SCIP_NODE* node1, /**< node data */
SCIP_NODE* node2 /**< node data */
);
/** gets the type of the node */
SCIP_EXPORT
SCIP_NODETYPE SCIPnodeGetType(
SCIP_NODE* node /**< node */
);
/** gets successively assigned number of the node */
SCIP_EXPORT
SCIP_Longint SCIPnodeGetNumber(
SCIP_NODE* node /**< node */
);
/** gets the depth of the node */
SCIP_EXPORT
int SCIPnodeGetDepth(
SCIP_NODE* node /**< node */
);
/** gets the lower bound of the node */
SCIP_EXPORT
SCIP_Real SCIPnodeGetLowerbound(
SCIP_NODE* node /**< node */
);
/** gets the estimated value of the best feasible solution in subtree of the node */
SCIP_EXPORT
SCIP_Real SCIPnodeGetEstimate(
SCIP_NODE* node /**< node */
);
/** gets the reoptimization type of a node */
SCIP_EXPORT
SCIP_REOPTTYPE SCIPnodeGetReopttype(
SCIP_NODE* node /**< node */
);
/** gets the unique id to identify the node during reoptimization; id is 0 if the node is the root or not part of the
* reoptimization tree
*/
SCIP_EXPORT
unsigned int SCIPnodeGetReoptID(
SCIP_NODE* node /**< node */
);
/** sets the reoptimization type of the node */
SCIP_EXPORT
void SCIPnodeSetReopttype(
SCIP_NODE* node, /**< node */
SCIP_REOPTTYPE reopttype /**< reoptimization type */
);
/** sets a unique id to identify the node during reoptimization */
SCIP_EXPORT
void SCIPnodeSetReoptID(
SCIP_NODE* node, /**< node */
unsigned int id /**< unique id */
);
/** counts the number of bound changes due to branching, constraint propagation, and propagation */
SCIP_EXPORT
void SCIPnodeGetNDomchg(
SCIP_NODE* node, /**< node */
int* nbranchings, /**< pointer to store number of branchings (or NULL if not needed) */
int* nconsprop, /**< pointer to store number of constraint propagations (or NULL if not needed) */
int* nprop /**< pointer to store number of propagations (or NULL if not needed) */
);
/** gets the domain change information of the node, i.e., the information about the differences in the
* variables domains to the parent node
*/
SCIP_EXPORT
SCIP_DOMCHG* SCIPnodeGetDomchg(
SCIP_NODE* node /**< node */
);
/** gets the parent node of a node in the branch-and-bound tree, if any */
SCIP_EXPORT
SCIP_NODE* SCIPnodeGetParent(
SCIP_NODE* node /**< node */
);
/** returns all constraints added to a given node */
SCIP_EXPORT
void SCIPnodeGetAddedConss(
SCIP_NODE* node, /**< node */
SCIP_CONS** addedconss, /**< array to store the constraints */
int* naddedconss, /**< number of added constraints */
int addedconsssize /**< size of the constraint array */
);
/** returns the number of added constraints to the given node */
SCIP_EXPORT
int SCIPnodeGetNAddedConss(
SCIP_NODE* node
);
/** returns whether node is in the path to the current node */
SCIP_EXPORT
SCIP_Bool SCIPnodeIsActive(
SCIP_NODE* node /**< node */
);
/** returns whether the node is marked to be propagated again */
SCIP_EXPORT
SCIP_Bool SCIPnodeIsPropagatedAgain(
SCIP_NODE* node /**< node data */
);
/* returns the set of changed constraints for a particular node */
SCIP_EXPORT
SCIP_CONSSETCHG* SCIPnodeGetConssetchg(
SCIP_NODE* node /**< node data */
);
#ifdef NDEBUG
/* In optimized mode, the function calls are overwritten by defines to reduce the number of function calls and
* speed up the algorithms.
*/
#define SCIPnodeGetType(node) ((SCIP_NODETYPE)(node)->nodetype)
#define SCIPnodeGetNumber(node) ((node)->number)
#define SCIPnodeGetDepth(node) ((int) (node)->depth)
#define SCIPnodeGetLowerbound(node) ((node)->lowerbound)
#define SCIPnodeGetEstimate(node) ((node)->estimate)
#define SCIPnodeGetDomchg(node) ((node)->domchg)
#define SCIPnodeGetParent(node) ((node)->parent)
#define SCIPnodeIsActive(node) ((node)->active)
#define SCIPnodeIsPropagatedAgain(node) ((node)->reprop)
#define SCIPnodeGetConssetchg(node) ((node)->conssetchg)
#endif
/** @} */
#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 pub_var.h
* @ingroup PUBLICCOREAPI
* @brief public methods for problem variables
* @author Tobias Achterberg
*/
/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
#ifndef __SCIP_PUB_VAR_H__
#define __SCIP_PUB_VAR_H__
#include "scip/def.h"
#include "scip/type_cons.h"
#include "scip/type_history.h"
#include "scip/type_implics.h"
#include "scip/type_lp.h"
#include "scip/type_misc.h"
#include "scip/type_prop.h"
#include "scip/type_result.h"
#include "scip/type_retcode.h"
#include "scip/type_scip.h"
#include "scip/type_var.h"
#ifdef NDEBUG
#include "scip/struct_var.h"
#include "scip/implics.h"
#include "scip/history.h"
#include "scip/pub_lp.h"
#endif
#ifdef __cplusplus
extern "C" {
#endif
/*
* methods for variables
*/
/**@addtogroup PublicVariableMethods
*
* @{
*/
/** gets number of locks for rounding down
*
* @note This method will always return variable locks of type model
*
* @note It is recommented to use SCIPvarGetNLocksDownType()
*/
SCIP_EXPORT
int SCIPvarGetNLocksDown(
SCIP_VAR* var /**< problem variable */
);
/** gets number of locks for rounding up
*
* @note This method will always return variable locks of type model
*
* @note It is recommented to use SCIPvarGetNLocksUpType()
*/
SCIP_EXPORT
int SCIPvarGetNLocksUp(
SCIP_VAR* var /**< problem variable */
);
/** gets number of locks for rounding up of a special type */
SCIP_EXPORT
int SCIPvarGetNLocksUpType(
SCIP_VAR* var, /**< problem variable */
SCIP_LOCKTYPE locktype /**< type of variable locks */
);
/** gets number of locks for rounding down of a special type */
SCIP_EXPORT
int SCIPvarGetNLocksDownType(
SCIP_VAR* var, /**< problem variable */
SCIP_LOCKTYPE locktype /**< type of variable locks */
);
/** is it possible, to round variable down and stay feasible?
*
* @note This method will always check w.r.t variable locks of type model
*/
SCIP_EXPORT
SCIP_Bool SCIPvarMayRoundDown(
SCIP_VAR* var /**< problem variable */
);
/** is it possible, to round variable up and stay feasible?
*
* @note This method will always check w.r.t. variable locks of type model
*/
SCIP_EXPORT
SCIP_Bool SCIPvarMayRoundUp(
SCIP_VAR* var /**< problem variable */
);
/** compares the index of two variables, only active or negated variables are allowed, if a variable
* is negated then the index of the corresponding active variable is taken, returns -1 if first is
* smaller than, and +1 if first is greater than second variable index; returns 0 if both indices
* are equal, which means both variables are equal
*/
SCIP_EXPORT
int SCIPvarCompareActiveAndNegated(
SCIP_VAR* var1, /**< first problem variable */
SCIP_VAR* var2 /**< second problem variable */
);
/** comparison method for sorting active and negated variables by non-decreasing index, active and negated
* variables are handled as the same variables
*/
SCIP_EXPORT
SCIP_DECL_SORTPTRCOMP(SCIPvarCompActiveAndNegated);
/** compares the index of two variables, returns -1 if first is smaller than, and +1 if first is greater than second
* variable index; returns 0 if both indices are equal, which means both variables are equal
*/
SCIP_EXPORT
int SCIPvarCompare(
SCIP_VAR* var1, /**< first problem variable */
SCIP_VAR* var2 /**< second problem variable */
);
/** comparison method for sorting variables by non-decreasing index */
SCIP_EXPORT
SCIP_DECL_SORTPTRCOMP(SCIPvarComp);
/** comparison method for sorting variables by non-decreasing objective coefficient */
SCIP_EXPORT
SCIP_DECL_SORTPTRCOMP(SCIPvarCompObj);
/** hash key retrieval function for variables */
SCIP_EXPORT
SCIP_DECL_HASHGETKEY(SCIPvarGetHashkey);
/** returns TRUE iff the indices of both variables are equal */
SCIP_EXPORT
SCIP_DECL_HASHKEYEQ(SCIPvarIsHashkeyEq);
/** returns the hash value of the key */
SCIP_EXPORT
SCIP_DECL_HASHKEYVAL(SCIPvarGetHashkeyVal);
/** gets corresponding active, fixed, or multi-aggregated problem variables of given variables,
* @note the content of the given array will/might change
*/
SCIP_EXPORT
void SCIPvarsGetProbvar(
SCIP_VAR** vars, /**< array of problem variables */
int nvars /**< number of variables */
);
/** gets corresponding active, fixed, or multi-aggregated problem variable of a variable */
SCIP_EXPORT
SCIP_VAR* SCIPvarGetProbvar(
SCIP_VAR* var /**< problem variable */
);
/** gets corresponding active, fixed, or multi-aggregated problem variables of binary variables and
* updates the given negation status of each variable
*/
SCIP_EXPORT
SCIP_RETCODE SCIPvarsGetProbvarBinary(
SCIP_VAR*** vars, /**< pointer to binary problem variables */
SCIP_Bool** negatedarr, /**< pointer to corresponding array to update the negation status */
int nvars /**< number of variables and values in vars and negated array */
);
/** gets corresponding active, fixed, or multi-aggregated problem variable of a binary variable and
* updates the given negation status
*/
SCIP_EXPORT
SCIP_RETCODE SCIPvarGetProbvarBinary(
SCIP_VAR** var, /**< pointer to binary problem variable */
SCIP_Bool* negated /**< pointer to update the negation status */
);
/** transforms given variable, boundtype and bound to the corresponding active, fixed, or multi-aggregated variable
* values
*/
SCIP_EXPORT
SCIP_RETCODE SCIPvarGetProbvarBound(
SCIP_VAR** var, /**< pointer to problem variable */
SCIP_Real* bound, /**< pointer to bound value to transform */
SCIP_BOUNDTYPE* boundtype /**< pointer to type of bound: lower or upper bound */
);
/** transforms given variable and domain hole to the corresponding active, fixed, or multi-aggregated variable
* values
*/
SCIP_EXPORT
SCIP_RETCODE SCIPvarGetProbvarHole(
SCIP_VAR** var, /**< pointer to problem variable */
SCIP_Real* left, /**< pointer to left bound of open interval in hole to transform */
SCIP_Real* right /**< pointer to right bound of open interval in hole to transform */
);
/** retransforms given variable, scalar and constant to the corresponding original variable, scalar
* and constant, if possible; if the retransformation is impossible, NULL is returned as variable
*/
SCIP_EXPORT
SCIP_RETCODE SCIPvarGetOrigvarSum(
SCIP_VAR** var, /**< pointer to problem variable x in sum a*x + c */
SCIP_Real* scalar, /**< pointer to scalar a in sum a*x + c */
SCIP_Real* constant /**< pointer to constant c in sum a*x + c */
);
/** returns whether the given variable is the direct counterpart of an original problem variable */
SCIP_EXPORT
SCIP_Bool SCIPvarIsTransformedOrigvar(
SCIP_VAR* var /**< problem variable */
);
/** returns the number of times, a bound of the variable was changed in given direction due to branching */
SCIP_EXPORT
SCIP_Longint SCIPvarGetNBranchings(
SCIP_VAR* var, /**< problem variable */
SCIP_BRANCHDIR dir /**< branching direction (downwards, or upwards) */
);
/** returns the number of times, a bound of the variable was changed in given direction due to branching
* in the current run
*/
SCIP_EXPORT
SCIP_Longint SCIPvarGetNBranchingsCurrentRun(
SCIP_VAR* var, /**< problem variable */
SCIP_BRANCHDIR dir /**< branching direction (downwards, or upwards) */
);
/** returns the number of inferences branching on this variable in given direction triggered */
SCIP_EXPORT
SCIP_Real SCIPvarGetInferenceSum(
SCIP_VAR* var, /**< problem variable */
SCIP_BRANCHDIR dir /**< branching direction (downwards, or upwards) */
);
/** returns the number of inferences branching on this variable in given direction triggered
* in the current run
*/
SCIP_EXPORT
SCIP_Real SCIPvarGetInferenceSumCurrentRun(
SCIP_VAR* var, /**< problem variable */
SCIP_BRANCHDIR dir /**< branching direction (downwards, or upwards) */
);
/** returns the number of cutoffs branching on this variable in given direction produced */
SCIP_EXPORT
SCIP_Real SCIPvarGetCutoffSum(
SCIP_VAR* var, /**< problem variable */
SCIP_BRANCHDIR dir /**< branching direction (downwards, or upwards) */
);
/** returns the number of cutoffs branching on this variable in given direction produced in the current run */
SCIP_EXPORT
SCIP_Real SCIPvarGetCutoffSumCurrentRun(
SCIP_VAR* var, /**< problem variable */
SCIP_BRANCHDIR dir /**< branching direction (downwards, or upwards) */
);
/** returns the average depth of bound changes in given direction due to branching on the variable */
SCIP_EXPORT
SCIP_Real SCIPvarGetAvgBranchdepth(
SCIP_VAR* var, /**< problem variable */
SCIP_BRANCHDIR dir /**< branching direction (downwards, or upwards) */
);
/** returns the average depth of bound changes in given direction due to branching on the variable
* in the current run
*/
SCIP_EXPORT
SCIP_Real SCIPvarGetAvgBranchdepthCurrentRun(
SCIP_VAR* var, /**< problem variable */
SCIP_BRANCHDIR dir /**< branching direction (downwards, or upwards) */
);
/** returns whether there is an implication x == varfixing -> y <= b or y >= b in the implication graph;
* implications that are represented as cliques in the clique table are not regarded (use SCIPvarsHaveCommonClique());
* both variables must be active, variable x must be binary
*/
SCIP_EXPORT
SCIP_Bool SCIPvarHasImplic(
SCIP_VAR* var, /**< problem variable x */
SCIP_Bool varfixing, /**< FALSE if y should be searched in implications for x == 0, TRUE for x == 1 */
SCIP_VAR* implvar, /**< variable y to search for */
SCIP_BOUNDTYPE impltype /**< type of implication y <=/>= b to search for */
);
/** returns whether there is an implication x == varfixing -> y == implvarfixing in the implication graph;
* implications that are represented as cliques in the clique table are not regarded (use SCIPvarsHaveCommonClique());
* both variables must be active binary variables
*/
SCIP_EXPORT
SCIP_Bool SCIPvarHasBinaryImplic(
SCIP_VAR* var, /**< problem variable x */
SCIP_Bool varfixing, /**< FALSE if y should be searched in implications for x == 0, TRUE for x == 1 */
SCIP_VAR* implvar, /**< variable y to search for */
SCIP_Bool implvarfixing /**< value of the implied variable to search for */
);
/** returns whether there is a clique that contains both given variable/value pairs;
* the variables must be active binary variables;
* if regardimplics is FALSE, only the cliques in the clique table are looked at;
* if regardimplics is TRUE, both the cliques and the implications of the implication graph are regarded
*/
SCIP_EXPORT
SCIP_Bool SCIPvarsHaveCommonClique(
SCIP_VAR* var1, /**< first variable */
SCIP_Bool value1, /**< value of first variable */
SCIP_VAR* var2, /**< second variable */
SCIP_Bool value2, /**< value of second variable */
SCIP_Bool regardimplics /**< should the implication graph also be searched for a clique? */
);
/** gets corresponding objective value of active, fixed, or multi-aggregated problem variable of given variable
* e.g. obj(x) = 1 this method returns for ~x the value -1
*/
SCIP_EXPORT
SCIP_RETCODE SCIPvarGetAggregatedObj(
SCIP_VAR* var, /**< problem variable */
SCIP_Real* aggrobj /**< pointer to store the aggregated objective value */
);
/** sets the initial flag of a variable; only possible for original or loose variables */
SCIP_EXPORT
SCIP_RETCODE SCIPvarSetInitial(
SCIP_VAR* var, /**< problem variable */
SCIP_Bool initial /**< initial flag */
);
/** sets the removable flag of a variable; only possible for original or loose variables */
SCIP_EXPORT
SCIP_RETCODE SCIPvarSetRemovable(
SCIP_VAR* var, /**< problem variable */
SCIP_Bool removable /**< removable flag */
);
/** returns the name of the variable
*
* @note to change the name of a variable, use SCIPchgVarName() from scip.h
*/
SCIP_EXPORT
const char* SCIPvarGetName(
SCIP_VAR* var /**< problem variable */
);
/** gets number of times, the variable is currently captured */
SCIP_EXPORT
int SCIPvarGetNUses(
SCIP_VAR* var /**< problem variable */
);
/** returns the user data of the variable */
SCIP_EXPORT
SCIP_VARDATA* SCIPvarGetData(
SCIP_VAR* var /**< problem variable */
);
/** sets the user data for the variable */
SCIP_EXPORT
void SCIPvarSetData(
SCIP_VAR* var, /**< problem variable */
SCIP_VARDATA* vardata /**< user variable data */
);
/** sets method to free user data for the original variable */
SCIP_EXPORT
void SCIPvarSetDelorigData(
SCIP_VAR* var, /**< problem variable */
SCIP_DECL_VARDELORIG ((*vardelorig)) /**< frees user data of original variable */
);
/** sets method to transform user data of the variable */
SCIP_EXPORT
void SCIPvarSetTransData(
SCIP_VAR* var, /**< problem variable */
SCIP_DECL_VARTRANS ((*vartrans)) /**< creates transformed user data by transforming original user data */
);
/** sets method to free transformed user data for the variable */
SCIP_EXPORT
void SCIPvarSetDeltransData(
SCIP_VAR* var, /**< problem variable */
SCIP_DECL_VARDELTRANS ((*vardeltrans)) /**< frees user data of transformed variable */
);
/** sets method to copy this variable into sub-SCIPs */
SCIP_EXPORT
void SCIPvarSetCopyData(
SCIP_VAR* var, /**< problem variable */
SCIP_DECL_VARCOPY ((*varcopy)) /**< copy method of the variable */
);
/** gets status of variable */
SCIP_EXPORT
SCIP_VARSTATUS SCIPvarGetStatus(
SCIP_VAR* var /**< problem variable */
);
/** returns whether the variable belongs to the original problem */
SCIP_EXPORT
SCIP_Bool SCIPvarIsOriginal(
SCIP_VAR* var /**< problem variable */
);
/** returns whether the variable belongs to the transformed problem */
SCIP_EXPORT
SCIP_Bool SCIPvarIsTransformed(
SCIP_VAR* var /**< problem variable */
);
/** returns whether the variable was created by negation of a different variable */
SCIP_EXPORT
SCIP_Bool SCIPvarIsNegated(
SCIP_VAR* var /**< problem variable */
);
/** gets type of variable */
SCIP_EXPORT
SCIP_VARTYPE SCIPvarGetType(
SCIP_VAR* var /**< problem variable */
);
/** returns TRUE if the variable is of binary type; this is the case if:
* (1) variable type is binary
* (2) variable type is integer or implicit integer and
* (i) the lazy lower bound or the global lower bound is greater than or equal to zero
* (ii) the lazy upper bound or the global upper bound is less than or equal to one
*/
SCIP_EXPORT
SCIP_Bool SCIPvarIsBinary(
SCIP_VAR* var /**< problem variable */
);
/** returns whether variable is of integral type (binary, integer, or implicit integer) */
SCIP_EXPORT
SCIP_Bool SCIPvarIsIntegral(
SCIP_VAR* var /**< problem variable */
);
/** returns whether variable's column should be present in the initial root LP */
SCIP_EXPORT
SCIP_Bool SCIPvarIsInitial(
SCIP_VAR* var /**< problem variable */
);
/** returns whether variable's column is removable from the LP (due to aging or cleanup) */
SCIP_EXPORT
SCIP_Bool SCIPvarIsRemovable(
SCIP_VAR* var /**< problem variable */
);
/** returns whether the variable was deleted from the problem */
SCIP_EXPORT
SCIP_Bool SCIPvarIsDeleted(
SCIP_VAR* var /**< problem variable */
);
/** marks the variable to be deletable, i.e., it may be deleted completely from the problem;
* method can only be called before the variable is added to the problem by SCIPaddVar() or SCIPaddPricedVar()
*/
SCIP_EXPORT
void SCIPvarMarkDeletable(
SCIP_VAR* var /**< problem variable */
);
/** marks the variable to be not deletable from the problem */
SCIP_EXPORT
void SCIPvarMarkNotDeletable(
SCIP_VAR* var
);
/** returns whether variable is allowed to be deleted completely from the problem */
SCIP_EXPORT
SCIP_Bool SCIPvarIsDeletable(
SCIP_VAR* var
);
/** marks variable to be deleted from global structures (cliques etc.) when cleaning up
*
* @note: this is not equivalent to marking the variable itself for deletion, this is done by using SCIPvarMarkDeletable()
*/
SCIP_EXPORT
void SCIPvarMarkDeleteGlobalStructures(
SCIP_VAR* var /**< problem variable */
);
/** returns whether variable is an active (neither fixed nor aggregated) variable */
SCIP_EXPORT
SCIP_Bool SCIPvarIsActive(
SCIP_VAR* var /**< problem variable */
);
/** gets unique index of variable */
SCIP_EXPORT
int SCIPvarGetIndex(
SCIP_VAR* var /**< problem variable */
);
/** gets position of variable in problem, or -1 if variable is not active */
SCIP_EXPORT
int SCIPvarGetProbindex(
SCIP_VAR* var /**< problem variable */
);
/** gets transformed variable of ORIGINAL variable */
SCIP_EXPORT
SCIP_VAR* SCIPvarGetTransVar(
SCIP_VAR* var /**< problem variable */
);
/** gets column of COLUMN variable */
SCIP_EXPORT
SCIP_COL* SCIPvarGetCol(
SCIP_VAR* var /**< problem variable */
);
/** returns whether the variable is a COLUMN variable that is member of the current LP */
SCIP_EXPORT
SCIP_Bool SCIPvarIsInLP(
SCIP_VAR* var /**< problem variable */
);
/** gets aggregation variable y of an aggregated variable x = a*y + c */
SCIP_EXPORT
SCIP_VAR* SCIPvarGetAggrVar(
SCIP_VAR* var /**< problem variable */
);
/** gets aggregation scalar a of an aggregated variable x = a*y + c */
SCIP_EXPORT
SCIP_Real SCIPvarGetAggrScalar(
SCIP_VAR* var /**< problem variable */
);
/** gets aggregation constant c of an aggregated variable x = a*y + c */
SCIP_EXPORT
SCIP_Real SCIPvarGetAggrConstant(
SCIP_VAR* var /**< problem variable */
);
/** gets number n of aggregation variables of a multi aggregated variable x = a0*y0 + ... + a(n-1)*y(n-1) + c */
SCIP_EXPORT
int SCIPvarGetMultaggrNVars(
SCIP_VAR* var /**< problem variable */
);
/** gets vector of aggregation variables y of a multi aggregated variable x = a0*y0 + ... + a(n-1)*y(n-1) + c */
SCIP_EXPORT
SCIP_VAR** SCIPvarGetMultaggrVars(
SCIP_VAR* var /**< problem variable */
);
/** gets vector of aggregation scalars a of a multi aggregated variable x = a0*y0 + ... + a(n-1)*y(n-1) + c */
SCIP_EXPORT
SCIP_Real* SCIPvarGetMultaggrScalars(
SCIP_VAR* var /**< problem variable */
);
/** gets aggregation constant c of a multi aggregated variable x = a0*y0 + ... + a(n-1)*y(n-1) + c */
SCIP_EXPORT
SCIP_Real SCIPvarGetMultaggrConstant(
SCIP_VAR* var /**< problem variable */
);
/** gets the negation of the given variable; may return NULL, if no negation is existing yet */
SCIP_EXPORT
SCIP_VAR* SCIPvarGetNegatedVar(
SCIP_VAR* var /**< negated problem variable */
);
/** gets the negation variable x of a negated variable x' = offset - x */
SCIP_EXPORT
SCIP_VAR* SCIPvarGetNegationVar(
SCIP_VAR* var /**< negated problem variable */
);
/** gets the negation offset of a negated variable x' = offset - x */
SCIP_EXPORT
SCIP_Real SCIPvarGetNegationConstant(
SCIP_VAR* var /**< negated problem variable */
);
/** gets objective function value of variable */
SCIP_EXPORT
SCIP_Real SCIPvarGetObj(
SCIP_VAR* var /**< problem variable */
);
/** gets the unchanged objective function value of variable (ignoring temproray changes performed in probing mode) */
SCIP_EXPORT
SCIP_Real SCIPvarGetUnchangedObj(
SCIP_VAR* var /**< problem variable */
);
/** gets original lower bound of original problem variable (i.e. the bound set in problem creation) */
SCIP_EXPORT
SCIP_Real SCIPvarGetLbOriginal(
SCIP_VAR* var /**< original problem variable */
);
/** gets original upper bound of original problem variable (i.e. the bound set in problem creation) */
SCIP_EXPORT
SCIP_Real SCIPvarGetUbOriginal(
SCIP_VAR* var /**< original problem variable */
);
/** gets the original hole list of an original variable */
SCIP_EXPORT
SCIP_HOLELIST* SCIPvarGetHolelistOriginal(
SCIP_VAR* var /**< problem variable */
);
/** gets global lower bound of variable */
SCIP_EXPORT
SCIP_Real SCIPvarGetLbGlobal(
SCIP_VAR* var /**< problem variable */
);
/** gets global upper bound of variable */
SCIP_EXPORT
SCIP_Real SCIPvarGetUbGlobal(
SCIP_VAR* var /**< problem variable */
);
/** gets the global hole list of an active variable */
SCIP_EXPORT
SCIP_HOLELIST* SCIPvarGetHolelistGlobal(
SCIP_VAR* var /**< problem variable */
);
/** gets best global bound of variable with respect to the objective function */
SCIP_EXPORT
SCIP_Real SCIPvarGetBestBoundGlobal(
SCIP_VAR* var /**< problem variable */
);
/** gets worst global bound of variable with respect to the objective function */
SCIP_EXPORT
SCIP_Real SCIPvarGetWorstBoundGlobal(
SCIP_VAR* var /**< problem variable */
);
/** gets current lower bound of variable */
SCIP_EXPORT
SCIP_Real SCIPvarGetLbLocal(
SCIP_VAR* var /**< problem variable */
);
/** gets current upper bound of variable */
SCIP_EXPORT
SCIP_Real SCIPvarGetUbLocal(
SCIP_VAR* var /**< problem variable */
);
/** gets the current hole list of an active variable */
SCIP_EXPORT
SCIP_HOLELIST* SCIPvarGetHolelistLocal(
SCIP_VAR* var /**< problem variable */
);
/** gets best local bound of variable with respect to the objective function */
SCIP_EXPORT
SCIP_Real SCIPvarGetBestBoundLocal(
SCIP_VAR* var /**< problem variable */
);
/** gets worst local bound of variable with respect to the objective function */
SCIP_EXPORT
SCIP_Real SCIPvarGetWorstBoundLocal(
SCIP_VAR* var /**< problem variable */
);
/** gets type (lower or upper) of best bound of variable with respect to the objective function */
SCIP_EXPORT
SCIP_BOUNDTYPE SCIPvarGetBestBoundType(
SCIP_VAR* var /**< problem variable */
);
/** gets type (lower or upper) of worst bound of variable with respect to the objective function */
SCIP_EXPORT
SCIP_BOUNDTYPE SCIPvarGetWorstBoundType(
SCIP_VAR* var /**< problem variable */
);
/** gets lazy lower bound of variable */
SCIP_EXPORT
SCIP_Real SCIPvarGetLbLazy(
SCIP_VAR* var /**< problem variable */
);
/** gets lazy upper bound of variable */
SCIP_EXPORT
SCIP_Real SCIPvarGetUbLazy(
SCIP_VAR* var /**< problem variable */
);
/** gets the branch factor of the variable; this value can be used in the branching methods to scale the score
* values of the variables; higher factor leads to a higher probability that this variable is chosen for branching
*/
SCIP_EXPORT
SCIP_Real SCIPvarGetBranchFactor(
SCIP_VAR* var /**< problem variable */
);
/** gets the branch priority of the variable; variables with higher priority should always be preferred to variables
* with lower priority
*/
SCIP_EXPORT
int SCIPvarGetBranchPriority(
SCIP_VAR* var /**< problem variable */
);
/** gets the preferred branch direction of the variable (downwards, upwards, or auto) */
SCIP_EXPORT
SCIP_BRANCHDIR SCIPvarGetBranchDirection(
SCIP_VAR* var /**< problem variable */
);
/** gets number of variable lower bounds x >= b_i*z_i + d_i of given variable x */
SCIP_EXPORT
int SCIPvarGetNVlbs(
SCIP_VAR* var /**< problem variable */
);
/** gets array with bounding variables z_i in variable lower bounds x >= b_i*z_i + d_i of given variable x;
* the variable bounds are sorted by increasing variable index of the bounding variable z_i (see SCIPvarGetIndex())
*/
SCIP_EXPORT
SCIP_VAR** SCIPvarGetVlbVars(
SCIP_VAR* var /**< problem variable */
);
/** gets array with bounding coefficients b_i in variable lower bounds x >= b_i*z_i + d_i of given variable x */
SCIP_EXPORT
SCIP_Real* SCIPvarGetVlbCoefs(
SCIP_VAR* var /**< problem variable */
);
/** gets array with bounding constants d_i in variable lower bounds x >= b_i*z_i + d_i of given variable x */
SCIP_EXPORT
SCIP_Real* SCIPvarGetVlbConstants(
SCIP_VAR* var /**< problem variable */
);
/** gets number of variable upper bounds x <= b_i*z_i + d_i of given variable x */
SCIP_EXPORT
int SCIPvarGetNVubs(
SCIP_VAR* var /**< problem variable */
);
/** gets array with bounding variables z_i in variable upper bounds x <= b_i*z_i + d_i of given variable x;
* the variable bounds are sorted by increasing variable index of the bounding variable z_i (see SCIPvarGetIndex())
*/
SCIP_EXPORT
SCIP_VAR** SCIPvarGetVubVars(
SCIP_VAR* var /**< problem variable */
);
/** gets array with bounding coefficients b_i in variable upper bounds x <= b_i*z_i + d_i of given variable x */
SCIP_EXPORT
SCIP_Real* SCIPvarGetVubCoefs(
SCIP_VAR* var /**< problem variable */
);
/** gets array with bounding constants d_i in variable upper bounds x <= b_i*z_i + d_i of given variable x */
SCIP_EXPORT
SCIP_Real* SCIPvarGetVubConstants(
SCIP_VAR* var /**< problem variable */
);
/** gets number of implications y <= b or y >= b for x == 0 or x == 1 of given active problem variable x,
* there are no implications for nonbinary variable x
*/
SCIP_EXPORT
int SCIPvarGetNImpls(
SCIP_VAR* var, /**< active problem variable */
SCIP_Bool varfixing /**< FALSE for implications for x == 0, TRUE for x == 1 */
);
/** gets array with implication variables y of implications y <= b or y >= b for x == 0 or x == 1 of given active
* problem variable x, there are no implications for nonbinary variable x;
* the implications are sorted such that implications with binary implied variables precede the ones with non-binary
* implied variables, and as a second criteria, the implied variables are sorted by increasing variable index
* (see SCIPvarGetIndex())
*/
SCIP_EXPORT
SCIP_VAR** SCIPvarGetImplVars(
SCIP_VAR* var, /**< active problem variable */
SCIP_Bool varfixing /**< FALSE for implications for x == 0, TRUE for x == 1 */
);
/** gets array with implication types of implications y <= b or y >= b for x == 0 or x == 1 of given active problem
* variable x (SCIP_BOUNDTYPE_UPPER if y <= b, SCIP_BOUNDTYPE_LOWER if y >= b),
* there are no implications for nonbinary variable x
*/
SCIP_EXPORT
SCIP_BOUNDTYPE* SCIPvarGetImplTypes(
SCIP_VAR* var, /**< active problem variable */
SCIP_Bool varfixing /**< FALSE for implications for x == 0, TRUE for x == 1 */
);
/** gets array with implication bounds b of implications y <= b or y >= b for x == 0 or x == 1 of given active problem
* variable x, there are no implications for nonbinary variable x
*/
SCIP_EXPORT
SCIP_Real* SCIPvarGetImplBounds(
SCIP_VAR* var, /**< active problem variable */
SCIP_Bool varfixing /**< FALSE for implications for x == 0, TRUE for x == 1 */
);
/** Gets array with unique ids of implications y <= b or y >= b for x == 0 or x == 1 of given active problem variable x,
* there are no implications for nonbinary variable x.
* If an implication is a shortcut, i.e., it was added as part of the transitive closure of another implication,
* its id is negative, otherwise it is nonnegative.
*/
SCIP_EXPORT
int* SCIPvarGetImplIds(
SCIP_VAR* var, /**< active problem variable */
SCIP_Bool varfixing /**< FALSE for implications for x == 0, TRUE for x == 1 */
);
/** gets number of cliques, the active variable is contained in */
SCIP_EXPORT
int SCIPvarGetNCliques(
SCIP_VAR* var, /**< active problem variable */
SCIP_Bool varfixing /**< FALSE for cliques containing x == 0, TRUE for x == 1 */
);
/** gets array of cliques, the active variable is contained in */
SCIP_EXPORT
SCIP_CLIQUE** SCIPvarGetCliques(
SCIP_VAR* var, /**< active problem variable */
SCIP_Bool varfixing /**< FALSE for cliques containing x == 0, TRUE for x == 1 */
);
/** gets primal LP solution value of variable */
SCIP_EXPORT
SCIP_Real SCIPvarGetLPSol(
SCIP_VAR* var /**< problem variable */
);
/** gets primal NLP solution value of variable */
SCIP_EXPORT
SCIP_Real SCIPvarGetNLPSol(
SCIP_VAR* var /**< problem variable */
);
/** return lower bound change info at requested position */
SCIP_EXPORT
SCIP_BDCHGINFO* SCIPvarGetBdchgInfoLb(
SCIP_VAR* var, /**< problem variable */
int pos /**< requested position */
);
/** gets the number of lower bound change info array */
SCIP_EXPORT
int SCIPvarGetNBdchgInfosLb(
SCIP_VAR* var /**< problem variable */
);
/** return upper bound change info at requested position */
SCIP_EXPORT
SCIP_BDCHGINFO* SCIPvarGetBdchgInfoUb(
SCIP_VAR* var, /**< problem variable */
int pos /**< requested position */
);
/** gets the number upper bound change info array */
SCIP_EXPORT
int SCIPvarGetNBdchgInfosUb(
SCIP_VAR* var /**< problem variable */
);
/** returns the value based history for the variable */
SCIP_EXPORT
SCIP_VALUEHISTORY* SCIPvarGetValuehistory(
SCIP_VAR* var /**< problem variable */
);
/** returns whether a variable has been introduced to define a relaxation
*
* These variables are only valid for the current SCIP solve round,
* they are not contained in any (checked) constraints, but may be used
* in cutting planes, for example.
* Relaxation-only variables are not copied by SCIPcopyVars and cuts
* that contain these variables are not added as linear constraints when
* restarting or transferring information from a copied SCIP to a SCIP.
* Also conflicts with relaxation-only variables are not generated at
* the moment.
* Relaxation-only variables do not appear in the objective.
*/
SCIP_EXPORT
SCIP_Bool SCIPvarIsRelaxationOnly(
SCIP_VAR* var /**< problem variable */
);
/** marks that this variable has only been introduced to define a relaxation
*
* The variable must not have a coefficient in the objective.
*
* @see SCIPvarIsRelaxationOnly
*/
SCIP_EXPORT
void SCIPvarMarkRelaxationOnly(
SCIP_VAR* var /**< problem variable */
);
#ifdef NDEBUG
/* In optimized mode, the function calls are overwritten by defines to reduce the number of function calls and
* speed up the algorithms.
*/
#define SCIPvarGetName(var) (var)->name
#define SCIPvarGetNUses(var) (var)->nuses
#define SCIPvarGetData(var) (var)->vardata
#define SCIPvarSetData(var,vdata) (var)->vardata = (vdata)
#define SCIPvarSetDelorigData(var,func) (var)->vardelorig = (func)
#define SCIPvarSetTransData(var,func) (var)->vartrans = (func)
#define SCIPvarSetDeltransData(var,func) (var)->vardeltrans = (func)
#define SCIPvarGetStatus(var) (SCIP_VARSTATUS)((var)->varstatus)
#define SCIPvarIsOriginal(var) ((var)->varstatus == SCIP_VARSTATUS_ORIGINAL \
|| ((var)->varstatus == SCIP_VARSTATUS_NEGATED && (var)->negatedvar->varstatus == SCIP_VARSTATUS_ORIGINAL))
#define SCIPvarIsTransformed(var) ((var)->varstatus != SCIP_VARSTATUS_ORIGINAL \
&& ((var)->varstatus != SCIP_VARSTATUS_NEGATED || (var)->negatedvar->varstatus != SCIP_VARSTATUS_ORIGINAL))
#define SCIPvarIsNegated(var) ((var)->varstatus == SCIP_VARSTATUS_NEGATED)
#define SCIPvarGetType(var) ((SCIP_VARTYPE)((var)->vartype))
#define SCIPvarIsBinary(var) ((var)->vartype == SCIP_VARTYPE_BINARY || \
((var)->vartype != SCIP_VARTYPE_CONTINUOUS && MAX((var)->glbdom.lb, (var)->lazylb) >= 0.0 && MIN((var)->glbdom.ub, (var)->lazyub) <= 1.0))
#define SCIPvarIsIntegral(var) ((var)->vartype != SCIP_VARTYPE_CONTINUOUS)
#define SCIPvarIsInitial(var) (var)->initial
#define SCIPvarIsRemovable(var) (var)->removable
#define SCIPvarIsDeleted(var) (var)->deleted
#define SCIPvarMarkDeletable(var) (var)->deletable = TRUE
#define SCIPvarMarkNotDeletable(var) (var)->deletable = FALSE
#define SCIPvarIsDeletable(var) (var)->deletable
#define SCIPvarIsActive(var) ((var)->probindex >= 0)
#define SCIPvarGetIndex(var) (var)->index
#define SCIPvarGetProbindex(var) (var)->probindex
#define SCIPvarGetTransVar(var) (var)->data.original.transvar
#define SCIPvarGetCol(var) (var)->data.col
#define SCIPvarIsInLP(var) ((var)->varstatus == SCIP_VARSTATUS_COLUMN && SCIPcolIsInLP((var)->data.col))
/* use different name for var - otherwise we have clash with the var at the end */
#define SCIPvarGetAggrVar(war) (war)->data.aggregate.var
#define SCIPvarGetAggrScalar(var) (var)->data.aggregate.scalar
#define SCIPvarGetAggrConstant(var) (var)->data.aggregate.constant
#define SCIPvarGetMultaggrNVars(var) (var)->data.multaggr.nvars
#define SCIPvarGetMultaggrVars(var) (var)->data.multaggr.vars
#define SCIPvarGetMultaggrScalars(var) (var)->data.multaggr.scalars
#define SCIPvarGetMultaggrConstant(var) (var)->data.multaggr.constant
#define SCIPvarGetNegatedVar(var) (var)->negatedvar
#define SCIPvarGetNegationVar(var) (var)->negatedvar
#define SCIPvarGetNegationConstant(var) (var)->data.negate.constant
#define SCIPvarGetObj(var) (var)->obj
#define SCIPvarGetLbOriginal(var) ((var)->varstatus == SCIP_VARSTATUS_ORIGINAL \
? (var)->data.original.origdom.lb \
: (var)->data.negate.constant - (var)->negatedvar->data.original.origdom.ub)
#define SCIPvarGetUbOriginal(var) ((var)->varstatus == SCIP_VARSTATUS_ORIGINAL \
? (var)->data.original.origdom.ub \
: (var)->data.negate.constant - (var)->negatedvar->data.original.origdom.lb)
#define SCIPvarGetHolelistOriginal(var) ((var)->varstatus == SCIP_VARSTATUS_ORIGINAL \
? (var)->data.original.origdom.holelist \
: NULL)
#define SCIPvarGetLbGlobal(var) (var)->glbdom.lb
#define SCIPvarGetUbGlobal(var) (var)->glbdom.ub
#define SCIPvarGetHolelistGlobal(var) (var)->glbdom.holelist
#define SCIPvarGetBestBoundGlobal(var) ((var)->obj >= 0.0 ? (var)->glbdom.lb : (var)->glbdom.ub)
#define SCIPvarGetWorstBoundGlobal(var) ((var)->obj >= 0.0 ? (var)->glbdom.ub : (var)->glbdom.lb)
#define SCIPvarGetLbLocal(var) (var)->locdom.lb
#define SCIPvarGetUbLocal(var) (var)->locdom.ub
#define SCIPvarGetHolelistLocal(var) (var)->locdom.holelist
#define SCIPvarGetBestBoundLocal(var) ((var)->obj >= 0.0 ? (var)->locdom.lb : (var)->locdom.ub)
#define SCIPvarGetWorstBoundLocal(var) ((var)->obj >= 0.0 ? (var)->locdom.ub : (var)->locdom.lb)
#define SCIPvarGetBestBoundType(var) ((var)->obj >= 0.0 ? SCIP_BOUNDTYPE_LOWER : SCIP_BOUNDTYPE_UPPER)
#define SCIPvarGetWorstBoundType(var) ((var)->obj >= 0.0 ? SCIP_BOUNDTYPE_UPPER : SCIP_BOUNDTYPE_LOWER)
#define SCIPvarGetLbLazy(var) (var)->lazylb
#define SCIPvarGetUbLazy(var) (var)->lazyub
#define SCIPvarGetBranchFactor(var) (var)->branchfactor
#define SCIPvarGetBranchPriority(var) (var)->branchpriority
#define SCIPvarGetBranchDirection(var) (var)->branchdirection
#define SCIPvarGetNVlbs(var) (SCIPvboundsGetNVbds((var)->vlbs))
#define SCIPvarGetVlbVars(var) (SCIPvboundsGetVars((var)->vlbs))
#define SCIPvarGetVlbCoefs(var) (SCIPvboundsGetCoefs((var)->vlbs))
#define SCIPvarGetVlbConstants(var) (SCIPvboundsGetConstants((var)->vlbs))
#define SCIPvarGetNVubs(var) (SCIPvboundsGetNVbds((var)->vubs))
#define SCIPvarGetVubVars(var) (SCIPvboundsGetVars((var)->vubs))
#define SCIPvarGetVubCoefs(var) (SCIPvboundsGetCoefs((var)->vubs))
#define SCIPvarGetVubConstants(var) (SCIPvboundsGetConstants((var)->vubs))
#define SCIPvarGetNImpls(var, fix) (SCIPimplicsGetNImpls((var)->implics, fix))
#define SCIPvarGetImplVars(var, fix) (SCIPimplicsGetVars((var)->implics, fix))
#define SCIPvarGetImplTypes(var, fix) (SCIPimplicsGetTypes((var)->implics, fix))
#define SCIPvarGetImplBounds(var, fix) (SCIPimplicsGetBounds((var)->implics, fix))
#define SCIPvarGetImplIds(var, fix) (SCIPimplicsGetIds((var)->implics, fix))
#define SCIPvarGetNCliques(var, fix) (SCIPcliquelistGetNCliques((var)->cliquelist, fix))
#define SCIPvarGetCliques(var, fix) (SCIPcliquelistGetCliques((var)->cliquelist, fix))
#define SCIPvarGetLPSol(var) ((var)->varstatus == SCIP_VARSTATUS_COLUMN ? SCIPcolGetPrimsol((var)->data.col) : SCIPvarGetLPSol_rec(var))
#define SCIPvarGetNLPSol(var) (((var)->varstatus == SCIP_VARSTATUS_COLUMN || ((var)->varstatus == SCIP_VARSTATUS_LOOSE)) ? (var)->nlpsol : SCIPvarGetNLPSol_rec(var))
#define SCIPvarGetBdchgInfoLb(var, pos) (&((var)->lbchginfos[pos]))
#define SCIPvarGetNBdchgInfosLb(var) ((var)->nlbchginfos)
#define SCIPvarGetBdchgInfoUb(var, pos) (&((var)->ubchginfos[pos]))
#define SCIPvarGetNBdchgInfosUb(var) ((var)->nubchginfos)
#define SCIPvarGetValuehistory(var) (var)->valuehistory
#define SCIPvarGetCliqueComponentIdx(var) ((var)->clqcomponentidx)
#define SCIPvarIsRelaxationOnly(var)((var)->relaxationonly)
#define SCIPvarMarkRelaxationOnly(var)((var)->relaxationonly = TRUE)
#endif
/** gets primal LP solution value of variable */
SCIP_EXPORT
SCIP_Real SCIPvarGetLPSol_rec(
SCIP_VAR* var /**< problem variable */
);
/** gets primal NLP solution value of variable */
SCIP_EXPORT
SCIP_Real SCIPvarGetNLPSol_rec(
SCIP_VAR* var /**< problem variable */
);
/** gets pseudo solution value of variable at current node */
SCIP_EXPORT
SCIP_Real SCIPvarGetPseudoSol(
SCIP_VAR* var /**< problem variable */
);
/** gets current LP or pseudo solution value of variable */
SCIP_EXPORT
SCIP_Real SCIPvarGetSol(
SCIP_VAR* var, /**< problem variable */
SCIP_Bool getlpval /**< should the LP solution value be returned? */
);
/** returns the solution of the variable in the last root node's relaxation, if the root relaxation is not yet
* completely solved, zero is returned
*/
SCIP_EXPORT
SCIP_Real SCIPvarGetRootSol(
SCIP_VAR* var /**< problem variable */
);
/** returns the best solution (w.r.t. root reduced cost propagation) of the variable in the root node's relaxation, if
* the root relaxation is not yet completely solved, zero is returned
*/
SCIP_EXPORT
SCIP_Real SCIPvarGetBestRootSol(
SCIP_VAR* var /**< problem variable */
);
/** returns the best reduced costs (w.r.t. root reduced cost propagation) of the variable in the root node's relaxation,
* if the root relaxation is not yet completely solved, or the variable was no column of the root LP, SCIP_INVALID is
* returned
*/
SCIP_EXPORT
SCIP_Real SCIPvarGetBestRootRedcost(
SCIP_VAR* var /**< problem variable */
);
/** returns the best objective value (w.r.t. root reduced cost propagation) of the root LP which belongs the root
* reduced cost which is accessible via SCIPvarGetRootRedcost() or the variable was no column of the root LP,
* SCIP_INVALID is returned
*/
SCIP_EXPORT
SCIP_Real SCIPvarGetBestRootLPObjval(
SCIP_VAR* var /**< problem variable */
);
/** set the given solution as the best root solution w.r.t. root reduced cost propagation in the variables */
SCIP_EXPORT
void SCIPvarSetBestRootSol(
SCIP_VAR* var, /**< problem variable */
SCIP_Real rootsol, /**< root solution value */
SCIP_Real rootredcost, /**< root reduced cost */
SCIP_Real rootlpobjval /**< objective value of the root LP */
);
/** returns a weighted average solution value of the variable in all feasible primal solutions found so far */
SCIP_EXPORT
SCIP_Real SCIPvarGetAvgSol(
SCIP_VAR* var /**< problem variable */
);
/** returns the bound change information for the last lower bound change on given active problem variable before or
* after the bound change with the given index was applied;
* returns NULL, if no change to the lower bound was applied up to this point of time
*/
SCIP_EXPORT
SCIP_BDCHGINFO* SCIPvarGetLbchgInfo(
SCIP_VAR* var, /**< active problem variable */
SCIP_BDCHGIDX* bdchgidx, /**< bound change index representing time on path to current node */
SCIP_Bool after /**< should the bound change with given index be included? */
);
/** returns the bound change information for the last upper bound change on given active problem variable before or
* after the bound change with the given index was applied;
* returns NULL, if no change to the upper bound was applied up to this point of time
*/
SCIP_EXPORT
SCIP_BDCHGINFO* SCIPvarGetUbchgInfo(
SCIP_VAR* var, /**< active problem variable */
SCIP_BDCHGIDX* bdchgidx, /**< bound change index representing time on path to current node */
SCIP_Bool after /**< should the bound change with given index be included? */
);
/** returns the bound change information for the last lower or upper bound change on given active problem variable
* before or after the bound change with the given index was applied;
* returns NULL, if no change to the lower/upper bound was applied up to this point of time
*/
SCIP_EXPORT
SCIP_BDCHGINFO* SCIPvarGetBdchgInfo(
SCIP_VAR* var, /**< active problem variable */
SCIP_BOUNDTYPE boundtype, /**< type of bound: lower or upper bound */
SCIP_BDCHGIDX* bdchgidx, /**< bound change index representing time on path to current node */
SCIP_Bool after /**< should the bound change with given index be included? */
);
/** returns lower bound of variable directly before or after the bound change given by the bound change index
* was applied
*
* @deprecated Please use SCIPgetVarLbAtIndex()
*/
SCIP_EXPORT
SCIP_Real SCIPvarGetLbAtIndex(
SCIP_VAR* var, /**< problem variable */
SCIP_BDCHGIDX* bdchgidx, /**< bound change index representing time on path to current node */
SCIP_Bool after /**< should the bound change with given index be included? */
);
/** returns upper bound of variable directly before or after the bound change given by the bound change index
* was applied
*
* @deprecated Please use SCIPgetVarUbAtIndex()
*/
SCIP_EXPORT
SCIP_Real SCIPvarGetUbAtIndex(
SCIP_VAR* var, /**< problem variable */
SCIP_BDCHGIDX* bdchgidx, /**< bound change index representing time on path to current node */
SCIP_Bool after /**< should the bound change with given index be included? */
);
/** returns lower or upper bound of variable directly before or after the bound change given by the bound change index
* was applied
*
* @deprecated Please use SCIPgetVarBdAtIndex()
*/
SCIP_EXPORT
SCIP_Real SCIPvarGetBdAtIndex(
SCIP_VAR* var, /**< problem variable */
SCIP_BOUNDTYPE boundtype, /**< type of bound: lower or upper bound */
SCIP_BDCHGIDX* bdchgidx, /**< bound change index representing time on path to current node */
SCIP_Bool after /**< should the bound change with given index be included? */
);
/** returns whether the binary variable was fixed at the time given by the bound change index
*
* @deprecated Please use SCIPgetVarWasFixedAtIndex()
*/
SCIP_EXPORT
SCIP_Bool SCIPvarWasFixedAtIndex(
SCIP_VAR* var, /**< problem variable */
SCIP_BDCHGIDX* bdchgidx, /**< bound change index representing time on path to current node */
SCIP_Bool after /**< should the bound change with given index be included? */
);
/** returns the last bound change index, at which the bounds of the given variable were tightened */
SCIP_EXPORT
SCIP_BDCHGIDX* SCIPvarGetLastBdchgIndex(
SCIP_VAR* var /**< problem variable */
);
/** returns the last depth level, at which the bounds of the given variable were tightened;
* returns -2, if the variable's bounds are still the global bounds
* returns -1, if the variable was fixed in presolving
*/
SCIP_EXPORT
int SCIPvarGetLastBdchgDepth(
SCIP_VAR* var /**< problem variable */
);
/** returns whether the first binary variable was fixed earlier than the second one;
* returns FALSE, if the first variable is not fixed, and returns TRUE, if the first variable is fixed, but the
* second one is not fixed
*/
SCIP_EXPORT
SCIP_Bool SCIPvarWasFixedEarlier(
SCIP_VAR* var1, /**< first binary variable */
SCIP_VAR* var2 /**< second binary variable */
);
/**
* @name Public SCIP_BDCHGIDX Methods
*
* @{
*/
/** returns whether first bound change index belongs to an earlier applied bound change than second one;
* if a bound change index is NULL, the bound change index represents the current time, i.e. the time after the
* last bound change was applied to the current node
*/
SCIP_EXPORT
SCIP_Bool SCIPbdchgidxIsEarlier(
SCIP_BDCHGIDX* bdchgidx1, /**< first bound change index, or NULL */
SCIP_BDCHGIDX* bdchgidx2 /**< second bound change index, or NULL */
);
/** returns whether first bound change index belongs to an earlier applied bound change than second one */
SCIP_EXPORT
SCIP_Bool SCIPbdchgidxIsEarlierNonNull(
SCIP_BDCHGIDX* bdchgidx1, /**< first bound change index */
SCIP_BDCHGIDX* bdchgidx2 /**< second bound change index */
);
/**@} */
/**
* @name Public SCIP_BDCHGINFO Methods
*
* @{
*/
/** returns old bound that was overwritten for given bound change information */
SCIP_EXPORT
SCIP_Real SCIPbdchginfoGetOldbound(
SCIP_BDCHGINFO* bdchginfo /**< bound change information */
);
/** returns new bound installed for given bound change information */
SCIP_EXPORT
SCIP_Real SCIPbdchginfoGetNewbound(
SCIP_BDCHGINFO* bdchginfo /**< bound change information */
);
/** returns variable that belongs to the given bound change information */
SCIP_EXPORT
SCIP_VAR* SCIPbdchginfoGetVar(
SCIP_BDCHGINFO* bdchginfo /**< bound change information */
);
/** returns whether the bound change information belongs to a branching decision or a deduction */
SCIP_EXPORT
SCIP_BOUNDCHGTYPE SCIPbdchginfoGetChgtype(
SCIP_BDCHGINFO* bdchginfo /**< bound change information */
);
/** returns whether the bound change information belongs to a lower or upper bound change */
SCIP_EXPORT
SCIP_BOUNDTYPE SCIPbdchginfoGetBoundtype(
SCIP_BDCHGINFO* bdchginfo /**< bound change information */
);
/** returns depth level of given bound change information */
SCIP_EXPORT
int SCIPbdchginfoGetDepth(
SCIP_BDCHGINFO* bdchginfo /**< bound change information */
);
/** returns bound change position in its depth level of given bound change information */
SCIP_EXPORT
int SCIPbdchginfoGetPos(
SCIP_BDCHGINFO* bdchginfo /**< bound change information */
);
/** returns bound change index of given bound change information */
SCIP_EXPORT
SCIP_BDCHGIDX* SCIPbdchginfoGetIdx(
SCIP_BDCHGINFO* bdchginfo /**< bound change information */
);
/** returns inference variable of given bound change information */
SCIP_EXPORT
SCIP_VAR* SCIPbdchginfoGetInferVar(
SCIP_BDCHGINFO* bdchginfo /**< bound change information */
);
/** returns inference constraint of given bound change information */
SCIP_EXPORT
SCIP_CONS* SCIPbdchginfoGetInferCons(
SCIP_BDCHGINFO* bdchginfo /**< bound change information */
);
/** returns inference propagator of given bound change information, or NULL if no propagator was responsible */
SCIP_EXPORT
SCIP_PROP* SCIPbdchginfoGetInferProp(
SCIP_BDCHGINFO* bdchginfo /**< bound change information */
);
/** returns inference user information of given bound change information */
SCIP_EXPORT
int SCIPbdchginfoGetInferInfo(
SCIP_BDCHGINFO* bdchginfo /**< bound change information */
);
/** returns inference bound of inference variable of given bound change information */
SCIP_EXPORT
SCIP_BOUNDTYPE SCIPbdchginfoGetInferBoundtype(
SCIP_BDCHGINFO* bdchginfo /**< bound change information */
);
/** returns whether the bound change information belongs to a redundant bound change */
SCIP_EXPORT
SCIP_Bool SCIPbdchginfoIsRedundant(
SCIP_BDCHGINFO* bdchginfo /**< bound change information */
);
/** returns whether the bound change has an inference reason (constraint or propagator), that can be resolved */
SCIP_EXPORT
SCIP_Bool SCIPbdchginfoHasInferenceReason(
SCIP_BDCHGINFO* bdchginfo /**< bound change information */
);
/** for two bound change informations belonging to the same variable and bound, returns whether the first bound change
* has a tighter new bound as the second bound change
*/
SCIP_EXPORT
SCIP_Bool SCIPbdchginfoIsTighter(
SCIP_BDCHGINFO* bdchginfo1, /**< first bound change information */
SCIP_BDCHGINFO* bdchginfo2 /**< second bound change information */
);
/**@} */
/**
* @name Public SCIP_BOUNDCHG Methods
*
* @{
*/
/** returns the new value of the bound in the bound change data */
SCIP_EXPORT
SCIP_Real SCIPboundchgGetNewbound(
SCIP_BOUNDCHG* boundchg /**< bound change data */
);
/** returns the variable of the bound change in the bound change data */
SCIP_EXPORT
SCIP_VAR* SCIPboundchgGetVar(
SCIP_BOUNDCHG* boundchg /**< bound change data */
);
/** returns the bound change type of the bound change in the bound change data */
SCIP_EXPORT
SCIP_BOUNDCHGTYPE SCIPboundchgGetBoundchgtype(
SCIP_BOUNDCHG* boundchg /**< bound change data */
);
/** returns the bound type of the bound change in the bound change data */
SCIP_EXPORT
SCIP_BOUNDTYPE SCIPboundchgGetBoundtype(
SCIP_BOUNDCHG* boundchg /**< bound change data */
);
/** returns whether the bound change is redundant due to a more global bound that is at least as strong */
SCIP_EXPORT
SCIP_Bool SCIPboundchgIsRedundant(
SCIP_BOUNDCHG* boundchg /**< bound change data */
);
/** @} */
/**
* @name Public SCIP_DOMCHG Methods
*
* @{
*/
/** returns the number of bound changes in the domain change data */
SCIP_EXPORT
int SCIPdomchgGetNBoundchgs(
SCIP_DOMCHG* domchg /**< domain change data */
);
/** returns a particular bound change in the domain change data */
SCIP_EXPORT
SCIP_BOUNDCHG* SCIPdomchgGetBoundchg(
SCIP_DOMCHG* domchg, /**< domain change data */
int pos /**< position of the bound change in the domain change data */
);
/**@} */
/**
* @name Public SCIP_HOLELIST Methods
*
* @{
*/
/** returns left bound of open interval in hole */
SCIP_EXPORT
SCIP_Real SCIPholelistGetLeft(
SCIP_HOLELIST* holelist /**< hole list pointer to hole of interest */
);
/** returns right bound of open interval in hole */
SCIP_EXPORT
SCIP_Real SCIPholelistGetRight(
SCIP_HOLELIST* holelist /**< hole list pointer to hole of interest */
);
/** returns next hole in list or NULL */
SCIP_EXPORT
SCIP_HOLELIST* SCIPholelistGetNext(
SCIP_HOLELIST* holelist /**< hole list pointer to hole of interest */
);
/**@} */
#ifdef NDEBUG
/* In optimized mode, the function calls are overwritten by defines to reduce the number of function calls and
* speed up the algorithms.
*/
#define SCIPbdchgidxIsEarlierNonNull(idx1,idx2) \
((idx1)->depth < (idx2)->depth || ((idx1)->depth == (idx2)->depth && (idx1)->pos < (idx2)->pos))
#define SCIPbdchgidxIsEarlier(idx1,idx2) \
((idx1) != NULL && ((idx2) == NULL || SCIPbdchgidxIsEarlierNonNull(idx1, idx2)))
#define SCIPbdchginfoGetOldbound(bdchginfo) (bdchginfo)->oldbound
#define SCIPbdchginfoGetNewbound(bdchginfo) (bdchginfo)->newbound
#define SCIPbdchginfoGetVar(bdchginfo) (bdchginfo)->var
#define SCIPbdchginfoGetChgtype(bdchginfo) (SCIP_BOUNDCHGTYPE)((bdchginfo)->boundchgtype)
#define SCIPbdchginfoGetBoundtype(bdchginfo) (SCIP_BOUNDTYPE)((bdchginfo)->boundtype)
#define SCIPbdchginfoGetDepth(bdchginfo) (bdchginfo)->bdchgidx.depth
#define SCIPbdchginfoGetPos(bdchginfo) (bdchginfo)->bdchgidx.pos
#define SCIPbdchginfoGetIdx(bdchginfo) (&(bdchginfo)->bdchgidx)
#define SCIPbdchginfoGetInferVar(bdchginfo) (bdchginfo)->inferencedata.var
#define SCIPbdchginfoGetInferCons(bdchginfo) (bdchginfo)->inferencedata.reason.cons
#define SCIPbdchginfoGetInferProp(bdchginfo) (bdchginfo)->inferencedata.reason.prop
#define SCIPbdchginfoGetInferInfo(bdchginfo) (bdchginfo)->inferencedata.info
#define SCIPbdchginfoGetInferBoundtype(bdchginfo) (SCIP_BOUNDTYPE)((bdchginfo)->inferboundtype)
#define SCIPbdchginfoIsRedundant(bdchginfo) (bdchginfo)->redundant
#define SCIPbdchginfoHasInferenceReason(bdchginfo) \
(((bdchginfo)->boundchgtype == SCIP_BOUNDCHGTYPE_CONSINFER) \
|| ((bdchginfo)->boundchgtype == SCIP_BOUNDCHGTYPE_PROPINFER && (bdchginfo)->inferencedata.reason.prop != NULL))
#define SCIPbdchginfoIsTighter(bdchginfo1,bdchginfo2) ((bdchginfo1)->boundtype == SCIP_BOUNDTYPE_LOWER \
? (bdchginfo1)->newbound > bdchginfo2->newbound : (bdchginfo1)->newbound < bdchginfo2->newbound)
#define SCIPboundchgGetNewbound(boundchg) ((boundchg)->newbound)
#define SCIPboundchgGetVar(boundchg) ((boundchg)->var)
#define SCIPboundchgGetBoundchgtype(boundchg) ((SCIP_BOUNDCHGTYPE)((boundchg)->boundchgtype))
#define SCIPboundchgGetBoundtype(boundchg) ((SCIP_BOUNDTYPE)((boundchg)->boundtype))
#define SCIPboundchgIsRedundant(boundchg) ((boundchg)->redundant)
#define SCIPdomchgGetNBoundchgs(domchg) ((domchg) != NULL ? (domchg)->domchgbound.nboundchgs : 0)
#define SCIPdomchgGetBoundchg(domchg, pos) (&(domchg)->domchgbound.boundchgs[pos])
#define SCIPholelistGetLeft(holelist) ((holelist)->hole.left)
#define SCIPholelistGetRight(holelist) ((holelist)->hole.right)
#define SCIPholelistGetNext(holelist) ((holelist)->next)
#endif
/**@} */
#ifdef __cplusplus
}
#endif
#endif