[go: up one dir, main page]

Menu

[17deec]: / mex / comp_pgauss.c  Maximize  Restore  History

Download this file

46 lines (32 with data), 843 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#define MEX_FILE comp_pgauss.c
#include "ltfat_mex_template_helper.h"
#if defined(LTFAT_DOUBLE)
#include "ltfat/types.h"
/* Calling convention:
* comp_pgauss(L,w,c_t,c_f);
*/
void LTFAT_NAME(ltfatMexFnc)( int UNUSED(nlhs), mxArray *plhs[],
int UNUSED(nrhs), const mxArray *prhs[] )
{
int L;
double w, c_t, c_f;
double *g;
L=(int)mxGetScalar(prhs[0]);
w=(double)mxGetScalar(prhs[1]);
c_t=(double)mxGetScalar(prhs[2]);
c_f=(double)mxGetScalar(prhs[3]);
if (c_f==0.0)
{
plhs[0] = mxCreateDoubleMatrix(L, 1, mxREAL);
g = mxGetPr(plhs[0]);
ltfat_pgauss_d(L, w, c_t,(double*)g);
}
else
{
plhs[0] = ltfatCreateMatrix(L, 1, mxDOUBLE_CLASS, mxCOMPLEX);
LTFAT_COMPLEX *gc = mxGetData(plhs[0]);
ltfat_pgauss_dc(L, w, c_t,c_f,gc);
}
return;
}
#endif