diff --git a/trunk/problems/eval/maxSATeval.h b/trunk/problems/eval/maxSATeval.h index 4a67fdb17..87a3c4ca6 100644 --- a/trunk/problems/eval/maxSATeval.h +++ b/trunk/problems/eval/maxSATeval.h @@ -55,10 +55,10 @@ public: nbLitteral = _k; // creation of the clauses - clauses = new vector[nbClauses]; + clauses = new std::vector[nbClauses]; // the variables are numbered from 1 to nbVar - variables = new vector[nbVar + 1]; + variables = new std::vector[nbVar + 1]; //int var[nbVar]; std::vector var; @@ -107,18 +107,18 @@ public: * * @param _fileName file name of the instance in cnf format */ - MaxSATeval(string & _fileName) { - fstream file(_fileName.c_str(), ios::in); + MaxSATeval(std::string & _fileName) { + std::fstream file(_fileName.c_str(), std::ios::in); if (!file) { - string str = "MaxSATeval: Could not open file [" + _fileName + "]." ; - throw runtime_error(str); + std::string str = "MaxSATeval: Could not open file [" + _fileName + "]." ; + throw std::runtime_error(str); } - string s; + std::string s; // commentaries - string line; + std::string line; file >> s; while (s[0] == 'c') { getline(file,line,'\n'); @@ -127,23 +127,23 @@ public: // parameters if (s[0] != 'p') { - string str = "MaxSATeval: could not read the parameters of the instance from file [" + _fileName + "]." ; - throw runtime_error(str); + std::string str = "MaxSATeval: could not read the parameters of the instance from file [" + _fileName + "]." ; + throw std::runtime_error(str); } file >> s; if (s != "cnf") { - string str = "MaxSATeval: " + _fileName + " is not a file in cnf format."; - throw runtime_error(str); + std::string str = "MaxSATeval: " + _fileName + " is not a file in cnf format."; + throw std::runtime_error(str); } file >> nbVar >> nbClauses; nbLitteral = 0; // could be different from one clause to antoher, so no value // creation of the clauses - clauses = new vector[nbClauses]; + clauses = new std::vector[nbClauses]; // the variables are numbered from 1 to nbVar - variables = new vector[nbVar + 1]; + variables = new std::vector[nbVar + 1]; // read the clauses int number; @@ -182,20 +182,20 @@ public: * * @param _fileName file name to export the instance */ - void save(string & _fileName) { - fstream file(_fileName.c_str(), ios::out); + void save(std::string & _fileName) { + std::fstream file(_fileName.c_str(), std::ios::out); if (!file) { - string str = "MaxSATeval: Could not open " + _fileName; - throw runtime_error(str); + std::string str = "MaxSATeval: Could not open " + _fileName; + throw std::runtime_error(str); } // write some commentaries - file << "c random max k-SAT generated by maxSATeval from paradisEO framework on sourceForge" << endl; - file << "c "<< endl; + file << "c random max k-SAT generated by maxSATeval from paradisEO framework on sourceForge" << std::endl; + file << "c "<< std::endl; // write the parameters - file << "p cnf " << nbVar << " " << nbClauses << endl; + file << "p cnf " << nbVar << " " << nbClauses << std::endl; // write the clauses unsigned int i, j; @@ -265,12 +265,12 @@ public: // list of clauses: // each clause has the number of the variable (from 1 to nbVar) // when the value is negative, litteral = not(variable) - vector * clauses; + std::vector * clauses; // list of variables: // for each variable, the list of clauses // when the value is negative, litteral = not(variable) in this clause - vector * variables; + std::vector * variables; };