Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

[3deeb5]: mex / comp_dwilt_long.c Maximize Restore History

Download this file

comp_dwilt_long.c    60 lines (42 with data), 1.1 kB

 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#ifndef _LTFAT_MEX_FILE
#define _LTFAT_MEX_FILE
#define ISNARGINEQ 4
#define TYPEDEPARGS 0, 1
#define SINGLEARGS
#define COMPLEXINDEPENDENT
#endif // _LTFAT_MEX_FILE - INCLUDED ONCE
#define MEX_FILE __BASE_FILE__
#include "ltfat_mex_template_helper.h"
#if defined(LTFAT_SINGLE) || defined(LTFAT_DOUBLE)
#include "ltfat_types.h"
// Calling convention:
// comp_dwilt_long(f,g,M,L);
void LTFAT_NAME(ltfatMexFnc)( int nlhs, mxArray *plhs[],int nrhs, const mxArray *prhs[] )
{
int M, N, L, W;
mwSize ndim;
mwSize dims[3];
// Get matrix dimensions.
M=(int)mxGetScalar(prhs[2]);
L=(int)mxGetScalar(prhs[3]);
W = mxGetN(prhs[0]);
N=L/M;
dims[0]=2*M;
dims[1]=N/2;
if (W==1)
{
ndim=2;
}
else
{
ndim=3;
dims[2]=W;
}
plhs[0] = ltfatCreateNdimArray(ndim,dims,LTFAT_MX_CLASSID,LTFAT_MX_COMPLEXITY);
const LTFAT_TYPE* f = (const LTFAT_TYPE*) mxGetData(prhs[0]);
const LTFAT_TYPE* g = (const LTFAT_TYPE*) mxGetData(prhs[1]);
LTFAT_TYPE* cout = (LTFAT_TYPE*) mxGetData(plhs[0]);
LTFAT_NAME(dwilt_long)(f,g,L, W, M, cout);
return;
}
#endif