comp.lang.ada
 help / color / mirror / Atom feed
From: Ada novice <posts@gmx.us>
Subject: Re: matrix package with Ada
Date: Mon, 12 Jul 2010 12:13:24 -0700 (PDT)
Date: 2010-07-12T12:13:24-07:00	[thread overview]
Message-ID: <ad7ff580-83c6-4b8f-b686-8ea8f86b498c@y11g2000yqm.googlegroups.com> (raw)
In-Reply-To: 8f4ba975-5441-4b42-89ad-b53373a59eb9@g19g2000yqc.googlegroups.com

On Jul 12, 5:13 pm, jonathan <johns...@googlemail.com> wrote:
> On Jul 12, 2:38 pm, Ada novice <po...@gmx.us> wrote:
>
>
>
> > On Jul 10, 10:22 pm, Gautier write-only <gautier_niou...@hotmail.com>
> > wrote:
>
> > > > And are there other alternatives or other packages?
>
> > > Look there - excellent stuff:
> > >  http://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
>
>     generic_complex_linear_equations.adb
>
> you need to change a line to initialize X with a complex number.
>
>   --X(N) := 0.0; -- change this to:
>     X(N) := 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.  The compiler error messages should tell you
> if you are missing anything.
>
> Finally! The test routine is user unfriendly.  (I hope you fix it up
> for the rest of us.) You have to enter numbers.  First 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



  reply	other threads:[~2010-07-12 19:13 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-10 13:25 matrix package with Ada fitta
2010-07-10 13:46 ` MRE
2010-07-10 15:42   ` fitta
2010-07-10 18:34     ` tmoran
2010-07-10 18:54       ` Simon Wright
2010-07-10 20:23     ` Gautier write-only
2010-07-14  2:02     ` robin
2010-07-10 20:22 ` Gautier write-only
2010-07-12  1:58   ` Jerry
2010-07-12 13:38   ` Ada novice
2010-07-12 15:13     ` jonathan
2010-07-12 19:13       ` Ada novice [this message]
2010-07-12 20:13       ` Simon Wright
2010-07-12 21:09         ` jonathan
2010-07-13  7:07           ` Ada novice
2010-07-13 14:27             ` jonathan
     [not found]               ` <ec73f176-876e-4bcf-ab11-eed852129d34@x21g2000yqa.googlegroups.com>
2010-07-13 17:59                 ` Jeffrey R. Carter
2010-07-13 18:00                 ` Georg Bauhaus
2010-07-13 18:26                   ` Ada novice
2010-07-19 22:34                 ` Randy Brukardt
2010-07-20  7:27                   ` Dmitry A. Kazakov
2010-07-25 19:15                   ` Ada novice
     [not found]                   ` <5f0082b8-7688-4422-be38-72f1c60be539@d8g2000yqf.googlegroups.com>
2010-07-25 19:39                     ` Nasser M. Abbasi
2010-07-13 19:11           ` Simon Wright
2010-07-13 20:43             ` Ada novice
2010-07-14 18:55               ` Simon Wright
2010-07-12 20:59     ` Simon Wright
2010-07-13 16:40   ` Warren
2010-07-27 22:10   ` jonathan
2010-07-27 22:40     ` jonathan
2010-07-28  0:51     ` jonathan
2010-07-12  2:04 ` Jerry
2010-07-12  8:52   ` Ada novice
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox