comp.lang.ada
 help / color / mirror / Atom feed
* ANN:Ada 2005 Math Extensions 20170427
@ 2017-04-27 10:52 Simon Wright
  2017-05-09 11:31 ` Vincent DIEMUNSCH
  0 siblings, 1 reply; 4+ messages in thread
From: Simon Wright @ 2017-04-27 10:52 UTC (permalink / raw)


The latest release of this project[1] is available at Sourceforge[2].

Changes:

   The procedure declaration for the generalized real eigensystem
   solution was wrong: the eigenvectors should have been
   complex. This has been corrected.

   The tests now succeed with LAPACK 3.2 to 3.4, and 3.5 to 3.7
   (the Fortran results for Real Generalized Eigensystems changed
   at 3.5). This may be a symptom of some deeper problem, to be
   investigated.

   The package can be installed with the compiler by 'make install'.

   The code is compatible with GNAT GPL 2016 and FSF GCC 7 (a
   minor change was required to avoid a compilation warning).

Windows users: there's now a version of LAPACK for Windows[3]; I haven't
tried it, but it has to be an improvement on the situation in 2013!

[1] http://gnat-math-extn.sourceforge.net/index.html/
[2] https://sourceforge.net/projects/gnat-math-extn/files/20170427/
[3] http://icl.cs.utk.edu/lapack-for-windows/lapack/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: ANN:Ada 2005 Math Extensions 20170427
  2017-04-27 10:52 ANN:Ada 2005 Math Extensions 20170427 Simon Wright
@ 2017-05-09 11:31 ` Vincent DIEMUNSCH
  2017-05-09 12:49   ` Simon Wright
  0 siblings, 1 reply; 4+ messages in thread
From: Vincent DIEMUNSCH @ 2017-05-09 11:31 UTC (permalink / raw)


Hello Simon,

I have some simple questions regarding matrices in Ada : 

So if understand well, this  is an extension of the Ada Arrays in row-major order, right ? How is it using Lapack since Fortran has column-major order for it's matrices ?

I have also seen different projects that use Lapack :
- Ada Lapack : https://sourceforge.net/projects/ada-lapack/
- AdaLAPACK  : https://sourceforge.net/projects/adalapack/

The first one is a binding and the second one a translation of Fortran code, right ? So if I want to use matrices in column-major order in Ada, can I use both, or only the second one is column-major ?

Kind regards,

Vincent




Le jeudi 27 avril 2017 12:52:42 UTC+2, Simon Wright a écrit :
> The latest release of this project[1] is available at Sourceforge[2].
 
> [1] http://gnat-math-extn.sourceforge.net/index.html/
> [2] https://sourceforge.net/projects/gnat-math-extn/files/20170427/
> [3] http://icl.cs.utk.edu/lapack-for-windows/lapack/



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: ANN:Ada 2005 Math Extensions 20170427
  2017-05-09 11:31 ` Vincent DIEMUNSCH
@ 2017-05-09 12:49   ` Simon Wright
  2017-05-09 13:20     ` Vincent
  0 siblings, 1 reply; 4+ messages in thread
From: Simon Wright @ 2017-05-09 12:49 UTC (permalink / raw)


Vincent DIEMUNSCH <vincent.diemunsch@gmail.com> writes:

> So if understand well, this is an extension of the Ada Arrays in
> row-major order, right ? How is it using Lapack since Fortran has
> column-major order for it's matrices ?

By transposing input matrices before handing over to LAPACK, and
transposing the results before handing back to the caller.

> I have also seen different projects that use Lapack :
> - Ada Lapack : https://sourceforge.net/projects/ada-lapack/

This is a translation of the Fortran library to Ada, and uses native Ada
ordering (row-major).

> - AdaLAPACK  : https://sourceforge.net/projects/adalapack/

This is a binding, and its interface is explicitly in terms of
Fortran-convention objects; for example,

   type Fortran_Real_Matrix is
     array (Fortran_Integer range <>, Fortran_Integer range <>) of Real;
   pragma Convention (Fortran, Fortran_Real_Matrix);

   ...

   procedure SGEEV
     (JOBVL : Character;
      JOBVR : Character;
      N     : Fortran_Integer;
      A     : Fortran_Real_Matrix;
      LDA   : Fortran_Integer;
      WR    : out Fortran_Real_Vector;
      WI    : out Fortran_Real_Vector;
      VL    : out Fortran_Real_Matrix;
      LDVL  : Fortran_Integer;
      VR    : out Fortran_Real_Matrix;
      LDVR  : Fortran_Integer;
      WORK  : in out Fortran_Real_Vector;
      LWORK : Fortran_Integer;
      INFO  : out Fortran_Integer);

   pragma Import (Fortran, SGEEV, "sgeev_");

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: ANN:Ada 2005 Math Extensions 20170427
  2017-05-09 12:49   ` Simon Wright
@ 2017-05-09 13:20     ` Vincent
  0 siblings, 0 replies; 4+ messages in thread
From: Vincent @ 2017-05-09 13:20 UTC (permalink / raw)


Le mardi 9 mai 2017 14:49:03 UTC+2, Simon Wright a écrit :

> > - AdaLAPACK  : https://sourceforge.net/projects/adalapack/
> 
> This is a binding, and its interface is explicitly in terms of
> Fortran-convention objects; for example,
> 
>    type Fortran_Real_Matrix is
>      array (Fortran_Integer range <>, Fortran_Integer range <>) of Real;
>    pragma Convention (Fortran, Fortran_Real_Matrix);
> 
>    ...

Thank you very much Simon for your kind answer. I will use the third one, the Fortran binding, because I prefer column-major order, for different reasons :
1. It is easier to interface with Fortran solvers (obviously), and many excellent solvers are still in Fortran.
2. It is easier to interface with Matlab compatible solvers written in C that use sparse matrices in CSC format, since CSC is column-major.
3. It is easier to deal with multidimensionnal arrays that contain matrices (a very common case in scientific computation).
4. It is consistent with little endian ordering.
5. It is the convention in math to see matrices composed of column vectors. Using matrices in row-major order forces you to transpose formulas, and it is a pain.
6. A simple Pragma Convention (Fortran) is enough to transpose to row-major an array manually entered in the source code.

Kind regards,

Vincent




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-05-09 13:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-27 10:52 ANN:Ada 2005 Math Extensions 20170427 Simon Wright
2017-05-09 11:31 ` Vincent DIEMUNSCH
2017-05-09 12:49   ` Simon Wright
2017-05-09 13:20     ` Vincent

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