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

Contents of /trunk/ascxx/testipopt.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2329 - (show annotations) (download) (as text)
Wed Dec 22 12:52:47 2010 UTC (7 years, 11 months ago) by jpye
File MIME type: text/x-c++src
File size: 463 byte(s)
Suppressing some console output.
Added test case that current crashes ASCEND/IPOPT with a memory error.
Issue with library.cpp not containing any way to free libascend memory.
1 #include "library.h"
2 #include "simulation.h"
3 #include "solver.h"
4 #include "solverreporter.h"
5
6 #include <iostream>
7 using namespace std;
8
9 int main(void){
10
11 Library L;
12 L.load("test/ipopt/test2.a4c");
13 Type t = L.findType("test2");
14 Simulation S = t.getSimulation("S");
15 SolverReporter R;
16 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"));
23
24 L.clear();
25 }

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