| 934 | |
| 935 | |
| 936 | int Pottier(INPUT_FILE MATRIX, |
| 937 | const int& version, |
| 938 | const int& S_pair_criteria, |
| 939 | const float& interred_percentage, |
| 940 | const BOOLEAN& verbose) |
| 941 | { |
| 942 | |
| 943 | |
| 944 | /////////////////////////// input ///////////////////////////////////////// |
| 945 | |
| 946 | char format_string[128]; // to verify file format |
| 947 | int constraints; // number of equality constraints |
| 948 | int variables; // number of variables (without auxiliary variables) |
| 949 | |
| 950 | ifstream input(MATRIX); |
| 951 | |
| 952 | // verfifie existence of file |
| 953 | |
| 954 | if(!input) |
| 955 | { |
| 956 | cerr<<"ERROR: int Pottier(INPUT_FILE, const BOOLEAN&):\n" |
| 957 | "cannot read from input file, possibly not found"<<endl; |
| 958 | return 0; |
| 959 | } |
| 960 | |
| 961 | // read format specification |
| 962 | |
| 963 | input>>format_string; |
| 964 | |
| 965 | if(!input) |
| 966 | { |
| 967 | cerr<<"ERROR: int Pottier(INPUT_FILE, const BOOLEAN&):\n" |
| 968 | "input failure when reading format specification,\n" |
| 969 | "input format not accepted"<<endl; |
| 970 | return 0; |
| 971 | } |
| 972 | |
| 973 | if(strcmp(format_string,"MATRIX")) |
| 974 | cerr<<"Warning: int Pottier(INPUT_FILE, const BOOLEAN&):\n" |
| 975 | "input file has suspicious format"<<endl; |
| 976 | |
| 977 | // read number of variables |
| 978 | |
| 979 | input>>format_string; |
| 980 | |
| 981 | if(!input) |
| 982 | { |
| 983 | cerr<<"ERROR: int Pottier(INPUT_FILE, const BOOLEAN&):\n" |
| 984 | "input failure before reading number of variables / matrix columns,\n" |
| 985 | "input format not accepted"<<endl; |
| 986 | return 0; |
| 987 | } |
| 988 | |
| 989 | if(strcmp(format_string,"columns:")) |
| 990 | cerr<<"WARNING: int Pottier(INPUT_FILE, const BOOLEAN&):\n" |
| 991 | "input file has suspicious format"<<endl; |
| 992 | |
| 993 | input>>variables; |
no test coverage detected