From: Ada novice on
On Jul 10, 10:22 pm, Gautier write-only <gautier_niou...(a)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
From: jonathan on
On Jul 12, 2:38 pm, Ada novice <po...(a)gmx.us> wrote:
> On Jul 10, 10:22 pm, Gautier write-only <gautier_niou...(a)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.
From: Ada novice on
On Jul 12, 5:13 pm, jonathan <johns...(a)googlemail.com> wrote:
> On Jul 12, 2:38 pm, Ada novice <po...(a)gmx.us> wrote:
>
>
>
> > On Jul 10, 10:22 pm, Gautier write-only <gautier_niou...(a)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!

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.

It would indeed be great if Ada users would make the Ada 2012 team
include more numeric facilities. The language has all basic
mathematical functions and advanced algorithms are only clever coding.

YC


From: Ada novice on
On Jul 12, 5:13 pm, jonathan <johns...(a)googlemail.com> wrote:
> On Jul 12, 2:38 pm, Ada novice <po...(a)gmx.us> wrote:
>
>
>
> > On Jul 10, 10:22 pm, Gautier write-only <gautier_niou...(a)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
From: Simon Wright on
jonathan <johnscpg(a)googlemail.com> writes:

> Finally! The test routine is user unfriendly. (I hope you fix it up
> for the rest of us.) You have to enter numbers.

Actually, there's a file test_generic_complex_eigenvalues.dat ...
First  |  Prev  |  Next  |  Last
Pages: 1 2 3 4 5 6 7 8
Prev: Truncating a fixed-point value
Next: cmake and PLplot for Ada