Project

General

Profile

Statistics
| Branch: | Tag: | Revision:

lustrec / test / src / arrays_arnaud / arrays.lus @ 22fe1c93

History | View | Annotate | Download (524 Bytes)

1
node add_vect_3 (in1,in2 : int^2) returns (out : int^2)
2
var t:int;
3
let
4
 t = in1[0];
5
out = [in1[0]+in2[0],in1[1]+in2[1]];
6
tel
7

    
8
node min_vect_2 (in : int^2) returns (out: int)
9
let
10
	out = if (in[0] < in[1]) then in[0] else in[1];
11
tel
12

    
13
node mumuse (in1 : int^2^2; mult : int) returns (out : int^4)
14
var
15
	tmp : int^2^2;
16
	tmp2 : int^2;
17
let
18
	tmp = [ [ in1[0][0]*mult , in1[0][1] ] , [ in1[1][0]*mult , in1[1][1] ] ];
19
	tmp2 = add_vect_3 ( tmp[0] , [ mult,mult ] );
20
	out = [ tmp[0][0] , min_vect_2 (tmp2) , tmp[0][1] , tmp2[1] ];
21
tel