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

Close

[6db11f]: mex / comp_gga.c Maximize Restore History

Download this file

comp_gga.c    48 lines (33 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
#ifndef _LTFAT_MEX_FILE
#define _LTFAT_MEX_FILE
#define ISNARGINEQ 2
#define TYPEDEPARGS 0
#define SINGLEARGS
#define COMPLEXINDEPENDENT
//#define NOCOMPLEXFMTCHANGE
#define GGA_WITH_PLAN
#endif // _LTFAT_MEX_FILE - INCLUDED ONCE
#define MEX_FILE __BASE_FILE__
#include "ltfat_mex_template_helper.h"
#if defined(LTFAT_SINGLE) || defined(LTFAT_DOUBLE)
// Calling convention:
// c = comp_gga(f,indvec)
void LTFAT_NAME(ltfatMexFnc)( int nlhs, mxArray *plhs[],int nrhs, const mxArray *prhs[] )
{
mwSize L = mxGetM(prhs[0]);
mwSize W = mxGetN(prhs[0]);
mwSize M = mxGetNumberOfElements(prhs[1]);
const LTFAT_TYPE* fPtr = (const LTFAT_TYPE*) mxGetPr(prhs[0]);
const double* indVecPtr = (const double*) mxGetPr(prhs[1]);
plhs[0] = ltfatCreateMatrix(M,W,LTFAT_MX_CLASSID,mxCOMPLEX);
LTFAT_REAL _Complex* cPtr = (LTFAT_REAL _Complex*) mxGetPr(plhs[0]);
#ifndef GGA_WITH_PLAN
LTFAT_NAME(gga)(fPtr,indVecPtr,L,W,M,cPtr);
#else
LTFAT_NAME(gga_plan) p = LTFAT_NAME(create_gga_plan)(indVecPtr,M,L);
LTFAT_NAME(gga_with_plan)(p,fPtr,cPtr,W);
LTFAT_NAME(destroy_gga_plan)(p);
#endif
return;
}
#endif