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,80532c203ced41ef X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!postnews.google.com!y31g2000prd.googlegroups.com!not-for-mail From: "comp.lang.php" Newsgroups: comp.lang.ada Subject: Re: Ann: Mathpaqs, release Feb. 2011 Date: Thu, 24 Feb 2011 01:51:18 -0800 (PST) Organization: http://groups.google.com Message-ID: <46b2df60-5b87-44f3-8c2d-22b830749c50@y31g2000prd.googlegroups.com> References: <838f49da-9a83-49d1-b42e-64b45f9b2917@x13g2000vbe.googlegroups.com> <1ib2wlicecaim$.1o25nuvllws3i.dlg@40tude.net> <1raralz4504m2$.1mwiu22cgxle0.dlg@40tude.net> NNTP-Posting-Host: 152.78.70.10 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1298541875 15775 127.0.0.1 (24 Feb 2011 10:04:35 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Thu, 24 Feb 2011 10:04:35 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: y31g2000prd.googlegroups.com; posting-host=152.78.70.10; posting-account=B_SmUwoAAAArT7-avjstloPG8dLOABck User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/534.13 (KHTML, like Gecko) Chrome/9.0.597.98 Safari/534.13,gzip(gfe) Xref: g2news1.google.com comp.lang.ada:17582 Date: 2011-02-24T01:51:18-08:00 List-Id: On Feb 23, 2:38=A0pm, Simon Wright wrote: > "Nasser M. Abbasi" writes: > > > > > > > > > > > On 2/22/2011 3:33 AM, Dmitry A. Kazakov wrote: > > >> Are you asking why Ada does not include them in the standard library? > > > My question is the same, a very simple user question, I will repeat it = again: > > > What do I need to do to solve Ax=3Db in Ada, with A being sparse matrix= . > > > If no one has done this before in Ada, that is fine. I am just asking. > > > The format of the sparse is not important, the package used is not > > important. I am just asking if the tools, the bindings, the > > library, or whatever, is there now, today, to do this in Ada. > > > It is really a simple question :) > > I'm pretty sure the answer is -- there is no Ada binding to do what you > want. A sparse matrix is one whose elements are mostly zero. Hence, the designer of code for such problems needs to avoid the store of zero terms and silly operations such as 0 + 0*0. The matrix can be stored in several ways. We can instantiate the package Ada.Containers.Ordered_Maps with the index as key_type, the chosen real type as element_type or use the compact row storage formula (or variants) of Saad. The first way gives a dynamic data structure the latter a bounded one. To solve linear equations directly by Gaussian elimination the problem is "fill in" where zeros become nonzeros. Reordering the rows and columns can help considerably. Modern methods try to work with blocks of dense matrices in order to exploit level 3 blas operations. A good method is UMFPACK http://www.cise.ufl.edu/research/sparse/umfpack/ , it is written in C and Ada bindings are possible. I have worked with sparse matrices in my finite element codes written in Ada. I have a crude binding to UMFPACK that needs tidying before public release. I have not used the gnat tool to generate automatic bindings yet. It would be very useful if it could be added to GPS and appear in a menu. Ken Thomas