From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,c1bdceb867926fdb X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,UTF8 Path: g2news1.google.com!news4.google.com!feeder1.cambriumusenet.nl!feed.tweaknews.nl!193.201.147.84.MISMATCH!xlned.com!feeder1.xlned.com!news.netcologne.de!newsfeed-fusi2.netcologne.de!news.swapon.de!eternal-september.org!.POSTED!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: Interfacing Ada with C Date: Wed, 28 Jul 2010 23:26:40 +0100 Organization: A noiseless patient Spider Message-ID: References: <0ee9eec7-6024-4fb8-8df0-f65c146e4b84@i28g2000yqa.googlegroups.com> <143ef70b-7e74-426b-a621-a5fd157849be@x21g2000yqa.googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Date: Wed, 28 Jul 2010 22:26:42 +0000 (UTC) Injection-Info: mx01.eternal-september.org; posting-host="KCXegvZb5vh43D+f3BR6Ew"; logging-data="15958"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/AeSDqfrZtQ3pHF6ZDwmXWgogWBIjNAYQ=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (darwin) Cancel-Lock: sha1:anq0npQ/NRk6sEGP5XEKBZFvjFE= sha1:gXTF7LrVhriGChUNhnufbDs9WJI= Xref: g2news1.google.com comp.lang.ada:12648 Date: 2010-07-28T23:26:40+01:00 List-Id: Simon Wright writes: > Ada novice writes: >> On Jul 26, 1:21 am, Simon Wright wrote: >> >>> I've encoded a general complex eigenvalues function, interfacing to the >>> LAPACK procedure zgeev > >> Thank you very much for your commendable efforts. This is a very good >> example to demonstrate how Ada can be binded with LAPACK. > > Well, it's a start! I've taken the plunge and started a SourceForge project for this. It's at http://sourceforge.net/projects/gnat-math-extn/ -- under "Ada 2005 Math Extensions", click on [Develop] then on [Code]. I've chosen to use Mercurial (Hg) as the VCS, mainly to get a real-world feel for using a DVCS (Distributed Version Control System). To downoad the code, you'll need to install Hg - http://mercurial.selenic.com/ - because I haven't actually made a code release yet! If anyone feels moved to join in, just say (of course you need a SF account to update the SF repository, but with Hg it should be possible to work via patchsets .. ) For interest, the test program now looks like with Ada.Text_IO; use Ada.Text_IO; with Ada.Numerics.Generic_Real_Arrays; with Ada.Numerics.Generic_Complex_Types; with Ada.Numerics.Generic_Complex_Arrays.Extensions; procedure Test_Extensions is package Real_Arrays is new Ada.Numerics.Generic_Real_Arrays (Long_Float); package Complex_Types is new Ada.Numerics.Generic_Complex_Types (Long_Float); package Complex_Arrays is new Ada.Numerics.Generic_Complex_Arrays (Real_Arrays, Complex_Types); package Extensions is new Complex_Arrays.Extensions; use Complex_Arrays; Input : Complex_Matrix (1 .. 3, 1 .. 3); Result : Complex_Vector (1 .. Input'Length (1)); begin -- Values in yc's example Input := (((8.0, 0.0), (-1.0, 0.0), (-5.0, 0.0)), ((-4.0, 0.0), (4.0, 0.0), (-2.0, 0.0)), ((18.0, 0.0), (-5.0, 0.0), (-7.0, 0.0))); Result := Extensions.Eigenvalues (Input); for J in Result'Range loop Put_Line (Long_Float'Image (Result (J).Re) & " " & Long_Float'Image (Result (J).Im)); end loop; end Test_Extensions; (results as before)