2015-09-28 Paul Thomas <pault@gcc.gnu.org>
[official-gcc.git] / gcc / ada / a-ngcoar.ads
blob8f8f37a79062fd50ed4181abc6c21410eb81e85a
1 ------------------------------------------------------------------------------
2 -- --
3 -- GNAT RUN-TIME COMPONENTS --
4 -- --
5 -- ADA.NUMERICS.GENERIC_COMPLEX_ARRAYS --
6 -- --
7 -- S p e c --
8 -- --
9 -- This specification is derived from the Ada Reference Manual for use with --
10 -- GNAT. In accordance with the copyright of that document, you can freely --
11 -- copy and modify this specification, provided that if you redistribute a --
12 -- modified version, any changes that you have made are clearly indicated. --
13 -- --
14 ------------------------------------------------------------------------------
16 with Ada.Numerics.Generic_Real_Arrays, Ada.Numerics.Generic_Complex_Types;
18 generic
19 with package Real_Arrays is new Ada.Numerics.Generic_Real_Arrays (<>);
20 use Real_Arrays;
21 with package Complex_Types is new Ada.Numerics.Generic_Complex_Types (Real);
22 use Complex_Types;
23 package Ada.Numerics.Generic_Complex_Arrays is
24 pragma Pure (Generic_Complex_Arrays);
26 -- Types
28 type Complex_Vector is array (Integer range <>) of Complex;
29 type Complex_Matrix is
30 array (Integer range <>, Integer range <>) of Complex;
32 -- Subprograms for Complex_Vector types
33 -- Complex_Vector selection, conversion and composition operations
35 function Re (X : Complex_Vector) return Real_Vector;
36 function Im (X : Complex_Vector) return Real_Vector;
38 procedure Set_Re (X : in out Complex_Vector; Re : Real_Vector);
39 procedure Set_Im (X : in out Complex_Vector; Im : Real_Vector);
41 function Compose_From_Cartesian
42 (Re : Real_Vector) return Complex_Vector;
43 function Compose_From_Cartesian
44 (Re, Im : Real_Vector) return Complex_Vector;
46 function Modulus (X : Complex_Vector) return Real_Vector;
47 function "abs" (Right : Complex_Vector) return Real_Vector renames Modulus;
48 function Argument (X : Complex_Vector) return Real_Vector;
50 function Argument
51 (X : Complex_Vector;
52 Cycle : Real'Base) return Real_Vector;
54 function Compose_From_Polar
55 (Modulus, Argument : Real_Vector) return Complex_Vector;
57 function Compose_From_Polar
58 (Modulus, Argument : Real_Vector;
59 Cycle : Real'Base) return Complex_Vector;
61 -- Complex_Vector arithmetic operations
63 function "+" (Right : Complex_Vector) return Complex_Vector;
64 function "-" (Right : Complex_Vector) return Complex_Vector;
65 function Conjugate (X : Complex_Vector) return Complex_Vector;
66 function "+" (Left, Right : Complex_Vector) return Complex_Vector;
67 function "-" (Left, Right : Complex_Vector) return Complex_Vector;
68 function "*" (Left, Right : Complex_Vector) return Complex;
69 function "abs" (Right : Complex_Vector) return Real'Base;
71 -- Mixed Real_Vector and Complex_Vector arithmetic operations
73 function "+"
74 (Left : Real_Vector;
75 Right : Complex_Vector) return Complex_Vector;
77 function "+"
78 (Left : Complex_Vector;
79 Right : Real_Vector) return Complex_Vector;
81 function "-"
82 (Left : Real_Vector;
83 Right : Complex_Vector) return Complex_Vector;
85 function "-"
86 (Left : Complex_Vector;
87 Right : Real_Vector) return Complex_Vector;
89 function "*" (Left : Real_Vector; Right : Complex_Vector) return Complex;
90 function "*" (Left : Complex_Vector; Right : Real_Vector) return Complex;
92 -- Complex_Vector scaling operations
94 function "*"
95 (Left : Complex;
96 Right : Complex_Vector) return Complex_Vector;
98 function "*"
99 (Left : Complex_Vector;
100 Right : Complex) return Complex_Vector;
102 function "/"
103 (Left : Complex_Vector;
104 Right : Complex) return Complex_Vector;
106 function "*"
107 (Left : Real'Base;
108 Right : Complex_Vector) return Complex_Vector;
110 function "*"
111 (Left : Complex_Vector;
112 Right : Real'Base) return Complex_Vector;
114 function "/"
115 (Left : Complex_Vector;
116 Right : Real'Base) return Complex_Vector;
118 -- Other Complex_Vector operations
120 function Unit_Vector
121 (Index : Integer;
122 Order : Positive;
123 First : Integer := 1) return Complex_Vector;
125 -- Subprograms for Complex_Matrix types
127 -- Complex_Matrix selection, conversion and composition operations
129 function Re (X : Complex_Matrix) return Real_Matrix;
130 function Im (X : Complex_Matrix) return Real_Matrix;
132 procedure Set_Re (X : in out Complex_Matrix; Re : Real_Matrix);
133 procedure Set_Im (X : in out Complex_Matrix; Im : Real_Matrix);
135 function Compose_From_Cartesian (Re : Real_Matrix) return Complex_Matrix;
137 function Compose_From_Cartesian
138 (Re, Im : Real_Matrix) return Complex_Matrix;
140 function Modulus (X : Complex_Matrix) return Real_Matrix;
141 function "abs" (Right : Complex_Matrix) return Real_Matrix renames Modulus;
143 function Argument (X : Complex_Matrix) return Real_Matrix;
145 function Argument
146 (X : Complex_Matrix;
147 Cycle : Real'Base) return Real_Matrix;
149 function Compose_From_Polar
150 (Modulus, Argument : Real_Matrix) return Complex_Matrix;
152 function Compose_From_Polar
153 (Modulus : Real_Matrix;
154 Argument : Real_Matrix;
155 Cycle : Real'Base) return Complex_Matrix;
157 -- Complex_Matrix arithmetic operations
159 function "+" (Right : Complex_Matrix) return Complex_Matrix;
160 function "-" (Right : Complex_Matrix) return Complex_Matrix;
162 function Conjugate (X : Complex_Matrix) return Complex_Matrix;
163 function Transpose (X : Complex_Matrix) return Complex_Matrix;
165 function "+" (Left, Right : Complex_Matrix) return Complex_Matrix;
166 function "-" (Left, Right : Complex_Matrix) return Complex_Matrix;
167 function "*" (Left, Right : Complex_Matrix) return Complex_Matrix;
168 function "*" (Left, Right : Complex_Vector) return Complex_Matrix;
170 function "*"
171 (Left : Complex_Vector;
172 Right : Complex_Matrix) return Complex_Vector;
174 function "*"
175 (Left : Complex_Matrix;
176 Right : Complex_Vector) return Complex_Vector;
178 -- Mixed Real_Matrix and Complex_Matrix arithmetic operations
180 function "+"
181 (Left : Real_Matrix;
182 Right : Complex_Matrix) return Complex_Matrix;
184 function "+"
185 (Left : Complex_Matrix;
186 Right : Real_Matrix) return Complex_Matrix;
188 function "-"
189 (Left : Real_Matrix;
190 Right : Complex_Matrix) return Complex_Matrix;
192 function "-"
193 (Left : Complex_Matrix;
194 Right : Real_Matrix) return Complex_Matrix;
196 function "*"
197 (Left : Real_Matrix;
198 Right : Complex_Matrix) return Complex_Matrix;
200 function "*"
201 (Left : Complex_Matrix;
202 Right : Real_Matrix) return Complex_Matrix;
204 function "*"
205 (Left : Real_Vector;
206 Right : Complex_Vector) return Complex_Matrix;
208 function "*"
209 (Left : Complex_Vector;
210 Right : Real_Vector) return Complex_Matrix;
212 function "*"
213 (Left : Real_Vector;
214 Right : Complex_Matrix) return Complex_Vector;
216 function "*"
217 (Left : Complex_Vector;
218 Right : Real_Matrix) return Complex_Vector;
220 function "*"
221 (Left : Real_Matrix;
222 Right : Complex_Vector) return Complex_Vector;
224 function "*"
225 (Left : Complex_Matrix;
226 Right : Real_Vector) return Complex_Vector;
228 -- Complex_Matrix scaling operations
230 function "*"
231 (Left : Complex;
232 Right : Complex_Matrix) return Complex_Matrix;
234 function "*"
235 (Left : Complex_Matrix;
236 Right : Complex) return Complex_Matrix;
238 function "/"
239 (Left : Complex_Matrix;
240 Right : Complex) return Complex_Matrix;
242 function "*"
243 (Left : Real'Base;
244 Right : Complex_Matrix) return Complex_Matrix;
246 function "*"
247 (Left : Complex_Matrix;
248 Right : Real'Base) return Complex_Matrix;
250 function "/"
251 (Left : Complex_Matrix;
252 Right : Real'Base) return Complex_Matrix;
254 -- Complex_Matrix inversion and related operations
256 function Solve
257 (A : Complex_Matrix;
258 X : Complex_Vector) return Complex_Vector;
260 function Solve (A, X : Complex_Matrix) return Complex_Matrix;
262 function Inverse (A : Complex_Matrix) return Complex_Matrix;
264 function Determinant (A : Complex_Matrix) return Complex;
266 -- Eigenvalues and vectors of a Hermitian matrix
268 function Eigenvalues (A : Complex_Matrix) return Real_Vector;
270 procedure Eigensystem
271 (A : Complex_Matrix;
272 Values : out Real_Vector;
273 Vectors : out Complex_Matrix);
275 -- Other Complex_Matrix operations
277 function Unit_Matrix
278 (Order : Positive;
279 First_1, First_2 : Integer := 1) return Complex_Matrix;
281 end Ada.Numerics.Generic_Complex_Arrays;