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

Function Conti_Traverso

IntegerProgramming/IP_algorithms.cc:62–338  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

60
61
62int Conti_Traverso(INPUT_FILE MATRIX,
63 const int& version,
64 const int& S_pair_criteria,
65 const float& interred_percentage,
66 const BOOLEAN& verbose)
67{
68
69
70/////////////////////////// input /////////////////////////////////////////
71
72 char format_string[128]; // to verify file format
73 int constraints; // number of equality constraints
74 int variables; // number of variables (without auxiliary variables)
75
76 ifstream input(MATRIX);
77
78 // verfifie existence of file
79
80 if(!input)
81 {
82 cerr<<"ERROR: int Conti_Traverso(INPUT_FILE, const BOOLEAN&):\n"
83 "cannot read from input file, possibly not found"<<endl;
84 return 0;
85 }
86
87 // read format specification
88
89 input>>format_string;
90
91 if(!input)
92 {
93 cerr<<"ERROR: int Conti_Traverso(INPUT_FILE, const BOOLEAN&):\n"
94 "input failure when reading format specification,\n"
95 "input format not accepted"<<endl;
96 return 0;
97 }
98
99 if(strcmp(format_string,"MATRIX"))
100 cerr<<"Warning: int Conti_Traverso(INPUT_FILE, const BOOLEAN&):\n"
101 "input file has suspicious format"<<endl;
102
103 // read number of variables
104
105 input>>format_string;
106
107 if(!input)
108 {
109 cerr<<"ERROR: int Conti_Traverso(INPUT_FILE, const BOOLEAN&):\n"
110 "input failure before reading number of variables / matrix columns,\n"
111 "input format not accepted"<<endl;
112 return 0;
113 }
114
115 if(strcmp(format_string,"columns:"))
116 cerr<<"WARNING: int Conti_Traverso(INPUT_FILE, const BOOLEAN&):\n"
117 "input file has suspicious format"<<endl;
118
119 input>>variables;

Callers 2

mainFunction · 0.85
mainFunction · 0.85

Calls 6

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

Tested by

no test coverage detected