| 1222 | |
| 1223 | |
| 1224 | int 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; |
no test coverage detected