Project

General

Profile

Download (11.3 KB) Statistics
| Branch: | Tag: | Revision:
1
-- This file has been generated by CoCoSim2.
2

    
3
-- Compiler: Lustre compiler 2 (ToLustre.m)
4
-- Time: 03-Dec-2018 22:47:18
5
node  abs_real(x : real;)
6
returns(y : real;);
7
let
8
	y = if (x >= 0.0) then
9
		x
10
	    else (- x);
11
tel
12

    
13
(*
14
external node code for doing Lookup_nD
15
*)
16
node  n_minus_DLookupTable_23_571_ext_node(In1_1 : real;
17
	In2_1 : real;)
18
returns(n_minus_DLookupTable_1 : real;);
19
var n_minus_DLookupTable_23_571_table_elem_1 : real;
20
	n_minus_DLookupTable_23_571_table_elem_2 : real;
21
	n_minus_DLookupTable_23_571_table_elem_3 : real;
22
	n_minus_DLookupTable_23_571_table_elem_4 : real;
23
	n_minus_DLookupTable_23_571_table_elem_5 : real;
24
	n_minus_DLookupTable_23_571_table_elem_6 : real;
25
	n_minus_DLookupTable_23_571_table_elem_7 : real;
26
	n_minus_DLookupTable_23_571_table_elem_8 : real;
27
	n_minus_DLookupTable_23_571_table_elem_9 : real;
28
	n_minus_DLookupTable_23_571_Breakpoints_dim1_1 : real;
29
	n_minus_DLookupTable_23_571_Breakpoints_dim1_2 : real;
30
	n_minus_DLookupTable_23_571_Breakpoints_dim1_3 : real;
31
	n_minus_DLookupTable_23_571_Breakpoints_dim2_1 : real;
32
	n_minus_DLookupTable_23_571_Breakpoints_dim2_2 : real;
33
	n_minus_DLookupTable_23_571_Breakpoints_dim2_3 : real;
34
	n_minus_DLookupTable_23_571_dimJump_1 : int;
35
	n_minus_DLookupTable_23_571_dimJump_2 : int;
36
	n_minus_DLookupTable_23_571_index_dim_1_1 : int;
37
	n_minus_DLookupTable_23_571_index_dim_1_2 : int;
38
	n_minus_DLookupTable_23_571_coords_dim_1_1 : real;
39
	n_minus_DLookupTable_23_571_coords_dim_1_2 : real;
40
	n_minus_DLookupTable_23_571_index_dim_2_1 : int;
41
	n_minus_DLookupTable_23_571_index_dim_2_2 : int;
42
	n_minus_DLookupTable_23_571_coords_dim_2_1 : real;
43
	n_minus_DLookupTable_23_571_coords_dim_2_2 : real;
44
	n_minus_DLookupTable_23_571_retTableInd_1 : int;
45
	n_minus_DLookupTable_23_571_disFromTableNode_dim_1_1 : real;
46
	n_minus_DLookupTable_23_571_disFromTableNode_dim_1_2 : real;
47
	n_minus_DLookupTable_23_571_nearestIndex_dim_1 : int;
48
	n_minus_DLookupTable_23_571_disFromTableNode_dim_2_1 : real;
49
	n_minus_DLookupTable_23_571_disFromTableNode_dim_2_2 : real;
50
	n_minus_DLookupTable_23_571_nearestIndex_dim_2 : int;
51
let
52
	n_minus_DLookupTable_23_571_table_elem_1 = 1.000000000000000;
53
	n_minus_DLookupTable_23_571_table_elem_2 = 4.000000000000000;
54
	n_minus_DLookupTable_23_571_table_elem_3 = 7.000000000000000;
55
	n_minus_DLookupTable_23_571_table_elem_4 = 2.000000000000000;
56
	n_minus_DLookupTable_23_571_table_elem_5 = 5.000000000000000;
57
	n_minus_DLookupTable_23_571_table_elem_6 = 8.000000000000000;
58
	n_minus_DLookupTable_23_571_table_elem_7 = 3.000000000000000;
59
	n_minus_DLookupTable_23_571_table_elem_8 = 6.000000000000000;
60
	n_minus_DLookupTable_23_571_table_elem_9 = 9.000000000000000;
61
	n_minus_DLookupTable_23_571_Breakpoints_dim1_1 = 1.000000000000000;
62
	n_minus_DLookupTable_23_571_Breakpoints_dim1_2 = 2.000000000000000;
63
	n_minus_DLookupTable_23_571_Breakpoints_dim1_3 = 3.000000000000000;
64
	n_minus_DLookupTable_23_571_Breakpoints_dim2_1 = 0.000000000000000;
65
	n_minus_DLookupTable_23_571_Breakpoints_dim2_2 = 1.000000000000000;
66
	n_minus_DLookupTable_23_571_Breakpoints_dim2_3 = 2.000000000000000;
67
	n_minus_DLookupTable_23_571_dimJump_1 = 1;
68
	n_minus_DLookupTable_23_571_dimJump_2 = 3;
69
	n_minus_DLookupTable_23_571_index_dim_1_1 = if ((In1_1 >= n_minus_DLookupTable_23_571_Breakpoints_dim1_3) or abs_real(In1_1 - n_minus_DLookupTable_23_571_Breakpoints_dim1_3) <= 0.000000000000000444089209850063) then
70
		3
71
	    else if ((In1_1 >= n_minus_DLookupTable_23_571_Breakpoints_dim1_2) or abs_real(In1_1 - n_minus_DLookupTable_23_571_Breakpoints_dim1_2) <= 0.000000000000000444089209850063) then
72
		2
73
	    else if ((In1_1 >= n_minus_DLookupTable_23_571_Breakpoints_dim1_1) or abs_real(In1_1 - n_minus_DLookupTable_23_571_Breakpoints_dim1_1) <= 0.000000000000000222044604925031) then
74
		1
75
	    else 1;
76
	n_minus_DLookupTable_23_571_coords_dim_1_1 = if ((In1_1 >= n_minus_DLookupTable_23_571_Breakpoints_dim1_3) or abs_real(In1_1 - n_minus_DLookupTable_23_571_Breakpoints_dim1_3) <= 0.000000000000000444089209850063) then
77
		n_minus_DLookupTable_23_571_Breakpoints_dim1_2
78
	    else if ((In1_1 >= n_minus_DLookupTable_23_571_Breakpoints_dim1_2) or abs_real(In1_1 - n_minus_DLookupTable_23_571_Breakpoints_dim1_2) <= 0.000000000000000444089209850063) then
79
		n_minus_DLookupTable_23_571_Breakpoints_dim1_2
80
	    else if ((In1_1 >= n_minus_DLookupTable_23_571_Breakpoints_dim1_1) or abs_real(In1_1 - n_minus_DLookupTable_23_571_Breakpoints_dim1_1) <= 0.000000000000000222044604925031) then
81
		n_minus_DLookupTable_23_571_Breakpoints_dim1_1
82
	    else n_minus_DLookupTable_23_571_Breakpoints_dim1_1;
83
	n_minus_DLookupTable_23_571_index_dim_1_2 = if ((In1_1 >= n_minus_DLookupTable_23_571_Breakpoints_dim1_3) or abs_real(In1_1 - n_minus_DLookupTable_23_571_Breakpoints_dim1_3) <= 0.000000000000000444089209850063) then
84
		3
85
	    else if ((In1_1 >= n_minus_DLookupTable_23_571_Breakpoints_dim1_2) or abs_real(In1_1 - n_minus_DLookupTable_23_571_Breakpoints_dim1_2) <= 0.000000000000000444089209850063) then
86
		3
87
	    else if ((In1_1 >= n_minus_DLookupTable_23_571_Breakpoints_dim1_1) or abs_real(In1_1 - n_minus_DLookupTable_23_571_Breakpoints_dim1_1) <= 0.000000000000000222044604925031) then
88
		2
89
	    else 2;
90
	n_minus_DLookupTable_23_571_coords_dim_1_2 = if ((In1_1 >= n_minus_DLookupTable_23_571_Breakpoints_dim1_3) or abs_real(In1_1 - n_minus_DLookupTable_23_571_Breakpoints_dim1_3) <= 0.000000000000000444089209850063) then
91
		n_minus_DLookupTable_23_571_Breakpoints_dim1_3
92
	    else if ((In1_1 >= n_minus_DLookupTable_23_571_Breakpoints_dim1_2) or abs_real(In1_1 - n_minus_DLookupTable_23_571_Breakpoints_dim1_2) <= 0.000000000000000444089209850063) then
93
		n_minus_DLookupTable_23_571_Breakpoints_dim1_3
94
	    else if ((In1_1 >= n_minus_DLookupTable_23_571_Breakpoints_dim1_1) or abs_real(In1_1 - n_minus_DLookupTable_23_571_Breakpoints_dim1_1) <= 0.000000000000000222044604925031) then
95
		n_minus_DLookupTable_23_571_Breakpoints_dim1_2
96
	    else n_minus_DLookupTable_23_571_Breakpoints_dim1_2;
97
	n_minus_DLookupTable_23_571_index_dim_2_1 = if ((In2_1 >= n_minus_DLookupTable_23_571_Breakpoints_dim2_3) or abs_real(In2_1 - n_minus_DLookupTable_23_571_Breakpoints_dim2_3) <= 0.000000000000000444089209850063) then
98
		3
99
	    else if ((In2_1 >= n_minus_DLookupTable_23_571_Breakpoints_dim2_2) or abs_real(In2_1 - n_minus_DLookupTable_23_571_Breakpoints_dim2_2) <= 0.000000000000000222044604925031) then
100
		2
101
	    else if ((In2_1 >= n_minus_DLookupTable_23_571_Breakpoints_dim2_1) or abs_real(In2_1 - n_minus_DLookupTable_23_571_Breakpoints_dim2_1) <= 0.000000000000000000000000000000) then
102
		1
103
	    else 1;
104
	n_minus_DLookupTable_23_571_coords_dim_2_1 = if ((In2_1 >= n_minus_DLookupTable_23_571_Breakpoints_dim2_3) or abs_real(In2_1 - n_minus_DLookupTable_23_571_Breakpoints_dim2_3) <= 0.000000000000000444089209850063) then
105
		n_minus_DLookupTable_23_571_Breakpoints_dim2_2
106
	    else if ((In2_1 >= n_minus_DLookupTable_23_571_Breakpoints_dim2_2) or abs_real(In2_1 - n_minus_DLookupTable_23_571_Breakpoints_dim2_2) <= 0.000000000000000222044604925031) then
107
		n_minus_DLookupTable_23_571_Breakpoints_dim2_2
108
	    else if ((In2_1 >= n_minus_DLookupTable_23_571_Breakpoints_dim2_1) or abs_real(In2_1 - n_minus_DLookupTable_23_571_Breakpoints_dim2_1) <= 0.000000000000000000000000000000) then
109
		n_minus_DLookupTable_23_571_Breakpoints_dim2_1
110
	    else n_minus_DLookupTable_23_571_Breakpoints_dim2_1;
111
	n_minus_DLookupTable_23_571_index_dim_2_2 = if ((In2_1 >= n_minus_DLookupTable_23_571_Breakpoints_dim2_3) or abs_real(In2_1 - n_minus_DLookupTable_23_571_Breakpoints_dim2_3) <= 0.000000000000000444089209850063) then
112
		3
113
	    else if ((In2_1 >= n_minus_DLookupTable_23_571_Breakpoints_dim2_2) or abs_real(In2_1 - n_minus_DLookupTable_23_571_Breakpoints_dim2_2) <= 0.000000000000000222044604925031) then
114
		3
115
	    else if ((In2_1 >= n_minus_DLookupTable_23_571_Breakpoints_dim2_1) or abs_real(In2_1 - n_minus_DLookupTable_23_571_Breakpoints_dim2_1) <= 0.000000000000000000000000000000) then
116
		2
117
	    else 2;
118
	n_minus_DLookupTable_23_571_coords_dim_2_2 = if ((In2_1 >= n_minus_DLookupTable_23_571_Breakpoints_dim2_3) or abs_real(In2_1 - n_minus_DLookupTable_23_571_Breakpoints_dim2_3) <= 0.000000000000000444089209850063) then
119
		n_minus_DLookupTable_23_571_Breakpoints_dim2_3
120
	    else if ((In2_1 >= n_minus_DLookupTable_23_571_Breakpoints_dim2_2) or abs_real(In2_1 - n_minus_DLookupTable_23_571_Breakpoints_dim2_2) <= 0.000000000000000222044604925031) then
121
		n_minus_DLookupTable_23_571_Breakpoints_dim2_3
122
	    else if ((In2_1 >= n_minus_DLookupTable_23_571_Breakpoints_dim2_1) or abs_real(In2_1 - n_minus_DLookupTable_23_571_Breakpoints_dim2_1) <= 0.000000000000000000000000000000) then
123
		n_minus_DLookupTable_23_571_Breakpoints_dim2_2
124
	    else n_minus_DLookupTable_23_571_Breakpoints_dim2_2;
125
	n_minus_DLookupTable_23_571_disFromTableNode_dim_1_1 = (In1_1 - n_minus_DLookupTable_23_571_coords_dim_1_1);
126
	n_minus_DLookupTable_23_571_disFromTableNode_dim_1_2 = (n_minus_DLookupTable_23_571_coords_dim_1_2 - In1_1);
127
	n_minus_DLookupTable_23_571_nearestIndex_dim_1 = if ((n_minus_DLookupTable_23_571_disFromTableNode_dim_1_2 <= n_minus_DLookupTable_23_571_disFromTableNode_dim_1_1) or abs_real(n_minus_DLookupTable_23_571_disFromTableNode_dim_1_2 - n_minus_DLookupTable_23_571_disFromTableNode_dim_1_1) <= 0.000000000000000444089209850063) then
128
		n_minus_DLookupTable_23_571_index_dim_1_2
129
	    else n_minus_DLookupTable_23_571_index_dim_1_1;
130
	n_minus_DLookupTable_23_571_disFromTableNode_dim_2_1 = (In2_1 - n_minus_DLookupTable_23_571_coords_dim_2_1);
131
	n_minus_DLookupTable_23_571_disFromTableNode_dim_2_2 = (n_minus_DLookupTable_23_571_coords_dim_2_2 - In2_1);
132
	n_minus_DLookupTable_23_571_nearestIndex_dim_2 = if ((n_minus_DLookupTable_23_571_disFromTableNode_dim_2_2 <= n_minus_DLookupTable_23_571_disFromTableNode_dim_2_1) or abs_real(n_minus_DLookupTable_23_571_disFromTableNode_dim_2_2 - n_minus_DLookupTable_23_571_disFromTableNode_dim_2_1) <= 0.000000000000000222044604925031) then
133
		n_minus_DLookupTable_23_571_index_dim_2_2
134
	    else n_minus_DLookupTable_23_571_index_dim_2_1;
135
	n_minus_DLookupTable_23_571_retTableInd_1 = ((n_minus_DLookupTable_23_571_nearestIndex_dim_1 * 1) + ((n_minus_DLookupTable_23_571_nearestIndex_dim_2 - 1) * 3));
136
	n_minus_DLookupTable_1 = if (n_minus_DLookupTable_23_571_retTableInd_1 = 1) then
137
		n_minus_DLookupTable_23_571_table_elem_1
138
	    else if (n_minus_DLookupTable_23_571_retTableInd_1 = 2) then
139
		n_minus_DLookupTable_23_571_table_elem_2
140
	    else if (n_minus_DLookupTable_23_571_retTableInd_1 = 3) then
141
		n_minus_DLookupTable_23_571_table_elem_3
142
	    else if (n_minus_DLookupTable_23_571_retTableInd_1 = 4) then
143
		n_minus_DLookupTable_23_571_table_elem_4
144
	    else if (n_minus_DLookupTable_23_571_retTableInd_1 = 5) then
145
		n_minus_DLookupTable_23_571_table_elem_5
146
	    else if (n_minus_DLookupTable_23_571_retTableInd_1 = 6) then
147
		n_minus_DLookupTable_23_571_table_elem_6
148
	    else if (n_minus_DLookupTable_23_571_retTableInd_1 = 7) then
149
		n_minus_DLookupTable_23_571_table_elem_7
150
	    else if (n_minus_DLookupTable_23_571_retTableInd_1 = 8) then
151
		n_minus_DLookupTable_23_571_table_elem_8
152
	    else n_minus_DLookupTable_23_571_table_elem_9;
153
tel
154

    
155
(*
156
Original block name: LookupTableND_2D_nearest_PP
157
*)
158
node  LookupTableND_2D_nearest_PP(In1_1 : real;
159
	In2_1 : real;)
160
returns(Out1_1 : real;);
161
var n_minus_DLookupTable_1 : real;
162
	__time_step : real;
163
	__nb_step : int;
164
let
165
	n_minus_DLookupTable_1 = n_minus_DLookupTable_23_571_ext_node(In1_1, In2_1);
166
	Out1_1 = n_minus_DLookupTable_1;
167
	__time_step = (0.0 -> ((pre __time_step) + 0.200000000000000));
168
	__nb_step = (0 -> ((pre __nb_step) + 1));
169
tel
170

    
(925-925/1153)