scm2cpp-learn 0.22.0__py3-none-macosx_15_0_arm64.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 (71) hide show
  1. scm2cpp_learn/.dylibs/libgcc_s.1.1.dylib +0 -0
  2. scm2cpp_learn/.dylibs/libgfortran.5.dylib +0 -0
  3. scm2cpp_learn/.dylibs/libomp.dylib +0 -0
  4. scm2cpp_learn/.dylibs/libopenblasp-r0.3.34.dylib +0 -0
  5. scm2cpp_learn/.dylibs/libquadmath.0.dylib +0 -0
  6. scm2cpp_learn/__init__.py +4794 -0
  7. scm2cpp_learn/_classifiers.cpython-312-darwin.so +0 -0
  8. scm2cpp_learn/_compat.py +354 -0
  9. scm2cpp_learn/_generated/__init__.py +0 -0
  10. scm2cpp_learn/_generated/_loader.py +41 -0
  11. scm2cpp_learn/_generated/_loader_accel_cublas.py +185 -0
  12. scm2cpp_learn/_generated/_loader_classifiers.py +308 -0
  13. scm2cpp_learn/_generated/_loader_derived_blas.py +29 -0
  14. scm2cpp_learn/_generated/_loader_derived_cublas.py +29 -0
  15. scm2cpp_learn/_generated/_loader_derived_loops.py +29 -0
  16. scm2cpp_learn/_generated/_loader_gpu_cuda.py +313 -0
  17. scm2cpp_learn/_generated/_loader_gramops_blas.py +836 -0
  18. scm2cpp_learn/_generated/_loader_gramops_loops.py +855 -0
  19. scm2cpp_learn/_generated/_loader_nmf_blas.py +29 -0
  20. scm2cpp_learn/_generated/_loader_nmf_cublas.py +29 -0
  21. scm2cpp_learn/_generated/_loader_nmf_loops.py +29 -0
  22. scm2cpp_learn/_generated/accel_cublas/accel.cpp +26 -0
  23. scm2cpp_learn/_generated/accel_cublas/accel.hpp +1250 -0
  24. scm2cpp_learn/_generated/accel_cublas/accel_capi.cpp +82 -0
  25. scm2cpp_learn/_generated/classifiers.cpp +37 -0
  26. scm2cpp_learn/_generated/classifiers.hpp +3745 -0
  27. scm2cpp_learn/_generated/classifiers_capi.cpp +115 -0
  28. scm2cpp_learn/_generated/derived_blas/lasso_design.cpp +5 -0
  29. scm2cpp_learn/_generated/derived_blas/lasso_design.hpp +156 -0
  30. scm2cpp_learn/_generated/derived_blas/lasso_design_capi.cpp +19 -0
  31. scm2cpp_learn/_generated/derived_cublas/lasso_design.cpp +5 -0
  32. scm2cpp_learn/_generated/derived_cublas/lasso_design.hpp +158 -0
  33. scm2cpp_learn/_generated/derived_cublas/lasso_design_capi.cpp +19 -0
  34. scm2cpp_learn/_generated/derived_loops/lasso_design.cpp +5 -0
  35. scm2cpp_learn/_generated/derived_loops/lasso_design.hpp +179 -0
  36. scm2cpp_learn/_generated/derived_loops/lasso_design_capi.cpp +19 -0
  37. scm2cpp_learn/_generated/gpu_cuda/gpu.cpp +37 -0
  38. scm2cpp_learn/_generated/gpu_cuda/gpu.hpp +3846 -0
  39. scm2cpp_learn/_generated/gpu_cuda/gpu_capi.cpp +308 -0
  40. scm2cpp_learn/_generated/gramops_blas/gramops.cpp +99 -0
  41. scm2cpp_learn/_generated/gramops_blas/gramops.hpp +6655 -0
  42. scm2cpp_learn/_generated/gramops_blas/gramops_capi.cpp +295 -0
  43. scm2cpp_learn/_generated/gramops_loops/gramops.cpp +99 -0
  44. scm2cpp_learn/_generated/gramops_loops/gramops.hpp +7711 -0
  45. scm2cpp_learn/_generated/gramops_loops/gramops_capi.cpp +301 -0
  46. scm2cpp_learn/_generated/lasso_cov.cpp +7 -0
  47. scm2cpp_learn/_generated/lasso_cov.hpp +152 -0
  48. scm2cpp_learn/_generated/lasso_cov_capi.cpp +25 -0
  49. scm2cpp_learn/_generated/nmf_blas/nmf_cd.cpp +5 -0
  50. scm2cpp_learn/_generated/nmf_blas/nmf_cd.hpp +132 -0
  51. scm2cpp_learn/_generated/nmf_blas/nmf_cd_capi.cpp +19 -0
  52. scm2cpp_learn/_generated/nmf_cublas/nmf_cd.cpp +5 -0
  53. scm2cpp_learn/_generated/nmf_cublas/nmf_cd.hpp +136 -0
  54. scm2cpp_learn/_generated/nmf_cublas/nmf_cd_capi.cpp +19 -0
  55. scm2cpp_learn/_generated/nmf_loops/nmf_cd.cpp +5 -0
  56. scm2cpp_learn/_generated/nmf_loops/nmf_cd.hpp +167 -0
  57. scm2cpp_learn/_generated/nmf_loops/nmf_cd_capi.cpp +19 -0
  58. scm2cpp_learn/_generated/scm2cpp-blas.hpp +176 -0
  59. scm2cpp_learn/_generated/scm2cpp-cublas.hpp +155 -0
  60. scm2cpp_learn/_generated/scm2cpp-cuda.hpp +285 -0
  61. scm2cpp_learn/_generated/scm2cpp.hpp +1641 -0
  62. scm2cpp_learn/_gramops_blas.cpython-312-darwin.so +0 -0
  63. scm2cpp_learn/_lasso_cov.cpython-312-darwin.so +0 -0
  64. scm2cpp_learn/_lasso_derived_blas.cpython-312-darwin.so +0 -0
  65. scm2cpp_learn/_libfind.py +153 -0
  66. scm2cpp_learn/_nmf_blas.cpython-312-darwin.so +0 -0
  67. scm2cpp_learn/batch_capi.cu +431 -0
  68. scm2cpp_learn-0.22.0.dist-info/METADATA +1350 -0
  69. scm2cpp_learn-0.22.0.dist-info/RECORD +71 -0
  70. scm2cpp_learn-0.22.0.dist-info/WHEEL +6 -0
  71. scm2cpp_learn-0.22.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,836 @@
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_int64
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_int64]
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_int64
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_int64]
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_int64
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_int64]
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_int64
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_int64, ctypes.c_double, ctypes.c_int64]
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_int64
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_int64, ctypes.c_double, ctypes.c_double, ctypes.c_int64]
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_int64
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_int64, ctypes.c_int64, ctypes.c_int64, ctypes.c_int64]
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_int64, ctypes.c_int64, ctypes.c_int64, ctypes.c_int64, ctypes.c_int64]
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_int64
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_int64, ctypes.c_double, ctypes.c_int64, ctypes.c_int64, ctypes.c_int64, ctypes.c_int64, ctypes.c_int64]
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_int64, ctypes.c_int64, ctypes.c_int64]
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_int64
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_int64, ctypes.c_double, ctypes.c_int64, ctypes.c_int64, ctypes.c_int64]
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_int64, ctypes.c_double, ctypes.c_double, ctypes.c_int64, ctypes.c_int64, ctypes.c_int64]
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_int64
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_int64, ctypes.c_double, ctypes.c_double, ctypes.c_int64, ctypes.c_double, ctypes.c_int64, ctypes.c_int64, ctypes.c_int64]
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_int64
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_int64
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_int64
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_int64]
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_int64, ctypes.POINTER(ctypes.c_double), ctypes.c_int64]
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_int64, ctypes.POINTER(ctypes.c_double), ctypes.c_int64, ctypes.c_int64]
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_int64, ctypes.c_double, ctypes.c_int64]
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_int64
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_int64, ctypes.c_int64, ctypes.c_int64, ctypes.c_int64]
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_int64, ctypes.c_int64, ctypes.c_int64, ctypes.c_int64]
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_int64
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_int64, ctypes.c_int64, ctypes.c_int64, ctypes.c_int64, ctypes.c_double, ctypes.c_int64]
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_int64
238
+ _lib.scm2cpp_lbfgs.argtypes = [ctypes.c_int64, 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_int64, ctypes.c_int64, ctypes.c_double, ctypes.c_double, ctypes.c_int64, ctypes.c_int64, ctypes.c_double, ctypes.c_int64, ctypes.c_int64, ctypes.c_int64, ctypes.c_int64]
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_int64, 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_int64, ctypes.c_int64, ctypes.c_int64]
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_int64
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_int64, ctypes.c_int64, ctypes.c_int64, ctypes.c_int64]
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_int64, ctypes.c_int64, ctypes.c_int64]
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_int64
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_int64, ctypes.c_double, ctypes.c_double, ctypes.c_int64, ctypes.c_int64, ctypes.c_int64]
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_int64
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_int64]
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_int64
326
+ _lib.scm2cpp_eig_order.argtypes = [ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_int), ctypes.c_int64]
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_int64
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_int64]
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_int64
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_int64, ctypes.c_double, ctypes.c_int64, ctypes.c_int64, ctypes.c_int64]
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_int64
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_int64, ctypes.c_int64]
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_int64
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_int64]
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_int64
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_int64]
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_int64
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_int64, ctypes.c_double, ctypes.c_double, ctypes.c_double, ctypes.c_double, ctypes.c_double, ctypes.c_double, ctypes.c_int64, ctypes.c_int64, ctypes.c_int64]
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_int64
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_int64, ctypes.c_int64, ctypes.c_int64, ctypes.c_int64]
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_int64
415
+ _lib.scm2cpp_f_classif.argtypes = [ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_int), ctypes.POINTER(ctypes.c_double), ctypes.c_int64, ctypes.c_int64, ctypes.c_int64]
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_int64]
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_int64
434
+ _lib.scm2cpp_cholesky_delete.argtypes = [ctypes.POINTER(ctypes.c_double), ctypes.c_int64, ctypes.c_int64, ctypes.c_int64]
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_int64
440
+ _lib.scm2cpp_swap_rc.argtypes = [ctypes.POINTER(ctypes.c_double), ctypes.c_int64, ctypes.c_int64, ctypes.c_int64]
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_int64
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_int64, ctypes.c_double, ctypes.c_double, ctypes.c_int64, ctypes.c_int64, ctypes.c_double, ctypes.c_int64]
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_int64
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_int64, ctypes.c_int64]
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_int64
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_int64, ctypes.c_int64]
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_int64
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_int64, ctypes.c_int64, ctypes.c_int64, ctypes.c_int64]
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_int64
483
+ _lib.scm2cpp_gram_xx.argtypes = [ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.c_int64, ctypes.c_int64]
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_int64
490
+ _lib.scm2cpp_gram_xy.argtypes = [ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.c_int64, ctypes.c_int64, ctypes.c_int64]
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
+
497
+ _lib.scm2cpp_spd_solve.restype = ctypes.c_int64
498
+ _lib.scm2cpp_spd_solve.argtypes = [ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.c_int64, ctypes.c_int64]
499
+ def spd_solve(a, b, m, q):
500
+ a = np.ascontiguousarray(a, dtype=np.float64)
501
+ b = np.ascontiguousarray(b, dtype=np.float64)
502
+ return _lib.scm2cpp_spd_solve(a.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), b.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), m, q)
503
+
504
+ _lib.scm2cpp_gram_abs.restype = ctypes.c_double
505
+ _lib.scm2cpp_gram_abs.argtypes = [ctypes.c_double]
506
+ def gram_abs(x):
507
+ return _lib.scm2cpp_gram_abs(x)
508
+
509
+ _lib.scm2cpp_spd_solve_rcond.restype = ctypes.c_double
510
+ _lib.scm2cpp_spd_solve_rcond.argtypes = [ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.c_int64, ctypes.c_int64]
511
+ def spd_solve_rcond(a, b, m, q):
512
+ a = np.ascontiguousarray(a, dtype=np.float64)
513
+ b = np.ascontiguousarray(b, dtype=np.float64)
514
+ return _lib.scm2cpp_spd_solve_rcond(a.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), b.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), m, q)
515
+
516
+ _lib.scm2cpp_gram_ridge_solve.restype = ctypes.c_int64
517
+ _lib.scm2cpp_gram_ridge_solve.argtypes = [ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.c_double, ctypes.c_int64, ctypes.c_int64]
518
+ def gram_ridge_solve(g, c, alpha, m, q):
519
+ g = np.ascontiguousarray(g, dtype=np.float64)
520
+ c = np.ascontiguousarray(c, dtype=np.float64)
521
+ return _lib.scm2cpp_gram_ridge_solve(g.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), c.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), alpha, m, q)
522
+
523
+ _lib.scm2cpp_ridge_gcv_primal.restype = ctypes.c_int64
524
+ _lib.scm2cpp_ridge_gcv_primal.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.c_int64, ctypes.c_int64, ctypes.c_int64]
525
+ def ridge_gcv_primal(x, xm, yc, g, v, lam, z, r, n, p, t):
526
+ x = np.ascontiguousarray(x, dtype=np.float64)
527
+ xm = np.ascontiguousarray(xm, dtype=np.float64)
528
+ yc = np.ascontiguousarray(yc, dtype=np.float64)
529
+ g = np.ascontiguousarray(g, dtype=np.float64)
530
+ v = np.ascontiguousarray(v, dtype=np.float64)
531
+ lam = np.ascontiguousarray(lam, dtype=np.float64)
532
+ z = np.ascontiguousarray(z, dtype=np.float64)
533
+ r = np.ascontiguousarray(r, dtype=np.float64)
534
+ return _lib.scm2cpp_ridge_gcv_primal(x.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), xm.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), yc.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), g.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), v.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), lam.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), z.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), r.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), n, p, t)
535
+
536
+ _lib.scm2cpp_ridge_gcv_dual.restype = ctypes.c_int64
537
+ _lib.scm2cpp_ridge_gcv_dual.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_int64, ctypes.c_int64, ctypes.c_int64]
538
+ def ridge_gcv_dual(k, q, mu, yc, r, n, t, icpt):
539
+ k = np.ascontiguousarray(k, dtype=np.float64)
540
+ q = np.ascontiguousarray(q, dtype=np.float64)
541
+ mu = np.ascontiguousarray(mu, dtype=np.float64)
542
+ yc = np.ascontiguousarray(yc, dtype=np.float64)
543
+ r = np.ascontiguousarray(r, dtype=np.float64)
544
+ return _lib.scm2cpp_ridge_gcv_dual(k.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), q.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), mu.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), yc.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), r.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), n, t, icpt)
545
+
546
+ _lib.scm2cpp_ridge_gcv_scan_dual.restype = ctypes.c_int64
547
+ _lib.scm2cpp_ridge_gcv_scan_dual.argtypes = [ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.c_int64, ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.c_int64, ctypes.c_int64, ctypes.c_int64, ctypes.c_int64]
548
+ def ridge_gcv_scan_dual(q, mu, r, alphas, drop, mse, loo, store, n, t, na):
549
+ q = np.ascontiguousarray(q, dtype=np.float64)
550
+ mu = np.ascontiguousarray(mu, dtype=np.float64)
551
+ r = np.ascontiguousarray(r, dtype=np.float64)
552
+ alphas = np.ascontiguousarray(alphas, dtype=np.float64)
553
+ mse = np.ascontiguousarray(mse, dtype=np.float64)
554
+ loo = np.ascontiguousarray(loo, dtype=np.float64)
555
+ return _lib.scm2cpp_ridge_gcv_scan_dual(q.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), mu.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), r.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), alphas.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), drop, mse.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), loo.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), store, n, t, na)
556
+
557
+ _lib.scm2cpp_ridge_gcv_scan.restype = ctypes.c_int64
558
+ _lib.scm2cpp_ridge_gcv_scan.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.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.c_int64, ctypes.c_int64, ctypes.c_int64, ctypes.c_int64, ctypes.c_int64]
559
+ def ridge_gcv_scan(z, lam, r, yc, alphas, h0, mse, loo, store, n, m, t, na):
560
+ z = np.ascontiguousarray(z, dtype=np.float64)
561
+ lam = np.ascontiguousarray(lam, dtype=np.float64)
562
+ r = np.ascontiguousarray(r, dtype=np.float64)
563
+ yc = np.ascontiguousarray(yc, dtype=np.float64)
564
+ alphas = np.ascontiguousarray(alphas, dtype=np.float64)
565
+ mse = np.ascontiguousarray(mse, dtype=np.float64)
566
+ loo = np.ascontiguousarray(loo, dtype=np.float64)
567
+ return _lib.scm2cpp_ridge_gcv_scan(z.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), lam.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), r.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), yc.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), alphas.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), h0, mse.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), loo.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), store, n, m, t, na)
568
+
569
+ _lib.scm2cpp_kpca_row_norms.restype = ctypes.c_int64
570
+ _lib.scm2cpp_kpca_row_norms.argtypes = [ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.c_int64, ctypes.c_int64]
571
+ def kpca_row_norms(x, s, n, p):
572
+ x = np.ascontiguousarray(x, dtype=np.float64)
573
+ s = np.ascontiguousarray(s, dtype=np.float64)
574
+ return _lib.scm2cpp_kpca_row_norms(x.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), s.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), n, p)
575
+
576
+ _lib.scm2cpp_kpca_apply.restype = ctypes.c_int64
577
+ _lib.scm2cpp_kpca_apply.argtypes = [ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.c_int64, ctypes.c_double, ctypes.c_double, ctypes.c_double, ctypes.c_int64, ctypes.c_int64]
578
+ def kpca_apply(g, sa, sb, kind, gamma, degree, coef0, na, nb):
579
+ g = np.ascontiguousarray(g, dtype=np.float64)
580
+ sa = np.ascontiguousarray(sa, dtype=np.float64)
581
+ sb = np.ascontiguousarray(sb, dtype=np.float64)
582
+ return _lib.scm2cpp_kpca_apply(g.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), sa.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), sb.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), kind, gamma, degree, coef0, na, nb)
583
+
584
+ _lib.scm2cpp_kpca_kernel.restype = ctypes.c_int64
585
+ _lib.scm2cpp_kpca_kernel.argtypes = [ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.c_int64, ctypes.c_double, ctypes.c_double, ctypes.c_double, ctypes.c_int64, ctypes.c_int64, ctypes.c_int64]
586
+ def kpca_kernel(x, y, k, kind, gamma, degree, coef0, na, nb, p):
587
+ x = np.ascontiguousarray(x, dtype=np.float64)
588
+ y = np.ascontiguousarray(y, dtype=np.float64)
589
+ k = np.ascontiguousarray(k, dtype=np.float64)
590
+ return _lib.scm2cpp_kpca_kernel(x.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), y.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), k.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), kind, gamma, degree, coef0, na, nb, p)
591
+
592
+ _lib.scm2cpp_kpca_kernel_self.restype = ctypes.c_int64
593
+ _lib.scm2cpp_kpca_kernel_self.argtypes = [ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.c_int64, ctypes.c_double, ctypes.c_double, ctypes.c_double, ctypes.c_int64, ctypes.c_int64]
594
+ def kpca_kernel_self(x, k, kind, gamma, degree, coef0, n, p):
595
+ x = np.ascontiguousarray(x, dtype=np.float64)
596
+ k = np.ascontiguousarray(k, dtype=np.float64)
597
+ return _lib.scm2cpp_kpca_kernel_self(x.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), k.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), kind, gamma, degree, coef0, n, p)
598
+
599
+ _lib.scm2cpp_kpca_centre.restype = ctypes.c_int64
600
+ _lib.scm2cpp_kpca_centre.argtypes = [ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.c_int64]
601
+ def kpca_centre(k, m, n):
602
+ k = np.ascontiguousarray(k, dtype=np.float64)
603
+ m = np.ascontiguousarray(m, dtype=np.float64)
604
+ return _lib.scm2cpp_kpca_centre(k.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), m.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), n)
605
+
606
+ _lib.scm2cpp_kpca_centre_new.restype = ctypes.c_int64
607
+ _lib.scm2cpp_kpca_centre_new.argtypes = [ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.c_int64, ctypes.c_int64]
608
+ def kpca_centre_new(k, m, nb, n):
609
+ k = np.ascontiguousarray(k, dtype=np.float64)
610
+ m = np.ascontiguousarray(m, dtype=np.float64)
611
+ return _lib.scm2cpp_kpca_centre_new(k.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), m.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), nb, n)
612
+
613
+ _lib.scm2cpp_kpca_flip.restype = ctypes.c_int64
614
+ _lib.scm2cpp_kpca_flip.argtypes = [ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.c_int64, ctypes.c_int64]
615
+ def kpca_flip(vecs, vals, n, c):
616
+ vecs = np.ascontiguousarray(vecs, dtype=np.float64)
617
+ vals = np.ascontiguousarray(vals, dtype=np.float64)
618
+ return _lib.scm2cpp_kpca_flip(vecs.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), vals.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), n, c)
619
+
620
+ _lib.scm2cpp_kpca_top_dense.restype = ctypes.c_int64
621
+ _lib.scm2cpp_kpca_top_dense.argtypes = [ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.c_int64, ctypes.c_int64]
622
+ def kpca_top_dense(k, vecs, vals, n, c):
623
+ k = np.ascontiguousarray(k, dtype=np.float64)
624
+ vecs = np.ascontiguousarray(vecs, dtype=np.float64)
625
+ vals = np.ascontiguousarray(vals, dtype=np.float64)
626
+ return _lib.scm2cpp_kpca_top_dense(k.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), vecs.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), vals.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), n, c)
627
+
628
+ _lib.scm2cpp_kpca_orth.restype = ctypes.c_int64
629
+ _lib.scm2cpp_kpca_orth.argtypes = [ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.c_int64, ctypes.c_int64]
630
+ def kpca_orth(y, g, n, b):
631
+ y = np.ascontiguousarray(y, dtype=np.float64)
632
+ g = np.ascontiguousarray(g, dtype=np.float64)
633
+ return _lib.scm2cpp_kpca_orth(y.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), g.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), n, b)
634
+
635
+ _lib.scm2cpp_kpca_top_subspace.restype = ctypes.c_int64
636
+ _lib.scm2cpp_kpca_top_subspace.argtypes = [ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.c_int64, ctypes.c_int64, ctypes.c_int64, ctypes.c_double, ctypes.c_int64]
637
+ def kpca_top_subspace(k, q, vecs, vals, n, b, c, tol, maxit):
638
+ k = np.ascontiguousarray(k, dtype=np.float64)
639
+ q = np.ascontiguousarray(q, dtype=np.float64)
640
+ vecs = np.ascontiguousarray(vecs, dtype=np.float64)
641
+ vals = np.ascontiguousarray(vals, dtype=np.float64)
642
+ return _lib.scm2cpp_kpca_top_subspace(k.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), q.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), vecs.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), vals.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), n, b, c, tol, maxit)
643
+
644
+ _lib.scm2cpp_kpca_linear.restype = ctypes.c_int64
645
+ _lib.scm2cpp_kpca_linear.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_int64, ctypes.c_int64, ctypes.c_int64]
646
+ def kpca_linear(x, xm, g, vecs, vals, n, p, c):
647
+ x = np.ascontiguousarray(x, dtype=np.float64)
648
+ xm = np.ascontiguousarray(xm, dtype=np.float64)
649
+ g = np.ascontiguousarray(g, dtype=np.float64)
650
+ vecs = np.ascontiguousarray(vecs, dtype=np.float64)
651
+ vals = np.ascontiguousarray(vals, dtype=np.float64)
652
+ return _lib.scm2cpp_kpca_linear(x.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), xm.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), g.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), vecs.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), vals.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), n, p, c)
653
+
654
+ _lib.scm2cpp_lda_moments.restype = ctypes.c_int64
655
+ _lib.scm2cpp_lda_moments.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.c_int64, ctypes.c_int64, ctypes.c_int64]
656
+ def lda_moments(x, lab, g, means, counts, n, p, k):
657
+ x = np.ascontiguousarray(x, dtype=np.float64)
658
+ lab = np.ascontiguousarray(lab, dtype=np.int32)
659
+ g = np.ascontiguousarray(g, dtype=np.float64)
660
+ means = np.ascontiguousarray(means, dtype=np.float64)
661
+ counts = np.ascontiguousarray(counts, dtype=np.float64)
662
+ return _lib.scm2cpp_lda_moments(x.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), lab.ctypes.data_as(ctypes.POINTER(ctypes.c_int)), g.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), means.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), counts.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), n, p, k)
663
+
664
+ _lib.scm2cpp_lda_within.restype = ctypes.c_int64
665
+ _lib.scm2cpp_lda_within.argtypes = [ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.c_double, ctypes.c_int64, ctypes.c_int64]
666
+ def lda_within(g, means, counts, n, p, k):
667
+ g = np.ascontiguousarray(g, dtype=np.float64)
668
+ means = np.ascontiguousarray(means, dtype=np.float64)
669
+ counts = np.ascontiguousarray(counts, dtype=np.float64)
670
+ return _lib.scm2cpp_lda_within(g.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), means.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), counts.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), n, p, k)
671
+
672
+ _lib.scm2cpp_lda_svd_first.restype = ctypes.c_int64
673
+ _lib.scm2cpp_lda_svd_first.argtypes = [ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.c_int64]
674
+ def lda_svd_first(sw, std, v, s, p):
675
+ sw = np.ascontiguousarray(sw, dtype=np.float64)
676
+ std = np.ascontiguousarray(std, dtype=np.float64)
677
+ v = np.ascontiguousarray(v, dtype=np.float64)
678
+ s = np.ascontiguousarray(s, dtype=np.float64)
679
+ return _lib.scm2cpp_lda_svd_first(sw.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), std.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), v.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), s.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), p)
680
+
681
+ _lib.scm2cpp_lda_eigen.restype = ctypes.c_int64
682
+ _lib.scm2cpp_lda_eigen.argtypes = [ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.c_int64]
683
+ def lda_eigen(sb, sw, v, ev, p):
684
+ sb = np.ascontiguousarray(sb, dtype=np.float64)
685
+ sw = np.ascontiguousarray(sw, dtype=np.float64)
686
+ v = np.ascontiguousarray(v, dtype=np.float64)
687
+ ev = np.ascontiguousarray(ev, dtype=np.float64)
688
+ return _lib.scm2cpp_lda_eigen(sb.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), sw.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)), p)
689
+
690
+ _lib.scm2cpp_tsvd_flip.restype = ctypes.c_int64
691
+ _lib.scm2cpp_tsvd_flip.argtypes = [ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.c_int64, ctypes.c_int64, ctypes.c_int64]
692
+ def tsvd_flip(v, z, n, p, k):
693
+ v = np.ascontiguousarray(v, dtype=np.float64)
694
+ z = np.ascontiguousarray(z, dtype=np.float64)
695
+ return _lib.scm2cpp_tsvd_flip(v.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), z.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), n, p, k)
696
+
697
+ _lib.scm2cpp_tsvd_tall.restype = ctypes.c_int64
698
+ _lib.scm2cpp_tsvd_tall.argtypes = [ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.c_int64, ctypes.c_int64, ctypes.c_int64]
699
+ def tsvd_tall(x, v, s, z, n, p, k):
700
+ x = np.ascontiguousarray(x, dtype=np.float64)
701
+ v = np.ascontiguousarray(v, dtype=np.float64)
702
+ s = np.ascontiguousarray(s, dtype=np.float64)
703
+ z = np.ascontiguousarray(z, dtype=np.float64)
704
+ return _lib.scm2cpp_tsvd_tall(x.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), v.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), s.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), z.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), n, p, k)
705
+
706
+ _lib.scm2cpp_tsvd_wide.restype = ctypes.c_int64
707
+ _lib.scm2cpp_tsvd_wide.argtypes = [ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.c_int64, ctypes.c_int64, ctypes.c_int64]
708
+ def tsvd_wide(x, v, s, z, n, p, k):
709
+ x = np.ascontiguousarray(x, dtype=np.float64)
710
+ v = np.ascontiguousarray(v, dtype=np.float64)
711
+ s = np.ascontiguousarray(s, dtype=np.float64)
712
+ z = np.ascontiguousarray(z, dtype=np.float64)
713
+ return _lib.scm2cpp_tsvd_wide(x.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), v.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), s.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), z.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), n, p, k)
714
+
715
+ _lib.scm2cpp_tsvd_gram.restype = ctypes.c_int64
716
+ _lib.scm2cpp_tsvd_gram.argtypes = [ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.c_int64, ctypes.c_int64]
717
+ def tsvd_gram(g, v, s, m, k):
718
+ g = np.ascontiguousarray(g, dtype=np.float64)
719
+ v = np.ascontiguousarray(v, dtype=np.float64)
720
+ s = np.ascontiguousarray(s, dtype=np.float64)
721
+ return _lib.scm2cpp_tsvd_gram(g.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), v.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), s.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), m, k)
722
+
723
+ _lib.scm2cpp_svd_jacobi.restype = ctypes.c_int64
724
+ _lib.scm2cpp_svd_jacobi.argtypes = [ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.c_int64, ctypes.c_int64]
725
+ def svd_jacobi(w, q, r, c):
726
+ w = np.ascontiguousarray(w, dtype=np.float64)
727
+ q = np.ascontiguousarray(q, dtype=np.float64)
728
+ return _lib.scm2cpp_svd_jacobi(w.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), q.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), r, c)
729
+
730
+ _lib.scm2cpp_svd_collect.restype = ctypes.c_int64
731
+ _lib.scm2cpp_svd_collect.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.c_int64, ctypes.c_int64]
732
+ def svd_collect(w, q, s, l, rr, ord, r, c):
733
+ w = np.ascontiguousarray(w, dtype=np.float64)
734
+ q = np.ascontiguousarray(q, dtype=np.float64)
735
+ s = np.ascontiguousarray(s, dtype=np.float64)
736
+ l = np.ascontiguousarray(l, dtype=np.float64)
737
+ rr = np.ascontiguousarray(rr, dtype=np.float64)
738
+ ord = np.ascontiguousarray(ord, dtype=np.int32)
739
+ return _lib.scm2cpp_svd_collect(w.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), q.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), s.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), l.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), rr.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), ord.ctypes.data_as(ctypes.POINTER(ctypes.c_int)), r, c)
740
+
741
+ _lib.scm2cpp_sym_svd.restype = ctypes.c_int64
742
+ _lib.scm2cpp_sym_svd.argtypes = [ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.c_int64, ctypes.c_int64]
743
+ def sym_svd(a, u, s, vt, m, n):
744
+ a = np.ascontiguousarray(a, dtype=np.float64)
745
+ u = np.ascontiguousarray(u, dtype=np.float64)
746
+ s = np.ascontiguousarray(s, dtype=np.float64)
747
+ vt = np.ascontiguousarray(vt, dtype=np.float64)
748
+ return _lib.scm2cpp_sym_svd(a.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), u.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), s.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), vt.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), m, n)
749
+
750
+ _lib.scm2cpp_pls_pinv.restype = ctypes.c_int64
751
+ _lib.scm2cpp_pls_pinv.argtypes = [ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.c_int64]
752
+ def pls_pinv(a, pv, m):
753
+ a = np.ascontiguousarray(a, dtype=np.float64)
754
+ pv = np.ascontiguousarray(pv, dtype=np.float64)
755
+ return _lib.scm2cpp_pls_pinv(a.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), pv.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), m)
756
+
757
+ _lib.scm2cpp_pls_mv.restype = ctypes.c_int64
758
+ _lib.scm2cpp_pls_mv.argtypes = [ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.c_int64, ctypes.c_int64]
759
+ def pls_mv(a, x, y, m, n):
760
+ a = np.ascontiguousarray(a, dtype=np.float64)
761
+ x = np.ascontiguousarray(x, dtype=np.float64)
762
+ y = np.ascontiguousarray(y, dtype=np.float64)
763
+ return _lib.scm2cpp_pls_mv(a.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)), m, n)
764
+
765
+ _lib.scm2cpp_pls_mtv.restype = ctypes.c_int64
766
+ _lib.scm2cpp_pls_mtv.argtypes = [ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.c_int64, ctypes.c_int64]
767
+ def pls_mtv(a, x, y, m, n):
768
+ a = np.ascontiguousarray(a, dtype=np.float64)
769
+ x = np.ascontiguousarray(x, dtype=np.float64)
770
+ y = np.ascontiguousarray(y, dtype=np.float64)
771
+ return _lib.scm2cpp_pls_mtv(a.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)), m, n)
772
+
773
+ _lib.scm2cpp_pls_dot.restype = ctypes.c_double
774
+ _lib.scm2cpp_pls_dot.argtypes = [ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.c_int64]
775
+ def pls_dot(x, y, m):
776
+ x = np.ascontiguousarray(x, dtype=np.float64)
777
+ y = np.ascontiguousarray(y, dtype=np.float64)
778
+ return _lib.scm2cpp_pls_dot(x.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), y.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), m)
779
+
780
+ _lib.scm2cpp_pls_fit.restype = ctypes.c_int64
781
+ _lib.scm2cpp_pls_fit.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_int), ctypes.c_int64, ctypes.c_int64, ctypes.c_int64, ctypes.c_int64, ctypes.c_int64, ctypes.c_int64, ctypes.c_int64, ctypes.c_double]
782
+ def pls_fit(cxx, cxy, cyy, xw, yw, xl, yl, niter, p, q, k, mode, canon, algo, maxit, tol):
783
+ cxx = np.ascontiguousarray(cxx, dtype=np.float64)
784
+ cxy = np.ascontiguousarray(cxy, dtype=np.float64)
785
+ cyy = np.ascontiguousarray(cyy, dtype=np.float64)
786
+ xw = np.ascontiguousarray(xw, dtype=np.float64)
787
+ yw = np.ascontiguousarray(yw, dtype=np.float64)
788
+ xl = np.ascontiguousarray(xl, dtype=np.float64)
789
+ yl = np.ascontiguousarray(yl, dtype=np.float64)
790
+ niter = np.ascontiguousarray(niter, dtype=np.int32)
791
+ return _lib.scm2cpp_pls_fit(cxx.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), cxy.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), cyy.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), xw.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), yw.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), xl.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), yl.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), niter.ctypes.data_as(ctypes.POINTER(ctypes.c_int)), p, q, k, mode, canon, algo, maxit, tol)
792
+
793
+ _lib.scm2cpp_fa_fit.restype = ctypes.c_int64
794
+ _lib.scm2cpp_fa_fit.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_int64, ctypes.c_int64, ctypes.c_int64, ctypes.c_double]
795
+ def fa_fit(c, var, psi, w, ll, n, p, k, maxit, tol):
796
+ c = np.ascontiguousarray(c, dtype=np.float64)
797
+ var = np.ascontiguousarray(var, dtype=np.float64)
798
+ psi = np.ascontiguousarray(psi, dtype=np.float64)
799
+ w = np.ascontiguousarray(w, dtype=np.float64)
800
+ ll = np.ascontiguousarray(ll, dtype=np.float64)
801
+ return _lib.scm2cpp_fa_fit(c.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), var.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), psi.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), w.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), ll.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), n, p, k, maxit, tol)
802
+
803
+ _lib.scm2cpp_linreg_solve.restype = ctypes.c_int64
804
+ _lib.scm2cpp_linreg_solve.argtypes = [ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.c_int64, ctypes.c_int64, ctypes.c_double, ctypes.c_double]
805
+ def linreg_solve(g, b, coef, p, t, ratio, tol):
806
+ g = np.ascontiguousarray(g, dtype=np.float64)
807
+ b = np.ascontiguousarray(b, dtype=np.float64)
808
+ coef = np.ascontiguousarray(coef, dtype=np.float64)
809
+ return _lib.scm2cpp_linreg_solve(g.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), b.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), coef.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), p, t, ratio, tol)
810
+
811
+ _lib.scm2cpp_linreg_singular.restype = ctypes.c_int64
812
+ _lib.scm2cpp_linreg_singular.argtypes = [ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.c_int64, ctypes.c_double]
813
+ def linreg_singular(g, s, p, tol):
814
+ g = np.ascontiguousarray(g, dtype=np.float64)
815
+ s = np.ascontiguousarray(s, dtype=np.float64)
816
+ return _lib.scm2cpp_linreg_singular(g.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), s.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), p, tol)
817
+
818
+ _lib.scm2cpp_csr_gram.restype = ctypes.c_int64
819
+ _lib.scm2cpp_csr_gram.argtypes = [ctypes.POINTER(ctypes.c_int64), ctypes.POINTER(ctypes.c_int), ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.c_int64, ctypes.c_int64, ctypes.c_int64]
820
+ def csr_gram(rp, ci, v, g, p, r0, r1):
821
+ rp = np.ascontiguousarray(rp, dtype=np.int64)
822
+ ci = np.ascontiguousarray(ci, dtype=np.int32)
823
+ v = np.ascontiguousarray(v, dtype=np.float64)
824
+ g = np.ascontiguousarray(g, dtype=np.float64)
825
+ return _lib.scm2cpp_csr_gram(rp.ctypes.data_as(ctypes.POINTER(ctypes.c_int64)), ci.ctypes.data_as(ctypes.POINTER(ctypes.c_int)), v.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), g.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), p, r0, r1)
826
+
827
+ _lib.scm2cpp_csr_mm.restype = ctypes.c_int64
828
+ _lib.scm2cpp_csr_mm.argtypes = [ctypes.POINTER(ctypes.c_int64), ctypes.POINTER(ctypes.c_int), ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.c_int64, ctypes.c_int64]
829
+ def csr_mm(rp, ci, v, b, c, n, k):
830
+ rp = np.ascontiguousarray(rp, dtype=np.int64)
831
+ ci = np.ascontiguousarray(ci, dtype=np.int32)
832
+ v = np.ascontiguousarray(v, dtype=np.float64)
833
+ b = np.ascontiguousarray(b, dtype=np.float64)
834
+ c = np.ascontiguousarray(c, dtype=np.float64)
835
+ return _lib.scm2cpp_csr_mm(rp.ctypes.data_as(ctypes.POINTER(ctypes.c_int64)), ci.ctypes.data_as(ctypes.POINTER(ctypes.c_int)), v.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), b.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), c.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), n, k)
836
+