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_errno.h)
  
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.

        Thomas



_______________________________________________
Help-gsl mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-gsl

Reply via email to