From: Simon Wright on
Ada novice <posts(a)gmx.us> writes:

>>
>> I found that not all of the numbers were different. Some of the
>> differences were very small. Sometimes vectors were given in the
>> opposite order (there's a note in the AI about that not being a
>> problem).
>
> The eigenvalues are not given in an ascending order. Different
> software implementations use different ways to present the eigenvalues
> and eigenvectors (normalizations for the latter).

But nominally these are the same software implementation. Still, the
..dat file is dated 31 Oct 1999, the .out file 26 May 2006, so the
implementation may well have changed in this respect.
From: Randy Brukardt on
"Ada novice" <posts(a)gmx.us> wrote in message
news:ec73f176-876e-4bcf-ab11-eed852129d34(a)x21g2000yqa.googlegroups.com...
....
> A friend uses F# for numerics and here also eigenvalue computation
> exists only for symmetric matrices as in Ada 05. I hope that in the
> next next Ada release, there would be more numeric facilities.

As far as I know, we haven't had a single request for more numeric
facilities in Ada 2012, and I'm pretty sure that there are no open requests
for the same.

If you want to see additional facilities, you need to ask (on Ada-Comment)
and give examples of problems that you have that can't be solved with the
current facilities. (Even better, would be to actively participate in the
language revision process; we don't have enough numerics expertise to do a
great job.)

In any case, the eigenvalue routines originally were supposed to work on all
matrices. That was dropped as the algorithms to solve such things are
supposedly suspect. Here's the discussion from AI95-0296-1 (which defines
the G.3 packages):

We considered providing subprograms for the determination of eigenvalues and
eigenvectors of general real and complex matrices. Such matrices can have
complex eigenvalues and therefore provision for these would have to be in
the complex package. However, there are mathematical difficulties with these
general cases which are in strong contrast to the real symmetric and
Hermitian matrices. Thus, Numerical Recipes by Press, Flannery, Teukolsky
and Vetterling says regarding the real case:

"The algorithms for symmetric matrices ... are highly satisfactory in
practice. By contrast, it is impossible to design equally satisfactory
algorithms for the nonsymmetric case. There are two reasons for this. First,
the eigenvalues of a
nonsymmetric matrix can be very sensitive to small changes in the matrix
elements. Second, the matrix itself can be defective so that there is no
complete set of eigenvectors. We emphasize that these difficulties are
intrinsic properties of certain nonsymmetric matrices, and no numerical
procedure can cure them."

Similar remarks apply to complex matrices where Hermitian matrices are
well-behaved but non-Hermitian matrices can be troublesome.

In view of these computational difficulties and the fact that requiring the
eigensystem of general matrices is uncommon, we decided not to provide such
facilities.

[End of quote from AI95-0296-1.]

I recall that the situation is actually worse than reported here; some of
the algorithms used may not terminate for some matricies. Algorithms that
don't terminate aren't tolerable in the Ada predefined libraries!

I am no expert on numerics, but I have to wonder what other languages and/or
packages do in such cases? Perhaps they just don't care (there is precedent
for that; Ada takes great pains to define the accuracy of most of the
numerical functions, most other languages say nothing at all). Clearly, this
problem would need to be solved in some way before a general routine could
in introduced (of course, the abstract above seems to imply that such a
solution is impossible).

Randy.





From: Dmitry A. Kazakov on
On Mon, 19 Jul 2010 17:34:25 -0500, Randy Brukardt wrote:

> I am no expert on numerics, but I have to wonder what other languages and/or
> packages do in such cases? Perhaps they just don't care (there is precedent
> for that; Ada takes great pains to define the accuracy of most of the
> numerical functions, most other languages say nothing at all). Clearly, this
> problem would need to be solved in some way before a general routine could
> in introduced (of course, the abstract above seems to imply that such a
> solution is impossible).

"Accuracy requirements for the subprograms Solve, Inverse, Determinant,
Eigenvalues and Eigensystem are implementation defined."
-- ARM G.3.1

I agree that it is not good from Ada design point of view. The requirement
should be: the accuracy is the precision of the corresponding Real type (or
else Constraint_Error).

This is an immense problem, especially for generic units, I have no idea
how to approach it using existing language means, not to mention
algorithmic issues.

--
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de
From: Ada novice on
On Jul 20, 12:34 am, "Randy Brukardt" <ra...(a)rrsoftware.com> wrote:
>
> As far as I know, we haven't had a single request for more numeric
> facilities in Ada 2012, and I'm pretty sure that there are no open requests
> for the same.

This can mean that people are still not much aware of Ada as a very
good and robust language for scientific programming. If we look at
recent publications, how many books discuss scientific computations
from the view of Ada, how many from the view say C++? For Ada, the sad
new is that we have practically no recent publication. There were
strong interest in the 1980s...e.g. the book Scientific Ada and
Applied Ada. What happened after that?

>
> If you want to see additional facilities, you need to ask (on Ada-Comment)
> and give examples of problems that you have that can't be solved with the
> current facilities. (Even better, would be to actively participate in the
> language revision process; we don't have enough numerics expertise to do a
> great job.)

I also don't have enough numerics expertise. I'm a mechanical
engineer. But if other languages have successfully created numerical
libraries since 1970 or 1980, then I guess that the Ada committee
could do some outsourcing and put up a team that would look into the
matter. I read here that some Ada users translate the codes from the
book Numerical recipes in Pascal. Translation can be ok, but re-
writing the code in Ada's spirit using generics and so on would be far
better. If the Ada committee doesn't put efforts to create good
numerical libraries, then we can say that Ada won't be appealing to
someone needing numerical computations.


> In any case, the eigenvalue routines originally were supposed to work on all
> matrices. That was dropped as the algorithms to solve such things are
> supposedly suspect. Here's the discussion from AI95-0296-1 (which defines
> the G.3 packages):
>
> In view of these computational difficulties and the fact that requiring the
> eigensystem of general matrices is uncommon, we decided not to provide such
> facilities.
>
> [End of quote from AI95-0296-1.]
>

I don't think that eigensystem analysis of general non-symmetric
matrices is uncommon. Many real-life systems can only be modeled
better as non-symmetric systems and these abound in engineering. If
eigensystem analysis for only symmetric matrices would exist, then
many engineering achievements would not be possible. The fact that
other languages do provide support for non-symmetric matrices do
indicate that they are needed more often than one may think.


> I recall that the situation is actually worse than reported here; some of
> the algorithms used may not terminate for some matricies. Algorithms that
> don't terminate aren't tolerable in the Ada predefined libraries!

This is good that Ada tkes much care in providing robust libraries.


> I am no expert on numerics, but I have to wonder what other languages and/or
> packages do in such cases? Perhaps they just don't care (there is precedent
> for that; Ada takes great pains to define the accuracy of most of the
> numerical functions, most other languages say nothing at all).

Still, as I mentioned the engineering community will be frustrated if
eigensystem analysis for non-symmetric matrices didn't exist. Other
languages have successfully implemented algorithms to deal with
general matrices. These algorithms usually have to pass some
benchmarks and these benchmarks are available in literature.

The problem with Ada remains that there is practically no recent books
(we have two in the 1980's that I know) which specifically that
discuss numerical techniques. A new person considering to use Ada
would be only puzzled to see why there are no such books after the
1990's. So that person will easily consider Fortran, C++ or something
else. If on the other hand, the Ada committee will provide robust
numeric libraries and some authors would consider writing books
demonstrating the power of Ada in numerical computing, then people
will become interested using Ada in scientific programming. Till then,
when I say people that I'm using Ada in numerical programming, I still
get puzzled looks of guys who haven't heard of Ada before. I have been
using C but I switched to Ada as it has allowed me to pick up with
good software engineering participates and make less mistakes in my
codes.


YC
From: Ada novice on
Thanks for all these information. I'll comment as appropriate:

On Jul 20, 12:34 am, "Randy Brukardt" <ra...(a)rrsoftware.com> wrote:

> As far as I know, we haven't had a single request for more numeric
> facilities in Ada 2012, and I'm pretty sure that there are no open requests
> for the same.

This can mean that people are still not much aware of Ada as a very
good and robust language for scientific programming. If we look at
recent publications, how many books discuss scientific computations
from the view of Ada, how many from the view say C++? For Ada, the sad
news is that we have practically no recent publication. There were
strong interest in the 1980s...e.g. the book Scientific Ada and
Applied Ada. What happened after that?

> If you want to see additional facilities, you need to ask (on Ada-Comment)
> and give examples of problems that you have that can't be solved with the
> current facilities. (Even better, would be to actively participate in the
> language revision process; we don't have enough numerics expertise to do a
> great job.)

I also don't have enough numerics expertise. But if other languages
have successfully created numerical
libraries since 1970 or 1980, then I guess that the Ada committee
could do some outsourcing and put up a team that would look into the
matter. I read here that some Ada users translate the codes from the
book Numerical recipes in Pascal. Translation can be ok, but re-
writing the code in Ada's spirit using generics and so on would be far
better. If the Ada committee doesn't put efforts to create good
numerical libraries, then we can say that Ada won't be appealing to
someone needing numerical computations.

> In any case, the eigenvalue routines originally were supposed to work on all
> matrices. That was dropped as the algorithms to solve such things are
> supposedly suspect. Here's the discussion from AI95-0296-1 (which defines
> the G.3 packages):

> In view of these computational difficulties and the fact that requiring the
> eigensystem of general matrices is uncommon, we decided not to provide such
> facilities.

> [End of quote from AI95-0296-1.]

I don't think that eigensystem analysis of general non-symmetric
matrices is uncommon. Many real-life systems can only be modeled
better as non-symmetric systems and these abound in engineering. If
eigensystem analysis for only symmetric matrices would exist, then
many engineering achievements would not be possible. The fact that
other languages do provide support for non-symmetric matrices do
indicate that they are needed more often than one may think.

> I recall that the situation is actually worse than reported here; some of
> the algorithms used may not terminate for some matricies. Algorithms that
> don't terminate aren't tolerable in the Ada predefined libraries!

This is good that Ada takes much care in providing robust libraries.

> I am no expert on numerics, but I have to wonder what other languages and/or
> packages do in such cases? Perhaps they just don't care (there is precedent
> for that; Ada takes great pains to define the accuracy of most of the
> numerical functions, most other languages say nothing at all).

Still, as I mentioned the engineering community will be frustrated if
eigensystem analysis for non-symmetric matrices wouldn't exist. Other
languages have successfully implemented algorithms to deal with
general matrices. These algorithms usually have to pass some
benchmarks and these benchmarks are available in literature.

The problem with Ada remains that there is practically no recent books
(we have two in the 1980's that I know) which specifically that
discuss numerical techniques. A new person considering to use Ada
would be only puzzled to see why there are no such books after the
1990's. So that person will easily consider Fortran, C++ or something
else. If on the other hand, the Ada committee will provide robust
numeric libraries and some authors would consider writing books
demonstrating the power of Ada in numerical computing, then people
will become interested using Ada in scientific programming.

YC
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