[Top][All Lists]

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

Re: [Help-gsl] gsl minimizer

From: Thomas Weber
Subject: Re: [Help-gsl] gsl minimizer
Date: Sat, 27 Mar 2010 21:09:55 +0100
User-agent: Mutt/1.5.18 (2008-05-17)

On Fri, Mar 26, 2010 at 01:59:59PM +0100, hanieh mahmoudian wrote:
> Hi
> I wrote a program in C with use of GSL but the the problem is that during
> the process it breaks! can you tell me what can be the problem? I attached
> my program with this mail.

The error code in status is '27', which seems to stand for (see
GSL_ENOPROG  = 27,  /* iteration is not making progress towards solution */

I'm not sure what you are trying to accomplish, could you give some
comments about the aim of you program?

Some remarks (although I don't know whether your code is a simplified
example or your real program):

1) You shouldn't set npixel in each function to 2000. Instead, get the
lenght of the vector v and use that for npixel. Otherwise, your code
will be a maintenance nightmare once the vector length changes.

2) It _might_ be helpful to use gsl_vector for I_model and I_obs as
well. I don't think you will gain a lot, but it helps in seeing that
they are used as a vector.

3) I see quite some malloc()'s, but not nearly as many free()'s. 

4) Your indentation is inconsistent. This makes reading your code
unnecessarily difficult.


reply via email to

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