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,294 @@
1
+ # ctypes loader for libgpu.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_gpu_lib as _load_gpu_lib
10
+
11
+ _lib = _load_gpu_lib()
12
+
13
+ _lib.scm2cpp_eig_hypot.restype = ctypes.c_double
14
+ _lib.scm2cpp_eig_hypot.argtypes = [ctypes.c_double, ctypes.c_double]
15
+ def eig_hypot(a, b):
16
+ return _lib.scm2cpp_eig_hypot(a, b)
17
+
18
+ _lib.scm2cpp_sym_eigen.restype = ctypes.c_int
19
+ _lib.scm2cpp_sym_eigen.argtypes = [ctypes.POINTER(ctypes.c_double), ctypes.c_int, ctypes.POINTER(ctypes.c_double), ctypes.c_int, ctypes.POINTER(ctypes.c_double), ctypes.c_int, ctypes.POINTER(ctypes.c_double), ctypes.c_int, ctypes.c_int]
20
+ def sym_eigen(a, v, ev, e, m):
21
+ a = np.ascontiguousarray(a, dtype=np.float64)
22
+ v = np.ascontiguousarray(v, dtype=np.float64)
23
+ ev = np.ascontiguousarray(ev, dtype=np.float64)
24
+ e = np.ascontiguousarray(e, dtype=np.float64)
25
+ return _lib.scm2cpp_sym_eigen(a.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), a.size, v.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), v.size, ev.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), ev.size, e.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), e.size, m)
26
+
27
+ _lib.scm2cpp_eig_abs.restype = ctypes.c_double
28
+ _lib.scm2cpp_eig_abs.argtypes = [ctypes.c_double]
29
+ def eig_abs(a):
30
+ return _lib.scm2cpp_eig_abs(a)
31
+
32
+ _lib.scm2cpp_eig_order.restype = ctypes.c_int
33
+ _lib.scm2cpp_eig_order.argtypes = [ctypes.POINTER(ctypes.c_double), ctypes.c_int, ctypes.POINTER(ctypes.c_int), ctypes.c_int, ctypes.c_int]
34
+ def eig_order(ev, ord, m):
35
+ ev = np.ascontiguousarray(ev, dtype=np.float64)
36
+ ord = np.ascontiguousarray(ord, dtype=np.int32)
37
+ return _lib.scm2cpp_eig_order(ev.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), ev.size, ord.ctypes.data_as(ctypes.POINTER(ctypes.c_int)), ord.size, m)
38
+
39
+ _lib.scm2cpp_ica_tanh.restype = ctypes.c_double
40
+ _lib.scm2cpp_ica_tanh.argtypes = [ctypes.c_double]
41
+ def ica_tanh(x):
42
+ return _lib.scm2cpp_ica_tanh(x)
43
+
44
+ _lib.scm2cpp_ica_sym.restype = ctypes.c_int
45
+ _lib.scm2cpp_ica_sym.argtypes = [ctypes.POINTER(ctypes.c_double), ctypes.c_int, ctypes.POINTER(ctypes.c_double), ctypes.c_int, ctypes.POINTER(ctypes.c_double), ctypes.c_int, ctypes.POINTER(ctypes.c_double), ctypes.c_int, ctypes.POINTER(ctypes.c_double), ctypes.c_int, ctypes.POINTER(ctypes.c_double), ctypes.c_int, ctypes.c_int]
46
+ def ica_sym(w, a, v, ev, e, t, m):
47
+ w = np.ascontiguousarray(w, dtype=np.float64)
48
+ a = np.ascontiguousarray(a, dtype=np.float64)
49
+ v = np.ascontiguousarray(v, dtype=np.float64)
50
+ ev = np.ascontiguousarray(ev, dtype=np.float64)
51
+ e = np.ascontiguousarray(e, dtype=np.float64)
52
+ t = np.ascontiguousarray(t, dtype=np.float64)
53
+ return _lib.scm2cpp_ica_sym(w.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), w.size, a.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), a.size, v.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), v.size, ev.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), ev.size, e.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), e.size, t.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), t.size, m)
54
+
55
+ _lib.scm2cpp_fastica.restype = ctypes.c_int
56
+ _lib.scm2cpp_fastica.argtypes = [ctypes.POINTER(ctypes.c_double), ctypes.c_int, ctypes.POINTER(ctypes.c_double), ctypes.c_int, ctypes.POINTER(ctypes.c_double), ctypes.c_int, ctypes.POINTER(ctypes.c_double), ctypes.c_int, ctypes.POINTER(ctypes.c_double), ctypes.c_int, ctypes.POINTER(ctypes.c_double), ctypes.c_int, ctypes.c_int, ctypes.c_double, ctypes.c_int, ctypes.c_int, ctypes.c_int]
57
+ def fastica(x, winit, comps, white, unmix, mean, maxiter, tol, n, p, nc):
58
+ x = np.ascontiguousarray(x, dtype=np.float64)
59
+ winit = np.ascontiguousarray(winit, dtype=np.float64)
60
+ comps = np.ascontiguousarray(comps, dtype=np.float64)
61
+ white = np.ascontiguousarray(white, dtype=np.float64)
62
+ unmix = np.ascontiguousarray(unmix, dtype=np.float64)
63
+ mean = np.ascontiguousarray(mean, dtype=np.float64)
64
+ return _lib.scm2cpp_fastica(x.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), x.size, winit.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), winit.size, comps.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), comps.size, white.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), white.size, unmix.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), unmix.size, mean.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), mean.size, maxiter, tol, n, p, nc)
65
+
66
+ _lib.scm2cpp_gmm_mstep.restype = ctypes.c_int
67
+ _lib.scm2cpp_gmm_mstep.argtypes = [ctypes.POINTER(ctypes.c_double), ctypes.c_int, ctypes.POINTER(ctypes.c_double), ctypes.c_int, ctypes.POINTER(ctypes.c_double), ctypes.c_int, ctypes.POINTER(ctypes.c_double), ctypes.c_int, ctypes.POINTER(ctypes.c_double), ctypes.c_int, ctypes.POINTER(ctypes.c_double), ctypes.c_int, ctypes.POINTER(ctypes.c_double), ctypes.c_int, ctypes.POINTER(ctypes.c_double), ctypes.c_int, ctypes.POINTER(ctypes.c_double), ctypes.c_int, ctypes.c_double, ctypes.c_int, ctypes.c_int, ctypes.c_int, ctypes.c_int]
68
+ def gmm_mstep(x, resp, weights, means, prec, dw, cov, l, u, reg, norm, n, p, kc):
69
+ x = np.ascontiguousarray(x, dtype=np.float64)
70
+ resp = np.ascontiguousarray(resp, dtype=np.float64)
71
+ weights = np.ascontiguousarray(weights, dtype=np.float64)
72
+ means = np.ascontiguousarray(means, dtype=np.float64)
73
+ prec = np.ascontiguousarray(prec, dtype=np.float64)
74
+ dw = np.ascontiguousarray(dw, dtype=np.float64)
75
+ cov = np.ascontiguousarray(cov, dtype=np.float64)
76
+ l = np.ascontiguousarray(l, dtype=np.float64)
77
+ u = np.ascontiguousarray(u, dtype=np.float64)
78
+ return _lib.scm2cpp_gmm_mstep(x.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), x.size, resp.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), resp.size, weights.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), weights.size, means.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), means.size, prec.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), prec.size, dw.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), dw.size, cov.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), cov.size, l.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), l.size, u.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), u.size, reg, norm, n, p, kc)
79
+
80
+ _lib.scm2cpp_gmm_estep.restype = ctypes.c_double
81
+ _lib.scm2cpp_gmm_estep.argtypes = [ctypes.POINTER(ctypes.c_double), ctypes.c_int, ctypes.POINTER(ctypes.c_double), ctypes.c_int, ctypes.POINTER(ctypes.c_double), ctypes.c_int, ctypes.POINTER(ctypes.c_double), ctypes.c_int, ctypes.POINTER(ctypes.c_double), ctypes.c_int, ctypes.POINTER(ctypes.c_double), ctypes.c_int, ctypes.POINTER(ctypes.c_double), ctypes.c_int, ctypes.POINTER(ctypes.c_double), ctypes.c_int, ctypes.POINTER(ctypes.c_double), ctypes.c_int, ctypes.c_int, ctypes.c_int, ctypes.c_int]
82
+ def gmm_estep(x, resp, weights, means, prec, wlp, y, u, mu, n, p, kc):
83
+ x = np.ascontiguousarray(x, dtype=np.float64)
84
+ resp = np.ascontiguousarray(resp, dtype=np.float64)
85
+ weights = np.ascontiguousarray(weights, dtype=np.float64)
86
+ means = np.ascontiguousarray(means, dtype=np.float64)
87
+ prec = np.ascontiguousarray(prec, dtype=np.float64)
88
+ wlp = np.ascontiguousarray(wlp, dtype=np.float64)
89
+ y = np.ascontiguousarray(y, dtype=np.float64)
90
+ u = np.ascontiguousarray(u, dtype=np.float64)
91
+ mu = np.ascontiguousarray(mu, dtype=np.float64)
92
+ return _lib.scm2cpp_gmm_estep(x.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), x.size, resp.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), resp.size, weights.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), weights.size, means.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), means.size, prec.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), prec.size, wlp.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), wlp.size, y.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), y.size, u.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), u.size, mu.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), mu.size, n, p, kc)
93
+
94
+ _lib.scm2cpp_gmm_abs.restype = ctypes.c_double
95
+ _lib.scm2cpp_gmm_abs.argtypes = [ctypes.c_double]
96
+ def gmm_abs(a):
97
+ return _lib.scm2cpp_gmm_abs(a)
98
+
99
+ _lib.scm2cpp_gmm.restype = ctypes.c_int
100
+ _lib.scm2cpp_gmm.argtypes = [ctypes.POINTER(ctypes.c_double), ctypes.c_int, ctypes.POINTER(ctypes.c_double), ctypes.c_int, ctypes.POINTER(ctypes.c_double), ctypes.c_int, ctypes.POINTER(ctypes.c_double), ctypes.c_int, ctypes.POINTER(ctypes.c_double), ctypes.c_int, ctypes.POINTER(ctypes.c_double), ctypes.c_int, 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_int]
101
+ def gmm(x, resp, weights, means, prec, labels, out, maxiter, tol, reg, n, p, kc):
102
+ x = np.ascontiguousarray(x, dtype=np.float64)
103
+ resp = np.ascontiguousarray(resp, dtype=np.float64)
104
+ weights = np.ascontiguousarray(weights, dtype=np.float64)
105
+ means = np.ascontiguousarray(means, dtype=np.float64)
106
+ prec = np.ascontiguousarray(prec, dtype=np.float64)
107
+ labels = np.ascontiguousarray(labels, dtype=np.float64)
108
+ out = np.ascontiguousarray(out, dtype=np.float64)
109
+ return _lib.scm2cpp_gmm(x.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), x.size, resp.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), resp.size, weights.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), weights.size, means.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), means.size, prec.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), prec.size, labels.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), labels.size, out.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), out.size, maxiter, tol, reg, n, p, kc)
110
+
111
+ _lib.scm2cpp_logistic_fg.restype = ctypes.c_double
112
+ _lib.scm2cpp_logistic_fg.argtypes = [ctypes.POINTER(ctypes.c_double), ctypes.c_int, ctypes.POINTER(ctypes.c_double), ctypes.c_int, ctypes.POINTER(ctypes.c_double), ctypes.c_int, ctypes.POINTER(ctypes.c_double), ctypes.c_int, ctypes.POINTER(ctypes.c_double), ctypes.c_int, ctypes.c_double, ctypes.c_int, ctypes.c_int, ctypes.c_int, ctypes.c_int, ctypes.c_int]
113
+ def logistic_fg(coef, g, x, y, z, l2, multi, fitint, n, p, k):
114
+ coef = np.ascontiguousarray(coef, dtype=np.float64)
115
+ g = np.ascontiguousarray(g, dtype=np.float64)
116
+ x = np.ascontiguousarray(x, dtype=np.float64)
117
+ y = np.ascontiguousarray(y, dtype=np.float64)
118
+ z = np.ascontiguousarray(z, dtype=np.float64)
119
+ return _lib.scm2cpp_logistic_fg(coef.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), coef.size, g.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), g.size, x.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), x.size, y.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), y.size, z.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), z.size, l2, multi, fitint, n, p, k)
120
+
121
+ _lib.scm2cpp_logistic_lbfgs.restype = ctypes.c_int
122
+ _lib.scm2cpp_logistic_lbfgs.argtypes = [ctypes.POINTER(ctypes.c_double), ctypes.c_int, ctypes.POINTER(ctypes.c_double), ctypes.c_int, ctypes.POINTER(ctypes.c_double), ctypes.c_int, ctypes.POINTER(ctypes.c_double), ctypes.c_int, ctypes.c_double, ctypes.c_int, ctypes.c_double, ctypes.c_int, ctypes.c_int, ctypes.c_int, ctypes.c_int, ctypes.c_int]
123
+ def logistic_lbfgs(x, y, coef, out, c, maxiter, tol, multi, fitint, n, p, k):
124
+ x = np.ascontiguousarray(x, dtype=np.float64)
125
+ y = np.ascontiguousarray(y, dtype=np.float64)
126
+ coef = np.ascontiguousarray(coef, dtype=np.float64)
127
+ out = np.ascontiguousarray(out, dtype=np.float64)
128
+ return _lib.scm2cpp_logistic_lbfgs(x.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), x.size, y.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), y.size, coef.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), coef.size, out.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), out.size, c, maxiter, tol, multi, fitint, n, p, k)
129
+
130
+ _lib.scm2cpp_huber_fg.restype = ctypes.c_double
131
+ _lib.scm2cpp_huber_fg.argtypes = [ctypes.POINTER(ctypes.c_double), ctypes.c_int, ctypes.POINTER(ctypes.c_double), ctypes.c_int, ctypes.POINTER(ctypes.c_double), ctypes.c_int, ctypes.POINTER(ctypes.c_double), ctypes.c_int, ctypes.POINTER(ctypes.c_double), ctypes.c_int, ctypes.c_double, ctypes.c_double, ctypes.c_int, ctypes.c_int, ctypes.c_int]
132
+ def huber_fg(coef, g, x, y, z, epsilon, alpha, fitint, n, p):
133
+ coef = np.ascontiguousarray(coef, dtype=np.float64)
134
+ g = np.ascontiguousarray(g, dtype=np.float64)
135
+ x = np.ascontiguousarray(x, dtype=np.float64)
136
+ y = np.ascontiguousarray(y, dtype=np.float64)
137
+ z = np.ascontiguousarray(z, dtype=np.float64)
138
+ return _lib.scm2cpp_huber_fg(coef.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), coef.size, g.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), g.size, x.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), x.size, y.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), y.size, z.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), z.size, epsilon, alpha, fitint, n, p)
139
+
140
+ _lib.scm2cpp_huber.restype = ctypes.c_int
141
+ _lib.scm2cpp_huber.argtypes = [ctypes.POINTER(ctypes.c_double), ctypes.c_int, ctypes.POINTER(ctypes.c_double), ctypes.c_int, ctypes.POINTER(ctypes.c_double), ctypes.c_int, 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]
142
+ def huber(x, y, coef, out, epsilon, alpha, maxiter, tol, fitint, n, p):
143
+ x = np.ascontiguousarray(x, dtype=np.float64)
144
+ y = np.ascontiguousarray(y, dtype=np.float64)
145
+ coef = np.ascontiguousarray(coef, dtype=np.float64)
146
+ out = np.ascontiguousarray(out, dtype=np.float64)
147
+ return _lib.scm2cpp_huber(x.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), x.size, y.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), y.size, coef.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), coef.size, out.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), out.size, epsilon, alpha, maxiter, tol, fitint, n, p)
148
+
149
+ _lib.scm2cpp_glm_fg.restype = ctypes.c_double
150
+ _lib.scm2cpp_glm_fg.argtypes = [ctypes.POINTER(ctypes.c_double), ctypes.c_int, ctypes.POINTER(ctypes.c_double), ctypes.c_int, ctypes.POINTER(ctypes.c_double), ctypes.c_int, ctypes.POINTER(ctypes.c_double), ctypes.c_int, 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_int]
151
+ def glm_fg(coef, g, x, y, z, family, power, l2, fitint, n, p):
152
+ coef = np.ascontiguousarray(coef, dtype=np.float64)
153
+ g = np.ascontiguousarray(g, dtype=np.float64)
154
+ x = np.ascontiguousarray(x, dtype=np.float64)
155
+ y = np.ascontiguousarray(y, dtype=np.float64)
156
+ z = np.ascontiguousarray(z, dtype=np.float64)
157
+ return _lib.scm2cpp_glm_fg(coef.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), coef.size, g.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), g.size, x.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), x.size, y.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), y.size, z.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), z.size, family, power, l2, fitint, n, p)
158
+
159
+ _lib.scm2cpp_glm.restype = ctypes.c_int
160
+ _lib.scm2cpp_glm.argtypes = [ctypes.POINTER(ctypes.c_double), ctypes.c_int, ctypes.POINTER(ctypes.c_double), ctypes.c_int, ctypes.POINTER(ctypes.c_double), ctypes.c_int, ctypes.POINTER(ctypes.c_double), ctypes.c_int, ctypes.c_int, ctypes.c_double, ctypes.c_double, ctypes.c_int, ctypes.c_double, ctypes.c_int, ctypes.c_int, ctypes.c_int]
161
+ def glm(x, y, coef, out, family, power, alpha, maxiter, tol, fitint, n, p):
162
+ x = np.ascontiguousarray(x, dtype=np.float64)
163
+ y = np.ascontiguousarray(y, dtype=np.float64)
164
+ coef = np.ascontiguousarray(coef, dtype=np.float64)
165
+ out = np.ascontiguousarray(out, dtype=np.float64)
166
+ return _lib.scm2cpp_glm(x.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), x.size, y.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), y.size, coef.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), coef.size, out.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), out.size, family, power, alpha, maxiter, tol, fitint, n, p)
167
+
168
+ _lib.scm2cpp_lb_abs.restype = ctypes.c_double
169
+ _lib.scm2cpp_lb_abs.argtypes = [ctypes.c_double]
170
+ def lb_abs(a):
171
+ return _lib.scm2cpp_lb_abs(a)
172
+
173
+ _lib.scm2cpp_lb_max.restype = ctypes.c_double
174
+ _lib.scm2cpp_lb_max.argtypes = [ctypes.c_double, ctypes.c_double]
175
+ def lb_max(a, b):
176
+ return _lib.scm2cpp_lb_max(a, b)
177
+
178
+ _lib.scm2cpp_lb_min.restype = ctypes.c_double
179
+ _lib.scm2cpp_lb_min.argtypes = [ctypes.c_double, ctypes.c_double]
180
+ def lb_min(a, b):
181
+ return _lib.scm2cpp_lb_min(a, b)
182
+
183
+ _lib.scm2cpp_lb_dcstep.restype = ctypes.c_int
184
+ _lib.scm2cpp_lb_dcstep.argtypes = [ctypes.POINTER(ctypes.c_double), ctypes.c_double, ctypes.c_double, ctypes.c_double, ctypes.c_double]
185
+ def lb_dcstep(cs, fp, dp, stpmin, stpmax):
186
+ cs = np.ascontiguousarray(cs, dtype=np.float64)
187
+ assert cs.size == 8, "cs: expected 8 elements"
188
+ return _lib.scm2cpp_lb_dcstep(cs.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), fp, dp, stpmin, stpmax)
189
+
190
+ _lib.scm2cpp_lb_search_start.restype = ctypes.c_int
191
+ _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]
192
+ def lb_search_start(ls, f, g, stp, stpmin, stpmax, ftol):
193
+ ls = np.ascontiguousarray(ls, dtype=np.float64)
194
+ assert ls.size == 16, "ls: expected 16 elements"
195
+ return _lib.scm2cpp_lb_search_start(ls.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), f, g, stp, stpmin, stpmax, ftol)
196
+
197
+ _lib.scm2cpp_lb_search_step.restype = ctypes.c_int
198
+ _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]
199
+ def lb_search_step(ls, cs, f, g, ftol, gtol, xtol, stpmin, stpmax):
200
+ ls = np.ascontiguousarray(ls, dtype=np.float64)
201
+ assert ls.size == 16, "ls: expected 16 elements"
202
+ cs = np.ascontiguousarray(cs, dtype=np.float64)
203
+ assert cs.size == 8, "cs: expected 8 elements"
204
+ 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)
205
+
206
+ _lib.scm2cpp_lb_dot.restype = ctypes.c_double
207
+ _lib.scm2cpp_lb_dot.argtypes = [ctypes.POINTER(ctypes.c_double), ctypes.c_int, ctypes.POINTER(ctypes.c_double), ctypes.c_int, ctypes.c_int]
208
+ def lb_dot(a, b, nv):
209
+ a = np.ascontiguousarray(a, dtype=np.float64)
210
+ b = np.ascontiguousarray(b, dtype=np.float64)
211
+ return _lib.scm2cpp_lb_dot(a.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), a.size, b.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), b.size, nv)
212
+
213
+ _lib.scm2cpp_lb_dot_row.restype = ctypes.c_double
214
+ _lib.scm2cpp_lb_dot_row.argtypes = [ctypes.POINTER(ctypes.c_double), ctypes.c_int, ctypes.c_int, ctypes.POINTER(ctypes.c_double), ctypes.c_int, ctypes.c_int]
215
+ def lb_dot_row(mem, slot, v, nv):
216
+ mem = np.ascontiguousarray(mem, dtype=np.float64)
217
+ v = np.ascontiguousarray(v, dtype=np.float64)
218
+ return _lib.scm2cpp_lb_dot_row(mem.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), mem.size, slot, v.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), v.size, nv)
219
+
220
+ _lib.scm2cpp_lb_dot_rows.restype = ctypes.c_double
221
+ _lib.scm2cpp_lb_dot_rows.argtypes = [ctypes.POINTER(ctypes.c_double), ctypes.c_int, ctypes.c_int, ctypes.POINTER(ctypes.c_double), ctypes.c_int, ctypes.c_int, ctypes.c_int]
222
+ def lb_dot_rows(a, ra, b, rb, nv):
223
+ a = np.ascontiguousarray(a, dtype=np.float64)
224
+ b = np.ascontiguousarray(b, dtype=np.float64)
225
+ return _lib.scm2cpp_lb_dot_rows(a.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), a.size, ra, b.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), b.size, rb, nv)
226
+
227
+ _lib.scm2cpp_lb_projgr.restype = ctypes.c_double
228
+ _lib.scm2cpp_lb_projgr.argtypes = [ctypes.POINTER(ctypes.c_double), ctypes.c_int, ctypes.POINTER(ctypes.c_double), ctypes.c_int, ctypes.c_int, ctypes.c_double, ctypes.c_int]
229
+ def lb_projgr(g, w, ib, lbv, nv):
230
+ g = np.ascontiguousarray(g, dtype=np.float64)
231
+ w = np.ascontiguousarray(w, dtype=np.float64)
232
+ return _lib.scm2cpp_lb_projgr(g.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), g.size, w.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), w.size, ib, lbv, nv)
233
+
234
+ _lib.scm2cpp_lb_hv.restype = ctypes.c_int
235
+ _lib.scm2cpp_lb_hv.argtypes = [ctypes.POINTER(ctypes.c_double), ctypes.c_int, ctypes.POINTER(ctypes.c_double), ctypes.c_int, ctypes.POINTER(ctypes.c_double), ctypes.c_int, ctypes.POINTER(ctypes.c_double), ctypes.c_int, ctypes.POINTER(ctypes.c_double), ctypes.c_int, ctypes.c_double, ctypes.c_int, ctypes.c_int, ctypes.c_int, ctypes.c_int]
236
+ def lb_hv(q, smem, ymem, rho, al, theta, col, head, m, nv):
237
+ q = np.ascontiguousarray(q, dtype=np.float64)
238
+ smem = np.ascontiguousarray(smem, dtype=np.float64)
239
+ ymem = np.ascontiguousarray(ymem, dtype=np.float64)
240
+ rho = np.ascontiguousarray(rho, dtype=np.float64)
241
+ al = np.ascontiguousarray(al, dtype=np.float64)
242
+ return _lib.scm2cpp_lb_hv(q.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), q.size, smem.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), smem.size, ymem.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), ymem.size, rho.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), rho.size, al.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), al.size, theta, col, head, m, nv)
243
+
244
+ _lib.scm2cpp_lb_vbv.restype = ctypes.c_double
245
+ _lib.scm2cpp_lb_vbv.argtypes = [ctypes.POINTER(ctypes.c_double), ctypes.c_int, ctypes.POINTER(ctypes.c_double), ctypes.c_int, ctypes.POINTER(ctypes.c_double), ctypes.c_int, ctypes.POINTER(ctypes.c_double), ctypes.c_int, ctypes.POINTER(ctypes.c_double), ctypes.c_int, ctypes.POINTER(ctypes.c_double), ctypes.c_int, ctypes.c_double, ctypes.c_int, ctypes.c_int, ctypes.c_int, ctypes.c_int]
246
+ def lb_vbv(v, smem, ymem, rho, bm, sb, theta, col, head, m, nv):
247
+ v = np.ascontiguousarray(v, dtype=np.float64)
248
+ smem = np.ascontiguousarray(smem, dtype=np.float64)
249
+ ymem = np.ascontiguousarray(ymem, dtype=np.float64)
250
+ rho = np.ascontiguousarray(rho, dtype=np.float64)
251
+ bm = np.ascontiguousarray(bm, dtype=np.float64)
252
+ sb = np.ascontiguousarray(sb, dtype=np.float64)
253
+ return _lib.scm2cpp_lb_vbv(v.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), v.size, smem.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), smem.size, ymem.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), ymem.size, rho.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), rho.size, bm.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), bm.size, sb.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), sb.size, theta, col, head, m, nv)
254
+
255
+ _lib.scm2cpp_lb_direction.restype = ctypes.c_int
256
+ _lib.scm2cpp_lb_direction.argtypes = [ctypes.POINTER(ctypes.c_double), ctypes.c_int, ctypes.POINTER(ctypes.c_double), ctypes.c_int, ctypes.POINTER(ctypes.c_double), ctypes.c_int, ctypes.POINTER(ctypes.c_double), ctypes.c_int, ctypes.POINTER(ctypes.c_double), ctypes.c_int, ctypes.POINTER(ctypes.c_double), ctypes.c_int, ctypes.POINTER(ctypes.c_double), ctypes.c_int, ctypes.POINTER(ctypes.c_double), ctypes.c_int, ctypes.POINTER(ctypes.c_double), ctypes.c_int, ctypes.POINTER(ctypes.c_double), ctypes.c_int, ctypes.POINTER(ctypes.c_double), ctypes.c_int, ctypes.c_double, ctypes.c_int, ctypes.c_int, ctypes.c_int, ctypes.c_int, ctypes.c_double, ctypes.c_int]
257
+ def lb_direction(w, g, d, q, e, smem, ymem, rho, al, bm, sb, theta, col, head, m, ib, lbv, nv):
258
+ w = np.ascontiguousarray(w, dtype=np.float64)
259
+ g = np.ascontiguousarray(g, dtype=np.float64)
260
+ d = np.ascontiguousarray(d, dtype=np.float64)
261
+ q = np.ascontiguousarray(q, dtype=np.float64)
262
+ e = np.ascontiguousarray(e, dtype=np.float64)
263
+ smem = np.ascontiguousarray(smem, dtype=np.float64)
264
+ ymem = np.ascontiguousarray(ymem, dtype=np.float64)
265
+ rho = np.ascontiguousarray(rho, dtype=np.float64)
266
+ al = np.ascontiguousarray(al, dtype=np.float64)
267
+ bm = np.ascontiguousarray(bm, dtype=np.float64)
268
+ sb = np.ascontiguousarray(sb, dtype=np.float64)
269
+ return _lib.scm2cpp_lb_direction(w.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), w.size, g.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), g.size, d.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), d.size, q.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), q.size, e.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), e.size, smem.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), smem.size, ymem.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), ymem.size, rho.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), rho.size, al.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), al.size, bm.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), bm.size, sb.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), sb.size, theta, col, head, m, ib, lbv, nv)
270
+
271
+ _lib.scm2cpp_lbfgs.restype = ctypes.c_int
272
+ _lib.scm2cpp_lbfgs.argtypes = [ctypes.c_int, ctypes.POINTER(ctypes.c_double), ctypes.c_int, ctypes.POINTER(ctypes.c_double), ctypes.c_int, ctypes.POINTER(ctypes.c_double), ctypes.c_int, ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.c_int, ctypes.POINTER(ctypes.c_double), ctypes.c_int, 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]
273
+ def lbfgs(kind, w, x, y, aux, work, out, m, maxiter, pgtol, ftol, maxls, ib, lbv, nv, n, p, k):
274
+ w = np.ascontiguousarray(w, dtype=np.float64)
275
+ x = np.ascontiguousarray(x, dtype=np.float64)
276
+ y = np.ascontiguousarray(y, dtype=np.float64)
277
+ aux = np.ascontiguousarray(aux, dtype=np.float64)
278
+ assert aux.size == 4, "aux: expected 4 elements"
279
+ work = np.ascontiguousarray(work, dtype=np.float64)
280
+ out = np.ascontiguousarray(out, dtype=np.float64)
281
+ return _lib.scm2cpp_lbfgs(kind, w.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), w.size, x.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), x.size, y.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), y.size, aux.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), work.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), work.size, out.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), out.size, m, maxiter, pgtol, ftol, maxls, ib, lbv, nv, n, p, k)
282
+
283
+ _lib.scm2cpp_lbfgs_fg.restype = ctypes.c_double
284
+ _lib.scm2cpp_lbfgs_fg.argtypes = [ctypes.c_int, ctypes.POINTER(ctypes.c_double), ctypes.c_int, ctypes.POINTER(ctypes.c_double), ctypes.c_int, ctypes.POINTER(ctypes.c_double), ctypes.c_int, ctypes.POINTER(ctypes.c_double), ctypes.c_int, ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.c_int, ctypes.c_int, ctypes.c_int, ctypes.c_int]
285
+ def lbfgs_fg(kind, w, g, x, y, aux, work, n, p, k):
286
+ w = np.ascontiguousarray(w, dtype=np.float64)
287
+ g = np.ascontiguousarray(g, dtype=np.float64)
288
+ x = np.ascontiguousarray(x, dtype=np.float64)
289
+ y = np.ascontiguousarray(y, dtype=np.float64)
290
+ aux = np.ascontiguousarray(aux, dtype=np.float64)
291
+ assert aux.size == 4, "aux: expected 4 elements"
292
+ work = np.ascontiguousarray(work, dtype=np.float64)
293
+ return _lib.scm2cpp_lbfgs_fg(kind, w.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), w.size, g.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), g.size, x.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), x.size, y.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), y.size, aux.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), work.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), work.size, n, p, k)
294
+