[scilab-Users] Usage of OPTIM function with external fortran

Serge Steer Serge.Steer at inria.fr
Tue Jun 19 22:14:22 CEST 2012


Le 19/06/2012 20:12, Eduardo Torrecillas a écrit :
> Hi all,
>
> I am currently working on a huge optimization (impossible to have it 
> done on pure scilab), so my cost function is an external fortran 
> function. I've tried a few small examples and everything is working 
> fine (links, results, etc).
>
> The external subroutine should be on the form:
>
> subroutine  costf(ind,n,x,f,g,ti,tr,td)
>
> Then, I can call it via scilab, passing integer, real, or double 
> arguments (ti, tr, td, respectively). Unfortunately, I couldn't find a 
> way to pass text strings (if needed) and also matrices. I have a cost 
> function which should count on a huge matrix (for example, dimension 
> 10.000,3). Is there a way to pass it via optim?
>
> Best regards,
> -- 
> Eduardo Torrecillas
You can pass your huge matrix using td for the floating point numbers 
and ti for the dimensions, The costf routine should then be able to 
recover pointer on matrix data from td ans matrix dimension from ti

Serge Steer
INRIA
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20120619/845f4904/attachment.htm>


More information about the users mailing list