Trust Region solver memory corruption

Trust Region solver memory corruption

Hi there,

I'm trying to use MKL to replace existing Levenberg-Marquardt fitting using MINPACK or MPFit.  As a test case, I'm fitting a Gaussian function.  Things work pretty well, except that my program crashes at the final MKL_FreeBuffers call.  I don't know if this is an MKL problem, as this crash occurs even when I comment out that MKL_FreeBuffers call.

I've pasted part of my code here: - if more of the code would be helpful, I'll upload it.  It's just a rather large codebase to ask you to crawl through.

I had a few questions, just to make sure I'm not doing anything dumb:

  1. Is it OK to use vectors as I've done, instead of malloc?  It seems to work (the algorithm fits my test Gaussian correctly), but memory corruption occurs at the end occurs in a vector's destructor.  (Do you have a good way to identify which vector is causing the problem?  I'm afraid I don't know how to debug that.)
  2. Does MKL keep any handle on any of the temporary arrays that would cause that destructor problem?

For reference, I'm using VS2008, x64 and MKL 10.3.1.

Thanks for any tips...

3 post / 0 nuovi
Ultimo contenuto
Per informazioni complete sulle ottimizzazioni del compilatore, consultare l'Avviso sull'ottimizzazione

PS: I also sometimes get access violation errors in my djacobix call, but that's not every time.

Sorry, my error.  I was not creating the fjac vector correctly - it was too small.  I had only m elements.

Sorry for the noise!

Accedere per lasciare un commento.