/[ascend]/trunk/models/test/blackbox/bbox3.a4c
ViewVC logotype

Contents of /trunk/models/test/blackbox/bbox3.a4c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1032 - (show annotations) (download) (as text)
Thu Jan 4 01:51:38 2007 UTC (18 years, 11 months ago) by johnpye
File MIME type: text/x-ascend
File size: 858 byte(s)
Added a necessary export symbol in extcall for used by bboxtest.
Broke apart Ben's z-bbox test suite and added it to the Python tests.
1 REQUIRE "system.a4l";
2 REQUIRE "basemodel.a4l";
3 IMPORT "test/blackbox/bboxtest"; (* yi = coef*xi test *)
4
5 MODEL bbox3;
6
7 coef IS_A real_constant;
8 n IS_A integer_constant;
9 coef :== 2.0;
10 n :== 3;
11
12 x[1..n], y[1..n] IS_A generic_real;
13
14 bbox: bboxtest( x[1..n] : INPUT ;
15 y[1..n] : OUTPUT ;
16 coef : DATA);
17
18 METHODS
19
20 METHOD default_all;
21 RUN default_self;
22 END default_all;
23 METHOD default_self;
24 FOR i IN [1..n] DO
25 x[i] := 1+i;
26 y[i] := -x[i];
27 END FOR;
28 END default_self;
29
30 METHOD on_load;
31 RUN reset;
32 RUN default_all;
33 END on_load;
34
35 METHOD self_test;
36 FOR i IN [1..n] DO
37 ASSERT y[1] == coef * x[1];
38 END FOR;
39 END self_test;
40
41 METHOD specify;
42 y[1..n].fixed := FALSE;
43 x[1..n].fixed := TRUE;
44 END specify;
45
46 METHOD specify_reverse;
47 x[1..n].fixed := FALSE;
48 y[1..n].fixed := TRUE;
49 END specify_reverse;
50 END bbox3;

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