1
2
3
4
5
6
7
8
9 """Wraper for the stepwise_regression function for SMLR."""
10
11 if __debug__:
12 from mvpa.base import debug
13 debug('INIT', 'mvpa.clfs.libsmlrc')
14
15 import numpy as N
16 import ctypes as C
17 import os
18 import sys
19
20 from mvpa.clfs.libsmlrc.ctypes_helper import extend_args, c_darray
21
22
23 if sys.platform == 'win32':
24
25
26 smlrlib = C.cdll[os.path.join(os.path.dirname(__file__), 'smlrc.pyd')]
27 elif sys.platform == 'darwin':
28
29 smlrlib = C.cdll[os.path.join(os.path.dirname(__file__), 'smlrc.so')]
30 else:
31 smlrlib = N.ctypeslib.load_library('smlrc', os.path.dirname(__file__))
32
33
35 func = smlrlib.stepwise_regression
36 func.argtypes = [C.c_int, C.c_int, c_darray,
37 C.c_int, C.c_int, c_darray,
38 C.c_int, C.c_int, c_darray,
39 C.c_int, C.c_int, c_darray,
40 C.c_int, C.c_int, c_darray,
41 C.c_int, c_darray,
42 C.c_int, c_darray,
43 C.c_int, c_darray,
44 C.c_int,
45 C.c_int,
46 C.c_double,
47 C.c_float,
48 C.c_float,
49 C.c_int64]
50 func.restype = C.c_long
51
52
53 arglist = extend_args(*args)
54 return func(*arglist)
55
56 if __debug__:
57 debug('INIT', 'mvpa.clfs.libsmlrc end')
58