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

Annotation of /trunk/models/test/blackbox/passmerge.a4c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1037 - (hide annotations) (download) (as text)
Thu Jan 4 08:11:55 2007 UTC (15 years, 7 months ago) by johnpye
File MIME type: text/x-ascend
File size: 2021 byte(s)
Fixed a few more TestBlackBox test cases.
1 johnpye 1032 REQUIRE "test/blackbox/pass.a4c";
2    
3     (* merged input solve *)
4     MODEL pass7 REFINES pass1;
5     x[1..2] ARE_THE_SAME;
6     END pass7;
7    
8     (* merged input reverse solve *)
9     MODEL pass8 REFINES pass7;
10     METHODS
11 johnpye 1037 METHOD specify;
12     RUN specify_reverse;
13     y[1].fixed := FALSE;
14     END specify;
15 johnpye 1032 END pass8;
16    
17     (* merged output solve *)
18     MODEL pass9 REFINES pass1;
19     y[1..2] ARE_THE_SAME;
20     METHODS
21 johnpye 1037 METHOD specify;
22     RUN pass1::specify;
23     x[1].fixed := FALSE;
24     END specify;
25 johnpye 1032 END pass9;
26    
27     (* merged output reverse solve *)
28     MODEL pass10 REFINES pass9;
29     METHODS
30 johnpye 1037 METHOD specify;
31     RUN specify_reverse;
32     END specify;
33 johnpye 1032 END pass10;
34    
35     (* merged input/output solve *)
36     MODEL pass11 REFINES pass1;
37     y[1], x[1] ARE_THE_SAME; (* always self consistent in theory unless you think you fixed both to distinct values. *)
38     METHODS
39 johnpye 1037 METHOD specify;
40     RUN pass1::specify;
41     x[1].fixed := FALSE;
42     END specify;
43 johnpye 1032 END pass11;
44    
45     (* merged input/output reverse solve *)
46     MODEL pass12 REFINES pass11 ;
47     METHODS
48 johnpye 1037 METHOD specify;
49     RUN specify_reverse;
50     y[1].fixed := FALSE;
51     END specify;
52 johnpye 1032 END pass12;
53    
54     (* cross-merged input/output solve *)
55     MODEL pass13 REFINES pass1;
56     y[1],x[2] ARE_THE_SAME; (* generally infeasible *)
57     METHODS
58 johnpye 1037 METHOD values_feasible;
59     x[1..2] := 7; (* could be any constant. result will be y1==y2 *)
60     END values_feasible;
61     METHOD values_infeasible;
62     x[1] := x[2] +1; (* could be any constant. result will be solve fail *)
63     END values_infeasible;
64     METHOD default_all;
65     RUN default_self;
66     RUN values_feasible;
67     END default_all;
68 johnpye 1032
69 johnpye 1037 METHOD on_load;
70     RUN reset;
71     RUN default_all;
72     END on_load;
73 johnpye 1032
74 johnpye 1037 METHOD self_test;
75     FOR i IN [1..2] DO
76     ASSERT x[i] == 7;
77     ASSERT y[i] == 7*coef;
78     END FOR;
79     END self_test;
80 johnpye 1032 END pass13;
81    
82     (* cross-merged input/output reverse solve *)
83     MODEL pass14 REFINES pass13;
84     METHODS
85 johnpye 1037 METHOD specify;
86     RUN specify_reverse;
87     FREE y[2];
88     END specify;
89     METHOD self_test;
90     ASSERT x[1] == 7.0/coef;
91     ASSERT y[1] == 7;
92     ASSERT x[2] == 7;
93     ASSERT y[2] == 7*coef;
94     ASSERT x[3] == -4/coef;
95     ASSERT y[3] == -4;
96     END self_test;
97 johnpye 1032 END pass14;

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