2

I'm in search for a free package that do most matrix/vector operations. I can write some basic functions myself but for advanced ones like computing eigenvalues and eigenvectors I would prefer robust code and I would like to know if such packages are freely available. If I understand correctly Ada 2005 have more matrix operations facilities but it has a function to calculate the eigenvalues for a symmetric and hermitian matrices only. I'll need a more general packages which can handle any kind of matrix.

An Ada95 matrix package (54KB tar.gz file) from Drexel Fusion Laboratory had the link: http://dflwww.ece.drexel.edu/research/ada/ but the page for this ink is non-existent today.

Thanks a lot...

3 Answers 3

3

I think that the Ada95 package you mean is here -- but it's only 35k, and it seems to have less functionality than the Ada2005 standard library does.

Not sure how this Ada95 binding to BLAS came to be in my browser cache! I see that for general matrix solving you need LAPACK too, I wonder whether the bindings already in GNAT will help? Package System.Generic_Real_LAPACK in file s-gerela.ad[bs]. The comments say

-- LAPACK Computational Routines -- gerfs Refines the solution of a system of linear equations with -- a general matrix and estimates its error -- getrf Computes LU factorization of a general m-by-n matrix -- getri Computes inverse of an LU-factored general matrix -- square matrix, with multiple right-hand sides -- getrs Solves a system of linear equations with an LU-factored -- square matrix, with multiple right-hand sides -- orgtr Generates the Float orthogonal matrix Q determined by sytrd -- steqr Computes all eigenvalues and eigenvectors of a symmetric or -- Hermitian matrix reduced to tridiagonal form (QR algorithm) -- sterf Computes all eigenvalues of a Float symmetric -- tridiagonal matrix using QR algorithm -- sytrd Reduces a Float symmetric matrix to tridiagonal form 

which I suspect is a small subset of the full library. Still, could act as a useful springboard for more extensive bindings.

Sign up to request clarification or add additional context in comments.

13 Comments

@yCalleecharan: Your implementation may already link to an external library to implement the standard. stackoverflow.com/questions/2662805
Thanks. The link you provided was my one of my own questions :). I use the AdaCore libre GNAT compiler. I was just reading the document here: libre.adacore.com/wp-content/uploads/2006/02/… and I quote: "Ada predefined numerics library as being in any way in competition with or as a substitute for professional libraries such as the renowned BLAS". I don't know if an Ada implementation does offer advanced numerical analysis packages.
@yCalleecharan: The Ada Rationale is more recent; I've elaborated in an adjacent answer.
@trashgod: I saw no sniping there!
Thanks a lot for the additional information. Computation of eigenvalues is provided for symmetric matrices only (real and complex). It would be interesting though to have it for a general matrix. As I mentioned earlier, this link: martin.dowie.btinternet.co.uk/Numerics/adabrowse/… gives some indication why this is hard-work. Again many thanks for the detailed information. It'll be useful to compare this to what Ada 05 now offers. It does for example offer error estimate for the system Ax=b, which I don't think Ada 05 provides.
|
2

As suggested in John Barnes Rationale for Ada 2005, Ada's Annex G: Numerics is not intended "as a substitute for professional libraries such as the renowned BLAS," but nothing precludes an implementation from using BLAS internally. As a concrete example, the GNAT compiler implements both G.3.1 Real Vectors and Matrices and G.3.2 Complex Vectors and Matrices using BLAS and LAPACK. To see the details, you can examine the relevant package bodies:

$ export ADA_INC = /your/path/to/adinclude $ view $ADA_INC/$(gnatkr Ada.Numerics.Generic_Real_Arrays.adb) $ view $ADA_INC/$(gnatkr Ada.Numerics.Generic_Complex_Arrays.adb) 

12 Comments

This is very useful to know. Thank you very much for the links. I shall read them carefully. Also 1 vote up.
These commands that u wrote: are they in unix? I use windows but I'll try and see if I can use these packages.
If u have time, maybe u an correct the link to G.3.1. real vectors... Both links that you gave point to G.3.2. But of course it's very easy for someone to navigate to G.3.1 having found the way to G.3.2.
I found a link: martin.dowie.btinternet.co.uk/Numerics/adabrowse/… where information is given as to why Ada has no eigenvalue computation facility for a general non-symmetric matrix. In brief, algorithms that cater for a non-symmetric matrix may as not be robust as those for symmetric ones.
I believe that a drawback with Ada is that it doesn't have convenient I/O operations for vectors and matrices, for example when it comes to input and output (say on the screen). But of course if a user would write a procedure to display the matrix elements, this drawback would be eliminated.
|
1

The site at which this package was previously available has been migrated and the old content is now available at:

http://dfl.ece.drexel.edu/content/ada95-matrix-package

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.