OSDN Git Service

* gcc-interface/decl.c (gnat_to_gnu_entity) <E_Class_Wide_Type>: Fix
[pf3gnuchains/gcc-fork.git] / gcc / ada / i-forlap.ads
1 ------------------------------------------------------------------------------
2 --                                                                          --
3 --                         GNAT RUN-TIME COMPONENTS                         --
4 --                                                                          --
5 --             I N T E R F A C E S . F O R T R A N . L A P A C K            --
6 --                                                                          --
7 --                                 S p e c                                  --
8 --                                                                          --
9 --          Copyright (C) 2006-2009, Free Software Foundation, Inc.         --
10 --                                                                          --
11 -- GNAT is free software;  you can  redistribute it  and/or modify it under --
12 -- terms of the  GNU General Public License as published  by the Free Soft- --
13 -- ware  Foundation;  either version 3,  or (at your option) any later ver- --
14 -- sion.  GNAT is distributed in the hope that it will be useful, but WITH- --
15 -- OUT ANY WARRANTY;  without even the  implied warranty of MERCHANTABILITY --
16 -- or FITNESS FOR A PARTICULAR PURPOSE.                                     --
17 --                                                                          --
18 -- As a special exception under Section 7 of GPL version 3, you are granted --
19 -- additional permissions described in the GCC Runtime Library Exception,   --
20 -- version 3.1, as published by the Free Software Foundation.               --
21 --                                                                          --
22 -- You should have received a copy of the GNU General Public License and    --
23 -- a copy of the GCC Runtime Library Exception along with this program;     --
24 -- see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see    --
25 -- <http://www.gnu.org/licenses/>.                                          --
26 --                                                                          --
27 -- GNAT was originally developed  by the GNAT team at  New York University. --
28 -- Extensive contributions were provided by Ada Core Technologies Inc.      --
29 --                                                                          --
30 ------------------------------------------------------------------------------
31
32 --  Package comment required if non-RM package ???
33
34 with Interfaces.Fortran.BLAS;
35 package Interfaces.Fortran.LAPACK is
36    pragma Pure;
37
38    type Integer_Vector is array (Integer range <>) of Integer;
39
40    Upper : aliased constant Character := 'U';
41    Lower : aliased constant Character := 'L';
42
43    subtype Real_Vector is BLAS.Real_Vector;
44    subtype Real_Matrix is BLAS.Real_Matrix;
45    subtype Double_Precision_Vector is BLAS.Double_Precision_Vector;
46    subtype Double_Precision_Matrix is BLAS.Double_Precision_Matrix;
47    subtype Complex_Vector is BLAS.Complex_Vector;
48    subtype Complex_Matrix is BLAS.Complex_Matrix;
49    subtype Double_Complex_Vector is BLAS.Double_Complex_Vector;
50    subtype Double_Complex_Matrix is BLAS.Double_Complex_Matrix;
51
52    --  LAPACK Computational Routines
53
54    --  gerfs  Refines the solution of a system of linear equations with
55    --         a general matrix and estimates its error
56    --  getrf  Computes LU factorization of a general m-by-n matrix
57    --  getri  Computes inverse of an LU-factored general matrix
58    --         square matrix, with multiple right-hand sides
59    --  getrs  Solves a system of linear equations with an LU-factored
60    --         square matrix, with multiple right-hand sides
61    --  hetrd  Reduces a complex Hermitian matrix to tridiagonal form
62    --  heevr  Computes selected eigenvalues and, optionally, eigenvectors of
63    --         a Hermitian matrix using the Relatively Robust Representations
64    --  orgtr  Generates the real orthogonal matrix Q determined by sytrd
65    --  steqr  Computes all eigenvalues and eigenvectors of a symmetric or
66    --         Hermitian matrix reduced to tridiagonal form (QR algorithm)
67    --  sterf  Computes all eigenvalues of a real symmetric
68    --         tridiagonal matrix using QR algorithm
69    --  sytrd  Reduces a real symmetric matrix to tridiagonal form
70
71    procedure sgetrf
72      (M     : Natural;
73       N     : Natural;
74       A     : in out Real_Matrix;
75       Ld_A  : Positive;
76       I_Piv : out Integer_Vector;
77       Info  : access Integer);
78
79    procedure dgetrf
80      (M     : Natural;
81       N     : Natural;
82       A     : in out Double_Precision_Matrix;
83       Ld_A  : Positive;
84       I_Piv : out Integer_Vector;
85       Info  : access Integer);
86
87    procedure cgetrf
88      (M     : Natural;
89       N     : Natural;
90       A     : in out Complex_Matrix;
91       Ld_A  : Positive;
92       I_Piv : out Integer_Vector;
93       Info  : access Integer);
94
95    procedure zgetrf
96      (M     : Natural;
97       N     : Natural;
98       A     : in out Double_Complex_Matrix;
99       Ld_A  : Positive;
100       I_Piv : out Integer_Vector;
101       Info  : access Integer);
102
103    procedure sgetri
104      (N      : Natural;
105       A      : in out Real_Matrix;
106       Ld_A   : Positive;
107       I_Piv  : Integer_Vector;
108       Work   : in out Real_Vector;
109       L_Work : Integer;
110       Info   : access Integer);
111
112    procedure dgetri
113      (N      : Natural;
114       A      : in out Double_Precision_Matrix;
115       Ld_A   : Positive;
116       I_Piv  : Integer_Vector;
117       Work   : in out Double_Precision_Vector;
118       L_Work : Integer;
119       Info   : access Integer);
120
121    procedure cgetri
122      (N      : Natural;
123       A      : in out Complex_Matrix;
124       Ld_A   : Positive;
125       I_Piv  : Integer_Vector;
126       Work   : in out Complex_Vector;
127       L_Work : Integer;
128       Info   : access Integer);
129
130    procedure zgetri
131      (N      : Natural;
132       A      : in out Double_Complex_Matrix;
133       Ld_A   : Positive;
134       I_Piv  : Integer_Vector;
135       Work   : in out Double_Complex_Vector;
136       L_Work : Integer;
137       Info   : access Integer);
138
139    procedure sgetrs
140      (Trans  : access constant Character;
141       N      : Natural;
142       N_Rhs  : Natural;
143       A      : Real_Matrix;
144       Ld_A   : Positive;
145       I_Piv  : Integer_Vector;
146       B      : in out Real_Matrix;
147       Ld_B   : Positive;
148       Info   : access Integer);
149
150    procedure dgetrs
151      (Trans  : access constant Character;
152       N      : Natural;
153       N_Rhs  : Natural;
154       A      : Double_Precision_Matrix;
155       Ld_A   : Positive;
156       I_Piv  : Integer_Vector;
157       B      : in out Double_Precision_Matrix;
158       Ld_B   : Positive;
159       Info   : access Integer);
160
161    procedure cgetrs
162      (Trans  : access constant Character;
163       N      : Natural;
164       N_Rhs  : Natural;
165       A      : Complex_Matrix;
166       Ld_A   : Positive;
167       I_Piv  : Integer_Vector;
168       B      : in out Complex_Matrix;
169       Ld_B   : Positive;
170       Info   : access Integer);
171
172    procedure zgetrs
173      (Trans  : access constant Character;
174       N      : Natural;
175       N_Rhs  : Natural;
176       A      : Double_Complex_Matrix;
177       Ld_A   : Positive;
178       I_Piv  : Integer_Vector;
179       B      : in out Double_Complex_Matrix;
180       Ld_B   : Positive;
181       Info   : access Integer);
182
183    procedure cheevr
184      (Job_Z    : access constant Character;
185       Rng      : access constant Character;
186       Uplo     : access constant Character;
187       N        : Natural;
188       A        : in out Complex_Matrix;
189       Ld_A     : Positive;
190       Vl, Vu   : Real := 0.0;
191       Il, Iu   : Integer := 1;
192       Abs_Tol  : Real := 0.0;
193       M        : out Integer;
194       W        : out Real_Vector;
195       Z        : out Complex_Matrix;
196       Ld_Z     : Positive;
197       I_Supp_Z : out Integer_Vector;
198       Work     : out Complex_Vector;
199       L_Work   : Integer;
200       R_Work   : out Real_Vector;
201       LR_Work  : Integer;
202       I_Work   : out Integer_Vector;
203       LI_Work  : Integer;
204       Info     : access Integer);
205
206    procedure zheevr
207      (Job_Z    : access constant Character;
208       Rng      : access constant Character;
209       Uplo     : access constant Character;
210       N        : Natural;
211       A        : in out Double_Complex_Matrix;
212       Ld_A     : Positive;
213       Vl, Vu   : Double_Precision := 0.0;
214       Il, Iu   : Integer := 1;
215       Abs_Tol  : Double_Precision := 0.0;
216       M        : out Integer;
217       W        : out Double_Precision_Vector;
218       Z        : out Double_Complex_Matrix;
219       Ld_Z     : Positive;
220       I_Supp_Z : out Integer_Vector;
221       Work     : out Double_Complex_Vector;
222       L_Work   : Integer;
223       R_Work   : out Double_Precision_Vector;
224       LR_Work  : Integer;
225       I_Work   : out Integer_Vector;
226       LI_Work  : Integer;
227       Info     : access Integer);
228
229    procedure chetrd
230      (Uplo   : access constant Character;
231       N      : Natural;
232       A      : in out Complex_Matrix;
233       Ld_A   : Positive;
234       D      : out Real_Vector;
235       E      : out Real_Vector;
236       Tau    : out Complex_Vector;
237       Work   : out Complex_Vector;
238       L_Work : Integer;
239       Info   : access Integer);
240
241    procedure zhetrd
242      (Uplo   : access constant Character;
243       N      : Natural;
244       A      : in out Double_Complex_Matrix;
245       Ld_A   : Positive;
246       D      : out Double_Precision_Vector;
247       E      : out Double_Precision_Vector;
248       Tau    : out Double_Complex_Vector;
249       Work   : out Double_Complex_Vector;
250       L_Work : Integer;
251       Info   : access Integer);
252
253    procedure ssytrd
254      (Uplo   : access constant Character;
255       N      : Natural;
256       A      : in out Real_Matrix;
257       Ld_A   : Positive;
258       D      : out Real_Vector;
259       E      : out Real_Vector;
260       Tau    : out Real_Vector;
261       Work   : out Real_Vector;
262       L_Work : Integer;
263       Info   : access Integer);
264
265    procedure dsytrd
266      (Uplo   : access constant Character;
267       N      : Natural;
268       A      : in out Double_Precision_Matrix;
269       Ld_A   : Positive;
270       D      : out Double_Precision_Vector;
271       E      : out Double_Precision_Vector;
272       Tau    : out Double_Precision_Vector;
273       Work   : out Double_Precision_Vector;
274       L_Work : Integer;
275       Info   : access Integer);
276
277    procedure ssterf
278      (N      : Natural;
279       D      : in out Real_Vector;
280       E      : in out Real_Vector;
281       Info   : access Integer);
282
283    procedure dsterf
284      (N      : Natural;
285       D      : in out Double_Precision_Vector;
286       E      : in out Double_Precision_Vector;
287       Info   : access Integer);
288
289    procedure sorgtr
290      (Uplo   : access constant Character;
291       N      : Natural;
292       A      : in out Real_Matrix;
293       Ld_A   : Positive;
294       Tau    : Real_Vector;
295       Work   : out Real_Vector;
296       L_Work : Integer;
297       Info   : access Integer);
298
299    procedure dorgtr
300      (Uplo   : access constant Character;
301       N      : Natural;
302       A      : in out Double_Precision_Matrix;
303       Ld_A   : Positive;
304       Tau    : Double_Precision_Vector;
305       Work   : out Double_Precision_Vector;
306       L_Work : Integer;
307       Info   : access Integer);
308
309    procedure sstebz
310      (Rng      : access constant Character;
311       Order    : access constant Character;
312       N        : Natural;
313       Vl, Vu   : Real := 0.0;
314       Il, Iu   : Integer := 1;
315       Abs_Tol  : Real := 0.0;
316       D        : Real_Vector;
317       E        : Real_Vector;
318       M        : out Natural;
319       N_Split  : out Natural;
320       W        : out Real_Vector;
321       I_Block  : out Integer_Vector;
322       I_Split  : out Integer_Vector;
323       Work     : out Real_Vector;
324       I_Work   : out Integer_Vector;
325       Info     : access Integer);
326
327    procedure dstebz
328      (Rng      : access constant Character;
329       Order    : access constant Character;
330       N        : Natural;
331       Vl, Vu   : Double_Precision := 0.0;
332       Il, Iu   : Integer := 1;
333       Abs_Tol  : Double_Precision := 0.0;
334       D        : Double_Precision_Vector;
335       E        : Double_Precision_Vector;
336       M        : out Natural;
337       N_Split  : out Natural;
338       W        : out Double_Precision_Vector;
339       I_Block  : out Integer_Vector;
340       I_Split  : out Integer_Vector;
341       Work     : out Double_Precision_Vector;
342       I_Work   : out Integer_Vector;
343       Info     : access Integer);
344
345    procedure ssteqr
346      (Comp_Z : access constant Character;
347       N      : Natural;
348       D      : in out Real_Vector;
349       E      : in out Real_Vector;
350       Z      : in out Real_Matrix;
351       Ld_Z   : Positive;
352       Work   : out Real_Vector;
353       Info   : access Integer);
354
355    procedure dsteqr
356      (Comp_Z : access constant Character;
357       N      : Natural;
358       D      : in out Double_Precision_Vector;
359       E      : in out Double_Precision_Vector;
360       Z      : in out Double_Precision_Matrix;
361       Ld_Z   : Positive;
362       Work   : out Double_Precision_Vector;
363       Info   : access Integer);
364
365    procedure csteqr
366      (Comp_Z : access constant Character;
367       N      : Natural;
368       D      : in out Real_Vector;
369       E      : in out Real_Vector;
370       Z      : in out Complex_Matrix;
371       Ld_Z   : Positive;
372       Work   : out Real_Vector;
373       Info   : access Integer);
374
375    procedure zsteqr
376      (Comp_Z : access constant Character;
377       N      : Natural;
378       D      : in out Double_Precision_Vector;
379       E      : in out Double_Precision_Vector;
380       Z      : in out Double_Complex_Matrix;
381       Ld_Z   : Positive;
382       Work   : out Double_Precision_Vector;
383       Info   : access Integer);
384
385 private
386    pragma Import (Fortran, csteqr, "csteqr_");
387    pragma Import (Fortran, cgetrf, "cgetrf_");
388    pragma Import (Fortran, cgetri, "cgetri_");
389    pragma Import (Fortran, cgetrs, "cgetrs_");
390    pragma Import (Fortran, cheevr, "cheevr_");
391    pragma Import (Fortran, chetrd, "chetrd_");
392    pragma Import (Fortran, dgetrf, "dgetrf_");
393    pragma Import (Fortran, dgetri, "dgetri_");
394    pragma Import (Fortran, dgetrs, "dgetrs_");
395    pragma Import (Fortran, dsytrd, "dsytrd_");
396    pragma Import (Fortran, dstebz, "dstebz_");
397    pragma Import (Fortran, dsterf, "dsterf_");
398    pragma Import (Fortran, dorgtr, "dorgtr_");
399    pragma Import (Fortran, dsteqr, "dsteqr_");
400    pragma Import (Fortran, sgetrf, "sgetrf_");
401    pragma Import (Fortran, sgetri, "sgetri_");
402    pragma Import (Fortran, sgetrs, "sgetrs_");
403    pragma Import (Fortran, sorgtr, "sorgtr_");
404    pragma Import (Fortran, sstebz, "sstebz_");
405    pragma Import (Fortran, ssterf, "ssterf_");
406    pragma Import (Fortran, ssteqr, "ssteqr_");
407    pragma Import (Fortran, ssytrd, "ssytrd_");
408    pragma Import (Fortran, zgetrf, "zgetrf_");
409    pragma Import (Fortran, zgetri, "zgetri_");
410    pragma Import (Fortran, zgetrs, "zgetrs_");
411    pragma Import (Fortran, zheevr, "zheevr_");
412    pragma Import (Fortran, zhetrd, "zhetrd_");
413    pragma Import (Fortran, zsteqr, "zsteqr_");
414 end Interfaces.Fortran.LAPACK;