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

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

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

revision 1036 by johnpye, Thu Jan 4 01:51:38 2007 UTC revision 1037 by johnpye, Thu Jan 4 08:11:55 2007 UTC
# Line 8  END pass7; Line 8  END pass7;
8  (*  merged input reverse solve *)  (*  merged input reverse solve *)
9  MODEL pass8 REFINES pass7;  MODEL pass8 REFINES pass7;
10  METHODS  METHODS
11  METHOD specify;      METHOD specify;
12      RUN specify_reverse;          RUN specify_reverse;
13      y[1].fixed := FALSE;          y[1].fixed := FALSE;
14  END specify;      END specify;
15  END pass8;  END pass8;
16    
17  (*  merged output solve *)  (*  merged output solve *)
18  MODEL pass9 REFINES pass1;  MODEL pass9 REFINES pass1;
19      y[1..2] ARE_THE_SAME;      y[1..2] ARE_THE_SAME;
20  METHODS  METHODS
21  METHOD specify;      METHOD specify;
22      RUN pass1::specify;          RUN pass1::specify;
23      x[1].fixed := FALSE;          x[1].fixed := FALSE;
24  END specify;      END specify;
25  END pass9;  END pass9;
26    
27  (*  merged output reverse solve *)  (*  merged output reverse solve *)
28  MODEL pass10 REFINES pass9;  MODEL pass10 REFINES pass9;
29  METHODS  METHODS
30  METHOD specify;      METHOD specify;
31      RUN specify_reverse;          RUN specify_reverse;
32  END specify;      END specify;
33  END pass10;  END pass10;
34    
35  (*  merged input/output solve *)  (*  merged input/output solve *)
36  MODEL pass11 REFINES pass1;  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. *)      y[1], x[1] ARE_THE_SAME; (* always self consistent in theory unless you think you fixed both to distinct values. *)
38  METHODS  METHODS
39  METHOD specify;      METHOD specify;
40      RUN pass1::specify;          RUN pass1::specify;
41      x[1].fixed := FALSE;          x[1].fixed := FALSE;
42  END specify;      END specify;
43  END pass11;  END pass11;
44    
45  (*  merged input/output reverse solve *)  (*  merged input/output reverse solve *)
46  MODEL pass12 REFINES pass11 ;  MODEL pass12 REFINES pass11 ;
47  METHODS  METHODS
48  METHOD specify;      METHOD specify;
49      RUN specify_reverse;          RUN specify_reverse;
50      y[1].fixed := FALSE;          y[1].fixed := FALSE;
51  END specify;      END specify;
52  END pass12;  END pass12;
53    
54  (*  cross-merged input/output solve *)  (*  cross-merged input/output solve *)
55  MODEL pass13 REFINES pass1;  MODEL pass13 REFINES pass1;
56      y[1],x[2] ARE_THE_SAME; (* generally infeasible *)      y[1],x[2] ARE_THE_SAME; (* generally infeasible *)
57  METHODS  METHODS
58  METHOD values_feasible;      METHOD values_feasible;
59      x[1..2] := 7; (* could be any constant. result will be y1==y2 *)          x[1..2] := 7; (* could be any constant. result will be y1==y2 *)
60  END values_feasible;      END values_feasible;
61  METHOD values_infeasible;      METHOD values_infeasible;
62      x[1] := x[2] +1; (* could be any constant. result will be solve fail *)          x[1] := x[2] +1; (* could be any constant. result will be solve fail *)
63  END values_infeasible;      END values_infeasible;
64  METHOD default_all;      METHOD default_all;
65      RUN default_self;          RUN default_self;
66      RUN values_feasible;          RUN values_feasible;
67  END default_all;      END default_all;
68    
69  METHOD on_load;      METHOD on_load;
70      RUN reset;          RUN reset;
71      RUN default_all;          RUN default_all;
72  END on_load;      END on_load;
73    
74  METHOD self_test;      METHOD self_test;
75      FOR i IN [1..2] DO          FOR i IN [1..2] DO
76          ASSERT x[i] == 7;              ASSERT x[i] == 7;
77          ASSERT y[i] == 7*coef;              ASSERT y[i] == 7*coef;
78      END FOR;          END FOR;
79  END self_test;      END self_test;
   
80  END pass13;  END pass13;
81    
82  (*  cross-merged input/output reverse solve *)  (*  cross-merged input/output reverse solve *)
83  MODEL pass14 REFINES pass13;  MODEL pass14 REFINES pass13;
84  METHODS  METHODS
85  METHOD specify;      METHOD specify;
86          RUN specify_reverse;          RUN specify_reverse;
87  END specify;          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  END pass14;  END pass14;

Legend:
Removed from v.1036  
changed lines
  Added in v.1037

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