Project

General

Profile

Statistics
| Branch: | Tag: | Revision:

lustrec-tests / sandbox / extraction / linear / ex1_mat.lus @ 43460259

History | View | Annotate | Download (449 Bytes)

1
#open "libarrays"
2

    
3
node ctl(in0 : real^1^1) returns (mem : real^2^1);
4
var _A:  real^2^2;
5
    _B:  real^2^1;
6
let
7
  _A = [[1.5, 1.],  [-0.7, 0.]]; 
8
  _B = [[1.6, 0.]]; 
9
   assert(in0[0][0] >= -1. and in0[0][0] <= 1.);
10
   mem = [[0., 0.]] -> _MatMul_real(2, 2, 1,  _A,  pre mem) + _MatMul_real(2, 1, 1, _B,  in0);
11
  
12
tel
13

    
14
node top(in0 : real) returns (x,  y:  real);
15
var res:  real^2^1;
16
let
17
  res = ctl([[in0]]);
18
  x = res[0][0];
19
  y = res[0][1];
20
tel
21