| 1999 | |
| 2000 | |
| 2001 | int Bigatti_LaScala_Robbiano(INPUT_FILE MATRIX, |
| 2002 | const int& version, |
| 2003 | const int& S_pair_criteria, |
| 2004 | const float& interred_percentage, |
| 2005 | const BOOLEAN& verbose) |
| 2006 | { |
| 2007 | |
| 2008 | |
| 2009 | /////////////////////////// input ///////////////////////////////////////// |
| 2010 | |
| 2011 | char format_string[128]; // to verify file format |
| 2012 | int constraints; // number of equality constraints |
| 2013 | int variables; // number of variables |
| 2014 | |
| 2015 | ifstream input(MATRIX); |
| 2016 | |
| 2017 | // verfifie existence of file |
| 2018 | |
| 2019 | if(!input) |
| 2020 | { |
| 2021 | cerr<<"ERROR: int Bigatti_LaScala_Robbiano(INPUT_FILE, const BOOLEAN&):\n" |
| 2022 | "cannot read from input file, possibly not found"<<endl; |
| 2023 | return 0; |
| 2024 | } |
| 2025 | |
| 2026 | // read format specification |
| 2027 | |
| 2028 | input>>format_string; |
| 2029 | |
| 2030 | if(!input) |
| 2031 | { |
| 2032 | cerr<<"ERROR: int Bigatti_LaScala_Robbiano(INPUT_FILE, const BOOLEAN&):\n" |
| 2033 | "input failure when reading format specification,\n" |
| 2034 | "input format not accepted"<<endl; |
| 2035 | return 0; |
| 2036 | } |
| 2037 | |
| 2038 | if(strcmp(format_string,"MATRIX")) |
| 2039 | cerr<<"Warning: int Bigatti_LaScala_Robbiano(INPUT_FILE, const BOOLEAN&):" |
| 2040 | "\n" |
| 2041 | "input file has suspicious format"<<endl; |
| 2042 | |
| 2043 | // read number of variables |
| 2044 | |
| 2045 | input>>format_string; |
| 2046 | |
| 2047 | if(!input) |
| 2048 | { |
| 2049 | cerr<<"ERROR: int Bigatti_LaScala_Robbiano(INPUT_FILE, const BOOLEAN&):\n" |
| 2050 | "input failure before reading number of variables / matrix columns,\n" |
| 2051 | "input format not accepted"<<endl; |
| 2052 | return 0; |
| 2053 | } |
| 2054 | |
| 2055 | if(strcmp(format_string,"columns:")) |
| 2056 | cerr<<"WARNING: int Bigatti_LaScala_Robbiano(INPUT_FILE, const BOOLEAN&):" |
| 2057 | "\n" |
| 2058 | "input file has suspicious format"<<endl; |
no test coverage detected