Hi,
Hi,
I want to create an array and to put it in a loop in order to use one function but for different data. So I have many observations (numobs) which I want to put in a function (NLS_Q)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
|
numobs_t = (int*)malloc(numobs+1);
for(numobs = 1; numobs <=20; numobs++){
numobs_t[numobs];
theta = parameters[0][0];
kappa = parameters[1][0];
sigmav = parameters[2][0];
rho = parameters[7][0];
beta_start[0] = kappa + 0.01;
NLS_Q(beta_start, data, beta_start[0]
numobs_t[numobs], 1, 8, numopt_sv,
kappa, theta, sigmav, rho, results);
results_NLSQ[1][0] = results[1][0];
|
When I debug the program I got the following error:
1>Compiling...
1>File_parameter.cpp
1>e:\File_parameter.cpp(231) : error C2665: 'NLS_Q' : none of the 3 overloads could convert all the argument types
1> e:\File_estimation.cpp(58): could be 'void NLS_Q(double *,double **,int *,int,int,int,double,double,double,double,double **)'
1> while trying to match the argument list '(double *, double **, int, int, int, int, double, double, double, double, double **)'
I use
#include "File_estimation.cpp"
in the main file File_parameters.cpp.
The function NLS_Q is defined in the File_estimation.cpp as follows:
1 2 3
|
void NLS_Q(double *beta_start, double **data, int *numobs_t, int numpar, int colvar, int numopt,
double kappa, double theta, double sigmav, double rho,
double **results)
|
The line File_parameter.cpp(231) is line 13 in the first code and the line File_estimation.cpp(58)File_estimation.cpp(58) is line 1 in the second code
Can someone give me a clue for solving the problem?
10x!