MCPcopy Create free account
hub / github.com/Singular/Singular / Hosten_Sturmfels

Function Hosten_Sturmfels

IntegerProgramming/IP_algorithms.cc:1224–1623  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1222
1223
1224int Hosten_Sturmfels(INPUT_FILE MATRIX,
1225 const int& version,
1226 const int& S_pair_criteria,
1227 const float& interred_percentage,
1228 const BOOLEAN& verbose)
1229{
1230
1231
1232/////////////////////////// input /////////////////////////////////////////
1233
1234 char format_string[128]; // to verify file format
1235 int constraints; // number of equality constraints
1236 int variables; // number of variables
1237
1238 ifstream input(MATRIX);
1239
1240 // verfifie existence of file
1241
1242 if(!input)
1243 {
1244 cerr<<"ERROR: int Hosten_Sturmfels(INPUT_FILE, const BOOLEAN&):\n"
1245 "cannot read from input file, possibly not found"<<endl;
1246 return 0;
1247 }
1248
1249 // read format specification
1250
1251 input>>format_string;
1252
1253 if(!input)
1254 {
1255 cerr<<"ERROR: int Hosten_Sturmfels(INPUT_FILE, const BOOLEAN&):\n"
1256 "input failure when reading format specification,\n"
1257 "input format not accepted"<<endl;
1258 return 0;
1259 }
1260
1261 if(strcmp(format_string,"MATRIX"))
1262 cerr<<"Warning: int Hosten_Sturmfels(INPUT_FILE, const BOOLEAN&):\n"
1263 "input file has suspicious format"<<endl;
1264
1265 // read number of variables
1266
1267 input>>format_string;
1268
1269 if(!input)
1270 {
1271 cerr<<"ERROR: int Hosten_Sturmfels(INPUT_FILE, const BOOLEAN&):\n"
1272 "input failure before reading number of variables / matrix columns,\n"
1273 "input format not accepted"<<endl;
1274 return 0;
1275 }
1276
1277 if(strcmp(format_string,"columns:"))
1278 cerr<<"WARNING: int Hosten_Sturmfels(INPUT_FILE, const BOOLEAN&):\n"
1279 "input file has suspicious format"<<endl;
1280
1281 input>>variables;

Callers 2

mainFunction · 0.85
mainFunction · 0.85

Calls 7

print_flagsFunction · 0.85
hosten_shapiroMethod · 0.80
number_of_generatorsMethod · 0.80
error_statusMethod · 0.45
is_nonnegativeMethod · 0.45
format_printMethod · 0.45

Tested by

no test coverage detected