Re: [Pdl-general] conv2d

2022-08-15 Thread Ed .
Hi Luis, For backward compatibility, operations default to supporting all real types, which is why you’re getting LDouble (the highest-numbered real type, but still below the complex ones). To make the various Image* operations work on native complex values, they just need telling to do so.

[Pdl-general] conv2d

2022-08-15 Thread Luis Mochan
Hello, I tried to use conv2d from PDL::Image2D to make a simple average, as in $z->conv2d(ones(3,3))/9; to take the arithmetic average a pixel with its neareast neighbors. However, what I want to average is a component of an electric field which is complex valued. It turns out that conv2d

Re: [Pdl-general] conv2d

2022-08-15 Thread Luis Mochan
Thaks Ed, I modified conv2d as you suggested. The result became a CDouble, but the imaginary part disappeared. I could fix it by also changing the init_vars line (around l. 270), removing the variable tmp, which was declared as a double, and declaring it just before the start of the broadcastloop

Re: [Pdl-general] conv2d

2022-08-15 Thread Luis Mochan
Done, at PDLPorters/pdl. I'm still unsure about removing 'tmp' from 'init_vars', as it seems to do more than just declaring the variable. Regards, Luis On Mon, Aug 15, 2022 at 11:20:03PM +, Ed . wrote: > Sorry that you had to add extra bits! Could you PR what you have, and add the > test

Re: [Pdl-general] conv2d

2022-08-15 Thread Ed .
Sorry that you had to add extra bits! Could you PR what you have, and add the test code as a comment on the PR? (I’m happy to bend it into the .t) Best regards, Ed From: Luis Mochan Sent: 15 August 2022 20:23 To: Ed . Cc: