public inbox for gsl-discuss@sourceware.org
 help / color / mirror / Atom feed
From: Adam Johansen <amj26@hermes.cam.ac.uk>
To: gsl-discuss@sources.redhat.com
Subject: Re: GSL-1.2 gsl_eigen_symmv() Problem
Date: Thu, 07 Nov 2002 09:15:00 -0000	[thread overview]
Message-ID: <Pine.SOL.4.44.0211071702400.20867-200000@orange.csi.cam.ac.uk> (raw)
In-Reply-To: <Pine.SOL.4.44.0211071332390.3567-100000@orange.csi.cam.ac.uk>

[-- Attachment #1: Type: TEXT/PLAIN, Size: 829 bytes --]

Hello Again,

Further to my earlier email, I've managed to narrow the problem down
somewhat. It would seem that if the log() function is called before a call
to gsl_eigen_symmmv with a matrix similar to one which has already been
solved (this is a rough summary which may not be entirely accurate, but I
think contains the relevant details) then that routine goes into an
apparently infinite loop.

I've attached a short piece of code which demonstrates this problem and
I'd be interested to know whether it is a general one or is confined to
systems like my own (or indeed, is due to a corrupt library and is only
happening to me...).

Many apologies if this is a known problem, or if there's some obvious
reason why using the C libraries log function in conjunction with gsl
isn't a reasonable thing to do....

Adam Johansen



[-- Attachment #2: The offending code --]
[-- Type: TEXT/PLAIN, Size: 789 bytes --]

#include <stdio.h>

#include <gsl/gsl_eigen.h>
#include <gsl/gsl_matrix.h>
#include <gsl/gsl_vector.h>

int main(int argc, char** argv) {
  double hmmm;
  gsl_eigen_symmv_workspace* wsp;
  gsl_matrix* in, *out;
  gsl_vector* vec;

  in = gsl_matrix_alloc(2,2);
  out = gsl_matrix_alloc(2,2);
  vec = gsl_vector_alloc(2);
  int i;

  int mi = 0;

  for(i = 1; i < 101; i++) { 
     hmmm = log(1.2);
     
     for(mi = 0; mi < 6; mi++) {
	wsp = gsl_eigen_symmv_alloc(2);
       
	gsl_matrix_set(in, 0, 0, i);
	gsl_matrix_set(in, 0, 1, i - 1);
	gsl_matrix_set(in, 1, 0, i - 1);
	gsl_matrix_set(in, 1, 1, i - 0.5);
	
	printf("Solving matrix %i in iteration %i...\n", mi, i);
	gsl_eigen_symmv(in, vec, out, wsp);
	
	gsl_eigen_symmv_free(wsp);
     }
  }
}

  reply	other threads:[~2002-11-07 17:06 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-11-07  9:06 Adam Johansen
2002-11-07  9:15 ` Adam Johansen [this message]
2002-11-07  9:22   ` Atakan Gurkan
2002-11-07 15:18     ` Adam Johansen

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=Pine.SOL.4.44.0211071702400.20867-200000@orange.csi.cam.ac.uk \
    --to=amj26@hermes.cam.ac.uk \
    --cc=gsl-discuss@sources.redhat.com \
    /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).