1 ------------------------------------------------------------------------------
3 -- GNAT RUN-TIME COMPONENTS --
5 -- INTERFACES.FORTRAN.LAPACK --
9 -- Copyright (C) 2006, Free Software Foundation, Inc. --
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 2, 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. See the GNU General Public License --
17 -- for more details. You should have received a copy of the GNU General --
18 -- Public License distributed with GNAT; see file COPYING. If not, write --
19 -- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, --
20 -- Boston, MA 02110-1301, USA. --
22 -- As a special exception, if other files instantiate generics from this --
23 -- unit, or you link this unit with other files to produce an executable, --
24 -- this unit does not by itself cause the resulting executable to be --
25 -- covered by the GNU General Public License. This exception does not --
26 -- however invalidate any other reasons why the executable file might be --
27 -- covered by the GNU Public License. --
29 -- GNAT was originally developed by the GNAT team at New York University. --
30 -- Extensive contributions were provided by Ada Core Technologies Inc. --
32 ------------------------------------------------------------------------------
34 -- Package comment required if non-RM package ???
36 with Interfaces.Fortran.BLAS;
37 package Interfaces.Fortran.LAPACK is
40 type Integer_Vector is array (Integer range <>) of Integer;
42 Upper : aliased constant Character := 'U';
43 Lower : aliased constant Character := 'L';
45 subtype Real_Vector is BLAS.Real_Vector;
46 subtype Real_Matrix is BLAS.Real_Matrix;
47 subtype Double_Precision_Vector is BLAS.Double_Precision_Vector;
48 subtype Double_Precision_Matrix is BLAS.Double_Precision_Matrix;
49 subtype Complex_Vector is BLAS.Complex_Vector;
50 subtype Complex_Matrix is BLAS.Complex_Matrix;
51 subtype Double_Complex_Vector is BLAS.Double_Complex_Vector;
52 subtype Double_Complex_Matrix is BLAS.Double_Complex_Matrix;
54 -- LAPACK Computational Routines
56 -- gerfs Refines the solution of a system of linear equations with
57 -- a general matrix and estimates its error
58 -- getrf Computes LU factorization of a general m-by-n matrix
59 -- getri Computes inverse of an LU-factored general matrix
60 -- square matrix, with multiple right-hand sides
61 -- getrs Solves a system of linear equations with an LU-factored
62 -- square matrix, with multiple right-hand sides
63 -- hetrd Reduces a complex Hermitian matrix to tridiagonal form
64 -- heevr Computes selected eigenvalues and, optionally, eigenvectors of
65 -- a Hermitian matrix using the Relatively Robust Representations
66 -- orgtr Generates the real orthogonal matrix Q determined by sytrd
67 -- steqr Computes all eigenvalues and eigenvectors of a symmetric or
68 -- Hermitian matrix reduced to tridiagonal form (QR algorithm)
69 -- sterf Computes all eigenvalues of a real symmetric
70 -- tridiagonal matrix using QR algorithm
71 -- sytrd Reduces a real symmetric matrix to tridiagonal form
76 A : in out Real_Matrix;
78 I_Piv : out Integer_Vector;
79 Info : access Integer);
84 A : in out Double_Precision_Matrix;
86 I_Piv : out Integer_Vector;
87 Info : access Integer);
92 A : in out Complex_Matrix;
94 I_Piv : out Integer_Vector;
95 Info : access Integer);
100 A : in out Double_Complex_Matrix;
102 I_Piv : out Integer_Vector;
103 Info : access Integer);
107 A : in out Real_Matrix;
109 I_Piv : Integer_Vector;
110 Work : in out Real_Vector;
112 Info : access Integer);
116 A : in out Double_Precision_Matrix;
118 I_Piv : Integer_Vector;
119 Work : in out Double_Precision_Vector;
121 Info : access Integer);
125 A : in out Complex_Matrix;
127 I_Piv : Integer_Vector;
128 Work : in out Complex_Vector;
130 Info : access Integer);
134 A : in out Double_Complex_Matrix;
136 I_Piv : Integer_Vector;
137 Work : in out Double_Complex_Vector;
139 Info : access Integer);
142 (Trans : access constant Character;
147 I_Piv : Integer_Vector;
148 B : in out Real_Matrix;
150 Info : access Integer);
153 (Trans : access constant Character;
156 A : Double_Precision_Matrix;
158 I_Piv : Integer_Vector;
159 B : in out Double_Precision_Matrix;
161 Info : access Integer);
164 (Trans : access constant Character;
169 I_Piv : Integer_Vector;
170 B : in out Complex_Matrix;
172 Info : access Integer);
175 (Trans : access constant Character;
178 A : Double_Complex_Matrix;
180 I_Piv : Integer_Vector;
181 B : in out Double_Complex_Matrix;
183 Info : access Integer);
186 (Job_Z : access constant Character;
187 Rng : access constant Character;
188 Uplo : access constant Character;
190 A : in out Complex_Matrix;
192 Vl, Vu : Real := 0.0;
193 Il, Iu : Integer := 1;
194 Abs_Tol : Real := 0.0;
197 Z : out Complex_Matrix;
199 I_Supp_Z : out Integer_Vector;
200 Work : out Complex_Vector;
202 R_Work : out Real_Vector;
204 I_Work : out Integer_Vector;
206 Info : access Integer);
209 (Job_Z : access constant Character;
210 Rng : access constant Character;
211 Uplo : access constant Character;
213 A : in out Double_Complex_Matrix;
215 Vl, Vu : Double_Precision := 0.0;
216 Il, Iu : Integer := 1;
217 Abs_Tol : Double_Precision := 0.0;
219 W : out Double_Precision_Vector;
220 Z : out Double_Complex_Matrix;
222 I_Supp_Z : out Integer_Vector;
223 Work : out Double_Complex_Vector;
225 R_Work : out Double_Precision_Vector;
227 I_Work : out Integer_Vector;
229 Info : access Integer);
232 (Uplo : access constant Character;
234 A : in out Complex_Matrix;
238 Tau : out Complex_Vector;
239 Work : out Complex_Vector;
241 Info : access Integer);
244 (Uplo : access constant Character;
246 A : in out Double_Complex_Matrix;
248 D : out Double_Precision_Vector;
249 E : out Double_Precision_Vector;
250 Tau : out Double_Complex_Vector;
251 Work : out Double_Complex_Vector;
253 Info : access Integer);
256 (Uplo : access constant Character;
258 A : in out Real_Matrix;
262 Tau : out Real_Vector;
263 Work : out Real_Vector;
265 Info : access Integer);
268 (Uplo : access constant Character;
270 A : in out Double_Precision_Matrix;
272 D : out Double_Precision_Vector;
273 E : out Double_Precision_Vector;
274 Tau : out Double_Precision_Vector;
275 Work : out Double_Precision_Vector;
277 Info : access Integer);
281 D : in out Real_Vector;
282 E : in out Real_Vector;
283 Info : access Integer);
287 D : in out Double_Precision_Vector;
288 E : in out Double_Precision_Vector;
289 Info : access Integer);
292 (Uplo : access constant Character;
294 A : in out Real_Matrix;
296 Tau : in Real_Vector;
297 Work : out Real_Vector;
299 Info : access Integer);
302 (Uplo : access constant Character;
304 A : in out Double_Precision_Matrix;
306 Tau : in Double_Precision_Vector;
307 Work : out Double_Precision_Vector;
309 Info : access Integer);
312 (Rng : access constant Character;
313 Order : access constant Character;
315 Vl, Vu : in Real := 0.0;
316 Il, Iu : in Integer := 1;
317 Abs_Tol : in Real := 0.0;
321 N_Split : out Natural;
323 I_Block : out Integer_Vector;
324 I_Split : out Integer_Vector;
325 Work : out Real_Vector;
326 I_Work : out Integer_Vector;
327 Info : access Integer);
330 (Rng : access constant Character;
331 Order : access constant Character;
333 Vl, Vu : in Double_Precision := 0.0;
334 Il, Iu : in Integer := 1;
335 Abs_Tol : in Double_Precision := 0.0;
336 D : in Double_Precision_Vector;
337 E : in Double_Precision_Vector;
339 N_Split : out Natural;
340 W : out Double_Precision_Vector;
341 I_Block : out Integer_Vector;
342 I_Split : out Integer_Vector;
343 Work : out Double_Precision_Vector;
344 I_Work : out Integer_Vector;
345 Info : access Integer);
348 (Comp_Z : access constant Character;
350 D : in out Real_Vector;
351 E : in out Real_Vector;
352 Z : in out Real_Matrix;
354 Work : out Real_Vector;
355 Info : access Integer);
358 (Comp_Z : access constant Character;
360 D : in out Double_Precision_Vector;
361 E : in out Double_Precision_Vector;
362 Z : in out Double_Precision_Matrix;
364 Work : out Double_Precision_Vector;
365 Info : access Integer);
368 (Comp_Z : access constant Character;
370 D : in out Real_Vector;
371 E : in out Real_Vector;
372 Z : in out Complex_Matrix;
374 Work : out Real_Vector;
375 Info : access Integer);
378 (Comp_Z : access constant Character;
380 D : in out Double_Precision_Vector;
381 E : in out Double_Precision_Vector;
382 Z : in out Double_Complex_Matrix;
384 Work : out Double_Precision_Vector;
385 Info : access Integer);
388 pragma Import (Fortran, csteqr, "csteqr_");
389 pragma Import (Fortran, cgetrf, "cgetrf_");
390 pragma Import (Fortran, cgetri, "cgetri_");
391 pragma Import (Fortran, cgetrs, "cgetrs_");
392 pragma Import (Fortran, cheevr, "cheevr_");
393 pragma Import (Fortran, chetrd, "chetrd_");
394 pragma Import (Fortran, dgetrf, "dgetrf_");
395 pragma Import (Fortran, dgetri, "dgetri_");
396 pragma Import (Fortran, dgetrs, "dgetrs_");
397 pragma Import (Fortran, dsytrd, "dsytrd_");
398 pragma Import (Fortran, dstebz, "dstebz_");
399 pragma Import (Fortran, dsterf, "dsterf_");
400 pragma Import (Fortran, dorgtr, "dorgtr_");
401 pragma Import (Fortran, dsteqr, "dsteqr_");
402 pragma Import (Fortran, sgetrf, "sgetrf_");
403 pragma Import (Fortran, sgetri, "sgetri_");
404 pragma Import (Fortran, sgetrs, "sgetrs_");
405 pragma Import (Fortran, sorgtr, "sorgtr_");
406 pragma Import (Fortran, sstebz, "sstebz_");
407 pragma Import (Fortran, ssterf, "ssterf_");
408 pragma Import (Fortran, ssteqr, "ssteqr_");
409 pragma Import (Fortran, ssytrd, "ssytrd_");
410 pragma Import (Fortran, zgetrf, "zgetrf_");
411 pragma Import (Fortran, zgetri, "zgetri_");
412 pragma Import (Fortran, zgetrs, "zgetrs_");
413 pragma Import (Fortran, zheevr, "zheevr_");
414 pragma Import (Fortran, zhetrd, "zhetrd_");
415 pragma Import (Fortran, zsteqr, "zsteqr_");
416 end Interfaces.Fortran.LAPACK;