Skip to content

Commit 3785b0b

Browse files
GioniMexiDominikKamp
authored andcommitted
cleanup, rename to pbsolver, remove retcode SCIP_BIGINT
1 parent a876508 commit 3785b0b

12 files changed

+73
-42
lines changed

INSTALL_APPLICATIONS_EXAMPLES.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Applications
1717
| `Coloring` | `coloring` | `coloring` |
1818
| `CycleClustering` | `cycleclustering` | `cycleclustering` |
1919
| `MinIISC` | `miniisc` | `miniisc` |
20-
| `PBSolver` | `pbscip` | `pbscip` |
20+
| `PBSolver` | `pbsolver` | `pbsolver` |
2121
| `Ringpacking` | `ringpacking` | `ringpacking` |
2222
| `Scheduler` | `scheduler` | `scheduler` |
2323

applications/PBSolver/CMakeLists.txt

+4-4
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,16 @@ endif()
1111

1212
include_directories(${SCIP_INCLUDE_DIRS})
1313

14-
add_executable(pbscip
14+
add_executable(pbsolver
1515
src/main.cpp
16-
src/message_pbscip.c
16+
src/message_pb.c
1717
src/event_bestsol.c
1818
)
1919

20-
target_link_libraries(pbscip ${SCIP_LIBRARIES})
20+
target_link_libraries(pbsolver ${SCIP_LIBRARIES})
2121

2222
if( TARGET applications )
23-
add_dependencies( applications pbscip )
23+
add_dependencies( applications pbsolver )
2424
endif()
2525

2626
enable_testing()

applications/PBSolver/src/event_bestsol.c

+10-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/* This file is part of the program and library */
44
/* SCIP --- Solving Constraint Integer Programs */
55
/* */
6-
/* Copyright (c) 2002-2024 Zuse Institute Berlin (ZIB) */
6+
/* Copyright (c) 2002-2025 Zuse Institute Berlin (ZIB) */
77
/* */
88
/* Licensed under the Apache License, Version 2.0 (the "License"); */
99
/* you may not use this file except in compliance with the License. */
@@ -22,8 +22,15 @@
2222
/* */
2323
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2424

25+
/**@file event_bestsol.c
26+
* @brief eventhdlr to print the best solution value
27+
* @author Alexander Hoen
28+
* @author Gioni Mexi
29+
*/
2530

26-
#include "message_pbscip.h"
31+
/*--+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
32+
33+
#include "message_pb.h"
2734
#include "event_bestsol.h"
2835

2936
#include <string.h>
@@ -97,7 +104,7 @@ SCIP_DECL_EVENTEXEC(eventExecBestsol)
97104
assert(scip != NULL);
98105
assert(SCIPeventGetType(event) == SCIP_EVENTTYPE_BESTSOLFOUND);
99106

100-
SCIPdebugMessage("exec method of event handler for pbscip\n");
107+
SCIPdebugMessage("exec method of event handler for pbsolver\n");
101108

102109
bestsol = SCIPgetBestSol(scip);
103110
assert(bestsol != NULL);

applications/PBSolver/src/event_bestsol.h

+10-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/* This file is part of the program and library */
44
/* SCIP --- Solving Constraint Integer Programs */
55
/* */
6-
/* Copyright (c) 2002-2024 Zuse Institute Berlin (ZIB) */
6+
/* Copyright (c) 2002-2025 Zuse Institute Berlin (ZIB) */
77
/* */
88
/* Licensed under the Apache License, Version 2.0 (the "License"); */
99
/* you may not use this file except in compliance with the License. */
@@ -22,6 +22,15 @@
2222
/* */
2323
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2424

25+
/**@file event_bestsol.h
26+
* @brief eventhdlr to print the best solution value
27+
* @author Alexander Hoen
28+
* @author Gioni Mexi
29+
*/
30+
31+
/*--+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
32+
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
33+
2534
#ifndef __SCIP_EVENT_HANDLER_PB_H__
2635
#define __SCIP_EVENT_HANDLER_PB_H__
2736

applications/PBSolver/src/main.cpp

+14-5
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/* This file is part of the program and library */
44
/* SCIP --- Solving Constraint Integer Programs */
55
/* */
6-
/* Copyright (c) 2002-2024 Zuse Institute Berlin (ZIB) */
6+
/* Copyright (c) 2002-2025 Zuse Institute Berlin (ZIB) */
77
/* */
88
/* Licensed under the Apache License, Version 2.0 (the "License"); */
99
/* you may not use this file except in compliance with the License. */
@@ -22,6 +22,15 @@
2222
/* */
2323
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2424

25+
/**@file main.cpp
26+
* @brief main file for the Pseudo-Boolean solver application
27+
* @author Alexander Hoen
28+
* @author Gioni Mexi
29+
*/
30+
31+
/*--+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
32+
33+
2534
#define PBSOLVER
2635

2736
#include <cstdio>
@@ -30,7 +39,7 @@
3039
#include "scip/scip.h"
3140
#include "scip/scipdefplugins.h"
3241
#include "scip/scipshell.h"
33-
#include "message_pbscip.h"
42+
#include "message_pb.h"
3443
#include "event_bestsol.h"
3544

3645
#define SETOBJ FALSE
@@ -277,7 +286,7 @@ SCIP_RETCODE fromCommandLine(
277286
{
278287
/* try to read the problem as opb format */
279288
SCIP_RETCODE scipRetcode = SCIPreadProb(scip, filename, "opb");
280-
if( scipRetcode == SCIP_BIGINT)
289+
if( scipRetcode == SCIP_INVALIDRESULT)
281290
{
282291
printUnsupportedSolution(scip);
283292
return SCIP_OKAY;
@@ -286,7 +295,7 @@ SCIP_RETCODE fromCommandLine(
286295
}
287296
else
288297
{
289-
if( retcode == SCIP_BIGINT)
298+
if( retcode == SCIP_INVALIDRESULT)
290299
{
291300
printUnsupportedSolution(scip);
292301
return SCIP_OKAY;
@@ -715,7 +724,7 @@ SCIP_RETCODE runShell(
715724
SCIPmessagehdlrCapture(defaultmessagehdlr);
716725

717726
/* create own buffered message handler for PB output and overrides default scip message handler */
718-
SCIP_CALL( SCIPcreateMessagehdlrPbscip(&messagehdlr, TRUE, NULL, FALSE) );
727+
SCIP_CALL( SCIPcreateMessagehdlrPbSolver(&messagehdlr, TRUE, NULL, FALSE) );
719728

720729
/* if we are running the PB competition we use this message handler to produce the required output */
721730
SCIP_CALL( SCIPsetMessagehdlr(scip, messagehdlr) );

applications/PBSolver/src/message_pbscip.c renamed to applications/PBSolver/src/message_pb.c

+19-11
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/* This file is part of the program and library */
44
/* SCIP --- Solving Constraint Integer Programs */
55
/* */
6-
/* Copyright (c) 2002-2024 Zuse Institute Berlin (ZIB) */
6+
/* Copyright (c) 2002-2025 Zuse Institute Berlin (ZIB) */
77
/* */
88
/* Licensed under the Apache License, Version 2.0 (the "License"); */
99
/* you may not use this file except in compliance with the License. */
@@ -22,13 +22,21 @@
2222
/* */
2323
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2424

25+
/**@file message_pb.c
26+
* @brief messagehdlr for the Pseudo-Boolean output format
27+
* @author Alexander Hoen
28+
* @author Gioni Mexi
29+
*/
30+
31+
/*--+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
32+
2533
#define PBSOLVER
2634

2735
#include <stdio.h>
2836
#include <string.h>
2937

3038
#include "scip/scip.h"
31-
#include "message_pbscip.h"
39+
#include "message_pb.h"
3240

3341

3442
static
@@ -57,7 +65,7 @@ void printMessage(
5765

5866
/** default error printing method which is used to print all occurring errors */
5967
static
60-
SCIP_DECL_ERRORPRINTING(messageErrorPbscip) { /*lint --e{715}*/
68+
SCIP_DECL_ERRORPRINTING(messageErrorPbSolver) { /*lint --e{715}*/
6169

6270
#ifdef PBSOLVER
6371
fputs("c ", stderr);
@@ -68,24 +76,24 @@ SCIP_DECL_ERRORPRINTING(messageErrorPbscip) { /*lint --e{715}*/
6876

6977
/** warning message print method of default message handler */
7078
static
71-
SCIP_DECL_MESSAGEWARNING(messageWarningPbscip) { /*lint --e{715}*/
79+
SCIP_DECL_MESSAGEWARNING(messageWarningPbSolver) { /*lint --e{715}*/
7280
printMessage(messagehdlr, file, msg);
7381
}
7482

7583
/** dialog message print method of default message handler */
7684
static
77-
SCIP_DECL_MESSAGEDIALOG(messageDialogPbscip) { /*lint --e{715}*/
85+
SCIP_DECL_MESSAGEDIALOG(messageDialogPbSolver) { /*lint --e{715}*/
7886
printMessage(messagehdlr, file, msg);
7987
}
8088

8189
/** info message print method of default message handler */
8290
static
83-
SCIP_DECL_MESSAGEINFO(messageInfoPbscip) { /*lint --e{715}*/
91+
SCIP_DECL_MESSAGEINFO(messageInfoPbSolver) { /*lint --e{715}*/
8492
printMessage(messagehdlr, file, msg);
8593
}
8694

8795
static
88-
SCIP_DECL_MESSAGEHDLRFREE(messagehdlrFreePbscip) { /*lint --e{715}*/
96+
SCIP_DECL_MESSAGEHDLRFREE(messagehdlrFreePbSolver) { /*lint --e{715}*/
8997
SCIP_MESSAGEHDLRDATA *messagehdlrdata;
9098

9199
assert(messagehdlr != NULL);
@@ -99,8 +107,8 @@ SCIP_DECL_MESSAGEHDLRFREE(messagehdlrFreePbscip) { /*lint --e{715}*/
99107
}
100108

101109

102-
/** creates default PBSCIP message handler */
103-
SCIP_RETCODE SCIPcreateMessagehdlrPbscip(
110+
/** creates default pbsolver message handler */
111+
SCIP_RETCODE SCIPcreateMessagehdlrPbSolver(
104112
SCIP_MESSAGEHDLR **messagehdlr, /**< pointer to message handler */
105113
SCIP_Bool buffered, /**< should the output be buffered */
106114
const char *filename, /**< name of log file, or NULL (stdout) */
@@ -116,10 +124,10 @@ SCIP_RETCODE SCIPcreateMessagehdlrPbscip(
116124
messagehdlrdata->comment = FALSE;
117125
#endif
118126
SCIP_CALL(SCIPmessagehdlrCreate(messagehdlr, buffered, filename, quiet,
119-
messageWarningPbscip, messageDialogPbscip, messageInfoPbscip, messagehdlrFreePbscip,
127+
messageWarningPbSolver, messageDialogPbSolver, messageInfoPbSolver, messagehdlrFreePbSolver,
120128
messagehdlrdata));
121129

122-
SCIPmessageSetErrorPrinting(messageErrorPbscip, NULL);
130+
SCIPmessageSetErrorPrinting(messageErrorPbSolver, NULL);
123131

124132
return SCIP_OKAY;
125133
}

applications/PBSolver/src/message_pbscip.h renamed to applications/PBSolver/src/message_pb.h

+11-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/* This file is part of the program and library */
44
/* SCIP --- Solving Constraint Integer Programs */
55
/* */
6-
/* Copyright (c) 2002-2024 Zuse Institute Berlin (ZIB) */
6+
/* Copyright (c) 2002-2025 Zuse Institute Berlin (ZIB) */
77
/* */
88
/* Licensed under the Apache License, Version 2.0 (the "License"); */
99
/* you may not use this file except in compliance with the License. */
@@ -22,6 +22,14 @@
2222
/* */
2323
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2424

25+
/**@file message_pb.h
26+
* @brief messagehdlr for the Pseudo-Boolean output format
27+
* @author Alexander Hoen
28+
* @author Gioni Mexi
29+
*/
30+
31+
/*--+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
32+
2533
#ifndef __SCIP_PB_MESSAGE_PB_H__
2634
#define __SCIP_PB_MESSAGE_PB_H__
2735

@@ -37,9 +45,9 @@ struct SCIP_MessagehdlrData
3745
SCIP_Bool comment; /**< should output be printed as PB comments */
3846
};
3947

40-
/** creates default PBSCIP message handler */
48+
/** creates default pbsolver message handler */
4149
extern
42-
SCIP_RETCODE SCIPcreateMessagehdlrPbscip(
50+
SCIP_RETCODE SCIPcreateMessagehdlrPbSolver(
4351
SCIP_MESSAGEHDLR** messagehdlr, /**< pointer to message handler */
4452
SCIP_Bool buffered, /**< should the output be buffered */
4553
const char* filename, /**< name of log file, or NULL (stdout) */

examples/Queens/src/scip_exception.hpp

-3
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,6 @@ inline char* SCIPgetErrorString(SCIP_RETCODE retcode, char* buffer_str, int buff
102102
case SCIP_NOTIMPLEMENTED:
103103
(void) SCIPsnprintf(buffer_str, buffersize, "function not implemented");
104104
return buffer_str;
105-
case SCIP_BIGINT:
106-
(void) SCIPsnprintf(buffer_str, buffersize, "big integers rejected");
107-
return buffer_str;
108105
}
109106
return NULL;
110107
}

src/scip/reader_opb.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -1654,7 +1654,7 @@ SCIP_RETCODE readOPBFile(
16541654
if( readerdata->maxintsize >= 0 && intsize > readerdata->maxintsize )
16551655
{
16561656
SCIPinfoMessage(scip, NULL, "Intsize %d exceeds %d maximum.\n", intsize, readerdata->maxintsize);
1657-
return SCIP_BIGINT;
1657+
return SCIP_INVALIDDATA;
16581658
}
16591659

16601660
/* create problem */
@@ -3982,7 +3982,7 @@ SCIP_RETCODE SCIPreadOpb(
39823982
SCIPfreeBlockMemoryArray(scip, &opbinput.token, OPB_MAX_LINELEN);
39833983
SCIPfreeBlockMemoryArray(scip, &opbinput.linebuf, opbinput.linebufsize);
39843984

3985-
if( retcode == SCIP_BIGINT )
3985+
if( retcode == SCIP_INVALIDDATA )
39863986
{
39873987
*result = SCIP_SUSPENDED;
39883988
return SCIP_OKAY;

src/scip/retcode.c

-6
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,6 @@ void SCIPretcodePrint(
103103
case SCIP_NOTIMPLEMENTED:
104104
SCIPmessageFPrintInfo(messagehdlr, file, "function not implemented");
105105
break;
106-
case SCIP_BIGINT:
107-
SCIPmessageFPrintInfo(messagehdlr, file, "big integers rejected");
108-
break;
109106
default:
110107
SCIPmessageFPrintInfo(messagehdlr, file, "unknown error code");
111108
break;
@@ -179,9 +176,6 @@ void SCIPretcodePrintError(
179176
case SCIP_NOTIMPLEMENTED:
180177
SCIPmessagePrintError("function not implemented");
181178
break;
182-
case SCIP_BIGINT:
183-
SCIPmessagePrintError("big integers rejected");
184-
break;
185179
default:
186180
SCIPmessagePrintError("unknown error code");
187181
break;

src/scip/scip_prob.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -479,7 +479,7 @@ SCIP_RETCODE SCIPreadProb(
479479
retcode = SCIP_OKAY;
480480
break;
481481
case SCIP_SUSPENDED:
482-
retcode = SCIP_BIGINT;
482+
retcode = SCIP_INVALIDDATA;
483483
break;
484484
default:
485485
assert(i < scip->set->nreaders);

src/scip/type_retcode.h

+1-2
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,7 @@ enum SCIP_Retcode
5858
SCIP_KEYALREADYEXISTING = -15, /**< the given key is already existing in table */
5959
SCIP_MAXDEPTHLEVEL = -16, /**< maximal branching depth level exceeded */
6060
SCIP_BRANCHERROR = -17, /**< no branching could be created */
61-
SCIP_NOTIMPLEMENTED = -18, /**< function not implemented */
62-
SCIP_BIGINT = -19 /**< big integers rejected */
61+
SCIP_NOTIMPLEMENTED = -18 /**< function not implemented */
6362
};
6463
typedef enum SCIP_Retcode SCIP_RETCODE; /**< return code for SCIP method */
6564

0 commit comments

Comments
 (0)