Scippy

    SCIP

    Solving Constraint Integer Programs

    reader_cor.h
    Go to the documentation of this file.
    1/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
    2/* */
    3/* This file is part of the program and library */
    4/* SCIP --- Solving Constraint Integer Programs */
    5/* */
    6/* Copyright (c) 2002-2025 Zuse Institute Berlin (ZIB) */
    7/* */
    8/* Licensed under the Apache License, Version 2.0 (the "License"); */
    9/* you may not use this file except in compliance with the License. */
    10/* You may obtain a copy of the License at */
    11/* */
    12/* http://www.apache.org/licenses/LICENSE-2.0 */
    13/* */
    14/* Unless required by applicable law or agreed to in writing, software */
    15/* distributed under the License is distributed on an "AS IS" BASIS, */
    16/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */
    17/* See the License for the specific language governing permissions and */
    18/* limitations under the License. */
    19/* */
    20/* You should have received a copy of the Apache-2.0 license */
    21/* along with SCIP; see the file LICENSE. If not visit scipopt.org. */
    22/* */
    23/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
    24
    25/**@file reader_cor.h
    26 * @ingroup FILEREADERS
    27 * @brief COR file reader (MPS format of the core problem for stochastic programs)
    28 * @author Stephen J. Maher
    29 *
    30 * This is a reader for the core file of a stochastic programming instance in SMPS format.
    31 * The three files that must be read are:
    32 * - .cor
    33 * - .tim
    34 * - .sto
    35 *
    36 * Alternatively, it is possible to create a .smps file with the relative path to the .cor, .tim and .sto files.
    37 * A file reader is available for the .smps file.
    38 *
    39 * The core file is in the form of an MPS.
    40 *
    41 * Details regarding the SMPS file format can be found at:
    42 * Birge, J. R.; Dempster, M. A.; Gassmann, H. I.; Gunn, E.; King, A. J. & Wallace, S. W.
    43 * A standard input format for multiperiod stochastic linear programs
    44 * IIASA, Laxenburg, Austria, WP-87-118, 1987
    45 *
    46 */
    47
    48
    49/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
    50
    51#ifndef __SCIP_READER_COR_H__
    52#define __SCIP_READER_COR_H__
    53
    54#include "scip/def.h"
    55#include "scip/type_reader.h"
    56#include "scip/type_result.h"
    57#include "scip/type_retcode.h"
    58#include "scip/type_scip.h"
    59
    60#ifdef __cplusplus
    61extern "C" {
    62#endif
    63
    64/** includes the cor file reader into SCIP
    65 *
    66 * @ingroup FileReaderIncludes
    67 */
    68SCIP_EXPORT
    70 SCIP* scip /**< SCIP data structure */
    71 );
    72
    73/**@addtogroup FILEREADERS
    74 *
    75 * @{
    76 */
    77
    78/** reads problem from file */
    79SCIP_EXPORT
    81 SCIP* scip, /**< SCIP data structure */
    82 const char* filename, /**< full path and name of file to read, or NULL if stdin should be used */
    83 SCIP_RESULT* result /**< pointer to store the result of the file reading call */
    84 );
    85
    86/** frees the COR reader data */
    87SCIP_EXPORT
    89 SCIP* scip /**< the SCIP data structure */
    90 );
    91
    92/*
    93 * Interface method for the tim and sto readers
    94 */
    95
    96/** returns whether the COR file has been successfully read. This is used by the TIM and STO readers. */
    97SCIP_EXPORT
    99 SCIP_READER* reader /**< the file reader itself */
    100 );
    101
    102/** returns the number of variable names in the COR problem */
    103SCIP_EXPORT
    105 SCIP_READER* reader /**< the file reader itself */
    106 );
    107
    108/** returns the number of constraint names in the COR problem */
    109SCIP_EXPORT
    111 SCIP_READER* reader /**< the file reader itself */
    112 );
    113
    114/** returns the variable name for the given index */
    115SCIP_EXPORT
    116const char* SCIPcorGetVarName(
    117 SCIP_READER* reader, /**< the file reader itself */
    118 int i /**< the index of the variable that is requested */
    119 );
    120
    121/** returns the constraint name for the given index */
    122SCIP_EXPORT
    123const char* SCIPcorGetConsName(
    124 SCIP_READER* reader, /**< the file reader itself */
    125 int i /**< the index of the constraint that is requested */
    126 );
    127
    128/** @} */
    129
    130#ifdef __cplusplus
    131}
    132#endif
    133
    134#endif
    common defines and data types used in all packages of SCIP
    #define SCIP_Bool
    Definition: def.h:91
    SCIP_RETCODE SCIPreadCor(SCIP *scip, const char *filename, SCIP_RESULT *result)
    Definition: reader_cor.c:200
    const char * SCIPcorGetVarName(SCIP_READER *reader, int i)
    Definition: reader_cor.c:315
    SCIP_Bool SCIPcorHasRead(SCIP_READER *reader)
    Definition: reader_cor.c:267
    const char * SCIPcorGetConsName(SCIP_READER *reader, int i)
    Definition: reader_cor.c:333
    SCIP_RETCODE SCIPfreeReaderdataCor(SCIP *scip)
    Definition: reader_cor.c:241
    int SCIPcorGetNConsNames(SCIP_READER *reader)
    Definition: reader_cor.c:299
    int SCIPcorGetNVarNames(SCIP_READER *reader)
    Definition: reader_cor.c:283
    SCIP_RETCODE SCIPincludeReaderCor(SCIP *scip)
    Definition: reader_cor.c:173
    type definitions for input file readers
    result codes for SCIP callback methods
    enum SCIP_Result SCIP_RESULT
    Definition: type_result.h:61
    type definitions for return codes for SCIP methods
    enum SCIP_Retcode SCIP_RETCODE
    Definition: type_retcode.h:63
    type definitions for SCIP's main datastructure