From bhh at xs4all.nl  Wed Jun 19 15:58:35 2013
From: bhh at xs4all.nl (Berend Hasselman)
Date: Wed, 19 Jun 2013 15:58:35 +0200
Subject: [Rd] eigen(symmetric=TRUE) for complex matrices
In-Reply-To: <C74505CF-FE4E-45D4-99D0-41EA2A9F4BF1@gmail.com>
References: <CAHHjBM4z8d58QNb1HuqT4-k7BKaTo_=zAeuFeDr4pZdjTP2-Tg@mail.gmail.com>
	<5CEBFA58-9D40-42F0-87B8-F006EC3A848B@gmail.com>
	<267A30A5-1865-4D23-8B9A-F04F9BBED1EE@gmail.com>
	<35EFC1D4-CA6B-42B6-A15B-4A1FCD0FD687@xs4all.nl>
	<84517510-5BD0-4842-B361-4F336E24E37A@gmail.com>
	<5A6C81B8-EB15-4A09-B5E0-ABE8CBC8EC5E@gmail.com>
	<24CD8823-56EC-4A15-B4FC-F54652DB2888@xs4all.nl>
	<C74505CF-FE4E-45D4-99D0-41EA2A9F4BF1@gmail.com>
Message-ID: <36D9889B-76F1-40AA-B003-7D222EEFD4D1@xs4all.nl>


On 19-06-2013, at 14:17, peter dalgaard <pdalgd at gmail.com> wrote:

> 
> 
> 
> Thanks. I think I have it nailed down now. The culprit was indeed in our reference BLAS (I had only checked the LAPACK code), cmplxblas.f to be specific. Revision 53001 had a number of IF statements being commented out, but two of the changes looked like this:
> 
> @@ -1561,7 +1561,7 @@
>                   C( J, J ) = DBLE( C( J, J ) )
>                END IF
>                DO 170 L = 1, K
> -                  IF( ( A( J, L ).NE.ZERO ) .OR. ( B( J, L ).NE.ZERO ) )
> +c                  IF( ( A( J, L ).NE.ZERO ) .OR. ( B( J, L ).NE.ZERO ) )
>      $                 THEN
>                      TEMP1 = ALPHA*DCONJG( B( J, L ) )
>                      TEMP2 = DCONJG( ALPHA*A( J, L ) )
> 
> Notice that the continuation line was NOT commented out. So FORTRAN, being what it is, continues the line before the comment and parses it as 
>      DO 170 L = 1, KTHEN
> with KTHEN uninitialized! and things go downhill from there. 
> 
> (The uninitialized variable was actually hinted at in PR14964 and the fact that I could get one of my builds to segfault also helped.)
> 


And it seems that line 1536 and 1537 ( R-3.0.1 source) have a similar change, so that will also have be put right.

Berend



[Rd] eigen(symmetric=TRUE) for complex matrices
Berend Hasselman