| 348 | |
| 349 | |
| 350 | int Positive_Conti_Traverso(INPUT_FILE MATRIX, |
| 351 | const int& version, |
| 352 | const int& S_pair_criteria, |
| 353 | const float& interred_percentage, |
| 354 | const BOOLEAN& verbose) |
| 355 | { |
| 356 | |
| 357 | |
| 358 | /////////////////////////// input ///////////////////////////////////////// |
| 359 | |
| 360 | char format_string[128]; // to verify file format |
| 361 | int constraints; // number of equality constraints |
| 362 | int variables; // number of variables (without auxiliary variables) |
| 363 | |
| 364 | ifstream input(MATRIX); |
| 365 | |
| 366 | // verfifie existence of file |
| 367 | |
| 368 | if(!input) |
| 369 | { |
| 370 | cerr<<"ERROR: int Positive_Conti_Traverso(INPUT_FILE, const BOOLEAN&):\n" |
| 371 | "cannot read from input file, possibly not found"<<endl; |
| 372 | return 0; |
| 373 | } |
| 374 | |
| 375 | // read format specification |
| 376 | |
| 377 | input>>format_string; |
| 378 | |
| 379 | if(!input) |
| 380 | { |
| 381 | cerr<<"ERROR: int Positive_Conti_Traverso(INPUT_FILE, const BOOLEAN&):\n" |
| 382 | "input failure when reading format specification,\n" |
| 383 | "input format not accepted"<<endl; |
| 384 | return 0; |
| 385 | } |
| 386 | |
| 387 | if(strcmp(format_string,"MATRIX")) |
| 388 | cerr<<"Warning: int Positive_Conti_Traverso(INPUT_FILE, const BOOLEAN&):\n" |
| 389 | "input file has suspicious format"<<endl; |
| 390 | |
| 391 | // read number of variables |
| 392 | |
| 393 | input>>format_string; |
| 394 | |
| 395 | if(!input) |
| 396 | { |
| 397 | cerr<<"ERROR: int Positive_Conti_Traverso(INPUT_FILE, const BOOLEAN&):\n" |
| 398 | "input failure before reading number of variables / matrix columns,\n" |
| 399 | "input format not accepted"<<endl; |
| 400 | return 0; |
| 401 | } |
| 402 | |
| 403 | if(strcmp(format_string,"columns:")) |
| 404 | cerr<<"WARNING: int Positive_Conti_Traverso(INPUT_FILE, const BOOLEAN&):\n" |
| 405 | "input file has suspicious format"<<endl; |
| 406 | |
| 407 | input>>variables; |
no test coverage detected