(4)
with Ada.Numerics.Generic_Complex_Types; -- see G.1.1
pragma Elaborate_All(Ada.Numerics.Generic_Complex_Types);
package Interfaces.Fortran is
pragma Pure(Fortran);
(5)
type Fortran_Integer is range implementation-defined;
(6)
type Real is digits implementation-defined;
type Double_Precision is digits implementation-defined;
(7)
type Logical is new Boolean;
(8)
package Single_Precision_Complex_Types is
new Ada.Numerics.Generic_Complex_Types (Real);
(9)
type Complex is new Single_Precision_Complex_Types.Complex;
(10)
subtype Imaginary is Single_Precision_Complex_Types.Imaginary;
i : Imaginary renames Single_Precision_Complex_Types.i;
j : Imaginary renames Single_Precision_Complex_Types.j;
(11)
type Character_Set is implementation-defined character type;
(12)
type Fortran_Character is array (Positive range <>) of Character_Set;
pragma Pack (Fortran_Character);
(13)
function To_Fortran (Item : in Character) return Character_Set;
function To_Ada (Item : in Character_Set) return Character;
(14)
function To_Fortran (Item : in String) return Fortran_Character;
function To_Ada (Item : in Fortran_Character) return String;
(15)
procedure To_Fortran (Item : in String;
Target : out Fortran_Character;
Last : out Natural);
(16)
procedure To_Ada (Item : in Fortran_Character;
Target : out String;
Last : out Natural);
(17)
end Interfaces.Fortran;
(29)
with Interfaces.Fortran;
use Interfaces.Fortran;
procedure Ada_Application is
(30)
type Fortran_Matrix is array (Integer range <>,
Integer range <>) of Double_Precision;
pragma Convention (Fortran, Fortran_Matrix); -- stored in Fortran's
-- column-major order
procedure Invert (Rank : in Fortran_Integer; X : in out Fortran_Matrix);
pragma Import (Fortran, Invert); -- a Fortran subroutine
(31)
Rank : constant Fortran_Integer := 100;
My_Matrix : Fortran_Matrix (1 .. Rank, 1 .. Rank);
(32)
begin
(33)
...
My_Matrix := ...;
...
Invert (Rank, My_Matrix);
...
(34)
end Ada_Application;
-- Email comments, additions, corrections, gripes, kudos, etc. to: