From: "Matthieu Dubuget" <matthieu.dubuget@gmail.com>
To: caml-list@inria.fr
Subject: Re: [Caml-list] nonlinear fit function binding
Date: Mon, 4 Jun 2007 09:37:44 +0200 [thread overview]
Message-ID: <9f09a07a0706040037gf551211ubcddcafe496a6c1d@mail.gmail.com> (raw)
In-Reply-To: <7625D6A1880B4C4DA11D2EBB8B43D2B90282F387@FRDEF-EXMB03.europe.am.socgen>
[-- Attachment #1: Type: text/plain, Size: 1486 bytes --]
Thanks for your reply, Rabih.
2007/5/31, RABIH.ELCHAAR@sgam.com <RABIH.ELCHAAR@sgam.com>:
>
> I did a wrapping of the levmar library.
>
Unfortunately, since I am to use this in a commercial product, and I was not
able (yet ?) to convince my boss to release the sources, I can't use with
levmar, wich is GPLed... I may switch to cminpack. But i think this is not
related to my current question.
The approach I chose is to allocate bigarrays from Caml, and pass them to
> the main C function, along with the function f.
>
Does it mean that each time f function is called by the minimization, the C
wrappers has to copy the params C array into your Bigarray pre-allocated
storage place? That's why I choosed to leave the C array untouched and wrap
a Bigarray around it (should not be a big amount of memory). Am I wrong in
going this way?
In the main function, I register f and all the bigarrays as global roots,
> and then call as many times the c sub function to compute the minimization.
I do not understand this part. f is passed to the main (C) function from
OCaml: why do you need to register it as a global root? Same question for
the Bigarrays? Does it mean that else, nothing in OCaml world would point to
them?
>
> Feel free to ask for more precisions if needed
>
> Hope this helps.
>
Surely. I really need to acquire a better understanding of GC and C
interface in OCaml.
Really, I do not understand what happens to those C allocated Bigarrays...
Salutations
Matthieu
[-- Attachment #2: Type: text/html, Size: 3302 bytes --]
next prev parent reply other threads:[~2007-06-04 7:37 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-05-31 12:22 RABIH.ELCHAAR
2007-06-04 7:37 ` Matthieu Dubuget [this message]
-- strict thread matches above, loose matches on Subject: below --
2007-06-05 9:44 RABIH.ELCHAAR
2007-06-05 9:33 RABIH.ELCHAAR
2007-05-25 7:54 matthieu.dubuget
2007-05-31 11:42 ` [Caml-list] " Matthieu Dubuget
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=9f09a07a0706040037gf551211ubcddcafe496a6c1d@mail.gmail.com \
--to=matthieu.dubuget@gmail.com \
--cc=caml-list@inria.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox