/[ascend]/trunk/models/johnpye/testlog10.a4c
ViewVC logotype

Contents of /trunk/models/johnpye/testlog10.a4c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 973 - (show annotations) (download) (as text)
Tue Dec 19 10:48:38 2006 UTC (18 years, 1 month ago) by johnpye
File MIME type: text/x-ascend
File size: 432 byte(s)
Fixed the 'repeated test' bug (a static pointer to a destroyed symchar was being used in type.cpp)
Improved error reporting for 'not a refined solver_var' message.
Refactors Library::listModules and Library::getModules to use shared code.
TODO: find a more efficient solution to the static pointer problem above.
1 REQUIRE "atoms.a4l";
2
3 MODEL testlog10;
4
5 x IS_A solver_var;
6 y IS_A solver_var;
7 z IS_A solver_var;
8
9 log_10_expr: y = log10(x);
10 log_e_expr: z = ln(x);
11
12 METHODS
13 METHOD specify;
14 FIX x;
15 END specify;
16 METHOD values;
17 x := 10;
18 END values;
19 METHOD on_load;
20 RUN reset;
21 RUN values;
22 END on_load;
23 METHOD self_test;
24 ASSERT abs(y - 1) < 1e-20;
25 ASSERT abs(z - 2.302585093) < 1e-8;
26 ASSERT abs(x - 10) <1e-20;
27 END self_test;
28
29 END testlog10;

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