> On 4 Mar 2016, at 08:51, MAURICE Jean - externe <jean-externe.maur...@edf.fr> 
> wrote:
> 
> Hi Berend,
> 
> 
>> The question belongs on the R-devel mailinglist.
> I try to find this mailing-list ...
> 

See https://www.r-project.org/mail.html

>> You are calling your Fortran routines directly from an R file with .Fortran, 
>> I presume?
> Yes. Is there another solution (possibility ?)
> 

Yes. Use C to interface with Fortran.

See for example packages: minpack.lm, QZ, expm, nleqslv. And more: rootSolve, 
ucminf.
There are probably even more.

>> Declare them with (:,:) or (*,*), allocate and the return the array? A 
>> Fortran95 pointer?
> That was what I wanted to do ...
> 
>> I think  all of that is just a no no.
> It would be a big problem with memory management but R could copy the result 
> before the memory attached to the FORTRAN subroutine is cleared at the end of 
> the routine. R does so strange things (for an old programmer as I am).
> 
>> Is it possible to calculate the required size of the array in a separate 
>> routine given some parameters (as can often be done with >Lapack routines) 
>> before calling the main subroutine?
>> If so, call the sizing routine and then declare the correctly sized array in 
>> your R code and pass it to the main subroutine.
> 
> It's a good idea : a 'two shots' routine. I'll dig that (I'll work in this 
> direction).
> 

Commercial:  Have a look at (my) packages nleqslv and geigen for that approach.

Berend

______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to