help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Input won't accept floats


From: Francisco Jesús Martínez Serrano
Subject: Re: Input won't accept floats
Date: Thu, 18 May 2006 19:54:53 +0200

On 5/18/06, John W. Eaton wrote:
On 18-May-2006, Francisco Jesús Martínez Serrano wrote:

How can we possibly help given the above information?  Your code could
be doing anything, but you haven't shown it to us, so the best we can
do is guess.  My guess is your code does something to alter the output
format state for Octave, but again, that's just a guess.

Sorry for being so imprecise. It's a compiled function yes, but in
fact it's a whole 10000+ lines standalone visualization program
written in C using libglade and OpenGL, to which i added some hook
functions using matwrap, to be able to start it as a separate thread
and then use octave as scripting language to set parameters and get
data to make 2D plots and so on.

Interesting bits of code:

pthread_t glthread;

void irhys_start()
{
       pthread_create(&glthread,0,init_irhys_thread,0);
}

void *init_irhys_thread(void* foo)
{
       [...]
       gtk_init(&argcp, &argv);
       gtk_gl_init (&argcp, &argv);
       [...]
}

I make the irhys_start function available with matwrap (all the hooks
inside the same header file):

#ifdef __cplusplus
extern "C" {
#endif

void irhys_start(void); //This function causes the problem
void irhys_print_options(); //This dumb function (just printfs) is fine

[the rest of the hooks that work correctly]
#ifdef __cplusplus
}
#endif


Previously the program was written using glut and this was not
happening, so I assume it is some interaction between octave and
libglade/gtk/you name it, though in principle they should be
completely separated (i used to believe the visualization program was
reentrant, with GLUT it was working fine).

It is indeed a real input problem, the output is not just messed:

octave:5> 1/0.5
warning: division by zero
ans = Inf

however if one works with variables:

octave:6> a=1/2
a = 0.50000
octave:7> 1/a
ans = 2

Anyway, since I've never looked inside the octave code I just thought
that it might be a recognisable problem for those that are used to
deal with its internals.

I guess i'll have to recompile Octave in debug mode and do some debug
(maybe also gtk+).

I'll report if i find something that might be of interest to the
octave community.

Thanks.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]