ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hi there, im using the gsl library and try to play with the least squares fitting routines so I test the next code but when compiling it it shows me warnings and at the end it does not show me the y=mx+b thing
only shows a nan string. Any help qould be apreciated thanks!!!
when using
gcc -Wall -I/usr/local/include -c thomson.c
it says
thomson.c:8: warning: (near initialization for ‘y’)
and then
gcc -L/usr/local/lib thomson.o -lgsl -lgslcblas -lm
and running it
./a.out
# best fit: Y = nan + nan X
# covariance matrix:
# [ nan, nan
# nan, nan]
# sumsq = nan
data: 1.08 0.11 inf
data: 1.14 0.105 1
data: 1.2 0.1 0.707107
data: 1.26 0.095 0.57735
data: 1.3 0.09 0.5
data: 2.75859e-313 1.08 0.447214
data: 1.23694e+13 1.14 0.408248
data: 6.64592e-316 1.2 0.377964
data: 4.70127e+12 1.26 0.353553
data: -0.0254148 1.3 0.333333
data: -9.35615e-39 2.75859e-313 0.316228
data: nan 1.23694e+13 0.301511
data: 4.8537e-270 6.64592e-316 0.288675
fit: 1.404 nan
hi : 1.404 nan
lo : 1.404 nan
fit: 1.3932 nan
hi : 1.3932 nan
lo : 1.3932 nan
fit: 1.3824 nan
hi : 1.3824 nan
lo : 1.3824 nan
fit: 1.3716 nan
hi : 1.3716 nan
lo : 1.3716 nan
fit: 1.3608 nan
hi : 1.3608 nan
lo : 1.3608 nan
fit: 1.35 nan
hi : 1.35 nan
lo : 1.35 nan
fit: 1.3392 nan
hi : 1.3392 nan
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.