public inbox for gsl-discuss@sourceware.org
 help / color / mirror / Atom feed
From: Patrick Alken <patrick.alken@colorado.edu>
To: gsl-discuss@sourceware.org
Subject: Re: generalized eigensystems
Date: Wed, 21 Mar 2007 18:02:00 -0000	[thread overview]
Message-ID: <20070321180206.GA13688@hippogriff.physics.drexel.edu> (raw)
In-Reply-To: <87ejni7vqw.wl%bjg@network-theory.co.uk>

[-- Attachment #1: Type: text/plain, Size: 1685 bytes --]

> Here is an interesting test case, it aborts with a "shouldn't get
> here" error in extended precision but works in double precision (via
> GSL_IEEE_MODE).
> 
> Might be worth also looking at the previous case you had that went
> away when changing the optimisation - did you try it in
> double-precision?

I could not reproduce the exact error you got, but that same test
case is giving incorrect eigenvalues when gsl is compiled with -O2
with gcc 4.1.2 with single precision. When GSL_IEEE_MODE is set to
double-precision, it gives correct output. If I compile libgsleigen
without -O2, it gives correct output in both cases...very odd. I'm still
looking into this. It may be an issue with not properly detecting
when a matrix element has become negligible.

When trying to debug this, I came across the following issue:

when GSL_IEEE_MODE is set to double-precision, gsl_finite(GSL_POSINF)
fails. I have attached a sample test program to demonstrate this:

> gcc --version
gcc (GCC) 4.1.2

> gcc -g -Wall -o testfin testfin.c -lgsl -lgslcblas
> setenv GSL_IEEE_MODE "double-precision"
> ./testfin
GSL_IEEE_MODE="double-precision,trap-common"
Floating exception (core dumped)
> gdb testfin core
...
Program terminated with signal 8, Arithmetic exception.
#0  0xb7ef3578 in gsl_finite (x=inf) at infnan.c:103
103       const double y = x - x;

...

> unsetenv GSL_IEEE_MODE
> ./testfin
s = 0

Is this a known issue? I'm trying to use gsl_finite() in testgen
to better sort the eigenvalues so I can compare them to lapack
if there are infinities present. Basically I'm getting segfaults
all over the place whenever I try to access nans/infs in
double-precision mode.

Patrick Alken



[-- Attachment #2: testfin.c --]
[-- Type: text/plain, Size: 217 bytes --]

#include <stdio.h>
#include <gsl/gsl_math.h>
#include <gsl/gsl_ieee_utils.h>

int
main()
{
  double a;
  int s;

  gsl_ieee_env_setup();

  a = GSL_POSINF;
  s = gsl_finite(a);
  printf("s = %d\n", s);

  return 0;
}

  reply	other threads:[~2007-03-21 18:02 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-13  5:03 Patrick Alken
2007-03-16 15:49 ` Brian Gough
2007-03-20 19:17   ` Patrick Alken
2007-03-20 22:35     ` Leopold Palomo Avellaneda
2007-03-21  0:01       ` Patrick Alken
2007-03-21  7:32         ` Leopold Palomo Avellaneda
2007-03-21 14:47           ` Patrick Alken
2007-03-21 15:02             ` Leopold Palomo-Avellaneda
2007-03-21 10:10 ` Brian Gough
2007-03-21 18:02   ` Patrick Alken [this message]
2007-03-21 19:38     ` Brian Gough
2007-03-21 19:18   ` Patrick Alken
2007-03-30 21:34   ` Patrick Alken
2007-04-03 14:32     ` Brian Gough
2007-04-23 22:15     ` Patrick Alken

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070321180206.GA13688@hippogriff.physics.drexel.edu \
    --to=patrick.alken@colorado.edu \
    --cc=gsl-discuss@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).