Fix printed string showed when file opening fails
This commit is contained in:
parent
ab7f4c8113
commit
57f46e7c0d
@ -81,6 +81,7 @@ BayesBallGraph::exportToGraphViz (const char* fileName)
|
||||
std::ofstream out (fileName);
|
||||
if (!out.is_open()) {
|
||||
std::cerr << "Error: couldn't open file '" << fileName << "'." ;
|
||||
std::cerr << std::endl;
|
||||
return;
|
||||
}
|
||||
out << "digraph {" << std::endl;
|
||||
|
@ -538,6 +538,7 @@ ConstraintTree::exportToGraphViz (
|
||||
std::ofstream out (fileName);
|
||||
if (!out.is_open()) {
|
||||
std::cerr << "Error: couldn't open file '" << fileName << "'." ;
|
||||
std::cerr << std::endl;
|
||||
return;
|
||||
}
|
||||
out << "digraph {" << std::endl;
|
||||
|
@ -99,6 +99,7 @@ ElimGraph::exportToGraphViz (
|
||||
std::ofstream out (fileName);
|
||||
if (!out.is_open()) {
|
||||
std::cerr << "Error: couldn't open file '" << fileName << "'." ;
|
||||
std::cerr << std::endl;
|
||||
return;
|
||||
}
|
||||
out << "strict graph {" << std::endl;
|
||||
|
@ -54,6 +54,7 @@ FactorGraph::readFromUaiFormat (const char* fileName)
|
||||
std::ifstream is (fileName);
|
||||
if (!is.is_open()) {
|
||||
std::cerr << "Error: couldn't open file '" << fileName << "'." ;
|
||||
std::cerr << std::endl;
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
ignoreLines (is);
|
||||
@ -139,6 +140,7 @@ FactorGraph::readFromLibDaiFormat (const char* fileName)
|
||||
std::ifstream is (fileName);
|
||||
if (!is.is_open()) {
|
||||
std::cerr << "Error: couldn't open file '" << fileName << "'." ;
|
||||
std::cerr << std::endl;
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
ignoreLines (is);
|
||||
@ -300,6 +302,7 @@ FactorGraph::exportToLibDai (const char* fileName) const
|
||||
std::ofstream out (fileName);
|
||||
if (!out.is_open()) {
|
||||
std::cerr << "Error: couldn't open file '" << fileName << "'." ;
|
||||
std::cerr << std::endl;
|
||||
return;
|
||||
}
|
||||
out << facNodes_.size() << std::endl << std::endl;
|
||||
@ -331,6 +334,7 @@ FactorGraph::exportToUai (const char* fileName) const
|
||||
std::ofstream out (fileName);
|
||||
if (!out.is_open()) {
|
||||
std::cerr << "Error: couldn't open file '" << fileName << "'." ;
|
||||
std::cerr << std::endl;
|
||||
return;
|
||||
}
|
||||
out << (bayesFactors_ ? "BAYES" : "MARKOV") ;
|
||||
@ -377,6 +381,7 @@ FactorGraph::exportToGraphViz (const char* fileName) const
|
||||
std::ofstream out (fileName);
|
||||
if (!out.is_open()) {
|
||||
std::cerr << "Error: couldn't open file '" << fileName << "'." ;
|
||||
std::cerr << std::endl;
|
||||
return;
|
||||
}
|
||||
out << "graph \"" << fileName << "\" {" << std::endl;
|
||||
|
@ -285,6 +285,7 @@ LiftedCircuit::exportToGraphViz (const char* fileName)
|
||||
std::ofstream out (fileName);
|
||||
if (!out.is_open()) {
|
||||
std::cerr << "Error: couldn't open file '" << fileName << "'." ;
|
||||
std::cerr << std::endl;
|
||||
return;
|
||||
}
|
||||
out << "digraph {" << std::endl;
|
||||
|
Reference in New Issue
Block a user