I can't speak to the nuances of Inplace => 1 or whatever.

However, for full control of Inplace processing,
you can use PMCode and the is_inplace() routine
to set things up before the call to the PP routine.

See PDL::PP re the PMCode key for details.

--Chris

On 2/4/2017 16:32, Luis Mochan wrote:
> On Sat, Feb 04, 2017 at 01:50:12PM -0600, Luis Mochan wrote:
>> On Sat, Feb 04, 2017 at 02:17:44PM -0500, Chris Marshall wrote:
>>> I think $P(a) != $P(b) will work.
> It did work, in a way.
>
> What I now don't understand is the use of inplace. My routine has two
> outputs (one of them an integer pdl). If I now call it as
>     ($y, $i)=f($x);
> it recognizes that $x is a different pdl than the output and
> copies the data before calling the fortran routine.
>
> I can also call the routine as
>     f($x, $y=PDL->null, $i=PDL->null);
> with the same result.
>
> If I call it as
>     $y=$x; f($y,$y, $i=PDL->null);
> it recognizes that the expected output $y and the input are the same pdl and
> calls the fortran routine without copying, producing the correct
> result.
>
> However, if I call it as
>     $y=$x; $i=f($y->inplace);
> I get a segmentation fault, and if I call it as
>     $y=$x; f($y->inplace, $i->PDL->null);
> I get a remainder the f expects three arguments, not two.
>
> I did have in my pp_def the line Inplace0>['x','y'].
>
> Is it that inplace is designed for one output routines only, or am I
> making something wrong?
>
> For the time being, I guess I'll pass only the input arguments
> (without using inplace) or all input and output arguments.
>
> Best regards,
> Luis
>
>
>
>
>
>>> It would probably work with $PDL(a) == $PDL(b) as well but I don't know.
>>>
>>> A quick test should answer the question.  I'm hoping Craig or
>>> another PDL::PP expert can weigh in from their experience and
>>> expertise.
>> Thanks, I'll test these solutions.
>> Regards,
>> Luis
>>
>> ------------------------------------------------------------------------------
>> Check out the vibrant tech community on one of the world's most
>> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
>> _______________________________________________
>> pdl-general mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/pdl-general
>>


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
pdl-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pdl-general

Reply via email to