/[ascend]/trunk/pygtk/testipopt.cpp
ViewVC logotype

Diff of /trunk/pygtk/testipopt.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2202 by mahesh, Fri Dec 18 01:32:28 2009 UTC revision 2203 by jpye, Fri May 21 04:29:59 2010 UTC
# Line 9  using namespace std; Line 9  using namespace std;
9  int main(void){  int main(void){
10    
11      Library L;      Library L;
12      L.load("test/ipopt/test1.a4c");      L.load("test/ipopt/test2.a4c");
13      Type t = L.findType("test1");      Type t = L.findType("test2");
     cerr << "Type = " << t.getName() << endl;  
14      Simulation S = t.getSimulation("S");      Simulation S = t.getSimulation("S");
       
     S.build();  
       
     cerr << "About to solve..." << endl;  
     S.run(t.getMethod("bound_self"));  
     S.run(t.getMethod("default_self"));  
15      SolverReporter R;      SolverReporter R;
16      S.solve(Solver("IPOPT"),R);      try{
17            S.solve(Solver("IPOPT"),R);
18        }catch(runtime_error &e){
19            cerr << "ERROR in solving:" << e.what() << endl;
20            exit(1);
21        }
22      S.run(t.getMethod("self_test"));      S.run(t.getMethod("self_test"));
23  }  }

Legend:
Removed from v.2202  
changed lines
  Added in v.2203

john.pye@anu.edu.au
ViewVC Help
Powered by ViewVC 1.1.22