comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » External development: Populating a complex array in C
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
External development: Populating a complex array in C [message #91532] Sat, 25 July 2015 11:08 Go to previous message
dg86 is currently offline  dg86
Messages: 118
Registered: September 2012
Senior Member
Dear Folks,

I'm trying to write a DLL in C that returns a complex array to IDL.
I can create the (temporary) array with no trouble:

char * pd;
IDL_VPTR idl_array;
IDL_MEMINT dim[IDL_MAX_ARRAY_DIM];

dim[0] = 512;
dim[1] = 512;
pd = IDL_MakeTempArray(IDL_TYP_COMPLEX, 2, dim, IDL_ARR_INI_ZERO, &idl_array);

Next, I'd like to populate the idl_array with values, ideally using memcpy for
speed and clarity. Attempts resembling

memcpy(pd, src, 512*512*sizeof(float));

seem not to change the data in idl_array. Does anyone know the right way
to copy floating point data from the C src array to the idl_array?

Alternatively, does anyone know how to convert two IDL_TYPE_FLOAT arrays
into one IDL_TYPE_COMPLEX array along the lines of the COMPLEX(real,imag)
function in IDL?

Many thanks,

David
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Dynamic Resize Moves Window
Next Topic: Current color table

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 11:54:25 PDT 2025

Total time taken to generate the page: 0.00245 seconds