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

michael.baudin at contrib.scilab.org michael.baudin at contrib.scilab.org
Fri Jun 22 10:05:00 CEST 2012


 Hi,

 In addition to the advices from Serge, you can find examples at :

 http://gitweb.scilab.org/?p=scilab.git;a=blob;f=scilab/modules/optimization/tests/unit_tests/optim_sourcec.tst;h=1ae43f6b105ae87b06eacf752a94c5d0a62c31fa;hb=HEAD
 http://gitweb.scilab.org/?p=scilab.git;a=blob;f=scilab/modules/optimization/tests/unit_tests/optim_sourcefortran1.tst;h=b653bcfd9174779da3a3ea72a7f99ca2ddfc4e68;hb=HEAD
 http://gitweb.scilab.org/?p=scilab.git;a=blob;f=scilab/modules/optimization/tests/unit_tests/optim_sourcefortran2.tst;h=f4cb00621db62af1cb719a8283bf0f44e3973568;hb=HEAD

 But there is no way to pass a text: can't you convert the text into 
 doubles or integers ? For example, the text may contain an option "yes" 
 or "no" which is actually a boolean, that you can represent by an 
 integer 0 or 1. Could this be possible ?

 Best regards,

 Michaël

 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



More information about the users mailing list