Skip to content

Commit

Permalink
Merge pull request #1 from mkrishan/master
Browse files Browse the repository at this point in the history
change numeric type
  • Loading branch information
lostella committed Aug 3, 2018
2 parents ca1a58d + 7ebbaa7 commit a9d8c0d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion private/lbfgs.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ void LBFGS_MATVEC_TWOLOOP(int n, int mem, double * dir_n, double * s_n_m, double

void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
{
int n, mem, curridx, currmem, dir_dims[2];
size_t n, mem, curridx, currmem, dir_dims[2];
double * dir, * s, * y, * ys, H, * g, * alpha;

if (nrhs != 7) {
Expand Down

1 comment on commit a9d8c0d

@MelisWillem
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is wrong, take a look at forbes:
https://github.com/kul-forbes/ForBES/blob/master/private/lbfgs.c

The size_t is dangerous for backward compatibility !!!
more info https://stackoverflow.com/questions/6585116/difference-between-size-t-and-mwsize-when-mexing-c-with-matlab

Please sign in to comment.