scm2cpp-lasso 0.13.2__py3-none-win_amd64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. scm2cpp_lasso/__init__.py +2808 -0
  2. scm2cpp_lasso/_classifiers.cp312-win_amd64.pyd +0 -0
  3. scm2cpp_lasso/_generated/__init__.py +0 -0
  4. scm2cpp_lasso/_generated/_loader.py +41 -0
  5. scm2cpp_lasso/_generated/_loader_accel_cublas.py +140 -0
  6. scm2cpp_lasso/_generated/_loader_classifiers.py +281 -0
  7. scm2cpp_lasso/_generated/_loader_derived_blas.py +29 -0
  8. scm2cpp_lasso/_generated/_loader_derived_cublas.py +29 -0
  9. scm2cpp_lasso/_generated/_loader_derived_loops.py +29 -0
  10. scm2cpp_lasso/_generated/_loader_gpu_cuda.py +294 -0
  11. scm2cpp_lasso/_generated/_loader_gramops_blas.py +496 -0
  12. scm2cpp_lasso/_generated/_loader_gramops_loops.py +496 -0
  13. scm2cpp_lasso/_generated/_loader_nmf_blas.py +29 -0
  14. scm2cpp_lasso/_generated/_loader_nmf_cublas.py +29 -0
  15. scm2cpp_lasso/_generated/_loader_nmf_loops.py +29 -0
  16. scm2cpp_lasso/_generated/accel_cublas/accel.cpp +20 -0
  17. scm2cpp_lasso/_generated/accel_cublas/accel.hpp +1023 -0
  18. scm2cpp_lasso/_generated/accel_cublas/accel_capi.cpp +64 -0
  19. scm2cpp_lasso/_generated/classifiers.cpp +34 -0
  20. scm2cpp_lasso/_generated/classifiers.hpp +2825 -0
  21. scm2cpp_lasso/_generated/classifiers_capi.cpp +106 -0
  22. scm2cpp_lasso/_generated/derived_blas/lasso_design.cpp +5 -0
  23. scm2cpp_lasso/_generated/derived_blas/lasso_design.hpp +153 -0
  24. scm2cpp_lasso/_generated/derived_blas/lasso_design_capi.cpp +19 -0
  25. scm2cpp_lasso/_generated/derived_cublas/lasso_design.cpp +5 -0
  26. scm2cpp_lasso/_generated/derived_cublas/lasso_design.hpp +155 -0
  27. scm2cpp_lasso/_generated/derived_cublas/lasso_design_capi.cpp +19 -0
  28. scm2cpp_lasso/_generated/derived_loops/lasso_design.cpp +5 -0
  29. scm2cpp_lasso/_generated/derived_loops/lasso_design.hpp +176 -0
  30. scm2cpp_lasso/_generated/derived_loops/lasso_design_capi.cpp +19 -0
  31. scm2cpp_lasso/_generated/gpu_cuda/gpu.cpp +35 -0
  32. scm2cpp_lasso/_generated/gpu_cuda/gpu.hpp +3715 -0
  33. scm2cpp_lasso/_generated/gpu_cuda/gpu_capi.cpp +289 -0
  34. scm2cpp_lasso/_generated/gramops_blas/gramops.cpp +57 -0
  35. scm2cpp_lasso/_generated/gramops_blas/gramops.hpp +3033 -0
  36. scm2cpp_lasso/_generated/gramops_blas/gramops_capi.cpp +175 -0
  37. scm2cpp_lasso/_generated/gramops_loops/gramops.cpp +57 -0
  38. scm2cpp_lasso/_generated/gramops_loops/gramops.hpp +3302 -0
  39. scm2cpp_lasso/_generated/gramops_loops/gramops_capi.cpp +175 -0
  40. scm2cpp_lasso/_generated/lasso_cov.cpp +7 -0
  41. scm2cpp_lasso/_generated/lasso_cov.hpp +152 -0
  42. scm2cpp_lasso/_generated/lasso_cov_capi.cpp +25 -0
  43. scm2cpp_lasso/_generated/nmf_blas/nmf_cd.cpp +5 -0
  44. scm2cpp_lasso/_generated/nmf_blas/nmf_cd.hpp +132 -0
  45. scm2cpp_lasso/_generated/nmf_blas/nmf_cd_capi.cpp +19 -0
  46. scm2cpp_lasso/_generated/nmf_cublas/nmf_cd.cpp +5 -0
  47. scm2cpp_lasso/_generated/nmf_cublas/nmf_cd.hpp +136 -0
  48. scm2cpp_lasso/_generated/nmf_cublas/nmf_cd_capi.cpp +19 -0
  49. scm2cpp_lasso/_generated/nmf_loops/nmf_cd.cpp +5 -0
  50. scm2cpp_lasso/_generated/nmf_loops/nmf_cd.hpp +167 -0
  51. scm2cpp_lasso/_generated/nmf_loops/nmf_cd_capi.cpp +19 -0
  52. scm2cpp_lasso/_generated/scm2cpp-blas.hpp +77 -0
  53. scm2cpp_lasso/_generated/scm2cpp-cublas.hpp +155 -0
  54. scm2cpp_lasso/_generated/scm2cpp-cuda.hpp +285 -0
  55. scm2cpp_lasso/_generated/scm2cpp.hpp +1627 -0
  56. scm2cpp_lasso/_gramops_loops.cp312-win_amd64.pyd +0 -0
  57. scm2cpp_lasso/_lasso_cov.cp312-win_amd64.pyd +0 -0
  58. scm2cpp_lasso/_lasso_derived_loops.cp312-win_amd64.pyd +0 -0
  59. scm2cpp_lasso/_libfind.py +149 -0
  60. scm2cpp_lasso/_nmf_loops.cp312-win_amd64.pyd +0 -0
  61. scm2cpp_lasso/batch_capi.cu +428 -0
  62. scm2cpp_lasso-0.13.2.dist-info/METADATA +920 -0
  63. scm2cpp_lasso-0.13.2.dist-info/RECORD +65 -0
  64. scm2cpp_lasso-0.13.2.dist-info/WHEEL +5 -0
  65. scm2cpp_lasso-0.13.2.dist-info/top_level.txt +1 -0
@@ -0,0 +1,496 @@
1
+ # ctypes loader for libgramops.so, generated alongside it.
2
+ # Arrays are numpy arrays of the declared dtype; they are made
3
+ # contiguous on the way in and mutated in place where the translated
4
+ # function mutates them.
5
+ import ctypes
6
+ import numpy as np
7
+ from pathlib import Path
8
+
9
+ from .._libfind import load_gramops_lib as _load_gramops_lib
10
+
11
+ _lib = _load_gramops_lib("blas")
12
+
13
+ _lib.scm2cpp_spd_inverse.restype = ctypes.c_int
14
+ _lib.scm2cpp_spd_inverse.argtypes = [ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.c_int]
15
+ def spd_inverse(a, inv, l, z, p):
16
+ a = np.ascontiguousarray(a, dtype=np.float64)
17
+ inv = np.ascontiguousarray(inv, dtype=np.float64)
18
+ l = np.ascontiguousarray(l, dtype=np.float64)
19
+ z = np.ascontiguousarray(z, dtype=np.float64)
20
+ return _lib.scm2cpp_spd_inverse(a.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), inv.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), l.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), z.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), p)
21
+
22
+ _lib.scm2cpp_enet_gap.restype = ctypes.c_int
23
+ _lib.scm2cpp_enet_gap.argtypes = [ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.c_double, ctypes.c_double, ctypes.c_int]
24
+ def enet_gap(w, q, qw, xta, out, alpha, ynorm2, m):
25
+ w = np.ascontiguousarray(w, dtype=np.float64)
26
+ q = np.ascontiguousarray(q, dtype=np.float64)
27
+ qw = np.ascontiguousarray(qw, dtype=np.float64)
28
+ xta = np.ascontiguousarray(xta, dtype=np.float64)
29
+ out = np.ascontiguousarray(out, dtype=np.float64)
30
+ assert out.size == 2, "out: expected 2 elements"
31
+ return _lib.scm2cpp_enet_gap(w.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), q.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), qw.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), xta.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), out.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), alpha, ynorm2, m)
32
+
33
+ _lib.scm2cpp_enet_safe_rule.restype = ctypes.c_int
34
+ _lib.scm2cpp_enet_safe_rule.argtypes = [ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_int), ctypes.POINTER(ctypes.c_int), ctypes.POINTER(ctypes.c_double), ctypes.c_double, ctypes.c_int]
35
+ def enet_safe_rule(w, qm, qw, xta, active, excl, out, alpha, m):
36
+ w = np.ascontiguousarray(w, dtype=np.float64)
37
+ qm = np.ascontiguousarray(qm, dtype=np.float64)
38
+ qw = np.ascontiguousarray(qw, dtype=np.float64)
39
+ xta = np.ascontiguousarray(xta, dtype=np.float64)
40
+ active = np.ascontiguousarray(active, dtype=np.int32)
41
+ excl = np.ascontiguousarray(excl, dtype=np.int32)
42
+ out = np.ascontiguousarray(out, dtype=np.float64)
43
+ assert out.size == 2, "out: expected 2 elements"
44
+ return _lib.scm2cpp_enet_safe_rule(w.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), qm.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), qw.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), xta.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), active.ctypes.data_as(ctypes.POINTER(ctypes.c_int)), excl.ctypes.data_as(ctypes.POINTER(ctypes.c_int)), out.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), alpha, m)
45
+
46
+ _lib.scm2cpp_enet_gram.restype = ctypes.c_int
47
+ _lib.scm2cpp_enet_gram.argtypes = [ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_int), ctypes.POINTER(ctypes.c_int), ctypes.POINTER(ctypes.c_double), ctypes.c_double, ctypes.c_int, ctypes.c_double, ctypes.c_int]
48
+ def enet_gram(w, qm, q, qw, xta, active, excl, out, alpha, maxiter, tol, m):
49
+ w = np.ascontiguousarray(w, dtype=np.float64)
50
+ qm = np.ascontiguousarray(qm, dtype=np.float64)
51
+ q = np.ascontiguousarray(q, dtype=np.float64)
52
+ qw = np.ascontiguousarray(qw, dtype=np.float64)
53
+ xta = np.ascontiguousarray(xta, dtype=np.float64)
54
+ active = np.ascontiguousarray(active, dtype=np.int32)
55
+ excl = np.ascontiguousarray(excl, dtype=np.int32)
56
+ out = np.ascontiguousarray(out, dtype=np.float64)
57
+ assert out.size == 2, "out: expected 2 elements"
58
+ return _lib.scm2cpp_enet_gram(w.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), qm.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), q.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), qw.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), xta.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), active.ctypes.data_as(ctypes.POINTER(ctypes.c_int)), excl.ctypes.data_as(ctypes.POINTER(ctypes.c_int)), out.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), alpha, maxiter, tol, m)
59
+
60
+ _lib.scm2cpp_graphical_lasso.restype = ctypes.c_int
61
+ _lib.scm2cpp_graphical_lasso.argtypes = [ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.c_double, ctypes.c_int, ctypes.c_double, ctypes.c_double, ctypes.c_int]
62
+ def graphical_lasso(emp, cov, prec, alpha, maxiter, tol, enettol, p):
63
+ emp = np.ascontiguousarray(emp, dtype=np.float64)
64
+ cov = np.ascontiguousarray(cov, dtype=np.float64)
65
+ prec = np.ascontiguousarray(prec, dtype=np.float64)
66
+ return _lib.scm2cpp_graphical_lasso(emp.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), cov.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), prec.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), alpha, maxiter, tol, enettol, p)
67
+
68
+ _lib.scm2cpp_omp.restype = ctypes.c_int
69
+ _lib.scm2cpp_omp.argtypes = [ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.c_int, ctypes.c_int, ctypes.c_int, ctypes.c_int]
70
+ def omp(x, y, coef, path, rec, kmax, n, p):
71
+ x = np.ascontiguousarray(x, dtype=np.float64)
72
+ y = np.ascontiguousarray(y, dtype=np.float64)
73
+ coef = np.ascontiguousarray(coef, dtype=np.float64)
74
+ path = np.ascontiguousarray(path, dtype=np.float64)
75
+ return _lib.scm2cpp_omp(x.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), y.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), coef.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), path.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), rec, kmax, n, p)
76
+
77
+ _lib.scm2cpp_logistic_fg.restype = ctypes.c_double
78
+ _lib.scm2cpp_logistic_fg.argtypes = [ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.c_double, ctypes.c_int, ctypes.c_int, ctypes.c_int, ctypes.c_int, ctypes.c_int]
79
+ def logistic_fg(coef, g, x, y, z, l2, multi, fitint, n, p, k):
80
+ coef = np.ascontiguousarray(coef, dtype=np.float64)
81
+ g = np.ascontiguousarray(g, dtype=np.float64)
82
+ x = np.ascontiguousarray(x, dtype=np.float64)
83
+ y = np.ascontiguousarray(y, dtype=np.float64)
84
+ z = np.ascontiguousarray(z, dtype=np.float64)
85
+ return _lib.scm2cpp_logistic_fg(coef.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), g.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), x.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), y.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), z.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), l2, multi, fitint, n, p, k)
86
+
87
+ _lib.scm2cpp_logistic_lbfgs.restype = ctypes.c_int
88
+ _lib.scm2cpp_logistic_lbfgs.argtypes = [ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.c_double, ctypes.c_int, ctypes.c_double, ctypes.c_int, ctypes.c_int, ctypes.c_int, ctypes.c_int, ctypes.c_int]
89
+ def logistic_lbfgs(x, y, coef, out, c, maxiter, tol, multi, fitint, n, p, k):
90
+ x = np.ascontiguousarray(x, dtype=np.float64)
91
+ y = np.ascontiguousarray(y, dtype=np.float64)
92
+ coef = np.ascontiguousarray(coef, dtype=np.float64)
93
+ out = np.ascontiguousarray(out, dtype=np.float64)
94
+ return _lib.scm2cpp_logistic_lbfgs(x.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), y.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), coef.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), out.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), c, maxiter, tol, multi, fitint, n, p, k)
95
+
96
+ _lib.scm2cpp_huber_fg.restype = ctypes.c_double
97
+ _lib.scm2cpp_huber_fg.argtypes = [ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.c_double, ctypes.c_double, ctypes.c_int, ctypes.c_int, ctypes.c_int]
98
+ def huber_fg(coef, g, x, y, z, epsilon, alpha, fitint, n, p):
99
+ coef = np.ascontiguousarray(coef, dtype=np.float64)
100
+ g = np.ascontiguousarray(g, dtype=np.float64)
101
+ x = np.ascontiguousarray(x, dtype=np.float64)
102
+ y = np.ascontiguousarray(y, dtype=np.float64)
103
+ z = np.ascontiguousarray(z, dtype=np.float64)
104
+ return _lib.scm2cpp_huber_fg(coef.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), g.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), x.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), y.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), z.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), epsilon, alpha, fitint, n, p)
105
+
106
+ _lib.scm2cpp_huber.restype = ctypes.c_int
107
+ _lib.scm2cpp_huber.argtypes = [ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.c_double, ctypes.c_double, ctypes.c_int, ctypes.c_double, ctypes.c_int, ctypes.c_int, ctypes.c_int]
108
+ def huber(x, y, coef, out, epsilon, alpha, maxiter, tol, fitint, n, p):
109
+ x = np.ascontiguousarray(x, dtype=np.float64)
110
+ y = np.ascontiguousarray(y, dtype=np.float64)
111
+ coef = np.ascontiguousarray(coef, dtype=np.float64)
112
+ out = np.ascontiguousarray(out, dtype=np.float64)
113
+ return _lib.scm2cpp_huber(x.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), y.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), coef.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), out.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), epsilon, alpha, maxiter, tol, fitint, n, p)
114
+
115
+ _lib.scm2cpp_glm_fg.restype = ctypes.c_double
116
+ _lib.scm2cpp_glm_fg.argtypes = [ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.c_int, ctypes.c_double, ctypes.c_double, ctypes.c_int, ctypes.c_int, ctypes.c_int]
117
+ def glm_fg(coef, g, x, y, z, family, power, l2, fitint, n, p):
118
+ coef = np.ascontiguousarray(coef, dtype=np.float64)
119
+ g = np.ascontiguousarray(g, dtype=np.float64)
120
+ x = np.ascontiguousarray(x, dtype=np.float64)
121
+ y = np.ascontiguousarray(y, dtype=np.float64)
122
+ z = np.ascontiguousarray(z, dtype=np.float64)
123
+ return _lib.scm2cpp_glm_fg(coef.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), g.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), x.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), y.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), z.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), family, power, l2, fitint, n, p)
124
+
125
+ _lib.scm2cpp_glm.restype = ctypes.c_int
126
+ _lib.scm2cpp_glm.argtypes = [ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.c_int, ctypes.c_double, ctypes.c_double, ctypes.c_int, ctypes.c_double, ctypes.c_int, ctypes.c_int, ctypes.c_int]
127
+ def glm(x, y, coef, out, family, power, alpha, maxiter, tol, fitint, n, p):
128
+ x = np.ascontiguousarray(x, dtype=np.float64)
129
+ y = np.ascontiguousarray(y, dtype=np.float64)
130
+ coef = np.ascontiguousarray(coef, dtype=np.float64)
131
+ out = np.ascontiguousarray(out, dtype=np.float64)
132
+ return _lib.scm2cpp_glm(x.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), y.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), coef.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), out.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), family, power, alpha, maxiter, tol, fitint, n, p)
133
+
134
+ _lib.scm2cpp_lb_abs.restype = ctypes.c_double
135
+ _lib.scm2cpp_lb_abs.argtypes = [ctypes.c_double]
136
+ def lb_abs(a):
137
+ return _lib.scm2cpp_lb_abs(a)
138
+
139
+ _lib.scm2cpp_lb_max.restype = ctypes.c_double
140
+ _lib.scm2cpp_lb_max.argtypes = [ctypes.c_double, ctypes.c_double]
141
+ def lb_max(a, b):
142
+ return _lib.scm2cpp_lb_max(a, b)
143
+
144
+ _lib.scm2cpp_lb_min.restype = ctypes.c_double
145
+ _lib.scm2cpp_lb_min.argtypes = [ctypes.c_double, ctypes.c_double]
146
+ def lb_min(a, b):
147
+ return _lib.scm2cpp_lb_min(a, b)
148
+
149
+ _lib.scm2cpp_lb_dcstep.restype = ctypes.c_int
150
+ _lib.scm2cpp_lb_dcstep.argtypes = [ctypes.POINTER(ctypes.c_double), ctypes.c_double, ctypes.c_double, ctypes.c_double, ctypes.c_double]
151
+ def lb_dcstep(cs, fp, dp, stpmin, stpmax):
152
+ cs = np.ascontiguousarray(cs, dtype=np.float64)
153
+ assert cs.size == 8, "cs: expected 8 elements"
154
+ return _lib.scm2cpp_lb_dcstep(cs.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), fp, dp, stpmin, stpmax)
155
+
156
+ _lib.scm2cpp_lb_search_start.restype = ctypes.c_int
157
+ _lib.scm2cpp_lb_search_start.argtypes = [ctypes.POINTER(ctypes.c_double), ctypes.c_double, ctypes.c_double, ctypes.c_double, ctypes.c_double, ctypes.c_double, ctypes.c_double]
158
+ def lb_search_start(ls, f, g, stp, stpmin, stpmax, ftol):
159
+ ls = np.ascontiguousarray(ls, dtype=np.float64)
160
+ assert ls.size == 16, "ls: expected 16 elements"
161
+ return _lib.scm2cpp_lb_search_start(ls.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), f, g, stp, stpmin, stpmax, ftol)
162
+
163
+ _lib.scm2cpp_lb_search_step.restype = ctypes.c_int
164
+ _lib.scm2cpp_lb_search_step.argtypes = [ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.c_double, ctypes.c_double, ctypes.c_double, ctypes.c_double, ctypes.c_double, ctypes.c_double, ctypes.c_double]
165
+ def lb_search_step(ls, cs, f, g, ftol, gtol, xtol, stpmin, stpmax):
166
+ ls = np.ascontiguousarray(ls, dtype=np.float64)
167
+ assert ls.size == 16, "ls: expected 16 elements"
168
+ cs = np.ascontiguousarray(cs, dtype=np.float64)
169
+ assert cs.size == 8, "cs: expected 8 elements"
170
+ return _lib.scm2cpp_lb_search_step(ls.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), cs.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), f, g, ftol, gtol, xtol, stpmin, stpmax)
171
+
172
+ _lib.scm2cpp_lb_dot.restype = ctypes.c_double
173
+ _lib.scm2cpp_lb_dot.argtypes = [ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.c_int]
174
+ def lb_dot(a, b, nv):
175
+ a = np.ascontiguousarray(a, dtype=np.float64)
176
+ b = np.ascontiguousarray(b, dtype=np.float64)
177
+ return _lib.scm2cpp_lb_dot(a.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), b.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), nv)
178
+
179
+ _lib.scm2cpp_lb_dot_row.restype = ctypes.c_double
180
+ _lib.scm2cpp_lb_dot_row.argtypes = [ctypes.POINTER(ctypes.c_double), ctypes.c_int, ctypes.POINTER(ctypes.c_double), ctypes.c_int]
181
+ def lb_dot_row(mem, slot, v, nv):
182
+ mem = np.ascontiguousarray(mem, dtype=np.float64)
183
+ v = np.ascontiguousarray(v, dtype=np.float64)
184
+ return _lib.scm2cpp_lb_dot_row(mem.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), slot, v.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), nv)
185
+
186
+ _lib.scm2cpp_lb_dot_rows.restype = ctypes.c_double
187
+ _lib.scm2cpp_lb_dot_rows.argtypes = [ctypes.POINTER(ctypes.c_double), ctypes.c_int, ctypes.POINTER(ctypes.c_double), ctypes.c_int, ctypes.c_int]
188
+ def lb_dot_rows(a, ra, b, rb, nv):
189
+ a = np.ascontiguousarray(a, dtype=np.float64)
190
+ b = np.ascontiguousarray(b, dtype=np.float64)
191
+ return _lib.scm2cpp_lb_dot_rows(a.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), ra, b.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), rb, nv)
192
+
193
+ _lib.scm2cpp_lb_projgr.restype = ctypes.c_double
194
+ _lib.scm2cpp_lb_projgr.argtypes = [ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.c_int, ctypes.c_double, ctypes.c_int]
195
+ def lb_projgr(g, w, ib, lbv, nv):
196
+ g = np.ascontiguousarray(g, dtype=np.float64)
197
+ w = np.ascontiguousarray(w, dtype=np.float64)
198
+ return _lib.scm2cpp_lb_projgr(g.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), w.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), ib, lbv, nv)
199
+
200
+ _lib.scm2cpp_lb_hv.restype = ctypes.c_int
201
+ _lib.scm2cpp_lb_hv.argtypes = [ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.c_double, ctypes.c_int, ctypes.c_int, ctypes.c_int, ctypes.c_int]
202
+ def lb_hv(q, smem, ymem, rho, al, theta, col, head, m, nv):
203
+ q = np.ascontiguousarray(q, dtype=np.float64)
204
+ smem = np.ascontiguousarray(smem, dtype=np.float64)
205
+ ymem = np.ascontiguousarray(ymem, dtype=np.float64)
206
+ rho = np.ascontiguousarray(rho, dtype=np.float64)
207
+ al = np.ascontiguousarray(al, dtype=np.float64)
208
+ return _lib.scm2cpp_lb_hv(q.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), smem.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), ymem.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), rho.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), al.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), theta, col, head, m, nv)
209
+
210
+ _lib.scm2cpp_lb_vbv.restype = ctypes.c_double
211
+ _lib.scm2cpp_lb_vbv.argtypes = [ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.c_double, ctypes.c_int, ctypes.c_int, ctypes.c_int, ctypes.c_int]
212
+ def lb_vbv(v, smem, ymem, rho, bm, sb, theta, col, head, m, nv):
213
+ v = np.ascontiguousarray(v, dtype=np.float64)
214
+ smem = np.ascontiguousarray(smem, dtype=np.float64)
215
+ ymem = np.ascontiguousarray(ymem, dtype=np.float64)
216
+ rho = np.ascontiguousarray(rho, dtype=np.float64)
217
+ bm = np.ascontiguousarray(bm, dtype=np.float64)
218
+ sb = np.ascontiguousarray(sb, dtype=np.float64)
219
+ return _lib.scm2cpp_lb_vbv(v.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), smem.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), ymem.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), rho.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), bm.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), sb.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), theta, col, head, m, nv)
220
+
221
+ _lib.scm2cpp_lb_direction.restype = ctypes.c_int
222
+ _lib.scm2cpp_lb_direction.argtypes = [ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.c_double, ctypes.c_int, ctypes.c_int, ctypes.c_int, ctypes.c_int, ctypes.c_double, ctypes.c_int]
223
+ def lb_direction(w, g, d, q, e, smem, ymem, rho, al, bm, sb, theta, col, head, m, ib, lbv, nv):
224
+ w = np.ascontiguousarray(w, dtype=np.float64)
225
+ g = np.ascontiguousarray(g, dtype=np.float64)
226
+ d = np.ascontiguousarray(d, dtype=np.float64)
227
+ q = np.ascontiguousarray(q, dtype=np.float64)
228
+ e = np.ascontiguousarray(e, dtype=np.float64)
229
+ smem = np.ascontiguousarray(smem, dtype=np.float64)
230
+ ymem = np.ascontiguousarray(ymem, dtype=np.float64)
231
+ rho = np.ascontiguousarray(rho, dtype=np.float64)
232
+ al = np.ascontiguousarray(al, dtype=np.float64)
233
+ bm = np.ascontiguousarray(bm, dtype=np.float64)
234
+ sb = np.ascontiguousarray(sb, dtype=np.float64)
235
+ return _lib.scm2cpp_lb_direction(w.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), g.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), d.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), q.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), e.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), smem.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), ymem.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), rho.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), al.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), bm.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), sb.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), theta, col, head, m, ib, lbv, nv)
236
+
237
+ _lib.scm2cpp_lbfgs.restype = ctypes.c_int
238
+ _lib.scm2cpp_lbfgs.argtypes = [ctypes.c_int, ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.c_int, ctypes.c_int, ctypes.c_double, ctypes.c_double, ctypes.c_int, ctypes.c_int, ctypes.c_double, ctypes.c_int, ctypes.c_int, ctypes.c_int, ctypes.c_int]
239
+ def lbfgs(kind, w, x, y, aux, work, out, m, maxiter, pgtol, ftol, maxls, ib, lbv, nv, n, p, k):
240
+ w = np.ascontiguousarray(w, dtype=np.float64)
241
+ x = np.ascontiguousarray(x, dtype=np.float64)
242
+ y = np.ascontiguousarray(y, dtype=np.float64)
243
+ aux = np.ascontiguousarray(aux, dtype=np.float64)
244
+ assert aux.size == 4, "aux: expected 4 elements"
245
+ work = np.ascontiguousarray(work, dtype=np.float64)
246
+ out = np.ascontiguousarray(out, dtype=np.float64)
247
+ return _lib.scm2cpp_lbfgs(kind, w.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), x.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), y.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), aux.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), work.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), out.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), m, maxiter, pgtol, ftol, maxls, ib, lbv, nv, n, p, k)
248
+
249
+ _lib.scm2cpp_lbfgs_fg.restype = ctypes.c_double
250
+ _lib.scm2cpp_lbfgs_fg.argtypes = [ctypes.c_int, ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.c_int, ctypes.c_int, ctypes.c_int]
251
+ def lbfgs_fg(kind, w, g, x, y, aux, work, n, p, k):
252
+ w = np.ascontiguousarray(w, dtype=np.float64)
253
+ g = np.ascontiguousarray(g, dtype=np.float64)
254
+ x = np.ascontiguousarray(x, dtype=np.float64)
255
+ y = np.ascontiguousarray(y, dtype=np.float64)
256
+ aux = np.ascontiguousarray(aux, dtype=np.float64)
257
+ assert aux.size == 4, "aux: expected 4 elements"
258
+ work = np.ascontiguousarray(work, dtype=np.float64)
259
+ return _lib.scm2cpp_lbfgs_fg(kind, w.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), g.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), x.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), y.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), aux.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), work.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), n, p, k)
260
+
261
+ _lib.scm2cpp_gmm_mstep.restype = ctypes.c_int
262
+ _lib.scm2cpp_gmm_mstep.argtypes = [ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.c_double, ctypes.c_int, ctypes.c_int, ctypes.c_int, ctypes.c_int]
263
+ def gmm_mstep(x, resp, weights, means, prec, dw, cov, l, u, reg, norm, n, p, kc):
264
+ x = np.ascontiguousarray(x, dtype=np.float64)
265
+ resp = np.ascontiguousarray(resp, dtype=np.float64)
266
+ weights = np.ascontiguousarray(weights, dtype=np.float64)
267
+ means = np.ascontiguousarray(means, dtype=np.float64)
268
+ prec = np.ascontiguousarray(prec, dtype=np.float64)
269
+ dw = np.ascontiguousarray(dw, dtype=np.float64)
270
+ cov = np.ascontiguousarray(cov, dtype=np.float64)
271
+ l = np.ascontiguousarray(l, dtype=np.float64)
272
+ u = np.ascontiguousarray(u, dtype=np.float64)
273
+ return _lib.scm2cpp_gmm_mstep(x.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), resp.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), weights.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), means.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), prec.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), dw.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), cov.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), l.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), u.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), reg, norm, n, p, kc)
274
+
275
+ _lib.scm2cpp_gmm_estep.restype = ctypes.c_double
276
+ _lib.scm2cpp_gmm_estep.argtypes = [ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.c_int, ctypes.c_int, ctypes.c_int]
277
+ def gmm_estep(x, resp, weights, means, prec, wlp, y, u, mu, n, p, kc):
278
+ x = np.ascontiguousarray(x, dtype=np.float64)
279
+ resp = np.ascontiguousarray(resp, dtype=np.float64)
280
+ weights = np.ascontiguousarray(weights, dtype=np.float64)
281
+ means = np.ascontiguousarray(means, dtype=np.float64)
282
+ prec = np.ascontiguousarray(prec, dtype=np.float64)
283
+ wlp = np.ascontiguousarray(wlp, dtype=np.float64)
284
+ y = np.ascontiguousarray(y, dtype=np.float64)
285
+ u = np.ascontiguousarray(u, dtype=np.float64)
286
+ mu = np.ascontiguousarray(mu, dtype=np.float64)
287
+ return _lib.scm2cpp_gmm_estep(x.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), resp.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), weights.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), means.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), prec.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), wlp.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), y.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), u.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), mu.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), n, p, kc)
288
+
289
+ _lib.scm2cpp_gmm_abs.restype = ctypes.c_double
290
+ _lib.scm2cpp_gmm_abs.argtypes = [ctypes.c_double]
291
+ def gmm_abs(a):
292
+ return _lib.scm2cpp_gmm_abs(a)
293
+
294
+ _lib.scm2cpp_gmm.restype = ctypes.c_int
295
+ _lib.scm2cpp_gmm.argtypes = [ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.c_int, ctypes.c_double, ctypes.c_double, ctypes.c_int, ctypes.c_int, ctypes.c_int]
296
+ def gmm(x, resp, weights, means, prec, labels, out, maxiter, tol, reg, n, p, kc):
297
+ x = np.ascontiguousarray(x, dtype=np.float64)
298
+ resp = np.ascontiguousarray(resp, dtype=np.float64)
299
+ weights = np.ascontiguousarray(weights, dtype=np.float64)
300
+ means = np.ascontiguousarray(means, dtype=np.float64)
301
+ prec = np.ascontiguousarray(prec, dtype=np.float64)
302
+ labels = np.ascontiguousarray(labels, dtype=np.float64)
303
+ out = np.ascontiguousarray(out, dtype=np.float64)
304
+ return _lib.scm2cpp_gmm(x.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), resp.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), weights.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), means.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), prec.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), labels.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), out.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), maxiter, tol, reg, n, p, kc)
305
+
306
+ _lib.scm2cpp_eig_hypot.restype = ctypes.c_double
307
+ _lib.scm2cpp_eig_hypot.argtypes = [ctypes.c_double, ctypes.c_double]
308
+ def eig_hypot(a, b):
309
+ return _lib.scm2cpp_eig_hypot(a, b)
310
+
311
+ _lib.scm2cpp_sym_eigen.restype = ctypes.c_int
312
+ _lib.scm2cpp_sym_eigen.argtypes = [ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.c_int]
313
+ def sym_eigen(a, v, ev, e, m):
314
+ a = np.ascontiguousarray(a, dtype=np.float64)
315
+ v = np.ascontiguousarray(v, dtype=np.float64)
316
+ ev = np.ascontiguousarray(ev, dtype=np.float64)
317
+ e = np.ascontiguousarray(e, dtype=np.float64)
318
+ return _lib.scm2cpp_sym_eigen(a.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), v.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), ev.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), e.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), m)
319
+
320
+ _lib.scm2cpp_eig_abs.restype = ctypes.c_double
321
+ _lib.scm2cpp_eig_abs.argtypes = [ctypes.c_double]
322
+ def eig_abs(a):
323
+ return _lib.scm2cpp_eig_abs(a)
324
+
325
+ _lib.scm2cpp_eig_order.restype = ctypes.c_int
326
+ _lib.scm2cpp_eig_order.argtypes = [ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_int), ctypes.c_int]
327
+ def eig_order(ev, ord, m):
328
+ ev = np.ascontiguousarray(ev, dtype=np.float64)
329
+ ord = np.ascontiguousarray(ord, dtype=np.int32)
330
+ return _lib.scm2cpp_eig_order(ev.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), ord.ctypes.data_as(ctypes.POINTER(ctypes.c_int)), m)
331
+
332
+ _lib.scm2cpp_ica_tanh.restype = ctypes.c_double
333
+ _lib.scm2cpp_ica_tanh.argtypes = [ctypes.c_double]
334
+ def ica_tanh(x):
335
+ return _lib.scm2cpp_ica_tanh(x)
336
+
337
+ _lib.scm2cpp_ica_sym.restype = ctypes.c_int
338
+ _lib.scm2cpp_ica_sym.argtypes = [ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.c_int]
339
+ def ica_sym(w, a, v, ev, e, t, m):
340
+ w = np.ascontiguousarray(w, dtype=np.float64)
341
+ a = np.ascontiguousarray(a, dtype=np.float64)
342
+ v = np.ascontiguousarray(v, dtype=np.float64)
343
+ ev = np.ascontiguousarray(ev, dtype=np.float64)
344
+ e = np.ascontiguousarray(e, dtype=np.float64)
345
+ t = np.ascontiguousarray(t, dtype=np.float64)
346
+ return _lib.scm2cpp_ica_sym(w.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), a.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), v.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), ev.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), e.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), t.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), m)
347
+
348
+ _lib.scm2cpp_fastica.restype = ctypes.c_int
349
+ _lib.scm2cpp_fastica.argtypes = [ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.c_int, ctypes.c_double, ctypes.c_int, ctypes.c_int, ctypes.c_int]
350
+ def fastica(x, winit, comps, white, unmix, mean, maxiter, tol, n, p, nc):
351
+ x = np.ascontiguousarray(x, dtype=np.float64)
352
+ winit = np.ascontiguousarray(winit, dtype=np.float64)
353
+ comps = np.ascontiguousarray(comps, dtype=np.float64)
354
+ white = np.ascontiguousarray(white, dtype=np.float64)
355
+ unmix = np.ascontiguousarray(unmix, dtype=np.float64)
356
+ mean = np.ascontiguousarray(mean, dtype=np.float64)
357
+ return _lib.scm2cpp_fastica(x.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), winit.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), comps.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), white.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), unmix.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), mean.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), maxiter, tol, n, p, nc)
358
+
359
+ _lib.scm2cpp_pca.restype = ctypes.c_int
360
+ _lib.scm2cpp_pca.argtypes = [ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.c_int, ctypes.c_int]
361
+ def pca(x, comps, ev, sv, mean, n, p):
362
+ x = np.ascontiguousarray(x, dtype=np.float64)
363
+ comps = np.ascontiguousarray(comps, dtype=np.float64)
364
+ ev = np.ascontiguousarray(ev, dtype=np.float64)
365
+ sv = np.ascontiguousarray(sv, dtype=np.float64)
366
+ mean = np.ascontiguousarray(mean, dtype=np.float64)
367
+ return _lib.scm2cpp_pca(x.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), comps.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), ev.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), sv.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), mean.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), n, p)
368
+
369
+ _lib.scm2cpp_ard_pinvh.restype = ctypes.c_int
370
+ _lib.scm2cpp_ard_pinvh.argtypes = [ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.c_int]
371
+ def ard_pinvh(a, s, v, ev, e, k):
372
+ a = np.ascontiguousarray(a, dtype=np.float64)
373
+ s = np.ascontiguousarray(s, dtype=np.float64)
374
+ v = np.ascontiguousarray(v, dtype=np.float64)
375
+ ev = np.ascontiguousarray(ev, dtype=np.float64)
376
+ e = np.ascontiguousarray(e, dtype=np.float64)
377
+ return _lib.scm2cpp_ard_pinvh(a.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), s.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), v.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), ev.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), e.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), k)
378
+
379
+ _lib.scm2cpp_ard_sigma_coef.restype = ctypes.c_int
380
+ _lib.scm2cpp_ard_sigma_coef.argtypes = [ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_int), ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.c_double, ctypes.c_int]
381
+ def ard_sigma_coef(xy, idx, lam, coef, sigma, a, v, ev, e, gk, alpha, k):
382
+ xy = np.ascontiguousarray(xy, dtype=np.float64)
383
+ idx = np.ascontiguousarray(idx, dtype=np.int32)
384
+ lam = np.ascontiguousarray(lam, dtype=np.float64)
385
+ coef = np.ascontiguousarray(coef, dtype=np.float64)
386
+ sigma = np.ascontiguousarray(sigma, dtype=np.float64)
387
+ a = np.ascontiguousarray(a, dtype=np.float64)
388
+ v = np.ascontiguousarray(v, dtype=np.float64)
389
+ ev = np.ascontiguousarray(ev, dtype=np.float64)
390
+ e = np.ascontiguousarray(e, dtype=np.float64)
391
+ gk = np.ascontiguousarray(gk, dtype=np.float64)
392
+ return _lib.scm2cpp_ard_sigma_coef(xy.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), idx.ctypes.data_as(ctypes.POINTER(ctypes.c_int)), lam.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), coef.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), sigma.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), a.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), v.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), ev.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), e.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), gk.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), alpha, k)
393
+
394
+ _lib.scm2cpp_ard.restype = ctypes.c_int
395
+ _lib.scm2cpp_ard.argtypes = [ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.c_int, ctypes.c_double, ctypes.c_double, ctypes.c_double, ctypes.c_double, ctypes.c_double, ctypes.c_double, ctypes.c_int, ctypes.c_int, ctypes.c_int]
396
+ def ard(x, y, coef, sigma, lam, out, maxiter, tol, alpha1, alpha2, lambda1, lambda2, thresh, hoist, n, p):
397
+ x = np.ascontiguousarray(x, dtype=np.float64)
398
+ y = np.ascontiguousarray(y, dtype=np.float64)
399
+ coef = np.ascontiguousarray(coef, dtype=np.float64)
400
+ sigma = np.ascontiguousarray(sigma, dtype=np.float64)
401
+ lam = np.ascontiguousarray(lam, dtype=np.float64)
402
+ out = np.ascontiguousarray(out, dtype=np.float64)
403
+ return _lib.scm2cpp_ard(x.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), y.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), coef.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), sigma.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), lam.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), out.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), maxiter, tol, alpha1, alpha2, lambda1, lambda2, thresh, hoist, n, p)
404
+
405
+ _lib.scm2cpp_f_regression.restype = ctypes.c_int
406
+ _lib.scm2cpp_f_regression.argtypes = [ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.c_int, ctypes.c_int, ctypes.c_int, ctypes.c_int]
407
+ def f_regression(x, y, r, f, center, n, p, q):
408
+ x = np.ascontiguousarray(x, dtype=np.float64)
409
+ y = np.ascontiguousarray(y, dtype=np.float64)
410
+ r = np.ascontiguousarray(r, dtype=np.float64)
411
+ f = np.ascontiguousarray(f, dtype=np.float64)
412
+ return _lib.scm2cpp_f_regression(x.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), y.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), r.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), f.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), center, n, p, q)
413
+
414
+ _lib.scm2cpp_f_classif.restype = ctypes.c_int
415
+ _lib.scm2cpp_f_classif.argtypes = [ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_int), ctypes.POINTER(ctypes.c_double), ctypes.c_int, ctypes.c_int, ctypes.c_int]
416
+ def f_classif(x, lab, f, n, p, k):
417
+ x = np.ascontiguousarray(x, dtype=np.float64)
418
+ lab = np.ascontiguousarray(lab, dtype=np.int32)
419
+ f = np.ascontiguousarray(f, dtype=np.float64)
420
+ return _lib.scm2cpp_f_classif(x.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), lab.ctypes.data_as(ctypes.POINTER(ctypes.c_int)), f.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), n, p, k)
421
+
422
+ _lib.scm2cpp_min_pos.restype = ctypes.c_double
423
+ _lib.scm2cpp_min_pos.argtypes = [ctypes.POINTER(ctypes.c_double), ctypes.c_int]
424
+ def min_pos(v, m):
425
+ v = np.ascontiguousarray(v, dtype=np.float64)
426
+ return _lib.scm2cpp_min_pos(v.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), m)
427
+
428
+ _lib.scm2cpp_round_even.restype = ctypes.c_double
429
+ _lib.scm2cpp_round_even.argtypes = [ctypes.c_double]
430
+ def round_even(y):
431
+ return _lib.scm2cpp_round_even(y)
432
+
433
+ _lib.scm2cpp_cholesky_delete.restype = ctypes.c_int
434
+ _lib.scm2cpp_cholesky_delete.argtypes = [ctypes.POINTER(ctypes.c_double), ctypes.c_int, ctypes.c_int, ctypes.c_int]
435
+ def cholesky_delete(l, go, n, k):
436
+ l = np.ascontiguousarray(l, dtype=np.float64)
437
+ return _lib.scm2cpp_cholesky_delete(l.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), go, n, k)
438
+
439
+ _lib.scm2cpp_swap_rc.restype = ctypes.c_int
440
+ _lib.scm2cpp_swap_rc.argtypes = [ctypes.POINTER(ctypes.c_double), ctypes.c_int, ctypes.c_int, ctypes.c_int]
441
+ def swap_rc(g, a, b, p):
442
+ g = np.ascontiguousarray(g, dtype=np.float64)
443
+ return _lib.scm2cpp_swap_rc(g.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), a, b, p)
444
+
445
+ _lib.scm2cpp_lars.restype = ctypes.c_int
446
+ _lib.scm2cpp_lars.argtypes = [ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.c_int, ctypes.c_double, ctypes.c_double, ctypes.c_int, ctypes.c_int, ctypes.c_double, ctypes.c_int]
447
+ def lars(g, cov, coef, path, alphas, rec, nsamples, alphamin, method, maxiter, eps, p):
448
+ g = np.ascontiguousarray(g, dtype=np.float64)
449
+ cov = np.ascontiguousarray(cov, dtype=np.float64)
450
+ coef = np.ascontiguousarray(coef, dtype=np.float64)
451
+ path = np.ascontiguousarray(path, dtype=np.float64)
452
+ alphas = np.ascontiguousarray(alphas, dtype=np.float64)
453
+ return _lib.scm2cpp_lars(g.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), cov.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), coef.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), path.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), alphas.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), rec, nsamples, alphamin, method, maxiter, eps, p)
454
+
455
+ _lib.scm2cpp_rfe_chol.restype = ctypes.c_int
456
+ _lib.scm2cpp_rfe_chol.argtypes = [ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_int), ctypes.POINTER(ctypes.c_double), ctypes.c_double, ctypes.c_int, ctypes.c_int]
457
+ def rfe_chol(g, idx, l, alpha, k, p):
458
+ g = np.ascontiguousarray(g, dtype=np.float64)
459
+ idx = np.ascontiguousarray(idx, dtype=np.int32)
460
+ l = np.ascontiguousarray(l, dtype=np.float64)
461
+ return _lib.scm2cpp_rfe_chol(g.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), idx.ctypes.data_as(ctypes.POINTER(ctypes.c_int)), l.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), alpha, k, p)
462
+
463
+ _lib.scm2cpp_rfe_solve.restype = ctypes.c_int
464
+ _lib.scm2cpp_rfe_solve.argtypes = [ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_int), ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.c_int, ctypes.c_int]
465
+ def rfe_solve(c, idx, w, l, k, p):
466
+ c = np.ascontiguousarray(c, dtype=np.float64)
467
+ idx = np.ascontiguousarray(idx, dtype=np.int32)
468
+ w = np.ascontiguousarray(w, dtype=np.float64)
469
+ l = np.ascontiguousarray(l, dtype=np.float64)
470
+ return _lib.scm2cpp_rfe_solve(c.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), idx.ctypes.data_as(ctypes.POINTER(ctypes.c_int)), w.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), l.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), k, p)
471
+
472
+ _lib.scm2cpp_rfe.restype = ctypes.c_int
473
+ _lib.scm2cpp_rfe.argtypes = [ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_int), ctypes.POINTER(ctypes.c_int), ctypes.c_double, ctypes.c_int, ctypes.c_int, ctypes.c_int, ctypes.c_int]
474
+ def rfe(x, y, coef, support, ranking, alpha, nsel, step, n, p):
475
+ x = np.ascontiguousarray(x, dtype=np.float64)
476
+ y = np.ascontiguousarray(y, dtype=np.float64)
477
+ coef = np.ascontiguousarray(coef, dtype=np.float64)
478
+ support = np.ascontiguousarray(support, dtype=np.int32)
479
+ ranking = np.ascontiguousarray(ranking, dtype=np.int32)
480
+ return _lib.scm2cpp_rfe(x.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), y.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), coef.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), support.ctypes.data_as(ctypes.POINTER(ctypes.c_int)), ranking.ctypes.data_as(ctypes.POINTER(ctypes.c_int)), alpha, nsel, step, n, p)
481
+
482
+ _lib.scm2cpp_gram_xx.restype = ctypes.c_int
483
+ _lib.scm2cpp_gram_xx.argtypes = [ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.c_int, ctypes.c_int]
484
+ def gram_xx(x, g, n, p):
485
+ x = np.ascontiguousarray(x, dtype=np.float64)
486
+ g = np.ascontiguousarray(g, dtype=np.float64)
487
+ return _lib.scm2cpp_gram_xx(x.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), g.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), n, p)
488
+
489
+ _lib.scm2cpp_gram_xy.restype = ctypes.c_int
490
+ _lib.scm2cpp_gram_xy.argtypes = [ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.c_int, ctypes.c_int, ctypes.c_int]
491
+ def gram_xy(x, y, c, n, p, q):
492
+ x = np.ascontiguousarray(x, dtype=np.float64)
493
+ y = np.ascontiguousarray(y, dtype=np.float64)
494
+ c = np.ascontiguousarray(c, dtype=np.float64)
495
+ return _lib.scm2cpp_gram_xy(x.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), y.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), c.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), n, p, q)
496
+