andbeck
02-10-2005, 08:55 AM
Hi
I really need help - I am relatively new to C++ although it isn't really difficult for me to follow as I have programmed with Fortran90 before and the ideas behind C++ don't seem too different.
I need to use the Levenberg-Marquardt method to perform a non-linear least squares fit on a set of data points. I have typed out the routines mrqmin, gaussj, covsrt, mrqcof and have also typed out my user-supplied function funcs and saved them all as source files. I have also included the header file "nr.h" in each of these source files.
What I am having problems trying to work out is how to input the required arrays for the x coordinates, y coordinates, individual standard deviations, parameters a and the boolean input array ia. I have tried several different methods but none of these work. Also, how do I incorporate each of these source files/routines into one main program and obtain output? (What I am having problems understanding is how each of these routines will produce an output when they are declared as type void!)
Sorry if I sound really stupid, I know there must be an easy solution staring me in the face but I am getting really frustrated with myself for not being able to work it out!
Many thanks in advance.
I really need help - I am relatively new to C++ although it isn't really difficult for me to follow as I have programmed with Fortran90 before and the ideas behind C++ don't seem too different.
I need to use the Levenberg-Marquardt method to perform a non-linear least squares fit on a set of data points. I have typed out the routines mrqmin, gaussj, covsrt, mrqcof and have also typed out my user-supplied function funcs and saved them all as source files. I have also included the header file "nr.h" in each of these source files.
What I am having problems trying to work out is how to input the required arrays for the x coordinates, y coordinates, individual standard deviations, parameters a and the boolean input array ia. I have tried several different methods but none of these work. Also, how do I incorporate each of these source files/routines into one main program and obtain output? (What I am having problems understanding is how each of these routines will produce an output when they are declared as type void!)
Sorry if I sound really stupid, I know there must be an easy solution staring me in the face but I am getting really frustrated with myself for not being able to work it out!
Many thanks in advance.