Skip to content

Commit

Permalink
better handling of wrong filenames
Browse files Browse the repository at this point in the history
  • Loading branch information
hhijazi committed Sep 27, 2023
1 parent 0e690a4 commit 794fedc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions examples/Optimization/MISDP/CBF/misdp_cbf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,10 @@ int main(int argc, char * argv[]){
m->add_hierarc=hierarc;

auto g=CBF_read(fname.c_str(), m);
if(g.nodes.size()==0){
cerr << "graph with size 0\n";
return -1;
}
m->print();
DebugOn("Instance "<<fname<<endl);

Expand Down
3 changes: 2 additions & 1 deletion examples/Optimization/MISDP/CBF/read_misdp.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,8 @@ Net CBF_read(const char *file, shared_ptr<Model<double>>& m, bool add_3d) {

pFile = FOPEN(file, "rt");
if (!pFile) {
throw invalid_argument("cannot open misdp data file");
cerr <<"Cannot open misdp data file " << file << endl;
return g;
}
CBFdata data = { 0, };
// Keyword OBJ should exist!
Expand Down

0 comments on commit 794fedc

Please sign in to comment.