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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,67d995bf9f62ea45 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!postnews.google.com!y11g2000yqm.googlegroups.com!not-for-mail From: Ada novice Newsgroups: comp.lang.ada Subject: Re: matrix package with Ada Date: Mon, 12 Jul 2010 12:13:24 -0700 (PDT) Organization: http://groups.google.com Message-ID: References: <23f0d8f1-e7bd-4af9-a0ee-cea85cbff4bd@x21g2000yqa.googlegroups.com> <8f4ba975-5441-4b42-89ad-b53373a59eb9@g19g2000yqc.googlegroups.com> NNTP-Posting-Host: 193.11.22.91 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1278962004 11611 127.0.0.1 (12 Jul 2010 19:13:24 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Mon, 12 Jul 2010 19:13:24 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: y11g2000yqm.googlegroups.com; posting-host=193.11.22.91; posting-account=Rr9I-QoAAACS-nOzpA-mGxtAlZ46Nb6I User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.6) Gecko/20100625 Firefox/3.6.6 (.NET CLR 3.5.30729),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:12352 Date: 2010-07-12T12:13:24-07:00 List-Id: On Jul 12, 5:13=A0pm, jonathan wrote: > On Jul 12, 2:38=A0pm, Ada novice wrote: > > > > > On Jul 10, 10:22=A0pm, Gautier write-only > > wrote: > > > > > And are there other alternatives or other packages? > > > > Look there - excellent stuff: > > > =A0http://www.csee.umbc.edu/~squire/adaclass/gnatmath95/ > > > The most amazing: add some "Ada." for the basic matrix packages > > > referenced, and you get Ada 2005 compatibility. > > > > G. > > > I've tried to compile the file test_generic_complex_eigenvalues.ada > > provided in this package (http://www.csee.umbc.edu/~squire/adaclass/ > > gnatmath95/) but it doesn't compile successfully. And The matrix > > package from Drexel doesn't have any eigenvalues/eigenvectors > > computation routine at all. > > > Looking at all this, I'm tempted to say how silly it is that Ada > > doesn't provide good numerics capabilities. Ada 05 brought a big > > improvement with more vector and matrix operations though it can't > > handle the eigenvalues computation of a non-symmetric matrix. The next > > version of Ada I read will be out in 2 years. I hope that there will > > be better facilities for scientific programming in Ada than there is > > today. Those on the Ada community should be made aware of the need for > > more scientific computing power in Ada. > > > There are many libraries for Fortran and C/C++ for numerical > > computations while Ada doesn't seem to have a decent one. One cannot > > expect people to switch to Ada if there are no good numerical > > computing libraries. Ada has been here for more than 25 years now but > > maybe has remained confined to military applications for many years. > > However free compilers are out there since many years and I hope that > > good programmers with good understanding of numerical methods will be > > motivated to have bindings for Ada. > > > YC > > OK, after a bit of trouble I got it to run (using the latest gnat/gcc > compiler). There's 1 bug to fix 1st: around line 150 of the package > body > > =A0 =A0 generic_complex_linear_equations.adb > > you need to change a line to initialize X with a complex number. > > =A0 --X(N) :=3D 0.0; -- change this to: > =A0 =A0 X(N) :=3D COMPOSE_FROM_CARTESIAN( 0.0 , 0.0 ) ; > > Finally, if you using GNAT, the file names have to end in either > .adb or .ads > > The instructions for that are at the top of each file. For example > the test procedure should end in .adb if you are using gnat. > > Notice also that you have to download quite a few packages to get > the eig-stuff to work. =A0The compiler error messages should tell you > if you are missing anything. > > Finally! The test routine is user unfriendly. =A0(I hope you fix it up > for the rest of us.) You have to enter numbers. =A0First enter the > size of the matrix > (type the number 2, then enter.) > then enter one by one the 4 elements of the complex matrix, say: > (1.0, 2.0) > (2.0, 2.2) > (3.0, 2.4) > (4.0, 2.6) > > I'm just guessing that that is what the program wants, but > it seemed to run when I tried it. > > J. > > numbers. Many thanks for your kind efforts. Now it works fine. I'm using the gnat compiler. I have made some quick tests with this package and compared the results with those from Matlab. The results match for the eigenvalues. I just need some more time to see how the eigenvectors are scaled. It is indeed very nice to see at last a package which delivers! The program doesn't exit well however. When the program (test_generic_complex_eigenvalues.ada) it will display the results but in my GPS editor the line 102 is highlighted. This is where the program stops. If the program would run fine then I would have finally got this line displayed: DONE test_generic_complex_eigenvalues (at the bottom of test_generic_complex_eigenvalues.ada). Do you have the same problem? I'm still a novice in Ada and still learning. This is why I couldn't fixed the bug in the package myself. Thus I thank you much again for looking into the problem. Yes it would be nice to be able to call the routine from a main program. I will work on that when time permits but first things first: I will have to check the scaling used for the eigenvectors. YC