Scippy

SCIP

Solving Constraint Integer Programs

retcode.c
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-2022 Konrad-Zuse-Zentrum */
7 /* fuer Informationstechnik Berlin */
8 /* */
9 /* SCIP is distributed under the terms of the ZIB Academic License. */
10 /* */
11 /* You should have received a copy of the ZIB Academic License */
12 /* along with SCIP; see the file COPYING. If not visit scipopt.org. */
13 /* */
14 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
15 
16 /**@file retcode.c
17  * @ingroup OTHER_CFILES
18  * @brief methods for return codes for SCIP methods
19  * @author Tobias Achterberg
20  */
21 
22 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
23 
24 #include <stdio.h>
25 
26 #include "scip/retcode.h"
27 
28 /** prints error message for return code via message handler */
30  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
31  FILE* file, /**< file stream to write error message */
32  SCIP_RETCODE retcode /**< SCIP return code causing the error */
33  )
34 {
35  switch( retcode )
36  {
37  case SCIP_OKAY:
38  SCIPmessageFPrintInfo(messagehdlr, file, "normal termination");
39  break;
40  case SCIP_ERROR:
41  SCIPmessageFPrintInfo(messagehdlr, file, "unspecified error");
42  break;
43  case SCIP_NOMEMORY:
44  SCIPmessageFPrintInfo(messagehdlr, file, "insufficient memory error");
45  break;
46  case SCIP_READERROR:
47  SCIPmessageFPrintInfo(messagehdlr, file, "read error");
48  break;
49  case SCIP_WRITEERROR:
50  SCIPmessageFPrintInfo(messagehdlr, file, "write error");
51  break;
52  case SCIP_NOFILE:
53  SCIPmessageFPrintInfo(messagehdlr, file, "file not found error");
54  break;
56  SCIPmessageFPrintInfo(messagehdlr, file, "cannot create file");
57  break;
58  case SCIP_LPERROR:
59  SCIPmessageFPrintInfo(messagehdlr, file, "error in LP solver");
60  break;
61  case SCIP_NOPROBLEM:
62  SCIPmessageFPrintInfo(messagehdlr, file, "no problem exists");
63  break;
64  case SCIP_INVALIDCALL:
65  SCIPmessageFPrintInfo(messagehdlr, file, "method cannot be called at this time in solution process");
66  break;
67  case SCIP_INVALIDDATA:
68  SCIPmessageFPrintInfo(messagehdlr, file, "method cannot be called with this type of data");
69  break;
70  case SCIP_INVALIDRESULT:
71  SCIPmessageFPrintInfo(messagehdlr, file, "method returned an invalid result code");
72  break;
74  SCIPmessageFPrintInfo(messagehdlr, file, "a required plugin was not found");
75  break;
77  SCIPmessageFPrintInfo(messagehdlr, file, "the parameter with the given name was not found");
78  break;
80  SCIPmessageFPrintInfo(messagehdlr, file, "the parameter is not of the expected type");
81  break;
83  SCIPmessageFPrintInfo(messagehdlr, file, "the value is invalid for the given parameter");
84  break;
86  SCIPmessageFPrintInfo(messagehdlr, file, "the given key is already existing in table");
87  break;
88  case SCIP_MAXDEPTHLEVEL:
89  SCIPmessageFPrintInfo(messagehdlr, file, "maximal branching depth level exceeded");
90  break;
91  case SCIP_BRANCHERROR:
92  SCIPmessageFPrintInfo(messagehdlr, file, "branching could not be performed (e.g. too large values in variable domain)");
93  break;
95  SCIPmessageFPrintInfo(messagehdlr, file, "function not implemented");
96  break;
97  default:
98  SCIPmessageFPrintInfo(messagehdlr, file, "unknown error code");
99  break;
100  }
101 }
102 
103 /** prints error message for return code via error message */
105  SCIP_RETCODE retcode /**< SCIP return code causing the error */
106  )
107 {
108  switch( retcode )
109  {
110  case SCIP_OKAY:
111  SCIPmessagePrintError("normal termination");
112  break;
113  case SCIP_ERROR:
114  SCIPmessagePrintError("unspecified error");
115  break;
116  case SCIP_NOMEMORY:
117  SCIPmessagePrintError("insufficient memory error");
118  break;
119  case SCIP_READERROR:
120  SCIPmessagePrintError("read error");
121  break;
122  case SCIP_WRITEERROR:
123  SCIPmessagePrintError("write error");
124  break;
125  case SCIP_NOFILE:
126  SCIPmessagePrintError("file not found error");
127  break;
129  SCIPmessagePrintError("cannot create file");
130  break;
131  case SCIP_LPERROR:
132  SCIPmessagePrintError("error in LP solver");
133  break;
134  case SCIP_NOPROBLEM:
135  SCIPmessagePrintError("no problem exists");
136  break;
137  case SCIP_INVALIDCALL:
138  SCIPmessagePrintError("method cannot be called at this time in solution process");
139  break;
140  case SCIP_INVALIDDATA:
141  SCIPmessagePrintError("method cannot be called with this type of data");
142  break;
143  case SCIP_INVALIDRESULT:
144  SCIPmessagePrintError("method returned an invalid result code");
145  break;
146  case SCIP_PLUGINNOTFOUND:
147  SCIPmessagePrintError("a required plugin was not found");
148  break;
150  SCIPmessagePrintError("the parameter with the given name was not found");
151  break;
153  SCIPmessagePrintError("the parameter is not of the expected type");
154  break;
156  SCIPmessagePrintError("the value is invalid for the given parameter");
157  break;
159  SCIPmessagePrintError("the given key is already existing in table");
160  break;
161  case SCIP_MAXDEPTHLEVEL:
162  SCIPmessagePrintError("maximal branching depth level exceeded");
163  break;
164  case SCIP_BRANCHERROR:
165  SCIPmessagePrintError("branching could not be performed (e.g. too large values in variable domain)");
166  break;
167  case SCIP_NOTIMPLEMENTED:
168  SCIPmessagePrintError("function not implemented");
169  break;
170  default:
171  SCIPmessagePrintError("unknown error code");
172  break;
173  }
174 }
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:54
void SCIPretcodePrint(SCIP_MESSAGEHDLR *messagehdlr, FILE *file, SCIP_RETCODE retcode)
Definition: retcode.c:29
void SCIPmessagePrintError(const char *formatstr,...)
Definition: message.c:782
void SCIPretcodePrintError(SCIP_RETCODE retcode)
Definition: retcode.c:104
internal methods for return codes for SCIP methods
void SCIPmessageFPrintInfo(SCIP_MESSAGEHDLR *messagehdlr, FILE *file, const char *formatstr,...)
Definition: message.c:609