Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

ANN: Ada 2005 Math Extensions 20120712

169 views
Skip to first unread message

Simon Wright

unread,
Jul 12, 2012, 3:44:46 PM7/12/12
to
I'm pleased to announce the 20120712 release of the Ada 2005 Math
Extensions.

Changes in this release:

The GNAT Project file is now in the top directory of the
distribution.

The tests expect AUnit 3 to be installed.

Different releases of LAPACK may alter the sign of eigenvectors
returned by the generalized eigensystem code (remember that the
generalized eigensystem is Av = lBv, where l is an eigenvalue and v
is the corresponding eigenvector). This only affected the tests.

Testing on Debian 6 required an increase in the test limit for
complex general eigenvalues tests for Float.

In GNAT GPL 2012 and GCC 4.7, LAPACK and BLAS are no longer used, and
therefore aren't provided as part of GNAT on platforms where they
aren't natively available. This package requires LAPACK and BLAS to
be installed (it links with "-llapack -lblas").

Download: https://sourceforge.net/projects/gnat-math-extn/files/20120712/

Ken Thomas

unread,
Jul 13, 2012, 7:12:13 AM7/13/12
to
On Thursday, July 12, 2012 8:44:46 PM UTC+1, Simon Wright wrote:
> I'm pleased to announce the 20120712 release of the Ada 2005 Math
> Extensions.
>
> Changes in this release:
>
> The GNAT Project file is now in the top directory of the
> distribution.
>
> The tests expect AUnit 3 to be installed.
>
> Different releases of LAPACK may alter the sign of eigenvectors
> returned by the generalized eigensystem code (remember that the
> generalized eigensystem is Av = lBv, where l is an eigenvalue and v
> is the corresponding eigenvector). This only affected the tests.
>
> Testing on Debian 6 required an increase in the test limit for
> complex general eigenvalues tests for Float.
>
> In GNAT GPL 2012 and GCC 4.7, LAPACK and BLAS are no longer used, and
> therefore aren't provided as part of GNAT on platforms where they
> aren't natively available. This package requires LAPACK and BLAS to
> be installed (it links with "-llapack -lblas").
>
> Download: https://sourceforge.net/projects/gnat-math-extn/files/20120712/

A useful contribution! Thanks

Ada novice

unread,
Jul 14, 2012, 4:13:49 AM7/14/12
to
On Thursday, July 12, 2012 8:44:46 PM UTC+1, Simon Wright wrote:
>
> In GNAT GPL 2012 and GCC 4.7, LAPACK and BLAS are no longer used, and
> therefore aren't provided as part of GNAT on platforms where they
> aren't natively available. This package requires LAPACK and BLAS to
> be installed (it links with "-llapack -lblas").
>

Thanks for the release. Someone advised me not to have GNAT GPL under linux but to have the Debian testing packages instead. I now have the linux mint debian edition. If I put the line:

deb ftp://ftp.debian.org/debian/ testing main

in the /etc/apt/sources.list, I will get on issuing

apt-get install gnat

the versions of gnat 4.6.3, gps 5.0.6 and libgtkada 2.24.1 among other files.

Questions:

1. One question is that whether your latest 20120712 package will work with gnat 4.6.3. Will the package use the inbuilt LAPACK and BLAS inside GNAT?

2. If I instead stick to your earlier release of the math extension package since I have gnat 4.6.3, then things should run smoothly. Is that true?

3. I am installing LAPACK liblapack3gf and BLAS libatlas3gf-base as you are aware. Will this separate installation of LAPACK and BLAS get into conflicts with the ones in GNAT when running your math extension package? Any adjustments in the path that I need to make?

Thanks.

YC

Simon Wright

unread,
Jul 14, 2012, 6:43:21 AM7/14/12
to
Ada novice <shai...@gmx.com> writes:

> 1. One question is that whether your latest 20120712 package will work
> with gnat 4.6.3. Will the package use the inbuilt LAPACK and BLAS
> inside GNAT?

I only have Debian 6 here (squeeze?), and GCC 4.4.5 doesn't have inbuilt
LAPACK or BLAS, which would be in libgnalasup.a. Instead, it says
"-lgnala -llapack -lblas' and picks up liblapack.so.3gf, libblas.so.3gf
(and libgfortran.so.3).

I expect Debian testing will do the same.

I tested 20120712 with GNAT GPL 2011 and 2012 on Mac OS X and Debian 6,
with FSF GCC 4.6 and 4.7 on Mac OS X, and with Debian GCC 4.4.5 on
Debian 6. As you know, it doesn't work on Windows because we can't find
a suitable liblapack.dll, libblas.dll.

> 2. If I instead stick to your earlier release of the math extension
> package since I have gnat 4.6.3, then things should run smoothly. Is
> that true?

I would think so.

> 3. I am installing LAPACK liblapack3gf and BLAS libatlas3gf-base as
> you are aware. Will this separate installation of LAPACK and BLAS get
> into conflicts with the ones in GNAT when running your math extension
> package? Any adjustments in the path that I need to make?

As I said above, I don't believe that GNAT on Debian has inbuilt LAPACK,
BLAS.

Ada novice

unread,
Jul 14, 2012, 10:18:58 AM7/14/12
to
On Saturday, July 14, 2012 11:43:21 AM UTC+1, Simon Wright wrote:

> I only have Debian 6 here (squeeze?), and GCC 4.4.5 doesn&#39;t have inbuilt
> LAPACK or BLAS, which would be in libgnalasup.a. Instead, it says
> &quot;-lgnala -llapack -lblas&#39; and picks up liblapack.so.3gf, libblas.so.3gf
> (and libgfortran.so.3).
>
Thanks for all the info. Though my Linux distribution is tuned to testing, I could only get gnat 4.4 and GPS 4.3.6 and not later. My gnat says 4.4+1.1 installed (with apt-cache policy gnat) but I do not know how to interpret that.

YC

Ada novice

unread,
Jul 27, 2012, 3:23:47 PM7/27/12
to
After knowing that the lapack and blas libraries are functional on my linux system, I tried the new math extension package. I do not understand however how lapack and blas are called.

After issuing the command: $ gnatmake -p -P demo_extensions, I see further down the output these lines:

gnatbind -E -I- -x /home/work/ada/simon2012/test/.build/demo_extensions.ali
gnatlink /home/work/ada/simon2012/test/.build/demo_extensions.ali -g /home/work/ada/simon2012/lib/libgnat_math_extensions.a -Wl,-rpath,/usr/local/gnat-2012/lib/gcc/i686-pc-linux-gnu/4.5.4/adalib/ -llapack -lblas -o

So the linker is calling -llpack and -lblas.

When I execute $ ./demo_extensions, I do get a long list of outputs which end with the last example:

ZGGEV example at http://www.nag.co.uk/lapack-ex/node122.html

Eigenvalue( 1) = ( 3.00000E+00,-9.00000E+00)
...
...
...

as expected from the code

My question is at which stage -llpack and -lblas are called? The file demo_extensions.gpr does not have these "switches" in the linker section.

I would like to know what lapack and blas libraries are being called, and if I can switch to the ACML ones which also work well for other Ada programs.

Thanks,
YC




Simon Wright

unread,
Jul 27, 2012, 5:03:05 PM7/27/12
to
Ada novice <shai...@gmx.com> writes:

> After knowing that the lapack and blas libraries are functional on my
> linux system, I tried the new math extension package. I do not
> understand however how lapack and blas are called.
>
> After issuing the command: $ gnatmake -p -P demo_extensions, I see
> further down the output these lines:
>
> gnatbind -E -I- -x /home/work/ada/simon2012/test/.build/demo_extensions.ali
> gnatlink /home/work/ada/simon2012/test/.build/demo_extensions.ali -g
> /home/work/ada/simon2012/lib/libgnat_math_extensions.a
> -Wl,-rpath,/usr/local/gnat-2012/lib/gcc/i686-pc-linux-gnu/4.5.4/adalib/
> -llapack -lblas -o
>
> So the linker is calling -llpack and -lblas.
>
> When I execute $ ./demo_extensions, I do get a long list of outputs
[...]
> as expected from the code
>
> My question is at which stage -llpack and -lblas are called? The file
> demo_extensions.gpr does not have these "switches" in the linker
> section.

demo_extensions.gpr starts

with "../gnat_math_extensions";

and gnat_math_extensions.gpr contains

package Linker is
for Linker_Options use ("-llapack", "-lblas");
end Linker;

> I would like to know what lapack and blas libraries are being called,
> and if I can switch to the ACML ones which also work well for other
> Ada programs.

"ldd demo_extensions" will show you which shareable libraries are used
by the executable demo_extensions.

You should be able to switch to the ACML libraries without trouble. You
may be able to do so without re-linking; I don't remember how to do that
(setting the env var LD_PRELOAD to the replacement libraries??)

Ada novice

unread,
Jul 28, 2012, 9:01:26 AM7/28/12
to
I apologise for the late reply. Thanks for the information. ACML works fine also by just setting the Linker_Option as "-lacml". GREAT!

To compare ACML and the "Debian" lapack:

With Debian lapack:

$ ldd demo_extensions
linux-gate.so.1 => (0xb7756000)
liblapack.so.3gf => /usr/lib/liblapack.so.3gf (0xb6ef2000)
libblas.so.3gf => /usr/lib/libblas.so.3gf (0xb6be9000)
libc.so.6 => /lib/i386-linux-gnu/i686/cmov/libc.so.6 (0xb6a8b000)
libpthread.so.0 => /lib/i386-linux-gnu/i686/cmov/libpthread.so.0 (0xb6a72000)
libgfortran.so.3 => /usr/lib/i386-linux-gnu/libgfortran.so.3 (0xb696f000)
libgcc_s.so.1 => /lib/i386-linux-gnu/libgcc_s.so.1 (0xb6952000)
libm.so.6 => /lib/i386-linux-gnu/i686/cmov/libm.so.6 (0xb692c000)
/lib/ld-linux.so.2 (0xb7757000)
libquadmath.so.0 => /usr/lib/i386-linux-gnu/libquadmath.so.0 (0xb68b8000)

and with ACML:

$ ldd demo_extensions
linux-gate.so.1 => (0xb777c000)
libacml.so => /opt/acml4.4.0/gfortran32/lib/libacml.so (0xb6d96000)
libc.so.6 => /lib/i386-linux-gnu/i686/cmov/libc.so.6 (0xb6c0a000)
libpthread.so.0 => /lib/i386-linux-gnu/i686/cmov/libpthread.so.0 (0xb6bf1000)
librt.so.1 => /lib/i386-linux-gnu/i686/cmov/librt.so.1 (0xb6be8000)
libgfortran.so.3 => /usr/lib/i386-linux-gnu/libgfortran.so.3 (0xb6ae5000)
libm.so.6 => /lib/i386-linux-gnu/i686/cmov/libm.so.6 (0xb6abf000)
/lib/ld-linux.so.2 (0xb777d000)
libquadmath.so.0 => /usr/lib/i386-linux-gnu/libquadmath.so.0 (0xb6a4b000)

I'm curious to know this "libquadmath" that appears in both of the above outputs at the end. What is it?

When running "demo_extensions", I saw some differences in the outputs (in the last example for instance). It is hard to compare on the screen; I will have to print and see the differences well. The outputs are:

(a) With Debian lapack:

$ ./demo_extensions
--------------------------------
Values from <143ef70b-7e74-426b...@x21g2000yqa.googlegroups.com>

42 => ( 2.00000, 4.00000)
43 => ( 2.00000,-4.00000)
44 => ( 1.00000,-0.00000)

--------------------------------
Values in Test16 of http://people.sc.fsu.edu/~jburkardt/f_src/lapack/lapack_OSX_prb_output.txt

using Complex_Arrays.Eigenvalues
6.00000
4.00000
2.00000
-0.00000
-2.00000
-4.00000
-6.00000

using Extensions.Eigenvalues
( 6.00000, 0.00000)
( 4.00000, 0.00000)
(-6.00000, 0.00000)
( 2.00000, 0.00000)
(-0.00000, 0.00000)
(-4.00000, 0.00000)
(-2.00000, 0.00000)

--------------------------------
Values from http://en.wikipedia.org/wiki/Skew-symmetric_matrix

( 0.00000, 4.58258)
(-0.00000, 0.00000)
( 0.00000,-4.58258)

--------------------------------
Results from http://en.wikipedia.org/wiki/Orthogonal_matrix

Eigenvalues:
( 0.00000, 1.00000)
(-0.00000,-1.00000)
(-1.00000, 0.00000)

Eignesystem Values:
( 0.00000, 1.00000)
(-0.00000,-1.00000)
(-1.00000, 0.00000)

Eigensystem Vectors:
( 0.70711, 0.00000) ( 0.70711, 0.00000) (-0.00000, 0.00000)
( 0.00000,-0.56569) (-0.00000, 0.56569) (-0.60000,-0.00000)
( 0.00000,-0.42426) (-0.00000, 0.42426) ( 0.80000, 0.00000)

--------------------------------
Generalized eigensystem of real non-symmetric matrix.
The solutions are such that beta*a - alpha*b is singular, ie
its determinant is zero. We'll show that it's small for
a selection of randomly-benerated matrices.

j: 1 determinant: 0.00000E+00
j: 2 determinant: 6.41364E-07
j: 3 determinant: 1.09388E-09
j: 4 determinant: 3.61017E-08
j: 5 determinant: 1.99069E-08
j: 6 determinant: 1.59409E-08

j: 1 determinant: 2.73842E-08
j: 2 determinant: 1.97363E-09
j: 3 determinant: 2.46558E-09
j: 4 determinant: 1.55393E-05
j: 5 determinant: 4.60858E-08
j: 6 determinant: 3.19744E-09

j: 1 determinant: 2.77505E-08
j: 2 determinant: 1.87194E-08
j: 3 determinant: 6.03069E-09
j: 4 determinant: 1.63023E-09
j: 5 determinant: 8.51147E-08
j: 6 determinant: 4.31280E-09

j: 1 determinant: 7.87980E-10
j: 2 determinant: 2.10041E-10
j: 3 determinant: 3.72882E-11
j: 4 determinant: 1.11441E-10
j: 5 determinant: 3.37806E-08
j: 6 determinant: 6.60784E-12

j: 1 determinant: 2.75188E-10
j: 2 determinant: 0.00000E+00
j: 3 determinant: 1.48421E-13
j: 4 determinant: 1.43467E-09
j: 5 determinant: 7.14908E-10
j: 6 determinant: 3.36777E-10

j: 1 determinant: 4.88385E-09
j: 2 determinant: 4.37879E-07
j: 3 determinant: 2.77873E-08
j: 4 determinant: 9.66340E-09
j: 5 determinant: 2.69842E-08
j: 6 determinant: 4.55744E-08

--------------------------------
ZGGEV example at http://www.nag.co.uk/lapack-ex/node122.html

Eigenvalue( 1) = ( 3.00000E+00,-9.00000E+00)
Eigenvector( 1) = (-8.37379E-01,-1.62621E-01)(-1.53495E-01, 7.44662E-02)(-7.44662E-02,-1.53495E-01)( 1.53495E-01,-7.44662E-02)
Eigenvalue( 2) = ( 2.00000E+00,-5.00000E+00)
Eigenvector( 2) = ( 6.29583E-01, 3.70417E-01)( 4.14831E-03,-4.65165E-04)( 3.95740E-02, 2.32833E-02)(-2.32833E-02, 3.95740E-02)
Eigenvalue( 3) = ( 3.00000E+00,-1.00000E+00)
Eigenvector( 3) = ( 9.77535E-01, 2.24654E-02)( 1.59101E-01,-1.13710E-01)( 1.20898E-01,-1.53710E-01)( 1.53710E-01, 1.20898E-01)
Eigenvalue( 4) = ( 4.00000E+00,-5.00000E+00)
Eigenvector( 4) = (-9.06236E-01, 9.37639E-02)(-7.43055E-03, 6.87512E-03)( 3.02078E-02,-3.12554E-03)(-1.45858E-02,-1.40970E-01)

(b) with ACML

$ ./demo_extensions
--------------------------------
Values from <143ef70b-7e74-426b...@x21g2000yqa.googlegroups.com>

42 => ( 2.00000, 4.00000)
43 => ( 2.00000,-4.00000)
44 => ( 1.00000,-0.00000)

--------------------------------
Values in Test16 of http://people.sc.fsu.edu/~jburkardt/f_src/lapack/lapack_OSX_prb_output.txt

using Complex_Arrays.Eigenvalues
6.00000
4.00000
2.00000
-0.00000
-2.00000
-4.00000
-6.00000

using Extensions.Eigenvalues
( 6.00000, 0.00000)
( 4.00000, 0.00000)
(-6.00000, 0.00000)
( 2.00000, 0.00000)
( 0.00000, 0.00000)
(-4.00000, 0.00000)
(-2.00000, 0.00000)

--------------------------------
Values from http://en.wikipedia.org/wiki/Skew-symmetric_matrix

( 0.00000, 4.58258)
( 0.00000, 0.00000)
(-0.00000,-4.58258)

--------------------------------
Results from http://en.wikipedia.org/wiki/Orthogonal_matrix

Eigenvalues:
( 0.00000, 1.00000)
( 0.00000,-1.00000)
(-1.00000, 0.00000)

Eignesystem Values:
( 0.00000, 1.00000)
( 0.00000,-1.00000)
(-1.00000, 0.00000)

Eigensystem Vectors:
( 0.70711, 0.00000) ( 0.70711, 0.00000) (-0.00000,-0.00000)
( 0.00000,-0.56569) ( 0.00000, 0.56569) (-0.60000,-0.00000)
( 0.00000,-0.42426) ( 0.00000, 0.42426) ( 0.80000, 0.00000)

--------------------------------
Generalized eigensystem of real non-symmetric matrix.
The solutions are such that beta*a - alpha*b is singular, ie
its determinant is zero. We'll show that it's small for
a selection of randomly-benerated matrices.

j: 1 determinant: 3.38316E-08
j: 2 determinant: 3.48750E-06
j: 3 determinant: 7.27814E-10
j: 4 determinant: 5.19989E-08
j: 5 determinant: 1.88069E-08
j: 6 determinant: 1.16859E-08

j: 1 determinant: 3.75126E-09
j: 2 determinant: 9.37482E-09
j: 3 determinant: 7.31456E-08
j: 4 determinant: 7.91349E-06
j: 5 determinant: 3.26590E-09
j: 6 determinant: 1.97660E-08

j: 1 determinant: 2.24647E-08
j: 2 determinant: 9.01645E-08
j: 3 determinant: 1.23797E-08
j: 4 determinant: 4.89069E-09
j: 5 determinant: 7.94987E-08
j: 6 determinant: 6.34529E-09

j: 1 determinant: 3.00981E-09
j: 2 determinant: 7.41406E-10
j: 3 determinant: 2.78002E-10
j: 4 determinant: 2.11384E-10
j: 5 determinant: 6.75613E-08
j: 6 determinant: 3.30392E-11

j: 1 determinant: 1.10075E-09
j: 2 determinant: 1.52874E-08
j: 3 determinant: 3.25786E-11
j: 4 determinant: 5.33539E-09
j: 5 determinant: 2.72676E-09
j: 6 determinant: 1.34711E-09

j: 1 determinant: 8.40869E-09
j: 2 determinant: 6.92644E-07
j: 3 determinant: 3.07913E-08
j: 4 determinant: 8.94615E-10
j: 5 determinant: 1.75984E-08
j: 6 determinant: 5.06383E-08

--------------------------------
ZGGEV example at http://www.nag.co.uk/lapack-ex/node122.html

Eigenvalue( 1) = ( 3.00000E+00,-9.00000E+00)
Eigenvector( 1) = ( 5.22150E-01, 4.77850E-01)( 1.40886E-01, 1.37983E-02)(-1.37980E-02, 1.40886E-01)(-1.40886E-01,-1.37980E-02)
Eigenvalue( 2) = ( 2.00000E+00,-5.00000E+00)
Eigenvector( 2) = (-9.41937E-01, 5.80634E-02)(-4.10722E-03, 3.49492E-03)(-5.92076E-02, 3.64964E-03)(-3.64968E-03,-5.92078E-02)
Eigenvalue( 3) = ( 3.00001E+00,-1.00000E+00)
Eigenvector( 3) = ( 9.37074E-01, 6.29255E-02)( 1.57483E-01,-1.02381E-01)( 1.22517E-01,-1.42381E-01)( 1.42381E-01, 1.22517E-01)
Eigenvalue( 4) = ( 4.00000E+00,-5.00000E+00)
Eigenvector( 4) = (-9.06228E-01, 9.37721E-02)(-7.43061E-03, 6.87517E-03)( 3.02073E-02,-3.12593E-03)(-1.45869E-02,-1.40969E-01)


YC

Simon Wright

unread,
Jul 28, 2012, 3:10:31 PM7/28/12
to
Ada novice <shai...@gmx.com> writes:

> I'm curious to know this "libquadmath" that appears in both of the
> above outputs at the end. What is it?

I don't know but if you Google it you will get some answers.

Simon Wright

unread,
Jul 28, 2012, 3:33:32 PM7/28/12
to
Ada novice <shai...@gmx.com> writes:

> When running "demo_extensions", I saw some differences in the outputs
> (in the last example for instance).

The last example comes from
http://www.nag.co.uk/lapack-ex/node122.html. The results
(http://www.nag.co.uk/lapack-ex/examples/results/zggev-ex.r) look a lot
more like the Debian output you list than the ACML output.

FWIW the Mac OS X 10.7.4 output is

ZGGEV example at http://www.nag.co.uk/lapack-ex/node122.html

Eigenvalue( 1) = ( 3.00000E+00,-9.00000E+00)
Eigenvector( 1) = ( 8.37379E-01, 1.62621E-01)( 1.53495E-01,-7.44663E-02)( 7.44662E-02, 1.53495E-01)(-1.53495E-01, 7.44663E-02)
Eigenvalue( 2) = ( 2.00000E+00,-5.00000E+00)
Eigenvector( 2) = (-6.29583E-01,-3.70417E-01)(-4.14824E-03, 4.65175E-04)(-3.95739E-02,-2.32833E-02)( 2.32834E-02,-3.95739E-02)
Eigenvalue( 3) = ( 3.00000E+00,-1.00001E+00)
Eigenvector( 3) = ( 9.77535E-01, 2.24653E-02)( 1.59101E-01,-1.13710E-01)( 1.20898E-01,-1.53710E-01)( 1.53710E-01, 1.20898E-01)
Eigenvalue( 4) = ( 4.00000E+00,-5.00000E+00)
Eigenvector( 4) = ( 9.06236E-01,-9.37645E-02)( 7.43045E-03,-6.87512E-03)(-3.02078E-02, 3.12552E-03)( 1.45859E-02, 1.40970E-01)

which has similar absolute values but the signs of all except (3) are
reversed; and are the same as the outputs of the NAG test program/data.

I'm not a numerical analyst, so I have no idea whether these differences
represent bugs or features.

Ada novice

unread,
Jul 29, 2012, 10:05:36 AM7/29/12
to
On Saturday, July 28, 2012 8:33:32 PM UTC+1, Simon Wright wrote:

> I'm not a numerical analyst, so I have no idea whether these differences
>
> represent bugs or features.

I've read that ACML is developed with NAG and so getting different results was perhaps not something to be expected. Eigenvectors are tricky as they could be normalised or not and different normalisation schemes exist. Something would have been terribly wrong had the eigenvalues were different!

YC

Nasser M. Abbasi

unread,
Jul 29, 2012, 10:22:46 AM7/29/12
to
It is the other way around.

Eigenvector times a scalar is still a valid Eigenvector.
(i.e. scaling an eigenvector does not matter).

But if the sign of the eigenvalue is different, then you
need to look into it. Depending on the context, eigenvalue
sign indicate stability or not. So it is important.

--Nasser

Ada novice

unread,
Jul 29, 2012, 10:34:34 AM7/29/12
to n...@12000.org
On Sunday, July 29, 2012 3:22:46 PM UTC+1, Nasser M. Abbasi wrote:
>
> It is the other way around.
>

Yes I know about eigenvalues and stability in the complex plane. This is why I said that something would have been terribly wrong if Debian lapack and ACML were not agreeing on the eigenvalues.

Yes eigenvectors show just the relatives maginitudes between DOFs as for example in vibrations. So as you say, scaling is not an issue. A beam can either bend upwards or downwards in its banana first mode shape and so a multiplication with a scalar value say of -1 does not affect the relative magnitudes between the different DOFs and we have the same information regarding the mode shape of the beam.

What I meant with the eigenvectors is that there are different ways of normalising. Normally the total length of an eigenvector is scaled to unity. Different normalisations exist also.

YC

Nasser M. Abbasi

unread,
Jul 29, 2012, 10:52:08 AM7/29/12
to
On 7/29/2012 9:34 AM, Ada novice wrote:
> On Sunday, July 29, 2012 3:22:46 PM UTC+1, Nasser M. Abbasi wrote:
>>
>> It is the other way around.
>>
>
> Yes I know about eigenvalues and stability in the complex plane. This is why I
> said that something would have been terribly wrong if Debian lapack and ACML were
>not agreeing on the eigenvalues.
>

Sorry, I misunderstood you. somehow I read what you said as the
eigenvalues were different.

But different eigenvectors magnitudes is not a problem. It is not
uncommon to see this:

-----------------------------
Matlab:
EDU>> A=[1 2;
3 4]

EDU>> [eigVectors,eigValues]=eig(A)

eigVectors =

-0.8246 -0.4160
0.5658 -0.9094


eigValues =

-0.3723 0
0 5.3723
-------------------------

Mathematica:

------------------------------
In[5]:= mat={{1,2},
{3,4}};

eigenVector=Eigenvectors[mat]//N
Out[6]= {{0.457427,1.},{-1.45743,1.}}

eigenVector=Eigenvalues[mat]//N
Out[7]= {5.37228,-0.372281}

-----------------------------

Maple:
-----------------
A:=<<1|2>,<3|4>>:

evalf(LinearAlgebra:-Eigenvectors(A));
[ 5.372281324] [0.4574271076 -1.457427107]
[ ], [ ]
[-0.372281324] [ 1. 1.]
-----------------------

You see, eigenvealuses are all the same (as you also said :), but the
eigenvectors have different normalization. Here Maple and Mathematica
used the same. But Matlab was different. (using default call).

--Nasser

Ada novice

unread,
Jul 29, 2012, 11:02:32 AM7/29/12
to n...@12000.org
On Sunday, July 29, 2012 3:52:08 PM UTC+1, Nasser M. Abbasi wrote:
> On 7/29/2012 9:34 AM, Ada novice wrote:

Yes, different software can produce different eigenvectors. It depends on the algorithm used. I remember (but not 100% sure) that in Matlab, [V,D] = eig(A,B) and [V,D] = eig(A,B,'qz')

where

'qz'

ignores the symmetry, if any, and uses the QZ algorithm as it would for nonsymmetric (non-Hermitian) A and B

produced different eigenvectors.


Eigenvalues are bound to be the same in any software independent of the algorithm used as they represent an intrinsic property of a system.


YC

Ada novice

unread,
Jul 29, 2012, 11:31:12 AM7/29/12
to n...@12000.org
On Sunday, July 29, 2012 3:52:08 PM UTC+1, Nasser M. Abbasi wrote:

> Sorry, I misunderstood you. somehow I read what you said as the
>
> eigenvalues were different.
>

No worries :)

Now I realised that I earlier wrote: "Something would have been terribly wrong had the eigenvalues were different!". Of course this is not grammatically correct and this may have confused you. I wanted to say: "Something would have been terribly wrong had the eigenvalues been different!". Sorry for this slip of mine.

YC

Ada novice

unread,
Jul 30, 2012, 2:59:06 PM7/30/12
to
On Saturday, July 28, 2012 8:33:32 PM UTC+1, Simon Wright wrote:
> I'm not a numerical analyst, so I have no idea whether these differences
>
> represent bugs or features.

From the lapack documentation:

The computed eigenvectors are normalized to have Euclidean norm equal to 1 and largest component real.

I have checked for both the "Debian" lapack and the ACML results and they both adhere to the documentation rule.

YC
0 new messages