2 -- { dg-options "-gnatws" }
4 procedure View_Conversion1
is
6 type Matrix
is array (Integer range <>, Integer range <>) of Float;
8 S1
: Matrix
(-3 .. -2, 2 .. 3) := ((2.0, -1.0), (-1.0, 2.0));
9 S2
: Matrix
(1 .. 2, 1 .. 2) := S1
;
10 S3
: Matrix
(2 .. 3, -3 .. -2);
11 S4
: Matrix
(1 .. 2, 1 .. 2);
13 function Normal_Last
(A
: Matrix
; N
: Natural) return Boolean is
15 if A
'Last (1) = N
and then A
'Last (2) = N
then
22 procedure Transpose
(A
: Matrix
; B
: out Matrix
) is
23 N
: constant Natural := A
'Length (1);
24 subtype Normal_Matrix
is Matrix
(1 .. N
, 1 .. N
);
26 if not Normal_Last
(A
, N
) or else not Normal_Last
(B
, N
) then
27 Transpose
(Normal_Matrix
(A
), Normal_Matrix
(B
));