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=2.0 required=5.0 tests=BAYES_00,FORGED_MUA_MOZILLA, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,79a5986379126078,start X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.224.33.210 with SMTP id i18mr2626517qad.4.1343933231370; Thu, 02 Aug 2012 11:47:11 -0700 (PDT) Received: by 10.216.113.70 with SMTP id z48mr494weg.6.1343910498157; Thu, 02 Aug 2012 05:28:18 -0700 (PDT) Received: by 10.224.100.137 with SMTP id y9mr13807822qan.2.1343910401701; Thu, 02 Aug 2012 05:26:41 -0700 (PDT) Path: c6ni1680qas.0!nntp.google.com!r1no9751771qas.0!news-out.google.com!q11ni4595616wiw.1!nntp.google.com!volia.net!news2.volia.net!feed-B.news.volia.net!12no4515763wil.1!news-out.google.com!a15ni8353177qag.0!nntp.google.com!border1.nntp.dca.giganews.com!border1.nntp.ams.giganews.com!border4.nntp.ams.giganews.com!border2.nntp.ams.giganews.com!nntp.giganews.com!goblin3!goblin.stu.neva.ru!news.matabio.net!jeffrey.matabio.net!thue.elzevir.fr!news.davenulle.org!gegeweb.org!aioe.org!.POSTED!not-for-mail From: "Nasser M. Abbasi" Newsgroups: comp.lang.ada Subject: fyi, small update to Ada LAPACK and BLAS binding Date: Tue, 31 Jul 2012 01:37:05 -0500 Organization: Aioe.org NNTP Server Message-ID: Reply-To: nma@12000.org NNTP-Posting-Host: 9ii5QNw33OfeoTzEH8w9ug.user.speranza.aioe.org Mime-Version: 1.0 X-Complaints-To: abuse@aioe.org User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:14.0) Gecko/20120713 Thunderbird/14.0 X-Notice: Filtered by postfilter v. 0.8.2 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Date: 2012-07-31T01:37:05-05:00 List-Id: FYI; I've added more documentation and made a little cleanup of the current Ada LAPACK and BLAS bindings. As per earlier thread, this snap shot of the LAPACK binding now uses one package to interface to LAPACK so it is easier to use. The location is still the same as before, and with more documentation now how to use the bindings. http://12000.org/my_notes/ada/index.htm I have a zip file the the LAPACK and BLAS updates I made there with links to the original versions Here is a complete example using LAPACK from Ada, with the gnatmake command to build it: gnatmake -Iada_lapack/binding mysolve.adb -largs -L/usr/lib -lblas -llapack ------ mysolve.adb ------------------------------------- with Ada.Text_IO; use Ada.Text_IO; with Interfaces.Fortran; use Interfaces.Fortran; with lapack; procedure mysolve is A : lapack.Fortran_Real_Matrix (1 .. 3, 1 .. 3); b : lapack.Fortran_Real_Matrix (1 .. 3, 1 .. 1); info : Fortran_Integer; ipiv : lapack.Fortran_Integer_Vector (1 .. A'Last (2)); begin -- solve A x=b A := ((2.0, 3.0, 1.0), (2.0, 1.0, 1.0), (4.0, -1.0, 6.0)); b := ((1 => 9.0), (1 => 2.0), (1 => -2.0)); lapack.SGESV (N => A'Last (2), NRHS => b'Last (2), A => A, LDA => A'Last (1), IPIV => ipiv, B => b, LDB => b'Last (1), INFO => info); if (info /= 0) then raise Program_Error; end if; declare package real_IO is new Ada.Text_IO.Float_IO (Real); begin for I in b'Range (1) loop real_IO.Put (b (I, 1)); New_Line; end loop; end; end mysolve; ----------------------- --Nasser