## lustrec-tests / regression_tests / lustre_files / success / Simulink / src_many_files / inv_M_3x3.LUSTREC.lus @ cd1faebc

History | View | Annotate | Download (2.53 KB)

1 |
-- This file has been generated by CoCoSim2. |
---|---|

2 | |

3 |
-- Compiler: Lustre compiler 2 (ToLustre.m) |

4 |
-- Time: 03-Dec-2018 22:52:42 |

5 |
node _inv_M_3x3(a11 : real; |

6 |
a21 : real; |

7 |
a31 : real; |

8 |
a12 : real; |

9 |
a22 : real; |

10 |
a32 : real; |

11 |
a13 : real; |

12 |
a23 : real; |

13 |
a33 : real;) |

14 |
returns(ai11 : real; |

15 |
ai21 : real; |

16 |
ai31 : real; |

17 |
ai12 : real; |

18 |
ai22 : real; |

19 |
ai32 : real; |

20 |
ai13 : real; |

21 |
ai23 : real; |

22 |
ai33 : real;); |

23 |
var det : real; |

24 |
adj11 : real; |

25 |
adj12 : real; |

26 |
adj13 : real; |

27 |
adj21 : real; |

28 |
adj22 : real; |

29 |
adj23 : real; |

30 |
adj31 : real; |

31 |
adj32 : real; |

32 |
adj33 : real; |

33 |
let |

34 |
assert (det <> 0.0); |

35 |
det = (((a11 * adj11) + (a12 * adj21)) + (a13 * adj31)); |

36 |
adj11 = ((a22 * a33) - (a23 * a32)); |

37 |
adj21 = ((a23 * a31) - (a21 * a33)); |

38 |
adj31 = ((a21 * a32) - (a31 * a22)); |

39 |
adj12 = ((a13 * a32) - (a33 * a12)); |

40 |
adj22 = ((a11 * a33) - (a13 * a31)); |

41 |
adj32 = ((a12 * a31) - (a32 * a11)); |

42 |
adj13 = ((a12 * a23) - (a22 * a13)); |

43 |
adj23 = ((a13 * a21) - (a23 * a11)); |

44 |
adj33 = ((a11 * a22) - (a21 * a12)); |

45 |
ai11 = (adj11 / det); |

46 |
ai12 = (adj12 / det); |

47 |
ai13 = (adj13 / det); |

48 |
ai21 = (adj21 / det); |

49 |
ai22 = (adj22 / det); |

50 |
ai23 = (adj23 / det); |

51 |
ai31 = (adj31 / det); |

52 |
ai32 = (adj32 / det); |

53 |
ai33 = (adj33 / det); |

54 |
tel |

55 | |

56 |
(* |

57 |
Original block name: inv_M_3x3 |

58 |
*) |

59 |
node inv_M_3x3(_virtual : bool;) |

60 |
returns(Out1_1 : real; |

61 |
Out1_2 : real; |

62 |
Out1_3 : real; |

63 |
Out1_4 : real; |

64 |
Out1_5 : real; |

65 |
Out1_6 : real; |

66 |
Out1_7 : real; |

67 |
Out1_8 : real; |

68 |
Out1_9 : real;); |

69 |
var Constant_1 : real; |

70 |
Constant_2 : real; |

71 |
Constant_3 : real; |

72 |
Constant_4 : real; |

73 |
Constant_5 : real; |

74 |
Constant_6 : real; |

75 |
Constant_7 : real; |

76 |
Constant_8 : real; |

77 |
Constant_9 : real; |

78 |
Divide_1 : real; |

79 |
Divide_2 : real; |

80 |
Divide_3 : real; |

81 |
Divide_4 : real; |

82 |
Divide_5 : real; |

83 |
Divide_6 : real; |

84 |
Divide_7 : real; |

85 |
Divide_8 : real; |

86 |
Divide_9 : real; |

87 |
__time_step : real; |

88 |
__nb_step : int; |

89 |
let |

90 |
Constant_1 = 1.000000000000000; |

91 |
Constant_2 = 3.000000000000000; |

92 |
Constant_3 = 2.000000000000000; |

93 |
Constant_4 = 2.000000000000000; |

94 |
Constant_5 = 1.000000000000000; |

95 |
Constant_6 = 0.000000000000000; |

96 |
Constant_7 = 3.000000000000000; |

97 |
Constant_8 = 0.000000000000000; |

98 |
Constant_9 = 1.000000000000000; |

99 |
(Divide_1, Divide_2, Divide_3, Divide_4, Divide_5, Divide_6, Divide_7, Divide_8, Divide_9) = _inv_M_3x3(Constant_1, Constant_2, Constant_3, Constant_4, Constant_5, Constant_6, Constant_7, Constant_8, Constant_9); |

100 |
Out1_1 = Divide_1; |

101 |
Out1_2 = Divide_2; |

102 |
Out1_3 = Divide_3; |

103 |
Out1_4 = Divide_4; |

104 |
Out1_5 = Divide_5; |

105 |
Out1_6 = Divide_6; |

106 |
Out1_7 = Divide_7; |

107 |
Out1_8 = Divide_8; |

108 |
Out1_9 = Divide_9; |

109 |
__time_step = (0.0 -> ((pre __time_step) + 0.200000000000000)); |

110 |
__nb_step = (0 -> ((pre __nb_step) + 1)); |

111 |
tel |

112 |