Re: MathLink MLGetRealArray
- To: mathgroup at smc.vnet.net
- Subject: [mg22007] Re: MathLink MLGetRealArray
- From: miyaji at taiiku.tsukuba.ac.jp (Chikara MIYAJI)
- Date: Thu, 10 Feb 2000 02:25:49 -0500 (EST)
- Organization: University of Tsukuba
- References: <87iph4$3vb@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Hi Johannes, In article <87iph4$3vb at smc.vnet.net>, "Johannes Ludsteck" <ludsteck at zew.de> wrote: If you set arguments in the template like {y,x,kernelWidth}, you must read each of them according to the order and type, because these are put on the link. So, I suppose your MLGetRealArray does not read the correct data. Before reading x by MLGetArray, you must read y using MLGetRealList or MLGetIntegerList. void kerndens(void) { double **x, temp; long *dimsx, depthx; char **headsx; MLGetRealArray(stdlink, &x, &dimsx, &headsx, &depthx); MLPutReal(stdlink, x[0][0]); MLDisownRealArray(stdlink, x, dimsx, headsx, depthx); } The template file has the following form: :Begin: :Function: kerndens :Pattern: kerndens[y_List,x_?MatrixQ,kernelWidth_Real] :Arguments: {y,x,kernelWidth} :ArgumentTypes: {Manual} :ReturnType: Manual :End: