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