Scippy

    SCIP

    Solving Constraint Integer Programs

    reader_tim.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_tim.h
    26 * @ingroup FILEREADERS
    27 * @brief TIM file reader - the stage information for a stochastic programming instance in SMPS format
    28 * @author Stephen J. Maher
    29 *
    30 * This is a reader for the time 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 * Details regarding the SMPS file format can be found at:
    40 * Birge, J. R.; Dempster, M. A.; Gassmann, H. I.; Gunn, E.; King, A. J. & Wallace, S. W.
    41 * A standard input format for multiperiod stochastic linear programs
    42 * IIASA, Laxenburg, Austria, WP-87-118, 1987
    43 *
    44 */
    45
    46/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
    47
    48#ifndef __SCIP_READER_TIM_H__
    49#define __SCIP_READER_TIM_H__
    50
    51#include "scip/def.h"
    52#include "scip/type_cons.h"
    53#include "scip/type_reader.h"
    54#include "scip/type_result.h"
    55#include "scip/type_retcode.h"
    56#include "scip/type_scip.h"
    57#include "scip/type_var.h"
    58
    59#ifdef __cplusplus
    60extern "C" {
    61#endif
    62
    63/** includes the tim file reader into SCIP
    64 *
    65 * @ingroup FileReaderIncludes
    66 */
    67SCIP_EXPORT
    69 SCIP* scip /**< SCIP data structure */
    70 );
    71
    72/**@addtogroup FILEREADERS
    73 *
    74 * @{
    75 */
    76
    77/** reads the stage information for a stochastic programming instance in SMPS format */
    78SCIP_EXPORT
    80 SCIP* scip, /**< SCIP data structure */
    81 const char* filename, /**< full path and name of file to read, or NULL if stdin should be used */
    82 SCIP_RESULT* result /**< pointer to store the result of the file reading call */
    83 );
    84
    85/** @} */
    86
    87/** frees the reader data for the tim file */
    88SCIP_EXPORT
    90 SCIP* scip /**< the SCIP data structure */
    91 );
    92
    93/*
    94 * Interface methods for the cor and sto files
    95 */
    96
    97/* return whether the tim file has been read */
    98SCIP_EXPORT
    100 SCIP_READER* reader /**< the file reader itself */
    101 );
    102
    103/* returns the number of stages */
    104SCIP_EXPORT
    106 SCIP* scip /**< SCIP data structure */
    107 );
    108
    109/* returns the name for a given stage */
    110SCIP_EXPORT
    111const char* SCIPtimGetStageName(
    112 SCIP* scip, /**< SCIP data structure */
    113 int stagenum /**< the number of the requested stage */
    114 );
    115
    116/* returns the stage name for a given constraint name */
    117const char* SCIPtimConsGetStageName(
    118 SCIP* scip, /**< SCIP data structure */
    119 const char* consname /**< the constraint to search for */
    120 );
    121
    122/* returns the number for a given stage */
    123SCIP_EXPORT
    125 SCIP* scip, /**< SCIP data structure */
    126 const char* stage /**< the name of the requested stage */
    127 );
    128
    129/* returns the array of variables for a given stage */
    130SCIP_EXPORT
    132 SCIP* scip, /**< SCIP data structure */
    133 int stagenum /**< the number of the requested stage */
    134 );
    135
    136/* returns an array of constraints for a given stage */
    137SCIP_EXPORT
    139 SCIP* scip, /**< SCIP data structure */
    140 int stagenum /**< the number of the requested stage */
    141 );
    142
    143/* returns the number of variables for a given stage */
    144SCIP_EXPORT
    146 SCIP* scip, /**< SCIP data structure */
    147 int stagenum /**< the number of the requested stage */
    148 );
    149
    150/* returns the number of constraints for a given stage */
    151SCIP_EXPORT
    153 SCIP* scip, /**< SCIP data structure */
    154 int stagenum /**< the number of the requested stage */
    155 );
    156
    157#ifdef __cplusplus
    158}
    159#endif
    160
    161#endif
    common defines and data types used in all packages of SCIP
    #define SCIP_Bool
    Definition: def.h:91
    SCIP_RETCODE SCIPreadTim(SCIP *scip, const char *filename, SCIP_RESULT *result)
    Definition: reader_tim.c:893
    SCIP_RETCODE SCIPincludeReaderTim(SCIP *scip)
    Definition: reader_tim.c:869
    int SCIPtimFindStage(SCIP *scip, const char *stage)
    Definition: reader_tim.c:1056
    int SCIPtimGetStageNVars(SCIP *scip, int stagenum)
    Definition: reader_tim.c:1136
    SCIP_RETCODE SCIPfreeReaderdataTim(SCIP *scip)
    Definition: reader_tim.c:932
    SCIP_VAR ** SCIPtimGetStageVars(SCIP *scip, int stagenum)
    Definition: reader_tim.c:1094
    SCIP_Bool SCIPtimHasRead(SCIP_READER *reader)
    Definition: reader_tim.c:958
    int SCIPtimGetNStages(SCIP *scip)
    Definition: reader_tim.c:975
    const char * SCIPtimGetStageName(SCIP *scip, int stagenum)
    Definition: reader_tim.c:994
    SCIP_CONS ** SCIPtimGetStageConss(SCIP *scip, int stagenum)
    Definition: reader_tim.c:1115
    int SCIPtimGetStageNConss(SCIP *scip, int stagenum)
    Definition: reader_tim.c:1157
    const char * SCIPtimConsGetStageName(SCIP *scip, const char *consname)
    Definition: reader_tim.c:1015
    type definitions for constraints and constraint handlers
    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
    type definitions for problem variables