andbeck
03-17-2005, 09:54 AM
I have written a program that uses the levenberg-marquardt routines and I have managed to get it to compile and build. I want to use the program to fit a set of data from a file that will contain my x, y and sig values.
However, whenever I try to use the >> operator to read in, say i values of x etc from a file e.g.
int n = x.size();
for (int i = 0; i < n i++) {
file >> x[i]; .......
this will only work if I define the x, y and sig vectors as double, not const double as in nrtypes_nr.h. When it does this, my program executes but misses out all the parts where it is crucial that the corresponding values are given! Also whenever I try to use cout << to print the values of the data read in from the file to the screen my program crashes!
Please help!!!!
However, whenever I try to use the >> operator to read in, say i values of x etc from a file e.g.
int n = x.size();
for (int i = 0; i < n i++) {
file >> x[i]; .......
this will only work if I define the x, y and sig vectors as double, not const double as in nrtypes_nr.h. When it does this, my program executes but misses out all the parts where it is crucial that the corresponding values are given! Also whenever I try to use cout << to print the values of the data read in from the file to the screen my program crashes!
Please help!!!!