help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Include Fortran Code which Returns Arrays of Dynamic/Unknown Size


From: Jaroslav Hajek
Subject: Re: Include Fortran Code which Returns Arrays of Dynamic/Unknown Size
Date: Tue, 14 Oct 2008 08:13:35 +0200

On Mon, Oct 13, 2008 at 11:14 PM, Marco2008 <address@hidden> wrote:
>
>
>
> Jaroslav Hajek-2 wrote:
>>
>> Maybe you could describe more closely the problem you are trying to solve?
>>
>
> I am trying to write a function that transforms a Spline from pp-form
> (Representation with polynomial coefficients) into B-Form (B-Form:
> Representation of Spline with B-Splines). It is not important what happens
> there exactly but I will try to explain what has brought me to this thread.
>
> One input data of this transform function is a strict monotonically
> increasing sequence (real array) of values, A1. The function takes among
> other things A1 and one results in a monotone increasing sequence, A2, that
> consists of the same values but these values can exits more than one time
> (So A2 is larger than A1).
> To get the size of A2 you have to compute A2, it is not possible to predict
> it exactly.
> So if I use the approach with two calls of the function, in each call A2
> will be computed and that is what I want to avoid.
>

I see. Is a good upper bound guess for size of A2 available? If so,
then you can simply allocate to that size in C++ and let the
computational routine return also the actual size.

If not, there's still a solution. Some time ago I "invented" a
technique to arrange the inter-language calls in such a way that you
can allocate memory for a Fortran pointer via C++. For a long time, I
wanted to put up an example of this technique on my website, so now is
a good time to do it.
I'll post a link once it's there.


-- 
RNDr. Jaroslav Hajek
computing expert
Aeronautical Research and Test Institute (VZLU)
Prague, Czech Republic
url: www.highegg.matfyz.cz


reply via email to

[Prev in Thread] Current Thread [Next in Thread]