numpy-ts 1.2.0 → 1.3.0

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 (408) hide show
  1. package/README.md +3 -11
  2. package/dist/esm/common/dtype.js +1 -1
  3. package/dist/esm/common/internal/compute.js +1 -1
  4. package/dist/esm/common/internal/indexing.js +1 -1
  5. package/dist/esm/common/ndarray-core.js +1 -1
  6. package/dist/esm/common/ops/advanced.js +1 -1
  7. package/dist/esm/common/ops/arithmetic.js +1 -1
  8. package/dist/esm/common/ops/bitwise.js +1 -1
  9. package/dist/esm/common/ops/comparison.js +1 -1
  10. package/dist/esm/common/ops/complex.js +1 -1
  11. package/dist/esm/common/ops/exponential.js +1 -1
  12. package/dist/esm/common/ops/fft.js +1 -1
  13. package/dist/esm/common/ops/gradient.js +1 -1
  14. package/dist/esm/common/ops/hyperbolic.js +1 -1
  15. package/dist/esm/common/ops/linalg.js +2 -2
  16. package/dist/esm/common/ops/logic.js +1 -1
  17. package/dist/esm/common/ops/random.js +1 -1
  18. package/dist/esm/common/ops/reduction.js +1 -1
  19. package/dist/esm/common/ops/rounding.js +1 -1
  20. package/dist/esm/common/ops/shape.js +1 -1
  21. package/dist/esm/common/ops/sorting.js +1 -1
  22. package/dist/esm/common/ops/statistics.js +1 -1
  23. package/dist/esm/common/ops/trig.js +1 -1
  24. package/dist/esm/common/storage.js +1 -1
  25. package/dist/esm/common/wasm/abs.js +1 -1
  26. package/dist/esm/common/wasm/add.js +1 -1
  27. package/dist/esm/common/wasm/all_finite.js +1 -0
  28. package/dist/esm/common/wasm/arccos.js +1 -1
  29. package/dist/esm/common/wasm/arcsin.js +1 -1
  30. package/dist/esm/common/wasm/arctan.js +1 -1
  31. package/dist/esm/common/wasm/arctan2.js +1 -0
  32. package/dist/esm/common/wasm/argpartition.js +1 -1
  33. package/dist/esm/common/wasm/argsort.js +1 -1
  34. package/dist/esm/common/wasm/bins/abs.wasm.js +1 -1
  35. package/dist/esm/common/wasm/bins/add.wasm.js +1 -1
  36. package/dist/esm/common/wasm/bins/all_finite.wasm.js +1 -0
  37. package/dist/esm/common/wasm/bins/alloc.wasm.js +1 -0
  38. package/dist/esm/common/wasm/bins/arccos.wasm.js +1 -1
  39. package/dist/esm/common/wasm/bins/arcsin.wasm.js +1 -1
  40. package/dist/esm/common/wasm/bins/arctan.wasm.js +1 -1
  41. package/dist/esm/common/wasm/bins/arctan2.wasm.js +1 -0
  42. package/dist/esm/common/wasm/bins/argpartition.wasm.js +1 -1
  43. package/dist/esm/common/wasm/bins/argsort.wasm.js +1 -1
  44. package/dist/esm/common/wasm/bins/bitwise_and.wasm.js +1 -1
  45. package/dist/esm/common/wasm/bins/bitwise_count.wasm.js +1 -1
  46. package/dist/esm/common/wasm/bins/bitwise_not.wasm.js +1 -1
  47. package/dist/esm/common/wasm/bins/bitwise_or.wasm.js +1 -1
  48. package/dist/esm/common/wasm/bins/bitwise_xor.wasm.js +1 -1
  49. package/dist/esm/common/wasm/bins/cholesky.wasm.js +1 -1
  50. package/dist/esm/common/wasm/bins/clip.wasm.js +1 -1
  51. package/dist/esm/common/wasm/bins/convolve.wasm.js +1 -1
  52. package/dist/esm/common/wasm/bins/copysign.wasm.js +1 -1
  53. package/dist/esm/common/wasm/bins/correlate.wasm.js +1 -1
  54. package/dist/esm/common/wasm/bins/cos.wasm.js +1 -1
  55. package/dist/esm/common/wasm/bins/cosh.wasm.js +1 -1
  56. package/dist/esm/common/wasm/bins/cross.wasm.js +1 -1
  57. package/dist/esm/common/wasm/bins/diff.wasm.js +1 -1
  58. package/dist/esm/common/wasm/bins/divide.wasm.js +1 -1
  59. package/dist/esm/common/wasm/bins/divmod.wasm.js +1 -0
  60. package/dist/esm/common/wasm/bins/dot_float-relaxed.wasm.js +1 -0
  61. package/dist/esm/common/wasm/bins/dot_float.wasm.js +1 -0
  62. package/dist/esm/common/wasm/bins/dot_int.wasm.js +1 -0
  63. package/dist/esm/common/wasm/bins/exp.wasm.js +1 -1
  64. package/dist/esm/common/wasm/bins/exp2.wasm.js +1 -1
  65. package/dist/esm/common/wasm/bins/fft.wasm.js +1 -1
  66. package/dist/esm/common/wasm/bins/frexp.wasm.js +1 -1
  67. package/dist/esm/common/wasm/bins/gather.wasm.js +1 -1
  68. package/dist/esm/common/wasm/bins/gcd.wasm.js +1 -1
  69. package/dist/esm/common/wasm/bins/gradient.wasm.js +1 -1
  70. package/dist/esm/common/wasm/bins/heaviside.wasm.js +1 -1
  71. package/dist/esm/common/wasm/bins/hypot.wasm.js +1 -1
  72. package/dist/esm/common/wasm/bins/indices.wasm.js +1 -1
  73. package/dist/esm/common/wasm/bins/inner_float-relaxed.wasm.js +1 -0
  74. package/dist/esm/common/wasm/bins/inner_float.wasm.js +1 -0
  75. package/dist/esm/common/wasm/bins/inner_int.wasm.js +1 -0
  76. package/dist/esm/common/wasm/bins/isfinite.wasm.js +1 -0
  77. package/dist/esm/common/wasm/bins/isnan.wasm.js +1 -0
  78. package/dist/esm/common/wasm/bins/kron.wasm.js +1 -1
  79. package/dist/esm/common/wasm/bins/ldexp.wasm.js +1 -1
  80. package/dist/esm/common/wasm/bins/left_shift.wasm.js +1 -1
  81. package/dist/esm/common/wasm/bins/lexsort.wasm.js +1 -1
  82. package/dist/esm/common/wasm/bins/logaddexp.wasm.js +1 -1
  83. package/dist/esm/common/wasm/bins/logical_and.wasm.js +1 -1
  84. package/dist/esm/common/wasm/bins/logical_not.wasm.js +1 -1
  85. package/dist/esm/common/wasm/bins/logical_or.wasm.js +1 -1
  86. package/dist/esm/common/wasm/bins/logical_xor.wasm.js +1 -1
  87. package/dist/esm/common/wasm/bins/lu.wasm.js +1 -0
  88. package/dist/esm/common/wasm/bins/matmul_float-relaxed.wasm.js +1 -0
  89. package/dist/esm/common/wasm/bins/matmul_float.wasm.js +1 -0
  90. package/dist/esm/common/wasm/bins/matmul_int.wasm.js +1 -0
  91. package/dist/esm/common/wasm/bins/matvec_float-relaxed.wasm.js +1 -0
  92. package/dist/esm/common/wasm/bins/matvec_float.wasm.js +1 -0
  93. package/dist/esm/common/wasm/bins/matvec_int.wasm.js +1 -0
  94. package/dist/esm/common/wasm/bins/max.wasm.js +1 -1
  95. package/dist/esm/common/wasm/bins/min.wasm.js +1 -1
  96. package/dist/esm/common/wasm/bins/mul.wasm.js +1 -1
  97. package/dist/esm/common/wasm/bins/neg.wasm.js +1 -1
  98. package/dist/esm/common/wasm/bins/outer.wasm.js +1 -1
  99. package/dist/esm/common/wasm/bins/pad.wasm.js +1 -1
  100. package/dist/esm/common/wasm/bins/partition.wasm.js +1 -1
  101. package/dist/esm/common/wasm/bins/power.wasm.js +1 -1
  102. package/dist/esm/common/wasm/bins/qr.wasm.js +1 -1
  103. package/dist/esm/common/wasm/bins/reciprocal.wasm.js +1 -1
  104. package/dist/esm/common/wasm/bins/reduce_all.wasm.js +1 -1
  105. package/dist/esm/common/wasm/bins/reduce_any.wasm.js +1 -1
  106. package/dist/esm/common/wasm/bins/reduce_argmax.wasm.js +1 -1
  107. package/dist/esm/common/wasm/bins/reduce_argmin.wasm.js +1 -1
  108. package/dist/esm/common/wasm/bins/reduce_count_nz.wasm.js +1 -1
  109. package/dist/esm/common/wasm/bins/reduce_max.wasm.js +1 -1
  110. package/dist/esm/common/wasm/bins/reduce_mean.wasm.js +1 -1
  111. package/dist/esm/common/wasm/bins/reduce_min.wasm.js +1 -1
  112. package/dist/esm/common/wasm/bins/reduce_nanmax.wasm.js +1 -1
  113. package/dist/esm/common/wasm/bins/reduce_nanmin.wasm.js +1 -1
  114. package/dist/esm/common/wasm/bins/reduce_nansum.wasm.js +1 -1
  115. package/dist/esm/common/wasm/bins/reduce_prod.wasm.js +1 -1
  116. package/dist/esm/common/wasm/bins/reduce_std.wasm.js +1 -1
  117. package/dist/esm/common/wasm/bins/reduce_sum.wasm.js +1 -1
  118. package/dist/esm/common/wasm/bins/reduce_var.wasm.js +1 -1
  119. package/dist/esm/common/wasm/bins/repeat.wasm.js +1 -1
  120. package/dist/esm/common/wasm/bins/right_shift.wasm.js +1 -1
  121. package/dist/esm/common/wasm/bins/rng.wasm.js +1 -1
  122. package/dist/esm/common/wasm/bins/roll.wasm.js +1 -1
  123. package/dist/esm/common/wasm/bins/searchsorted.wasm.js +1 -1
  124. package/dist/esm/common/wasm/bins/sign.wasm.js +1 -1
  125. package/dist/esm/common/wasm/bins/signbit.wasm.js +1 -0
  126. package/dist/esm/common/wasm/bins/sin.wasm.js +1 -0
  127. package/dist/esm/common/wasm/bins/sinh.wasm.js +1 -1
  128. package/dist/esm/common/wasm/bins/sort.wasm.js +1 -1
  129. package/dist/esm/common/wasm/bins/sqrt.wasm.js +1 -1
  130. package/dist/esm/common/wasm/bins/square.wasm.js +1 -1
  131. package/dist/esm/common/wasm/bins/sub.wasm.js +1 -1
  132. package/dist/esm/common/wasm/bins/svd.wasm.js +1 -1
  133. package/dist/esm/common/wasm/bins/tan.wasm.js +1 -1
  134. package/dist/esm/common/wasm/bins/tanh.wasm.js +1 -1
  135. package/dist/esm/common/wasm/bins/tile.wasm.js +1 -1
  136. package/dist/esm/common/wasm/bins/unravel_index.wasm.js +1 -0
  137. package/dist/esm/common/wasm/bins/vdot.wasm.js +1 -1
  138. package/dist/esm/common/wasm/bins/vecdot_float-relaxed.wasm.js +1 -0
  139. package/dist/esm/common/wasm/bins/vecdot_float.wasm.js +1 -0
  140. package/dist/esm/common/wasm/bins/vecdot_int.wasm.js +1 -0
  141. package/dist/esm/common/wasm/bins/vecmat_float-relaxed.wasm.js +1 -0
  142. package/dist/esm/common/wasm/bins/vecmat_float.wasm.js +1 -0
  143. package/dist/esm/common/wasm/bins/vecmat_int.wasm.js +1 -0
  144. package/dist/esm/common/wasm/bins/vector_norm-relaxed.wasm.js +1 -0
  145. package/dist/esm/common/wasm/bins/vector_norm.wasm.js +1 -0
  146. package/dist/esm/common/wasm/bitwise_and.js +1 -1
  147. package/dist/esm/common/wasm/bitwise_count.js +1 -1
  148. package/dist/esm/common/wasm/bitwise_not.js +1 -1
  149. package/dist/esm/common/wasm/bitwise_or.js +1 -1
  150. package/dist/esm/common/wasm/bitwise_xor.js +1 -1
  151. package/dist/esm/common/wasm/cholesky.js +1 -1
  152. package/dist/esm/common/wasm/clip.js +1 -1
  153. package/dist/esm/common/wasm/config.js +1 -1
  154. package/dist/esm/common/wasm/convolve.js +1 -1
  155. package/dist/esm/common/wasm/copysign.js +1 -1
  156. package/dist/esm/common/wasm/correlate.js +1 -1
  157. package/dist/esm/common/wasm/cos.js +1 -1
  158. package/dist/esm/common/wasm/cosh.js +1 -1
  159. package/dist/esm/common/wasm/cross.js +1 -1
  160. package/dist/esm/common/wasm/detect.js +1 -0
  161. package/dist/esm/common/wasm/diff.js +1 -1
  162. package/dist/esm/common/wasm/divide.js +1 -1
  163. package/dist/esm/common/wasm/divmod.js +1 -0
  164. package/dist/esm/common/wasm/dot.js +1 -1
  165. package/dist/esm/common/wasm/exp.js +1 -1
  166. package/dist/esm/common/wasm/exp2.js +1 -1
  167. package/dist/esm/common/wasm/fft.js +1 -1
  168. package/dist/esm/common/wasm/frexp.js +1 -1
  169. package/dist/esm/common/wasm/gather.js +1 -1
  170. package/dist/esm/common/wasm/gcd.js +1 -1
  171. package/dist/esm/common/wasm/gradient.js +1 -1
  172. package/dist/esm/common/wasm/heaviside.js +1 -1
  173. package/dist/esm/common/wasm/hypot.js +1 -1
  174. package/dist/esm/common/wasm/indices.js +1 -1
  175. package/dist/esm/common/wasm/inner.js +1 -1
  176. package/dist/esm/common/wasm/isfinite.js +1 -0
  177. package/dist/esm/common/wasm/isnan.js +1 -0
  178. package/dist/esm/common/wasm/kron.js +1 -1
  179. package/dist/esm/common/wasm/ldexp.js +1 -1
  180. package/dist/esm/common/wasm/left_shift.js +1 -1
  181. package/dist/esm/common/wasm/lexsort.js +1 -1
  182. package/dist/esm/common/wasm/logaddexp.js +1 -1
  183. package/dist/esm/common/wasm/logical_and.js +1 -1
  184. package/dist/esm/common/wasm/logical_not.js +1 -1
  185. package/dist/esm/common/wasm/logical_or.js +1 -1
  186. package/dist/esm/common/wasm/logical_xor.js +1 -1
  187. package/dist/esm/common/wasm/lu.js +1 -0
  188. package/dist/esm/common/wasm/matmul.js +1 -1
  189. package/dist/esm/common/wasm/matvec.js +1 -1
  190. package/dist/esm/common/wasm/max.js +1 -1
  191. package/dist/esm/common/wasm/min.js +1 -1
  192. package/dist/esm/common/wasm/mul.js +1 -1
  193. package/dist/esm/common/wasm/neg.js +1 -1
  194. package/dist/esm/common/wasm/outer.js +1 -1
  195. package/dist/esm/common/wasm/pad.js +1 -1
  196. package/dist/esm/common/wasm/partition.js +1 -1
  197. package/dist/esm/common/wasm/power.js +1 -1
  198. package/dist/esm/common/wasm/qr.js +1 -1
  199. package/dist/esm/common/wasm/reciprocal.js +1 -1
  200. package/dist/esm/common/wasm/reduce_all.js +1 -1
  201. package/dist/esm/common/wasm/reduce_any.js +1 -1
  202. package/dist/esm/common/wasm/reduce_argmax.js +1 -1
  203. package/dist/esm/common/wasm/reduce_argmin.js +1 -1
  204. package/dist/esm/common/wasm/reduce_count_nz.js +1 -1
  205. package/dist/esm/common/wasm/reduce_max.js +1 -1
  206. package/dist/esm/common/wasm/reduce_mean.js +1 -1
  207. package/dist/esm/common/wasm/reduce_min.js +1 -1
  208. package/dist/esm/common/wasm/reduce_nanmax.js +1 -1
  209. package/dist/esm/common/wasm/reduce_nanmin.js +1 -1
  210. package/dist/esm/common/wasm/reduce_nansum.js +1 -1
  211. package/dist/esm/common/wasm/reduce_prod.js +1 -1
  212. package/dist/esm/common/wasm/reduce_quantile.js +1 -1
  213. package/dist/esm/common/wasm/reduce_std.js +1 -1
  214. package/dist/esm/common/wasm/reduce_sum.js +1 -1
  215. package/dist/esm/common/wasm/reduce_var.js +1 -1
  216. package/dist/esm/common/wasm/repeat.js +1 -1
  217. package/dist/esm/common/wasm/right_shift.js +1 -1
  218. package/dist/esm/common/wasm/rng.js +1 -1
  219. package/dist/esm/common/wasm/roll.js +1 -1
  220. package/dist/esm/common/wasm/runtime.js +1 -1
  221. package/dist/esm/common/wasm/searchsorted.js +1 -1
  222. package/dist/esm/common/wasm/sign.js +1 -1
  223. package/dist/esm/common/wasm/signbit.js +1 -0
  224. package/dist/esm/common/wasm/sin.js +1 -0
  225. package/dist/esm/common/wasm/sinh.js +1 -1
  226. package/dist/esm/common/wasm/sort.js +1 -1
  227. package/dist/esm/common/wasm/sqrt.js +1 -1
  228. package/dist/esm/common/wasm/square.js +1 -1
  229. package/dist/esm/common/wasm/sub.js +1 -1
  230. package/dist/esm/common/wasm/svd.js +1 -1
  231. package/dist/esm/common/wasm/tan.js +1 -1
  232. package/dist/esm/common/wasm/tanh.js +1 -1
  233. package/dist/esm/common/wasm/tile.js +1 -1
  234. package/dist/esm/common/wasm/unravel_index.js +1 -0
  235. package/dist/esm/common/wasm/vdot.js +1 -1
  236. package/dist/esm/common/wasm/vecdot.js +1 -1
  237. package/dist/esm/common/wasm/vecmat.js +1 -1
  238. package/dist/esm/common/wasm/vector_norm.js +1 -0
  239. package/dist/esm/core/advanced.js +1 -1
  240. package/dist/esm/core/creation.js +1 -1
  241. package/dist/esm/core/index.js +1 -1
  242. package/dist/esm/core/linalg.js +1 -1
  243. package/dist/esm/core/polynomial.js +1 -1
  244. package/dist/esm/core/reduction.js +1 -1
  245. package/dist/esm/core/shape-extra.js +1 -1
  246. package/dist/esm/core/statistics.js +1 -1
  247. package/dist/esm/full/index.js +1 -1
  248. package/dist/esm/full/ndarray.js +1 -1
  249. package/dist/esm/index.js +1 -1
  250. package/dist/esm/io/npy/parser.js +1 -1
  251. package/dist/esm/io/zip/reader.js +1 -1
  252. package/dist/numpy-ts.browser.js +6 -6
  253. package/dist/types/common/dtype.d.ts +46 -0
  254. package/dist/types/common/internal/indexing.d.ts +9 -0
  255. package/dist/types/common/ndarray-core.d.ts +20 -0
  256. package/dist/types/common/ops/advanced.d.ts +17 -2
  257. package/dist/types/common/ops/complex.d.ts +19 -1
  258. package/dist/types/common/ops/linalg.d.ts +1 -1
  259. package/dist/types/common/ops/reduction.d.ts +2 -2
  260. package/dist/types/common/ops/sets.d.ts +2 -1
  261. package/dist/types/common/ops/shape.d.ts +2 -2
  262. package/dist/types/common/ops/statistics.d.ts +2 -1
  263. package/dist/types/common/storage.d.ts +54 -2
  264. package/dist/types/common/wasm/all_finite.d.ts +8 -0
  265. package/dist/types/common/wasm/arccos.d.ts +4 -2
  266. package/dist/types/common/wasm/arcsin.d.ts +4 -2
  267. package/dist/types/common/wasm/arctan.d.ts +4 -2
  268. package/dist/types/common/wasm/arctan2.d.ts +17 -0
  269. package/dist/types/common/wasm/argpartition.d.ts +8 -3
  270. package/dist/types/common/wasm/argsort.d.ts +8 -3
  271. package/dist/types/common/wasm/bins/abs.wasm.d.ts +1 -0
  272. package/dist/types/common/wasm/bins/all_finite.wasm.d.ts +4 -0
  273. package/dist/types/common/wasm/bins/alloc.wasm.d.ts +6 -0
  274. package/dist/types/common/wasm/bins/arccos.wasm.d.ts +8 -2
  275. package/dist/types/common/wasm/bins/arcsin.wasm.d.ts +8 -2
  276. package/dist/types/common/wasm/bins/arctan.wasm.d.ts +8 -2
  277. package/dist/types/common/wasm/bins/arctan2.wasm.d.ts +11 -0
  278. package/dist/types/common/wasm/bins/convolve.wasm.d.ts +6 -0
  279. package/dist/types/common/wasm/bins/copysign.wasm.d.ts +2 -0
  280. package/dist/types/common/wasm/bins/correlate.wasm.d.ts +6 -0
  281. package/dist/types/common/wasm/bins/cos.wasm.d.ts +8 -0
  282. package/dist/types/common/wasm/bins/cosh.wasm.d.ts +8 -2
  283. package/dist/types/common/wasm/bins/divmod.wasm.d.ts +11 -0
  284. package/dist/types/common/wasm/bins/dot_float-relaxed.wasm.d.ts +5 -0
  285. package/dist/types/common/wasm/bins/dot_float.wasm.d.ts +5 -0
  286. package/dist/types/common/wasm/bins/dot_int.wasm.d.ts +5 -0
  287. package/dist/types/common/wasm/bins/exp.wasm.d.ts +8 -2
  288. package/dist/types/common/wasm/bins/exp2.wasm.d.ts +8 -2
  289. package/dist/types/common/wasm/bins/fft.wasm.d.ts +6 -0
  290. package/dist/types/common/wasm/bins/frexp.wasm.d.ts +1 -0
  291. package/dist/types/common/wasm/bins/gather.wasm.d.ts +0 -1
  292. package/dist/types/common/wasm/bins/gcd.wasm.d.ts +8 -0
  293. package/dist/types/common/wasm/bins/indices.wasm.d.ts +6 -2
  294. package/dist/types/common/wasm/bins/inner_float-relaxed.wasm.d.ts +5 -0
  295. package/dist/types/common/wasm/bins/inner_float.wasm.d.ts +5 -0
  296. package/dist/types/common/wasm/bins/inner_int.wasm.d.ts +5 -0
  297. package/dist/types/common/wasm/bins/isfinite.wasm.d.ts +4 -0
  298. package/dist/types/common/wasm/bins/isnan.wasm.d.ts +4 -0
  299. package/dist/types/common/wasm/bins/lexsort.wasm.d.ts +4 -4
  300. package/dist/types/common/wasm/bins/logical_and.wasm.d.ts +2 -0
  301. package/dist/types/common/wasm/bins/logical_not.wasm.d.ts +1 -0
  302. package/dist/types/common/wasm/bins/logical_or.wasm.d.ts +2 -0
  303. package/dist/types/common/wasm/bins/logical_xor.wasm.d.ts +2 -0
  304. package/dist/types/common/wasm/bins/lu.wasm.d.ts +7 -0
  305. package/dist/types/common/wasm/bins/matmul_float-relaxed.wasm.d.ts +5 -0
  306. package/dist/types/common/wasm/bins/matmul_float.wasm.d.ts +5 -0
  307. package/dist/types/common/wasm/bins/matmul_int.wasm.d.ts +5 -0
  308. package/dist/types/common/wasm/bins/matvec_float-relaxed.wasm.d.ts +5 -0
  309. package/dist/types/common/wasm/bins/matvec_float.wasm.d.ts +5 -0
  310. package/dist/types/common/wasm/bins/matvec_int.wasm.d.ts +5 -0
  311. package/dist/types/common/wasm/bins/neg.wasm.d.ts +1 -0
  312. package/dist/types/common/wasm/bins/qr.wasm.d.ts +0 -1
  313. package/dist/types/common/wasm/bins/reciprocal.wasm.d.ts +8 -4
  314. package/dist/types/common/wasm/bins/reduce_argmax.wasm.d.ts +8 -0
  315. package/dist/types/common/wasm/bins/reduce_argmin.wasm.d.ts +8 -0
  316. package/dist/types/common/wasm/bins/reduce_max.wasm.d.ts +1 -0
  317. package/dist/types/common/wasm/bins/reduce_min.wasm.d.ts +1 -0
  318. package/dist/types/common/wasm/bins/reduce_prod.wasm.d.ts +2 -0
  319. package/dist/types/common/wasm/bins/reduce_sum.wasm.d.ts +8 -2
  320. package/dist/types/common/wasm/bins/rng.wasm.d.ts +0 -3
  321. package/dist/types/common/wasm/bins/sign.wasm.d.ts +1 -0
  322. package/dist/types/common/wasm/bins/signbit.wasm.d.ts +8 -0
  323. package/dist/types/common/wasm/bins/sin.wasm.d.ts +11 -0
  324. package/dist/types/common/wasm/bins/sinh.wasm.d.ts +8 -2
  325. package/dist/types/common/wasm/bins/sort.wasm.d.ts +4 -4
  326. package/dist/types/common/wasm/bins/sqrt.wasm.d.ts +2 -2
  327. package/dist/types/common/wasm/bins/svd.wasm.d.ts +1 -0
  328. package/dist/types/common/wasm/bins/tan.wasm.d.ts +8 -0
  329. package/dist/types/common/wasm/bins/tanh.wasm.d.ts +8 -2
  330. package/dist/types/common/wasm/bins/unravel_index.wasm.d.ts +4 -0
  331. package/dist/types/common/wasm/bins/vecdot_float-relaxed.wasm.d.ts +5 -0
  332. package/dist/types/common/wasm/bins/vecdot_float.wasm.d.ts +5 -0
  333. package/dist/types/common/wasm/bins/vecdot_int.wasm.d.ts +5 -0
  334. package/dist/types/common/wasm/bins/vecmat_float-relaxed.wasm.d.ts +5 -0
  335. package/dist/types/common/wasm/bins/vecmat_float.wasm.d.ts +5 -0
  336. package/dist/types/common/wasm/bins/vecmat_int.wasm.d.ts +5 -0
  337. package/dist/types/common/wasm/bins/vector_norm-relaxed.wasm.d.ts +3 -0
  338. package/dist/types/common/wasm/bins/vector_norm.wasm.d.ts +3 -0
  339. package/dist/types/common/wasm/config.d.ts +25 -0
  340. package/dist/types/common/wasm/convolve.d.ts +1 -1
  341. package/dist/types/common/wasm/cos.d.ts +4 -2
  342. package/dist/types/common/wasm/cosh.d.ts +4 -2
  343. package/dist/types/common/wasm/detect.d.ts +17 -0
  344. package/dist/types/common/wasm/divide.d.ts +4 -0
  345. package/dist/types/common/wasm/divmod.d.ts +13 -0
  346. package/dist/types/common/wasm/exp.d.ts +4 -2
  347. package/dist/types/common/wasm/exp2.d.ts +4 -2
  348. package/dist/types/common/wasm/fft.d.ts +5 -5
  349. package/dist/types/common/wasm/frexp.d.ts +1 -0
  350. package/dist/types/common/wasm/gather.d.ts +4 -0
  351. package/dist/types/common/wasm/gcd.d.ts +1 -0
  352. package/dist/types/common/wasm/hypot.d.ts +4 -2
  353. package/dist/types/common/wasm/indices.d.ts +2 -1
  354. package/dist/types/common/wasm/isfinite.d.ts +7 -0
  355. package/dist/types/common/wasm/isnan.d.ts +7 -0
  356. package/dist/types/common/wasm/lexsort.d.ts +3 -1
  357. package/dist/types/common/wasm/logaddexp.d.ts +4 -2
  358. package/dist/types/common/wasm/lu.d.ts +27 -0
  359. package/dist/types/common/wasm/partition.d.ts +3 -1
  360. package/dist/types/common/wasm/reduce_argmax.d.ts +5 -0
  361. package/dist/types/common/wasm/reduce_argmin.d.ts +5 -0
  362. package/dist/types/common/wasm/reduce_prod.d.ts +4 -0
  363. package/dist/types/common/wasm/reduce_quantile.d.ts +11 -3
  364. package/dist/types/common/wasm/reduce_sum.d.ts +10 -0
  365. package/dist/types/common/wasm/rng.d.ts +10 -0
  366. package/dist/types/common/wasm/runtime.d.ts +113 -30
  367. package/dist/types/common/wasm/searchsorted.d.ts +3 -1
  368. package/dist/types/common/wasm/signbit.d.ts +14 -0
  369. package/dist/types/common/wasm/sin.d.ts +17 -0
  370. package/dist/types/common/wasm/sinh.d.ts +4 -2
  371. package/dist/types/common/wasm/sort.d.ts +4 -1
  372. package/dist/types/common/wasm/sqrt.d.ts +4 -2
  373. package/dist/types/common/wasm/svd.d.ts +6 -0
  374. package/dist/types/common/wasm/tan.d.ts +4 -2
  375. package/dist/types/common/wasm/tanh.d.ts +4 -2
  376. package/dist/types/common/wasm/unravel_index.d.ts +12 -0
  377. package/dist/types/common/wasm/vector_norm.d.ts +11 -0
  378. package/dist/types/core/advanced.d.ts +10 -2
  379. package/dist/types/core/creation.d.ts +1 -1
  380. package/dist/types/core/index.d.ts +2 -1
  381. package/dist/types/core/linalg.d.ts +1 -1
  382. package/dist/types/core/sets.d.ts +4 -1
  383. package/dist/types/core/statistics.d.ts +2 -1
  384. package/dist/types/full/index.d.ts +18 -5
  385. package/dist/types/index.d.ts +3 -1
  386. package/package.json +36 -43
  387. package/dist/esm/common/wasm/bins/dot.wasm.js +0 -1
  388. package/dist/esm/common/wasm/bins/flip.wasm.js +0 -1
  389. package/dist/esm/common/wasm/bins/inner.wasm.js +0 -1
  390. package/dist/esm/common/wasm/bins/matmul.wasm.js +0 -1
  391. package/dist/esm/common/wasm/bins/matvec.wasm.js +0 -1
  392. package/dist/esm/common/wasm/bins/reduce_quantile.wasm.js +0 -1
  393. package/dist/esm/common/wasm/bins/rot90.wasm.js +0 -1
  394. package/dist/esm/common/wasm/bins/vecdot.wasm.js +0 -1
  395. package/dist/esm/common/wasm/bins/vecmat.wasm.js +0 -1
  396. package/dist/esm/common/wasm/flip.js +0 -1
  397. package/dist/esm/common/wasm/rot90.js +0 -1
  398. package/dist/types/common/wasm/bins/dot.wasm.d.ts +0 -9
  399. package/dist/types/common/wasm/bins/flip.wasm.d.ts +0 -7
  400. package/dist/types/common/wasm/bins/inner.wasm.d.ts +0 -9
  401. package/dist/types/common/wasm/bins/matmul.wasm.d.ts +0 -9
  402. package/dist/types/common/wasm/bins/matvec.wasm.d.ts +0 -9
  403. package/dist/types/common/wasm/bins/reduce_quantile.wasm.d.ts +0 -2
  404. package/dist/types/common/wasm/bins/rot90.wasm.d.ts +0 -7
  405. package/dist/types/common/wasm/bins/vecdot.wasm.d.ts +0 -9
  406. package/dist/types/common/wasm/bins/vecmat.wasm.d.ts +0 -9
  407. package/dist/types/common/wasm/flip.d.ts +0 -13
  408. package/dist/types/common/wasm/rot90.d.ts +0 -14
@@ -1 +1 @@
1
- import*as o from"../core/index.js";import{NDArray as N}from"./ndarray.js";import{NDArrayCore as i}from"../common/ndarray-core.js";import{ArrayStorage as s}from"../common/storage.js";import{Complex as l}from"../common/complex.js";import{DEFAULT_DTYPE as y,getTypedArrayConstructor as b,promoteDTypes as d,isComplexDType as _}from"../common/dtype.js";const n=r=>{if(r instanceof N)return r;const e=r.base?n(r.base):void 0;return N.fromStorage(r.storage,e)};import{NDArray as Lt,meshgrid as Ut}from"./ndarray.js";import{NDArrayCore as Gt}from"../common/ndarray-core.js";import{Complex as Jt}from"../common/complex.js";function T(r,e){return n(o.broadcast_to(r,e))}function q(r,e,t){return n(o.take(r,e,t))}function z(r,e,t){return n(o.take_along_axis(r,e,t))}function j(r,e){return n(o.choose(r,e))}function S(r,e,t){return n(o.compress(r,e,t))}function F(r,e,t=0){return n(o.iindex(r,e,t))}function I(r,e,t){return n(o.bindex(r,e,t))}function P(r,e,t=0){return n(o.select(r,e,t))}function E(r,e="int32"){return n(o.indices(r,e))}function M(r,e,t="raise"){return n(o.ravel_multi_index(r,e,t))}function B(r,e){return o.unravel_index(r,e).map(n)}function L(r,e=2){return o.diag_indices(r,e).map(n)}function U(r){return o.diag_indices_from(r).map(n)}function Y(r,e=0,t){return o.tril_indices(r,e,t).map(n)}function G(r,e=0){return o.tril_indices_from(r,e).map(n)}function H(r,e=0,t){return o.triu_indices(r,e,t).map(n)}function J(r,e=0){return o.triu_indices_from(r,e).map(n)}function K(r,e,t=0){return o.mask_indices(r,e,t).map(n)}function O(r,e,t){const a=u=>r(n(u));return n(o.apply_along_axis(a,e,t))}function Q(r,e,t){const a=(u,p)=>r(n(u),p);return n(o.apply_over_axes(a,e,t))}function R(r,e){return n(o.add(r,e))}function V(r,e){return n(o.subtract(r,e))}function W(r,e){return n(o.multiply(r,e))}function X(r){return n(o.sqrt(r))}function Z(r,e){return n(o.power(r,e))}function $(r){return n(o.exp(r))}function rr(r){return n(o.exp2(r))}function er(r){return n(o.expm1(r))}function nr(r){return n(o.log(r))}function or(r){return n(o.log2(r))}function tr(r){return n(o.log10(r))}function ar(r){return n(o.log1p(r))}function ur(r,e){return n(o.logaddexp(r,e))}function ir(r,e){return n(o.logaddexp2(r,e))}function yr(r){return n(o.absolute(r))}function Dr(r){return n(o.negative(r))}function Ar(r){return n(o.sign(r))}function Nr(r,e){return n(o.mod(r,e))}function cr(r,e){return n(o.divide(r,e))}function mr(r,e){return n(o.floor_divide(r,e))}function pr(r){return n(o.positive(r))}function fr(r){return n(o.reciprocal(r))}function sr(r){return n(o.cbrt(r))}function br(r){return n(o.fabs(r))}function Cr(r,e){const t=o.divmod(r,e);return[n(t[0]),n(t[1])]}function xr(r){return n(o.square(r))}function lr(r,e){return n(o.remainder(r,e))}function dr(r,e){return n(o.heaviside(r,e))}function _r(r,e){return n(o.float_power(r,e))}function gr(r,e){return n(o.fmod(r,e))}function vr(r){const e=o.frexp(r);return[n(e[0]),n(e[1])]}function hr(r,e){return n(o.gcd(r,e))}function kr(r,e){return n(o.lcm(r,e))}function wr(r,e){return n(o.ldexp(r,e))}function Tr(r){const e=o.modf(r);return[n(e[0]),n(e[1])]}function qr(r,e,t){return n(o.clip(r,e,t))}function zr(r,e){return n(o.maximum(r,e))}function jr(r,e){return n(o.minimum(r,e))}function Sr(r,e){return n(o.fmax(r,e))}function Fr(r,e){return n(o.fmin(r,e))}function Ir(r,e=0,t,a){return n(o.nan_to_num(r,e,t,a))}function Pr(r,e,t,a,u){return n(o.interp(r,e,t,a,u))}function Er(r,e=Math.PI,t=-1,a=2*Math.PI){return n(o.unwrap(r,e,t,a))}function Mr(r){return n(o.sinc(r))}function Br(r){return n(o.i0(r))}function Lr(r,e){return n(o.bitwise_and(r,e))}function Ur(r,e){return n(o.bitwise_or(r,e))}function Yr(r,e){return n(o.bitwise_xor(r,e))}function Gr(r){return n(o.bitwise_not(r))}function Hr(r){return n(o.invert(r))}function Jr(r,e){return n(o.left_shift(r,e))}function Kr(r,e){return n(o.right_shift(r,e))}function Or(r,e,t){return n(o.packbits(r,e,t))}function Qr(r,e,t,a){return n(o.unpackbits(r,e,t,a))}function Rr(r){return n(o.bitwise_count(r))}function Vr(r){return n(o.bitwise_invert(r))}function Wr(r,e){return n(o.bitwise_left_shift(r,e))}function Xr(r,e){return n(o.bitwise_right_shift(r,e))}function Zr(r){return n(o.real(r))}function $r(r){return n(o.imag(r))}function re(r){return n(o.conj(r))}function ee(r,e){return n(o.angle(r,e))}function ne(r,e=y){return n(o.zeros(r,e))}function oe(r,e=y){return n(o.ones(r,e))}function te(r,e=y){return n(o.empty(r,e))}function ae(r,e,t){return n(o.full(r,e,t))}function ue(r,e){return n(o.array(r,e))}function ie(r,e,t=1,a=y){return n(o.arange(r,e,t,a))}function ye(r,e,t=50,a=y){return n(o.linspace(r,e,t,a))}function De(r,e,t=50,a=10,u=y){return n(o.logspace(r,e,t,a,u))}function Ae(r,e,t=50,a=y){return n(o.geomspace(r,e,t,a))}function Ne(r,e,t=0,a=y){return n(o.eye(r,e,t,a))}function ce(r,e=y){return n(o.identity(r,e))}function me(r,e){return n(o.asarray(r,e))}function pe(r,e){return n(o.zeros_like(r,e))}function fe(r,e){return n(o.ones_like(r,e))}function se(r,e){return n(o.empty_like(r,e))}function be(r,e,t){return n(o.full_like(r,e,t))}function Ce(r){return n(o.copy(r))}function xe(r,e){return n(o.asanyarray(r,e))}function le(r,e){return n(o.ascontiguousarray(r,e))}function de(r,e){return n(o.asfortranarray(r,e))}function _e(r,e){return n(o.asarray_chkfinite(r,e))}function ge(r,e,t){return n(o.require(r,e,t))}function ve(r,e=0){return n(o.diag(r,e))}function he(r,e=0){return n(o.diagflat(r,e))}function ke(r,e,t=0,a=y){return n(o.tri(r,e,t,a))}function we(r,e=0){return n(o.tril(r,e))}function Te(r,e=0){return n(o.triu(r,e))}function qe(r,e,t=!1){return n(o.vander(r,e,t))}function ze(r,e=y,t=-1,a=0){return n(o.frombuffer(r,e,t,a))}function je(r,e,t=y){return n(o.fromfunction(r,e,t))}function Se(r,e=y,t=-1){return n(o.fromiter(r,e,t))}function Fe(r,e=y,t=-1,a){return n(o.fromstring(r,e,t,a))}function Ie(r,e=y,t=-1,a=""){return n(o.fromfile(r,e,t,a))}function Pe(r,e,t){return n(o.diff(r,e,t))}function Ee(r,e,t){return n(o.ediff1d(r,e,t))}function Me(r,e){const t=o.dot(r,e);return t instanceof i?n(t):t}function Be(r,e=0,t=0,a=1){const u=o.trace(r,e,t,a);return u instanceof i?n(u):u}function Le(r,e=0,t=0,a=1){return n(o.diagonal(r,e,t,a))}function Ue(r,e){return n(o.kron(r,e))}function Ye(r,e){return n(o.transpose(r,e))}function Ge(r,e){const t=o.inner(r,e);return t instanceof i?n(t):t}function He(r,e){return n(o.outer(r,e))}function Je(r,e,t=2){const a=o.tensordot(r,e,t);return a instanceof i?n(a):a}function Ke(r,e,t=-1){const a=o.vecdot(r,e,t);return a instanceof i?n(a):a}function Oe(r){return n(o.matrix_transpose(r))}function Qe(r,e){return n(o.permute_dims(r,e))}function Re(r,e){return n(o.matvec(r,e))}function Ve(r,e){return n(o.vecmat(r,e))}function We(r,e,t=-1,a=-1,u=-1,p){const D=o.cross(r,e,t,a,u,p),A=d(r.dtype,e.dtype);if(D instanceof l){const c=b(A==="complex64"?"float32":"float64"),m=new c(2);return m[0]=D.re,m[1]=D.im,N.fromStorage(s.fromData(m,[],A))}if(typeof D=="number"||typeof D=="bigint"){if(_(A)){const x=b(A==="complex64"?"float32":"float64"),f=new x(2);return f[0]=Number(D),f[1]=0,N.fromStorage(s.fromData(f,[],A))}const C=b(A),c=new C(1);return c[0]=D,N.fromStorage(s.fromData(c,[],A))}return n(D)}function Xe(r,e){return n(o.matmul(r,e))}function Ze(r,e){return n(o.logical_and(r,e))}function $e(r,e){return n(o.logical_or(r,e))}function rn(r){return n(o.logical_not(r))}function en(r,e){return n(o.logical_xor(r,e))}function nn(r){return n(o.isfinite(r))}function on(r){return n(o.isinf(r))}function tn(r){return n(o.isnan(r))}function an(r){return n(o.isnat(r))}function un(r){return n(o.isneginf(r))}function yn(r){return n(o.isposinf(r))}function Dn(r){return n(o.iscomplex(r))}function An(r){return n(o.isreal(r))}function Nn(r,e){return n(o.real_if_close(r,e))}function cn(r,e){return n(o.copysign(r,e))}function mn(r){return n(o.signbit(r))}function pn(r,e){return n(o.nextafter(r,e))}function fn(r){return n(o.spacing(r))}function sn(r,e){return n(o.greater(r,e))}function bn(r,e){return n(o.greater_equal(r,e))}function Cn(r,e){return n(o.less(r,e))}function xn(r,e){return n(o.less_equal(r,e))}function ln(r,e){return n(o.equal(r,e))}function dn(r,e){return n(o.not_equal(r,e))}function _n(r,e,t=1e-5,a=1e-8){return n(o.isclose(r,e,t,a))}function gn(r){return n(o.poly(r))}function vn(r,e){return n(o.polyadd(r,e))}function hn(r,e=1){return n(o.polyder(r,e))}function kn(r,e){const t=o.polydiv(r,e);return[n(t[0]),n(t[1])]}function wn(r,e,t){return n(o.polyfit(r,e,t))}function Tn(r,e=1,t=0){return n(o.polyint(r,e,t))}function qn(r,e){return n(o.polymul(r,e))}function zn(r,e){return n(o.polysub(r,e))}function jn(r,e){const t=o.polyval(r,e);return t instanceof i?n(t):t}function Sn(r){return n(o.roots(r))}function Fn(r,e,t){const a=o.sum(r,e,t);return a instanceof i?n(a):a}function In(r,e,t){const a=o.mean(r,e,t);return a instanceof i?n(a):a}function Pn(r,e,t){const a=o.prod(r,e,t);return a instanceof i?n(a):a}function En(r,e,t){const a=o.max(r,e,t);return a instanceof i?n(a):a}function Mn(r,e,t){const a=o.min(r,e,t);return a instanceof i?n(a):a}function Bn(r,e,t){const a=o.ptp(r,e,t);return a instanceof i?n(a):a}function Ln(r,e){const t=o.argmin(r,e);return t instanceof i?n(t):t}function Un(r,e){const t=o.argmax(r,e);return t instanceof i?n(t):t}function Yn(r,e,t,a){const u=o.variance(r,e,t,a);return u instanceof i?n(u):u}function Gn(r,e,t,a){const u=o.std(r,e,t,a);return u instanceof i?n(u):u}function Hn(r,e,t){const a=o.median(r,e,t);return a instanceof i?n(a):a}function Jn(r,e,t,a){const u=o.percentile(r,e,t,a);return u instanceof i?n(u):u}function Kn(r,e,t,a){const u=o.quantile(r,e,t,a);return u instanceof i?n(u):u}function On(r,e,t,a){const u=o.average(r,e,t,a);return u instanceof i?n(u):u}function Qn(r,e,t){const a=o.all(r,e,t);return a instanceof i?n(a):a}function Rn(r,e,t){const a=o.any(r,e,t);return a instanceof i?n(a):a}function Vn(r,e){return n(o.cumsum(r,e))}function Wn(r,e){return n(o.cumprod(r,e))}function Xn(r,e,t){const a=o.nansum(r,e,t);return a instanceof i?n(a):a}function Zn(r,e,t){const a=o.nanprod(r,e,t);return a instanceof i?n(a):a}function $n(r,e,t){const a=o.nanmean(r,e,t);return a instanceof i?n(a):a}function ro(r,e,t,a){const u=o.nanvar(r,e,t,a);return u instanceof i?n(u):u}function eo(r,e,t,a){const u=o.nanstd(r,e,t,a);return u instanceof i?n(u):u}function no(r,e,t){const a=o.nanmin(r,e,t);return a instanceof i?n(a):a}function oo(r,e,t){const a=o.nanmax(r,e,t);return a instanceof i?n(a):a}function to(r,e){const t=o.nanargmin(r,e);return t instanceof i?n(t):t}function ao(r,e){const t=o.nanargmax(r,e);return t instanceof i?n(t):t}function uo(r,e){return n(o.nancumsum(r,e))}function io(r,e){return n(o.nancumprod(r,e))}function yo(r,e,t){const a=o.nanmedian(r,e,t);return a instanceof i?n(a):a}function Do(r,e,t,a){const u=o.nanquantile(r,e,t,a);return u instanceof i?n(u):u}function Ao(r,e,t,a){const u=o.nanpercentile(r,e,t,a);return u instanceof i?n(u):u}function No(r,e=0){return n(o.around(r,e))}function co(r,e=0){return n(o.round(r,e))}function mo(r){return n(o.ceil(r))}function po(r){return n(o.fix(r))}function fo(r){return n(o.floor(r))}function so(r){return n(o.rint(r))}function bo(r){return n(o.trunc(r))}function Co(r,e){return n(o.in1d(r,e))}function xo(r,e){return n(o.intersect1d(r,e))}function lo(r,e){return n(o.isin(r,e))}function _o(r,e){return n(o.setdiff1d(r,e))}function go(r,e){return n(o.setxor1d(r,e))}function vo(r,e){return n(o.union1d(r,e))}function ho(r,e){return n(o.trim_zeros(r,e))}function ko(r){return n(o.unique_values(r))}function wo(r,e,t){return n(o.append(r,e,t))}function To(r,e,t){return n(o.delete(r,e,t))}function qo(r,e,t,a){return n(o.insert(r,e,t,a))}function zo(r,e,t="constant",a=0){return n(o.pad(r,e,t,a))}function jo(r,e){return n(o.reshape(r,e))}function So(r){return n(o.flatten(r))}function Fo(r){return n(o.ravel(r))}function Io(r,e){return n(o.squeeze(r,e))}function Po(r,e){return n(o.expand_dims(r,e))}function Eo(r,e,t){return n(o.swapaxes(r,e,t))}function Mo(r,e,t){return n(o.moveaxis(r,e,t))}function Bo(r,e,t=0){return n(o.rollaxis(r,e,t))}function Lo(r,e=0){return n(o.concatenate(r,e))}function Uo(r,e=0){return n(o.stack(r,e))}function Yo(r){return n(o.vstack(r))}function Go(r){return n(o.hstack(r))}function Ho(r){return n(o.dstack(r))}function Jo(r,e=0){return n(o.concat(r,e))}function Ko(r){return n(o.column_stack(r))}function Oo(r){return n(o.block(r))}function Qo(r,e=0){return o.unstack(r,e).map(n)}function Ro(r,e){return n(o.tile(r,e))}function Vo(r,e,t){return n(o.repeat(r,e,t))}function Wo(r,e){return n(o.flip(r,e))}function Xo(r){return n(o.fliplr(r))}function Zo(r){return n(o.flipud(r))}function $o(r,e=1,t=[0,1]){return n(o.rot90(r,e,t))}function rt(r,e,t){return n(o.roll(r,e,t))}function et(r,e){return n(o.resize(r,e))}function nt(r,e=-1){return n(o.sort(r,e))}function ot(r,e=-1){return n(o.argsort(r,e))}function tt(r){return n(o.lexsort(r))}function at(r,e,t=-1){return n(o.partition(r,e,t))}function ut(r,e,t=-1){return n(o.argpartition(r,e,t))}function it(r){return n(o.sort_complex(r))}function yt(r){return o.nonzero(r).map(n)}function Dt(r){return n(o.argwhere(r))}function At(r){return n(o.flatnonzero(r))}function Nt(r,e){return n(o.extract(r,e))}function ct(r,e,t){return n(o.bincount(r,e,t))}function mt(r,e,t){return n(o.digitize(r,e,t))}function pt(r,e,t){return n(o.correlate(r,e,t))}function ft(r,e,t){return n(o.convolve(r,e,t))}function st(r,e,t,a,u){return n(o.cov(r,e,t,a,u))}function bt(r,e,t){return n(o.corrcoef(r,e,t))}function Ct(r,e,t,a){const u=o.trapezoid(r,e,t,a);return u instanceof i?n(u):u}function xt(r){return n(o.sin(r))}function lt(r){return n(o.cos(r))}function dt(r){return n(o.tan(r))}function _t(r){return n(o.arcsin(r))}function gt(r){return n(o.arccos(r))}function vt(r){return n(o.arctan(r))}function ht(r,e){return n(o.arctan2(r,e))}function kt(r,e){return n(o.hypot(r,e))}function wt(r){return n(o.degrees(r))}function Tt(r){return n(o.radians(r))}function qt(r){return n(o.deg2rad(r))}function zt(r){return n(o.rad2deg(r))}function jt(r){return n(o.sinh(r))}function St(r){return n(o.cosh(r))}function Ft(r){return n(o.tanh(r))}function It(r){return n(o.arcsinh(r))}function Pt(r){return n(o.arccosh(r))}function Et(r){return n(o.arctanh(r))}import{broadcast_arrays as Ot,broadcast_shapes as Qt,put as Rt,put_along_axis as Vt,place as Wt,putmask as Xt,copyto as Zt,ix_ as $t,fill_diagonal as ra,array_equal as ea,array_equiv as na,may_share_memory as oa,shares_memory as ta,geterr as aa,seterr as ua,pow as ia,abs as ya,true_divide as Da,conjugate as Aa,array2string as Na,array_repr as ca,array_str as ma,set_printoptions as pa,get_printoptions as fa,printoptions as sa,format_float_positional as ba,format_float_scientific as Ca,base_repr as xa,binary_repr as la,gradient as da,einsum as _a,einsum_path as ga,vdot as va,linalg as ha,iscomplexobj as ka,isrealobj as wa,isfortran as Ta,isscalar as qa,iterable as za,isdtype as ja,promote_types as Sa,allclose as Fa,amax as Ia,amin as Pa,var_ as Ea,cumulative_sum as Ma,cumulative_prod as Ba,unique as La,unique_all as Ua,unique_counts as Ya,unique_inverse as Ga,split as Ha,array_split as Ja,vsplit as Ka,hsplit as Oa,dsplit as Qa,atleast_1d as Ra,atleast_2d as Va,atleast_3d as Wa,row_stack as Xa,where as Za,searchsorted as $a,count_nonzero as ru,histogram as eu,histogram2d as nu,histogramdd as ou,histogram_bin_edges as tu,asin as au,acos as uu,atan as iu,atan2 as yu,asinh as Du,acosh as Au,atanh as Nu,can_cast as cu,common_type as mu,result_type as pu,min_scalar_type as fu,issubdtype as su,typename as bu,mintypecode as Cu,ndim as xu,shape as lu,size as du,item as _u,tolist as gu,tobytes as vu,byteswap as hu,view as ku,tofile as wu,fill as Tu}from"../core/index.js";export{Jt as Complex,Lt as NDArray,Gt as NDArrayCore,ya as abs,yr as absolute,uu as acos,Au as acosh,R as add,Qn as all,Fa as allclose,Ia as amax,Pa as amin,ee as angle,Rn as any,wo as append,O as apply_along_axis,Q as apply_over_axes,ie as arange,gt as arccos,Pt as arccosh,_t as arcsin,It as arcsinh,vt as arctan,ht as arctan2,Et as arctanh,Un as argmax,Ln as argmin,ut as argpartition,ot as argsort,Dt as argwhere,No as around,ue as array,Na as array2string,ea as array_equal,na as array_equiv,ca as array_repr,Ja as array_split,ma as array_str,xe as asanyarray,me as asarray,_e as asarray_chkfinite,le as ascontiguousarray,de as asfortranarray,au as asin,Du as asinh,iu as atan,yu as atan2,Nu as atanh,Ra as atleast_1d,Va as atleast_2d,Wa as atleast_3d,On as average,xa as base_repr,la as binary_repr,ct as bincount,I as bindex,Lr as bitwise_and,Rr as bitwise_count,Vr as bitwise_invert,Wr as bitwise_left_shift,Gr as bitwise_not,Ur as bitwise_or,Xr as bitwise_right_shift,Yr as bitwise_xor,Oo as block,Ot as broadcast_arrays,Qt as broadcast_shapes,T as broadcast_to,hu as byteswap,cu as can_cast,sr as cbrt,mo as ceil,j as choose,qr as clip,Ko as column_stack,mu as common_type,S as compress,Jo as concat,Lo as concatenate,re as conj,Aa as conjugate,ft as convolve,Ce as copy,cn as copysign,Zt as copyto,bt as corrcoef,pt as correlate,lt as cos,St as cosh,ru as count_nonzero,st as cov,We as cross,Wn as cumprod,Vn as cumsum,Ba as cumulative_prod,Ma as cumulative_sum,qt as deg2rad,wt as degrees,To as delete_,ve as diag,L as diag_indices,U as diag_indices_from,he as diagflat,Le as diagonal,Pe as diff,mt as digitize,cr as divide,Cr as divmod,Me as dot,Qa as dsplit,Ho as dstack,Ee as ediff1d,_a as einsum,ga as einsum_path,te as empty,se as empty_like,ln as equal,$ as exp,rr as exp2,Po as expand_dims,er as expm1,Nt as extract,Ne as eye,br as fabs,Tu as fill,ra as fill_diagonal,po as fix,At as flatnonzero,So as flatten,Wo as flip,Xo as fliplr,Zo as flipud,_r as float_power,fo as floor,mr as floor_divide,Sr as fmax,Fr as fmin,gr as fmod,ba as format_float_positional,Ca as format_float_scientific,vr as frexp,ze as frombuffer,Ie as fromfile,je as fromfunction,Se as fromiter,Fe as fromstring,ae as full,be as full_like,hr as gcd,Ae as geomspace,fa as get_printoptions,aa as geterr,da as gradient,sn as greater,bn as greater_equal,dr as heaviside,eu as histogram,nu as histogram2d,tu as histogram_bin_edges,ou as histogramdd,Oa as hsplit,Go as hstack,kt as hypot,Br as i0,ce as identity,F as iindex,$r as imag,Co as in1d,E as indices,Ge as inner,qo as insert,Pr as interp,xo as intersect1d,Hr as invert,_n as isclose,Dn as iscomplex,ka as iscomplexobj,ja as isdtype,nn as isfinite,Ta as isfortran,lo as isin,on as isinf,tn as isnan,an as isnat,un as isneginf,yn as isposinf,An as isreal,wa as isrealobj,qa as isscalar,su as issubdtype,_u as item,za as iterable,$t as ix_,Ue as kron,kr as lcm,wr as ldexp,Jr as left_shift,Cn as less,xn as less_equal,tt as lexsort,ha as linalg,ye as linspace,nr as log,tr as log10,ar as log1p,or as log2,ur as logaddexp,ir as logaddexp2,Ze as logical_and,rn as logical_not,$e as logical_or,en as logical_xor,De as logspace,K as mask_indices,Xe as matmul,Oe as matrix_transpose,Re as matvec,En as max,zr as maximum,oa as may_share_memory,In as mean,Hn as median,Ut as meshgrid,Mn as min,fu as min_scalar_type,jr as minimum,Cu as mintypecode,Nr as mod,Tr as modf,Mo as moveaxis,W as multiply,Ir as nan_to_num,ao as nanargmax,to as nanargmin,io as nancumprod,uo as nancumsum,oo as nanmax,$n as nanmean,yo as nanmedian,no as nanmin,Ao as nanpercentile,Zn as nanprod,Do as nanquantile,eo as nanstd,Xn as nansum,ro as nanvar,xu as ndim,Dr as negative,pn as nextafter,yt as nonzero,dn as not_equal,oe as ones,fe as ones_like,He as outer,Or as packbits,zo as pad,at as partition,Jn as percentile,Qe as permute_dims,Wt as place,gn as poly,vn as polyadd,hn as polyder,kn as polydiv,wn as polyfit,Tn as polyint,qn as polymul,zn as polysub,jn as polyval,pr as positive,ia as pow,Z as power,sa as printoptions,Pn as prod,Sa as promote_types,Bn as ptp,Rt as put,Vt as put_along_axis,Xt as putmask,Kn as quantile,zt as rad2deg,Tt as radians,Fo as ravel,M as ravel_multi_index,Zr as real,Nn as real_if_close,fr as reciprocal,lr as remainder,Vo as repeat,ge as require,jo as reshape,et as resize,pu as result_type,Kr as right_shift,so as rint,rt as roll,Bo as rollaxis,Sn as roots,$o as rot90,co as round,Xa as row_stack,$a as searchsorted,P as select,pa as set_printoptions,_o as setdiff1d,ua as seterr,go as setxor1d,lu as shape,ta as shares_memory,Ar as sign,mn as signbit,xt as sin,Mr as sinc,jt as sinh,du as size,nt as sort,it as sort_complex,fn as spacing,Ha as split,X as sqrt,xr as square,Io as squeeze,Uo as stack,Gn as std,V as subtract,Fn as sum,Eo as swapaxes,q as take,z as take_along_axis,dt as tan,Ft as tanh,Je as tensordot,Ro as tile,vu as tobytes,wu as tofile,gu as tolist,Be as trace,Ye as transpose,Ct as trapezoid,ke as tri,we as tril,Y as tril_indices,G as tril_indices_from,ho as trim_zeros,Te as triu,H as triu_indices,J as triu_indices_from,Da as true_divide,bo as trunc,bu as typename,vo as union1d,La as unique,Ua as unique_all,Ya as unique_counts,Ga as unique_inverse,ko as unique_values,Qr as unpackbits,B as unravel_index,Qo as unstack,Er as unwrap,qe as vander,Ea as var_,Yn as variance,va as vdot,Ke as vecdot,Ve as vecmat,ku as view,Ka as vsplit,Yo as vstack,Za as where,ne as zeros,pe as zeros_like};
1
+ import*as o from"../core/index.js";import{NDArray as N}from"./ndarray.js";import{NDArrayCore as i}from"../common/ndarray-core.js";import{ArrayStorage as s}from"../common/storage.js";import{Complex as l}from"../common/complex.js";import{DEFAULT_DTYPE as y,getTypedArrayConstructor as b,promoteDTypes as d,isComplexDType as _}from"../common/dtype.js";const n=r=>{if(r instanceof N)return r;const e=r.base?n(r.base):void 0;return N.fromStorage(r.storage,e)};import{NDArray as Ut,meshgrid as Wt}from"./ndarray.js";import{NDArrayCore as Gt}from"../common/ndarray-core.js";import{Complex as Jt}from"../common/complex.js";function T(r,e){return n(o.broadcast_to(r,e))}function q(r,e,t){return n(o.take(r,e,t))}function z(r,e,t){return n(o.take_along_axis(r,e,t))}function j(r,e){return n(o.choose(r,e))}function S(r,e,t){return n(o.compress(r,e,t))}function I(r,e,t=0){return n(o.iindex(r,e,t))}function F(r,e,t){return n(o.bindex(r,e,t))}function P(r,e,t=0){return n(o.select(r,e,t))}function E(r,e="float64"){return n(o.indices(r,e))}function M(r,e,t="raise"){return n(o.ravel_multi_index(r,e,t))}function B(r,e){return o.unravel_index(r,e).map(n)}function L(r,e=2){return o.diag_indices(r,e).map(n)}function U(r){return o.diag_indices_from(r).map(n)}function W(r,e=0,t){return o.tril_indices(r,e,t).map(n)}function Y(r,e=0){return o.tril_indices_from(r,e).map(n)}function G(r,e=0,t){return o.triu_indices(r,e,t).map(n)}function H(r,e=0){return o.triu_indices_from(r,e).map(n)}function J(r,e,t=0){return o.mask_indices(r,e,t).map(n)}function K(r,e,t){const a=u=>r(n(u));return n(o.apply_along_axis(a,e,t))}function O(r,e,t){const a=(u,p)=>r(n(u),p);return n(o.apply_over_axes(a,e,t))}function Q(r,...e){return n(o.vindex(r,...e))}function R(r,e){return n(o.add(r,e))}function V(r,e){return n(o.subtract(r,e))}function X(r,e){return n(o.multiply(r,e))}function Z(r){return n(o.sqrt(r))}function $(r,e){return n(o.power(r,e))}function rr(r){return n(o.exp(r))}function er(r){return n(o.exp2(r))}function nr(r){return n(o.expm1(r))}function or(r){return n(o.log(r))}function tr(r){return n(o.log2(r))}function ar(r){return n(o.log10(r))}function ur(r){return n(o.log1p(r))}function ir(r,e){return n(o.logaddexp(r,e))}function yr(r,e){return n(o.logaddexp2(r,e))}function Dr(r){return n(o.absolute(r))}function Ar(r){return n(o.negative(r))}function Nr(r){return n(o.sign(r))}function cr(r,e){return n(o.mod(r,e))}function mr(r,e){return n(o.divide(r,e))}function pr(r,e){return n(o.floor_divide(r,e))}function fr(r){return n(o.positive(r))}function sr(r){return n(o.reciprocal(r))}function br(r){return n(o.cbrt(r))}function xr(r){return n(o.fabs(r))}function Cr(r,e){const t=o.divmod(r,e);return[n(t[0]),n(t[1])]}function lr(r){return n(o.square(r))}function dr(r,e){return n(o.remainder(r,e))}function _r(r,e){return n(o.heaviside(r,e))}function gr(r,e){return n(o.float_power(r,e))}function vr(r,e){return n(o.fmod(r,e))}function hr(r){const e=o.frexp(r);return[n(e[0]),n(e[1])]}function kr(r,e){return n(o.gcd(r,e))}function wr(r,e){return n(o.lcm(r,e))}function Tr(r,e){return n(o.ldexp(r,e))}function qr(r){const e=o.modf(r);return[n(e[0]),n(e[1])]}function zr(r,e,t){return n(o.clip(r,e,t))}function jr(r,e){return n(o.maximum(r,e))}function Sr(r,e){return n(o.minimum(r,e))}function Ir(r,e){return n(o.fmax(r,e))}function Fr(r,e){return n(o.fmin(r,e))}function Pr(r,e=0,t,a){return n(o.nan_to_num(r,e,t,a))}function Er(r,e,t,a,u){return n(o.interp(r,e,t,a,u))}function Mr(r,e=Math.PI,t=-1,a=2*Math.PI){return n(o.unwrap(r,e,t,a))}function Br(r){return n(o.sinc(r))}function Lr(r){return n(o.i0(r))}function Ur(r,e){return n(o.bitwise_and(r,e))}function Wr(r,e){return n(o.bitwise_or(r,e))}function Yr(r,e){return n(o.bitwise_xor(r,e))}function Gr(r){return n(o.bitwise_not(r))}function Hr(r){return n(o.invert(r))}function Jr(r,e){return n(o.left_shift(r,e))}function Kr(r,e){return n(o.right_shift(r,e))}function Or(r,e,t){return n(o.packbits(r,e,t))}function Qr(r,e,t,a){return n(o.unpackbits(r,e,t,a))}function Rr(r){return n(o.bitwise_count(r))}function Vr(r){return n(o.bitwise_invert(r))}function Xr(r,e){return n(o.bitwise_left_shift(r,e))}function Zr(r,e){return n(o.bitwise_right_shift(r,e))}function $r(r){return n(o.real(r))}function re(r){return n(o.imag(r))}function ee(r){return n(o.conj(r))}function ne(r,e){return n(o.angle(r,e))}function oe(r,e=y){return n(o.zeros(r,e))}function te(r,e=y){return n(o.ones(r,e))}function ae(r,e=y){return n(o.empty(r,e))}function ue(r,e,t){return n(o.full(r,e,t))}function ie(r,e){return n(o.array(r,e))}function ye(r,e,t=1,a){return n(o.arange(r,e,t,a))}function De(r,e,t=50,a=y){return n(o.linspace(r,e,t,a))}function Ae(r,e,t=50,a=10,u=y){return n(o.logspace(r,e,t,a,u))}function Ne(r,e,t=50,a=y){return n(o.geomspace(r,e,t,a))}function ce(r,e,t=0,a=y){return n(o.eye(r,e,t,a))}function me(r,e=y){return n(o.identity(r,e))}function pe(r,e){return n(o.asarray(r,e))}function fe(r,e){return n(o.zeros_like(r,e))}function se(r,e){return n(o.ones_like(r,e))}function be(r,e){return n(o.empty_like(r,e))}function xe(r,e,t){return n(o.full_like(r,e,t))}function Ce(r){return n(o.copy(r))}function le(r,e){return n(o.asanyarray(r,e))}function de(r,e){return n(o.ascontiguousarray(r,e))}function _e(r,e){return n(o.asfortranarray(r,e))}function ge(r,e){return n(o.asarray_chkfinite(r,e))}function ve(r,e,t){return n(o.require(r,e,t))}function he(r,e=0){return n(o.diag(r,e))}function ke(r,e=0){return n(o.diagflat(r,e))}function we(r,e,t=0,a=y){return n(o.tri(r,e,t,a))}function Te(r,e=0){return n(o.tril(r,e))}function qe(r,e=0){return n(o.triu(r,e))}function ze(r,e,t=!1){return n(o.vander(r,e,t))}function je(r,e=y,t=-1,a=0){return n(o.frombuffer(r,e,t,a))}function Se(r,e,t=y){return n(o.fromfunction(r,e,t))}function Ie(r,e=y,t=-1){return n(o.fromiter(r,e,t))}function Fe(r,e=y,t=-1,a){return n(o.fromstring(r,e,t,a))}function Pe(r,e=y,t=-1,a=""){return n(o.fromfile(r,e,t,a))}function Ee(r,e,t){return n(o.diff(r,e,t))}function Me(r,e,t){return n(o.ediff1d(r,e,t))}function Be(r,e){const t=o.dot(r,e);return t instanceof i?n(t):t}function Le(r,e=0,t=0,a=1){const u=o.trace(r,e,t,a);return u instanceof i?n(u):u}function Ue(r,e=0,t=0,a=1){return n(o.diagonal(r,e,t,a))}function We(r,e){return n(o.kron(r,e))}function Ye(r,e){return n(o.transpose(r,e))}function Ge(r,e){const t=o.inner(r,e);return t instanceof i?n(t):t}function He(r,e){return n(o.outer(r,e))}function Je(r,e,t=2){const a=o.tensordot(r,e,t);return a instanceof i?n(a):a}function Ke(r,e,t=-1){const a=o.vecdot(r,e,t);return a instanceof i?n(a):a}function Oe(r){return n(o.matrix_transpose(r))}function Qe(r,e){return n(o.permute_dims(r,e))}function Re(r,e){return n(o.matvec(r,e))}function Ve(r,e){return n(o.vecmat(r,e))}function Xe(r,e,t=-1,a=-1,u=-1,p){const D=o.cross(r,e,t,a,u,p),A=d(r.dtype,e.dtype);if(D instanceof l){const c=b(A==="complex64"?"float32":"float64"),m=new c(2);return m[0]=D.re,m[1]=D.im,N.fromStorage(s.fromData(m,[],A))}if(typeof D=="number"||typeof D=="bigint"){if(_(A)){const C=b(A==="complex64"?"float32":"float64"),f=new C(2);return f[0]=Number(D),f[1]=0,N.fromStorage(s.fromData(f,[],A))}const x=b(A),c=new x(1);return c[0]=D,N.fromStorage(s.fromData(c,[],A))}return n(D)}function Ze(r,e){return n(o.matmul(r,e))}function $e(r,e){return n(o.logical_and(r,e))}function rn(r,e){return n(o.logical_or(r,e))}function en(r){return n(o.logical_not(r))}function nn(r,e){return n(o.logical_xor(r,e))}function on(r){return n(o.isfinite(r))}function tn(r){return n(o.isinf(r))}function an(r){return n(o.isnan(r))}function un(r){return n(o.isnat(r))}function yn(r){return n(o.isneginf(r))}function Dn(r){return n(o.isposinf(r))}function An(r){return n(o.iscomplex(r))}function Nn(r){return n(o.isreal(r))}function cn(r,e){return n(o.real_if_close(r,e))}function mn(r,e){return n(o.copysign(r,e))}function pn(r){return n(o.signbit(r))}function fn(r,e){return n(o.nextafter(r,e))}function sn(r){return n(o.spacing(r))}function bn(r,e){return n(o.greater(r,e))}function xn(r,e){return n(o.greater_equal(r,e))}function Cn(r,e){return n(o.less(r,e))}function ln(r,e){return n(o.less_equal(r,e))}function dn(r,e){return n(o.equal(r,e))}function _n(r,e){return n(o.not_equal(r,e))}function gn(r,e,t=1e-5,a=1e-8){return n(o.isclose(r,e,t,a))}function vn(r){return n(o.poly(r))}function hn(r,e){return n(o.polyadd(r,e))}function kn(r,e=1){return n(o.polyder(r,e))}function wn(r,e){const t=o.polydiv(r,e);return[n(t[0]),n(t[1])]}function Tn(r,e,t){return n(o.polyfit(r,e,t))}function qn(r,e=1,t=0){return n(o.polyint(r,e,t))}function zn(r,e){return n(o.polymul(r,e))}function jn(r,e){return n(o.polysub(r,e))}function Sn(r,e){const t=o.polyval(r,e);return t instanceof i?n(t):t}function In(r){return n(o.roots(r))}function Fn(r,e,t){const a=o.sum(r,e,t);return a instanceof i?n(a):a}function Pn(r,e,t){const a=o.mean(r,e,t);return a instanceof i?n(a):a}function En(r,e,t){const a=o.prod(r,e,t);return a instanceof i?n(a):a}function Mn(r,e,t){const a=o.max(r,e,t);return a instanceof i?n(a):a}function Bn(r,e,t){const a=o.min(r,e,t);return a instanceof i?n(a):a}function Ln(r,e,t){const a=o.ptp(r,e,t);return a instanceof i?n(a):a}function Un(r,e){const t=o.argmin(r,e);return t instanceof i?n(t):t}function Wn(r,e){const t=o.argmax(r,e);return t instanceof i?n(t):t}function Yn(r,e,t,a){const u=o.variance(r,e,t,a);return u instanceof i?n(u):u}function Gn(r,e,t,a){const u=o.std(r,e,t,a);return u instanceof i?n(u):u}function Hn(r,e,t){const a=o.median(r,e,t);return a instanceof i?n(a):a}function Jn(r,e,t,a){const u=o.percentile(r,e,t,a);return u instanceof i?n(u):u}function Kn(r,e,t,a){const u=o.quantile(r,e,t,a);return u instanceof i?n(u):u}function On(r,e,t,a){const u=o.average(r,e,t,a);return u instanceof i?n(u):u}function Qn(r,e,t){const a=o.all(r,e,t);return a instanceof i?n(a):a}function Rn(r,e,t){const a=o.any(r,e,t);return a instanceof i?n(a):a}function Vn(r,e){return n(o.cumsum(r,e))}function Xn(r,e){return n(o.cumprod(r,e))}function Zn(r,e,t){const a=o.nansum(r,e,t);return a instanceof i?n(a):a}function $n(r,e,t){const a=o.nanprod(r,e,t);return a instanceof i?n(a):a}function ro(r,e,t){const a=o.nanmean(r,e,t);return a instanceof i?n(a):a}function eo(r,e,t,a){const u=o.nanvar(r,e,t,a);return u instanceof i?n(u):u}function no(r,e,t,a){const u=o.nanstd(r,e,t,a);return u instanceof i?n(u):u}function oo(r,e,t){const a=o.nanmin(r,e,t);return a instanceof i?n(a):a}function to(r,e,t){const a=o.nanmax(r,e,t);return a instanceof i?n(a):a}function ao(r,e){const t=o.nanargmin(r,e);return t instanceof i?n(t):t}function uo(r,e){const t=o.nanargmax(r,e);return t instanceof i?n(t):t}function io(r,e){return n(o.nancumsum(r,e))}function yo(r,e){return n(o.nancumprod(r,e))}function Do(r,e,t){const a=o.nanmedian(r,e,t);return a instanceof i?n(a):a}function Ao(r,e,t,a){const u=o.nanquantile(r,e,t,a);return u instanceof i?n(u):u}function No(r,e,t,a){const u=o.nanpercentile(r,e,t,a);return u instanceof i?n(u):u}function co(r,e=0){return n(o.around(r,e))}function mo(r,e=0){return n(o.round(r,e))}function po(r){return n(o.ceil(r))}function fo(r){return n(o.fix(r))}function so(r){return n(o.floor(r))}function bo(r){return n(o.rint(r))}function xo(r){return n(o.trunc(r))}function Co(r,e){return n(o.in1d(r,e))}function lo(r,e){return n(o.intersect1d(r,e))}function _o(r,e){return n(o.isin(r,e))}function go(r,e){return n(o.setdiff1d(r,e))}function vo(r,e){return n(o.setxor1d(r,e))}function ho(r,e){return n(o.union1d(r,e))}function ko(r,e){return n(o.trim_zeros(r,e))}function wo(r){return n(o.unique_values(r))}function To(r,e,t){return n(o.append(r,e,t))}function qo(r,e,t){return n(o.delete(r,e,t))}function zo(r,e,t,a){return n(o.insert(r,e,t,a))}function jo(r,e,t="constant",a=0){return n(o.pad(r,e,t,a))}function So(r,e){return n(o.reshape(r,e))}function Io(r){return n(o.flatten(r))}function Fo(r){return n(o.ravel(r))}function Po(r,e){return n(o.squeeze(r,e))}function Eo(r,e){return n(o.expand_dims(r,e))}function Mo(r,e,t){return n(o.swapaxes(r,e,t))}function Bo(r,e,t){return n(o.moveaxis(r,e,t))}function Lo(r,e,t=0){return n(o.rollaxis(r,e,t))}function Uo(r,e=0){return n(o.concatenate(r,e))}function Wo(r,e=0){return n(o.stack(r,e))}function Yo(r){return n(o.vstack(r))}function Go(r){return n(o.hstack(r))}function Ho(r){return n(o.dstack(r))}function Jo(r,e=0){return n(o.concat(r,e))}function Ko(r){return n(o.column_stack(r))}function Oo(r){return n(o.block(r))}function Qo(r,e=0){return o.unstack(r,e).map(n)}function Ro(r,e){return n(o.tile(r,e))}function Vo(r,e,t){return n(o.repeat(r,e,t))}function Xo(r,e){return n(o.flip(r,e))}function Zo(r){return n(o.fliplr(r))}function $o(r){return n(o.flipud(r))}function rt(r,e=1,t=[0,1]){return n(o.rot90(r,e,t))}function et(r,e,t){return n(o.roll(r,e,t))}function nt(r,e){return n(o.resize(r,e))}function ot(r,e=-1){return n(o.sort(r,e))}function tt(r,e=-1){return n(o.argsort(r,e))}function at(r){return n(o.lexsort(r))}function ut(r,e,t=-1){return n(o.partition(r,e,t))}function it(r,e,t=-1){return n(o.argpartition(r,e,t))}function yt(r){return n(o.sort_complex(r))}function Dt(r){return o.nonzero(r).map(n)}function At(r){return n(o.argwhere(r))}function Nt(r){return n(o.flatnonzero(r))}function ct(r,e){return n(o.extract(r,e))}function mt(r,e,t){return n(o.bincount(r,e,t))}function pt(r,e,t){return n(o.digitize(r,e,t))}function ft(r,e,t){return n(o.correlate(r,e,t))}function st(r,e,t){return n(o.convolve(r,e,t))}function bt(r,e,t,a,u){return n(o.cov(r,e,t,a,u))}function xt(r,e,t){return n(o.corrcoef(r,e,t))}function Ct(r,e,t,a){const u=o.trapezoid(r,e,t,a);return u instanceof i?n(u):u}function lt(r){return n(o.sin(r))}function dt(r){return n(o.cos(r))}function _t(r){return n(o.tan(r))}function gt(r){return n(o.arcsin(r))}function vt(r){return n(o.arccos(r))}function ht(r){return n(o.arctan(r))}function kt(r,e){return n(o.arctan2(r,e))}function wt(r,e){return n(o.hypot(r,e))}function Tt(r){return n(o.degrees(r))}function qt(r){return n(o.radians(r))}function zt(r){return n(o.deg2rad(r))}function jt(r){return n(o.rad2deg(r))}function St(r){return n(o.sinh(r))}function It(r){return n(o.cosh(r))}function Ft(r){return n(o.tanh(r))}function Pt(r){return n(o.arcsinh(r))}function Et(r){return n(o.arccosh(r))}function Mt(r){return n(o.arctanh(r))}import{broadcast_arrays as Ot,broadcast_shapes as Qt,put as Rt,put_along_axis as Vt,place as Xt,putmask as Zt,copyto as $t,ix_ as ra,fill_diagonal as ea,array_equal as na,array_equiv as oa,may_share_memory as ta,shares_memory as aa,geterr as ua,seterr as ia,pow as ya,abs as Da,true_divide as Aa,conjugate as Na,array2string as ca,array_repr as ma,array_str as pa,set_printoptions as fa,get_printoptions as sa,printoptions as ba,format_float_positional as xa,format_float_scientific as Ca,base_repr as la,binary_repr as da,gradient as _a,einsum as ga,einsum_path as va,vdot as ha,linalg as ka,iscomplexobj as wa,isrealobj as Ta,isfortran as qa,isscalar as za,iterable as ja,isdtype as Sa,promote_types as Ia,allclose as Fa,amax as Pa,amin as Ea,var_ as Ma,cumulative_sum as Ba,cumulative_prod as La,unique as Ua,unique_all as Wa,unique_counts as Ya,unique_inverse as Ga,split as Ha,array_split as Ja,vsplit as Ka,hsplit as Oa,dsplit as Qa,atleast_1d as Ra,atleast_2d as Va,atleast_3d as Xa,row_stack as Za,where as $a,searchsorted as ru,count_nonzero as eu,histogram as nu,histogram2d as ou,histogramdd as tu,histogram_bin_edges as au,asin as uu,acos as iu,atan as yu,atan2 as Du,asinh as Au,acosh as Nu,atanh as cu,can_cast as mu,common_type as pu,result_type as fu,min_scalar_type as su,issubdtype as bu,typename as xu,mintypecode as Cu,ndim as lu,shape as du,size as _u,item as gu,tolist as vu,tobytes as hu,byteswap as ku,view as wu,tofile as Tu,fill as qu}from"../core/index.js";import{wasmConfig as ju}from"../common/wasm/config.js";import{configureWasm as Iu}from"../common/wasm/runtime.js";export{Jt as Complex,Ut as NDArray,Gt as NDArrayCore,Da as abs,Dr as absolute,iu as acos,Nu as acosh,R as add,Qn as all,Fa as allclose,Pa as amax,Ea as amin,ne as angle,Rn as any,To as append,K as apply_along_axis,O as apply_over_axes,ye as arange,vt as arccos,Et as arccosh,gt as arcsin,Pt as arcsinh,ht as arctan,kt as arctan2,Mt as arctanh,Wn as argmax,Un as argmin,it as argpartition,tt as argsort,At as argwhere,co as around,ie as array,ca as array2string,na as array_equal,oa as array_equiv,ma as array_repr,Ja as array_split,pa as array_str,le as asanyarray,pe as asarray,ge as asarray_chkfinite,de as ascontiguousarray,_e as asfortranarray,uu as asin,Au as asinh,yu as atan,Du as atan2,cu as atanh,Ra as atleast_1d,Va as atleast_2d,Xa as atleast_3d,On as average,la as base_repr,da as binary_repr,mt as bincount,F as bindex,Ur as bitwise_and,Rr as bitwise_count,Vr as bitwise_invert,Xr as bitwise_left_shift,Gr as bitwise_not,Wr as bitwise_or,Zr as bitwise_right_shift,Yr as bitwise_xor,Oo as block,Ot as broadcast_arrays,Qt as broadcast_shapes,T as broadcast_to,ku as byteswap,mu as can_cast,br as cbrt,po as ceil,j as choose,zr as clip,Ko as column_stack,pu as common_type,S as compress,Jo as concat,Uo as concatenate,Iu as configureWasm,ee as conj,Na as conjugate,st as convolve,Ce as copy,mn as copysign,$t as copyto,xt as corrcoef,ft as correlate,dt as cos,It as cosh,eu as count_nonzero,bt as cov,Xe as cross,Xn as cumprod,Vn as cumsum,La as cumulative_prod,Ba as cumulative_sum,zt as deg2rad,Tt as degrees,qo as delete_,he as diag,L as diag_indices,U as diag_indices_from,ke as diagflat,Ue as diagonal,Ee as diff,pt as digitize,mr as divide,Cr as divmod,Be as dot,Qa as dsplit,Ho as dstack,Me as ediff1d,ga as einsum,va as einsum_path,ae as empty,be as empty_like,dn as equal,rr as exp,er as exp2,Eo as expand_dims,nr as expm1,ct as extract,ce as eye,xr as fabs,qu as fill,ea as fill_diagonal,fo as fix,Nt as flatnonzero,Io as flatten,Xo as flip,Zo as fliplr,$o as flipud,gr as float_power,so as floor,pr as floor_divide,Ir as fmax,Fr as fmin,vr as fmod,xa as format_float_positional,Ca as format_float_scientific,hr as frexp,je as frombuffer,Pe as fromfile,Se as fromfunction,Ie as fromiter,Fe as fromstring,ue as full,xe as full_like,kr as gcd,Ne as geomspace,sa as get_printoptions,ua as geterr,_a as gradient,bn as greater,xn as greater_equal,_r as heaviside,nu as histogram,ou as histogram2d,au as histogram_bin_edges,tu as histogramdd,Oa as hsplit,Go as hstack,wt as hypot,Lr as i0,me as identity,I as iindex,re as imag,Co as in1d,E as indices,Ge as inner,zo as insert,Er as interp,lo as intersect1d,Hr as invert,gn as isclose,An as iscomplex,wa as iscomplexobj,Sa as isdtype,on as isfinite,qa as isfortran,_o as isin,tn as isinf,an as isnan,un as isnat,yn as isneginf,Dn as isposinf,Nn as isreal,Ta as isrealobj,za as isscalar,bu as issubdtype,gu as item,ja as iterable,ra as ix_,We as kron,wr as lcm,Tr as ldexp,Jr as left_shift,Cn as less,ln as less_equal,at as lexsort,ka as linalg,De as linspace,or as log,ar as log10,ur as log1p,tr as log2,ir as logaddexp,yr as logaddexp2,$e as logical_and,en as logical_not,rn as logical_or,nn as logical_xor,Ae as logspace,J as mask_indices,Ze as matmul,Oe as matrix_transpose,Re as matvec,Mn as max,jr as maximum,ta as may_share_memory,Pn as mean,Hn as median,Wt as meshgrid,Bn as min,su as min_scalar_type,Sr as minimum,Cu as mintypecode,cr as mod,qr as modf,Bo as moveaxis,X as multiply,Pr as nan_to_num,uo as nanargmax,ao as nanargmin,yo as nancumprod,io as nancumsum,to as nanmax,ro as nanmean,Do as nanmedian,oo as nanmin,No as nanpercentile,$n as nanprod,Ao as nanquantile,no as nanstd,Zn as nansum,eo as nanvar,lu as ndim,Ar as negative,fn as nextafter,Dt as nonzero,_n as not_equal,te as ones,se as ones_like,He as outer,Or as packbits,jo as pad,ut as partition,Jn as percentile,Qe as permute_dims,Xt as place,vn as poly,hn as polyadd,kn as polyder,wn as polydiv,Tn as polyfit,qn as polyint,zn as polymul,jn as polysub,Sn as polyval,fr as positive,ya as pow,$ as power,ba as printoptions,En as prod,Ia as promote_types,Ln as ptp,Rt as put,Vt as put_along_axis,Zt as putmask,Kn as quantile,jt as rad2deg,qt as radians,Fo as ravel,M as ravel_multi_index,$r as real,cn as real_if_close,sr as reciprocal,dr as remainder,Vo as repeat,ve as require,So as reshape,nt as resize,fu as result_type,Kr as right_shift,bo as rint,et as roll,Lo as rollaxis,In as roots,rt as rot90,mo as round,Za as row_stack,ru as searchsorted,P as select,fa as set_printoptions,go as setdiff1d,ia as seterr,vo as setxor1d,du as shape,aa as shares_memory,Nr as sign,pn as signbit,lt as sin,Br as sinc,St as sinh,_u as size,ot as sort,yt as sort_complex,sn as spacing,Ha as split,Z as sqrt,lr as square,Po as squeeze,Wo as stack,Gn as std,V as subtract,Fn as sum,Mo as swapaxes,q as take,z as take_along_axis,_t as tan,Ft as tanh,Je as tensordot,Ro as tile,hu as tobytes,Tu as tofile,vu as tolist,Le as trace,Ye as transpose,Ct as trapezoid,we as tri,Te as tril,W as tril_indices,Y as tril_indices_from,ko as trim_zeros,qe as triu,G as triu_indices,H as triu_indices_from,Aa as true_divide,xo as trunc,xu as typename,ho as union1d,Ua as unique,Wa as unique_all,Ya as unique_counts,Ga as unique_inverse,wo as unique_values,Qr as unpackbits,B as unravel_index,Qo as unstack,Mr as unwrap,ze as vander,Ma as var_,Yn as variance,ha as vdot,Ke as vecdot,Ve as vecmat,wu as view,Q as vindex,Ka as vsplit,Yo as vstack,ju as wasmConfig,$a as where,oe as zeros,fe as zeros_like};
@@ -1 +1 @@
1
- import{getTypedArrayConstructor as v,getDTypeSize as g,isBigIntDType as p,isComplexDType as z}from"../common/dtype.js";import{Complex as D}from"../common/complex.js";import{ArrayStorage as d}from"../common/storage.js";import{NDArrayCore as m}from"../common/ndarray-core.js";import*as t from"../core/index.js";const s=l=>{if(l instanceof b)return l;const r=l.base?s(l.base):void 0;return b.fromStorage(l.storage,r)};class b extends m{constructor(r,e){super(r,e),this._base=e}static fromStorage(r,e){return new b(r,e)}get base(){return this._base??null}get T(){return this.transpose()}get itemsize(){return g(this._storage.dtype)}get nbytes(){return this.size*this.itemsize}fill(r){const e=this._storage.dtype,n=this.size;if(p(e)){const a=typeof r=="bigint"?r:BigInt(Math.round(Number(r)));for(let o=0;o<n;o++)this._storage.iset(o,a)}else if(e==="bool"){const a=r?1:0;for(let o=0;o<n;o++)this._storage.iset(o,a)}else{const a=Number(r);for(let o=0;o<n;o++)this._storage.iset(o,a)}}*[Symbol.iterator](){if(this.ndim===0)yield this._storage.iget(0);else if(this.ndim===1)for(let r=0;r<this.shape[0];r++)yield this._storage.iget(r);else for(let r=0;r<this.shape[0];r++)yield this.slice(String(r))}get(r){if(r.length!==this.ndim)throw new Error(`Index has ${r.length} dimensions, but array has ${this.ndim} dimensions`);const e=r.map((n,a)=>{let o=n;if(o<0&&(o=this.shape[a]+o),o<0||o>=this.shape[a])throw new Error(`Index ${n} is out of bounds for axis ${a} with size ${this.shape[a]}`);return o});return this._storage.get(...e)}set(r,e){if(r.length!==this.ndim)throw new Error(`Index has ${r.length} dimensions, but array has ${this.ndim} dimensions`);const n=r.map((o,i)=>{let h=o;if(h<0&&(h=this.shape[i]+h),h<0||h>=this.shape[i])throw new Error(`Index ${o} is out of bounds for axis ${i} with size ${this.shape[i]}`);return h}),a=this.dtype;if(z(a))this._storage.set(n,e);else if(p(a)){const o=e instanceof D?e.re:Number(e),i=typeof e=="bigint"?e:BigInt(Math.round(o));this._storage.set(n,i)}else if(a==="bool"){const i=(e instanceof D?e.re:Number(e))?1:0;this._storage.set(n,i)}else{const o=e instanceof D?e.re:Number(e);this._storage.set(n,o)}}copy(){return new b(this._storage.copy())}astype(r,e=!0){const n=super.astype(r,e);return n instanceof b?n:new b(n._storage)}row(r){if(this.ndim<2)throw new Error("row() requires at least 2 dimensions");return this.slice(String(r),":")}col(r){if(this.ndim<2)throw new Error("col() requires at least 2 dimensions");return this.slice(":",String(r))}rows(r,e){if(this.ndim<2)throw new Error("rows() requires at least 2 dimensions");return this.slice(`${r}:${e}`,":")}cols(r,e){if(this.ndim<2)throw new Error("cols() requires at least 2 dimensions");return this.slice(":",`${r}:${e}`)}reshape(...r){const e=r.length===1&&Array.isArray(r[0])?r[0]:r,n=t.reshape(this,e).storage,o=n.data===this.data?this._base??this:void 0;return b.fromStorage(n,o)}ravel(){const r=t.ravel(this).storage,n=r.data===this.data?this._base??this:void 0;return b.fromStorage(r,n)}put(r,e){const n=e instanceof b?e._storage:e;t.put(this,r,n)}compress(r,e){const n=r instanceof b?r:b.fromStorage(d.fromData(new Uint8Array(r.map(a=>a?1:0)),[r.length],"bool"));return s(t.compress(n,this,e))}choose(r){return s(t.choose(this,r))}clip(r,e){return s(t.clip(this,r,e))}iindex(r,e=0){let n;if(r instanceof b){n=[];for(let a=0;a<r.size;a++){const o=r.storage.iget(a),i=typeof o=="bigint"?Number(o):o instanceof D?o.re:o;n.push(i)}}else Array.isArray(r)&&r.length>0&&Array.isArray(r[0])?n=r.flat():n=r;return this.take(n,e)}bindex(r,e){return s(t.compress(r,this,e))}toString(){return t.array_str(this)}toArray(){if(this.ndim===0)return this._storage.iget(0);const r=this.shape,e=r.length,n=(a,o)=>{if(o===e)return this._storage.get(...a);const i=[];for(let h=0;h<r[o];h++)a[o]=h,i.push(n(a,o+1));return i};return n(new Array(e),0)}tolist(){return this.toArray()}tobytes(){if(this._storage.isCContiguous){const n=this._storage.data,a=n.BYTES_PER_ELEMENT,o=this._storage.offset*a,i=this.size*a;return n.buffer.slice(o,o+i)}const e=this.copy()._storage.data;return e.buffer.slice(0,this.size*e.BYTES_PER_ELEMENT)}item(...r){if(r.length===0){if(this.size!==1)throw new Error("can only convert an array of size 1 to a Python scalar");return this._storage.iget(0)}if(r.length===1){const e=r[0];if(e<0||e>=this.size)throw new Error(`index ${e} is out of bounds for size ${this.size}`);return this._storage.iget(e)}return this.get(r)}byteswap(r=!1){const e=r?this:this.copy(),n=e._storage.data,a=n.BYTES_PER_ELEMENT;if(a===1)return e;const o=n.buffer,i=new DataView(o);for(let h=0;h<n.length;h++){const u=h*a;if(a===2){const c=i.getUint8(u),y=i.getUint8(u+1);i.setUint8(u,y),i.setUint8(u+1,c)}else if(a===4){const c=i.getUint8(u),y=i.getUint8(u+1),A=i.getUint8(u+2),f=i.getUint8(u+3);i.setUint8(u,f),i.setUint8(u+1,A),i.setUint8(u+2,y),i.setUint8(u+3,c)}else if(a===8){const c=i.getUint8(u),y=i.getUint8(u+1),A=i.getUint8(u+2),f=i.getUint8(u+3),N=i.getUint8(u+4),x=i.getUint8(u+5),w=i.getUint8(u+6),_=i.getUint8(u+7);i.setUint8(u,_),i.setUint8(u+1,w),i.setUint8(u+2,x),i.setUint8(u+3,N),i.setUint8(u+4,f),i.setUint8(u+5,A),i.setUint8(u+6,y),i.setUint8(u+7,c)}}return e}view(r){if(!r||r===this.dtype)return b.fromStorage(this._storage,this._base??this);const e=g(this.dtype),n=g(r);if(e!==n)throw new Error("When changing to a larger dtype, its size must be a divisor of the total size in bytes of the last axis of the array.");const a=v(r);if(!a)throw new Error(`Unsupported dtype: ${r}`);const o=this._storage.data,i=o.byteOffset+this._storage.offset*e,h=new a(o.buffer,i,this.size),u=d.fromData(h,[...this.shape],r,[...this._storage.strides],0);return b.fromStorage(u,this._base??this)}tofile(r,e="",n=""){throw new Error('tofile() requires file system access. Use the node module: import { save } from "numpy-ts/node"')}round(r=0){return this.around(r)}conjugate(){return this.conj()}around(r=0){return s(t.around(this,r))}allclose(r,e=1e-5,n=1e-8){return t.allclose(this,r,e,n)}isclose(r,e=1e-5,n=1e-8){return s(t.isclose(this,r,e,n))}average(r,e){const n=t.average(this,e,r);return n instanceof m?s(n):n}dot(r){const e=t.dot(this,r);return e instanceof m?s(e):e}trace(){const r=t.trace(this);return r instanceof m?s(r):r}inner(r){const e=t.inner(this,r);return e instanceof m?s(e):e}tensordot(r,e=2){const n=t.tensordot(this,r,e);return n instanceof m?s(n):n}divmod(r){const e=t.divmod(this,r);return[s(e[0]),s(e[1])]}searchsorted(r,e="left"){return s(t.searchsorted(this,r,e))}sqrt(){return s(t.sqrt(this))}exp(){return s(t.exp(this))}exp2(){return s(t.exp2(this))}expm1(){return s(t.expm1(this))}log(){return s(t.log(this))}log2(){return s(t.log2(this))}log10(){return s(t.log10(this))}log1p(){return s(t.log1p(this))}absolute(){return s(t.absolute(this))}negative(){return s(t.negative(this))}sign(){return s(t.sign(this))}positive(){return s(t.positive(this))}reciprocal(){return s(t.reciprocal(this))}ceil(){return s(t.ceil(this))}fix(){return s(t.fix(this))}floor(){return s(t.floor(this))}rint(){return s(t.rint(this))}trunc(){return s(t.trunc(this))}sin(){return s(t.sin(this))}cos(){return s(t.cos(this))}tan(){return s(t.tan(this))}arcsin(){return s(t.arcsin(this))}arccos(){return s(t.arccos(this))}arctan(){return s(t.arctan(this))}degrees(){return s(t.degrees(this))}radians(){return s(t.radians(this))}sinh(){return s(t.sinh(this))}cosh(){return s(t.cosh(this))}tanh(){return s(t.tanh(this))}arcsinh(){return s(t.arcsinh(this))}arccosh(){return s(t.arccosh(this))}arctanh(){return s(t.arctanh(this))}bitwise_not(){return s(t.bitwise_not(this))}invert(){return s(t.invert(this))}logical_not(){return s(t.logical_not(this))}isfinite(){return s(t.isfinite(this))}isinf(){return s(t.isinf(this))}isnan(){return s(t.isnan(this))}isnat(){return s(t.isnat(this))}signbit(){return s(t.signbit(this))}spacing(){return s(t.spacing(this))}cbrt(){return s(t.cbrt(this))}fabs(){return s(t.fabs(this))}square(){return s(t.square(this))}conj(){return s(t.conj(this))}flatten(){return s(t.flatten(this))}argwhere(){return s(t.argwhere(this))}add(r){return s(t.add(this,r))}subtract(r){return s(t.subtract(this,r))}multiply(r){return s(t.multiply(this,r))}divide(r){return s(t.divide(this,r))}mod(r){return s(t.mod(this,r))}floor_divide(r){return s(t.floor_divide(this,r))}power(r){return s(t.power(this,r))}logaddexp(r){return s(t.logaddexp(this,r))}logaddexp2(r){return s(t.logaddexp2(this,r))}arctan2(r){return s(t.arctan2(this,r))}hypot(r){return s(t.hypot(this,r))}greater(r){return s(t.greater(this,r))}greater_equal(r){return s(t.greater_equal(this,r))}less(r){return s(t.less(this,r))}less_equal(r){return s(t.less_equal(this,r))}equal(r){return s(t.equal(this,r))}not_equal(r){return s(t.not_equal(this,r))}bitwise_and(r){return s(t.bitwise_and(this,r))}bitwise_or(r){return s(t.bitwise_or(this,r))}bitwise_xor(r){return s(t.bitwise_xor(this,r))}left_shift(r){return s(t.left_shift(this,r))}right_shift(r){return s(t.right_shift(this,r))}logical_and(r){return s(t.logical_and(this,r))}logical_or(r){return s(t.logical_or(this,r))}logical_xor(r){return s(t.logical_xor(this,r))}copysign(r){return s(t.copysign(this,r))}nextafter(r){return s(t.nextafter(this,r))}remainder(r){return s(t.remainder(this,r))}heaviside(r){return s(t.heaviside(this,r))}matmul(r){return s(t.matmul(this,r))}outer(r){return s(t.outer(this,r))}sum(r,e=!1){const n=t.sum(this,r,e);return n instanceof m?s(n):n}mean(r,e=!1){const n=t.mean(this,r,e);return n instanceof m?s(n):n}prod(r,e=!1){const n=t.prod(this,r,e);return n instanceof m?s(n):n}max(r,e=!1){const n=t.max(this,r,e);return n instanceof m?s(n):n}min(r,e=!1){const n=t.min(this,r,e);return n instanceof m?s(n):n}ptp(r,e=!1){const n=t.ptp(this,r,e);return n instanceof m?s(n):n}nansum(r,e=!1){const n=t.nansum(this,r,e);return n instanceof m?s(n):n}nanprod(r,e=!1){const n=t.nanprod(this,r,e);return n instanceof m?s(n):n}nanmean(r,e=!1){const n=t.nanmean(this,r,e);return n instanceof m?s(n):n}nanmin(r,e=!1){const n=t.nanmin(this,r,e);return n instanceof m?s(n):n}nanmax(r,e=!1){const n=t.nanmax(this,r,e);return n instanceof m?s(n):n}argmin(r){const e=t.argmin(this,r);return e instanceof m?s(e):e}argmax(r){const e=t.argmax(this,r);return e instanceof m?s(e):e}nanargmin(r){const e=t.nanargmin(this,r);return e instanceof m?s(e):e}nanargmax(r){const e=t.nanargmax(this,r);return e instanceof m?s(e):e}var(r,e=0,n=!1){const a=t.variance(this,r,e,n);return a instanceof m?s(a):a}std(r,e=0,n=!1){const a=t.std(this,r,e,n);return a instanceof m?s(a):a}nanvar(r,e=0,n=!1){const a=t.nanvar(this,r,e,n);return a instanceof m?s(a):a}nanstd(r,e=0,n=!1){const a=t.nanstd(this,r,e,n);return a instanceof m?s(a):a}all(r,e=!1){const n=t.all(this,r,e);return n instanceof m?s(n):n}any(r,e=!1){const n=t.any(this,r,e);return n instanceof m?s(n):n}median(r,e=!1){const n=t.median(this,r,e);return n instanceof m?s(n):n}nanmedian(r,e=!1){const n=t.nanmedian(this,r,e);return n instanceof m?s(n):n}percentile(r,e,n=!1){const a=t.percentile(this,r,e,n);return a instanceof m?s(a):a}quantile(r,e,n=!1){const a=t.quantile(this,r,e,n);return a instanceof m?s(a):a}nanquantile(r,e,n=!1){const a=t.nanquantile(this,r,e,n);return a instanceof m?s(a):a}nanpercentile(r,e,n=!1){const a=t.nanpercentile(this,r,e,n);return a instanceof m?s(a):a}cumsum(r){return s(t.cumsum(this,r))}cumprod(r){return s(t.cumprod(this,r))}nancumsum(r){return s(t.nancumsum(this,r))}nancumprod(r){return s(t.nancumprod(this,r))}sort(r=-1){return s(t.sort(this,r))}argsort(r=-1){return s(t.argsort(this,r))}partition(r,e=-1){return s(t.partition(this,r,e))}argpartition(r,e=-1){return s(t.argpartition(this,r,e))}diagonal(r=0,e=0,n=1){return s(t.diagonal(this,r,e,n))}resize(r){return s(t.resize(this,r))}diff(r=1,e=-1){return s(t.diff(this,r,e))}take(r,e){return s(t.take(this,r,e))}repeat(r,e){return s(t.repeat(this,r,e))}transpose(r){return s(t.transpose(this,r))}squeeze(r){return s(t.squeeze(this,r))}expand_dims(r){return s(t.expand_dims(this,r))}swapaxes(r,e){return s(t.swapaxes(this,r,e))}moveaxis(r,e){return s(t.moveaxis(this,r,e))}nonzero(){return t.nonzero(this).map(s)}}function q(...l){let r=[],e="xy";for(const h of l)h instanceof b?r.push(h):typeof h=="object"&&"indexing"in h&&(e=h.indexing||"xy");if(r.length===0)return[];if(r.length===1)return[r[0].copy()];const n=r.map(h=>h.size);e==="xy"&&r.length>=2&&(r=[r[1],r[0],...r.slice(2)],[n[0],n[1]]=[n[1],n[0]]);const a=n,o=a.length,i=[];for(let h=0;h<r.length;h++){const u=r[h],c=u.size,y=new Array(o).fill(1);y[h]=c;const A=u.reshape(...y),f=t.broadcast_to(A,a),N=b.fromStorage(f.storage.copy());i.push(N)}return e==="xy"&&i.length>=2&&([i[0],i[1]]=[i[1],i[0]]),i}export{b as NDArray,q as meshgrid};
1
+ import{getTypedArrayConstructor as z,getDTypeSize as g,isBigIntDType as p,isComplexDType as S}from"../common/dtype.js";import{Complex as N}from"../common/complex.js";import{ArrayStorage as d}from"../common/storage.js";import{NDArrayCore as u}from"../common/ndarray-core.js";import*as t from"../core/index.js";const s=c=>{if(c instanceof b)return c;const r=c.base?s(c.base):void 0;return b.fromStorage(c.storage,r)};class b extends u{constructor(r,e){super(r,e),this._base=e}static fromStorage(r,e){return new b(r,e)}get base(){return this._base??null}get T(){return this.transpose()}get itemsize(){return g(this._storage.dtype)}get nbytes(){return this.size*this.itemsize}fill(r){const e=this._storage.dtype,n=this.size;if(p(e)){const a=typeof r=="bigint"?r:BigInt(Math.round(Number(r)));for(let o=0;o<n;o++)this._storage.iset(o,a)}else if(e==="bool"){const a=r?1:0;for(let o=0;o<n;o++)this._storage.iset(o,a)}else{const a=Number(r);for(let o=0;o<n;o++)this._storage.iset(o,a)}}*[Symbol.iterator](){if(this.ndim===0)yield this._storage.iget(0);else if(this.ndim===1)for(let r=0;r<this.shape[0];r++)yield this._storage.iget(r);else for(let r=0;r<this.shape[0];r++)yield this.slice(String(r))}get(r){if(r.length!==this.ndim)throw new Error(`Index has ${r.length} dimensions, but array has ${this.ndim} dimensions`);const e=r.map((n,a)=>{let o=n;if(o<0&&(o=this.shape[a]+o),o<0||o>=this.shape[a])throw new Error(`Index ${n} is out of bounds for axis ${a} with size ${this.shape[a]}`);return o});return this._storage.get(...e)}set(r,e){if(r.length!==this.ndim)throw new Error(`Index has ${r.length} dimensions, but array has ${this.ndim} dimensions`);const n=r.map((o,h)=>{let i=o;if(i<0&&(i=this.shape[h]+i),i<0||i>=this.shape[h])throw new Error(`Index ${o} is out of bounds for axis ${h} with size ${this.shape[h]}`);return i}),a=this.dtype;if(S(a))this._storage.set(n,e);else if(p(a)){const o=e instanceof N?e.re:Number(e),h=typeof e=="bigint"?e:BigInt(Math.round(o));this._storage.set(n,h)}else if(a==="bool"){const h=(e instanceof N?e.re:Number(e))?1:0;this._storage.set(n,h)}else{const o=e instanceof N?e.re:Number(e);this._storage.set(n,o)}}copy(){return new b(this._storage.copy())}astype(r,e=!0){const n=super.astype(r,e);return n instanceof b?n:new b(n._storage)}row(r){if(this.ndim<2)throw new Error("row() requires at least 2 dimensions");return this.slice(String(r),":")}col(r){if(this.ndim<2)throw new Error("col() requires at least 2 dimensions");return this.slice(":",String(r))}rows(r,e){if(this.ndim<2)throw new Error("rows() requires at least 2 dimensions");return this.slice(`${r}:${e}`,":")}cols(r,e){if(this.ndim<2)throw new Error("cols() requires at least 2 dimensions");return this.slice(":",`${r}:${e}`)}reshape(...r){const e=r.length===1&&Array.isArray(r[0])?r[0]:r,n=t.reshape(this,e).storage,o=n.data===this.data?this._base??this:void 0;return b.fromStorage(n,o)}ravel(){const r=t.ravel(this).storage,n=r.data===this.data?this._base??this:void 0;return b.fromStorage(r,n)}put(r,e){const n=e instanceof b?e._storage:e;t.put(this,r,n)}compress(r,e){const n=r instanceof b?r:b.fromStorage(d.fromData(new Uint8Array(r.map(a=>a?1:0)),[r.length],"bool"));return s(t.compress(n,this,e))}choose(r){return s(t.choose(this,r))}clip(r,e){return s(t.clip(this,r,e))}iindex(r,e=0){let n;if(r instanceof b){n=[];for(let a=0;a<r.size;a++){const o=r.storage.iget(a),h=typeof o=="bigint"?Number(o):o instanceof N?o.re:o;n.push(h)}}else Array.isArray(r)&&r.length>0&&Array.isArray(r[0])?n=r.flat():n=r;return this.take(n,e)}bindex(r,e){return s(t.compress(r,this,e))}toString(){return t.array_str(this)}toArray(){if(this.ndim===0)return this._storage.iget(0);const r=this.shape,e=r.length,n=(a,o)=>{if(o===e)return this._storage.get(...a);const h=[];for(let i=0;i<r[o];i++)a[o]=i,h.push(n(a,o+1));return h};return n(new Array(e),0)}tolist(){return this.toArray()}tobytes(){if(this._storage.isCContiguous){const n=this._storage.data,a=n.BYTES_PER_ELEMENT,o=n.byteOffset+this._storage.offset*a,h=this.size*a;return n.buffer.slice(o,o+h)}const e=this.copy()._storage.data;return e.buffer.slice(e.byteOffset,e.byteOffset+this.size*e.BYTES_PER_ELEMENT)}item(...r){if(r.length===0){if(this.size!==1)throw new Error("can only convert an array of size 1 to a Python scalar");return this._storage.iget(0)}if(r.length===1){const e=r[0];if(e<0||e>=this.size)throw new Error(`index ${e} is out of bounds for size ${this.size}`);return this._storage.iget(e)}return this.get(r)}byteswap(r=!1){const e=r?this:this.copy(),n=e._storage.data,a=n.BYTES_PER_ELEMENT;if(a===1)return e;const o=n.buffer,h=n.byteOffset,i=new DataView(o);for(let y=0;y<n.length;y++){const m=h+y*a;if(a===2){const l=i.getUint8(m),f=i.getUint8(m+1);i.setUint8(m,f),i.setUint8(m+1,l)}else if(a===4){const l=i.getUint8(m),f=i.getUint8(m+1),A=i.getUint8(m+2),D=i.getUint8(m+3);i.setUint8(m,D),i.setUint8(m+1,A),i.setUint8(m+2,f),i.setUint8(m+3,l)}else if(a===8){const l=i.getUint8(m),f=i.getUint8(m+1),A=i.getUint8(m+2),D=i.getUint8(m+3),x=i.getUint8(m+4),w=i.getUint8(m+5),_=i.getUint8(m+6),v=i.getUint8(m+7);i.setUint8(m,v),i.setUint8(m+1,_),i.setUint8(m+2,w),i.setUint8(m+3,x),i.setUint8(m+4,D),i.setUint8(m+5,A),i.setUint8(m+6,f),i.setUint8(m+7,l)}}return e}view(r){if(!r||r===this.dtype)return b.fromStorage(this._storage,this._base??this);const e=g(this.dtype),n=g(r);if(e!==n)throw new Error("When changing to a larger dtype, its size must be a divisor of the total size in bytes of the last axis of the array.");const a=z(r);if(!a)throw new Error(`Unsupported dtype: ${r}`);const o=this._storage.data,h=o.byteOffset+this._storage.offset*e,i=new a(o.buffer,h,this.size),y=d.fromData(i,[...this.shape],r,[...this._storage.strides],0);return b.fromStorage(y,this._base??this)}tofile(r,e="",n=""){throw new Error('tofile() requires file system access. Use the node module: import { save } from "numpy-ts/node"')}round(r=0){return this.around(r)}conjugate(){return this.conj()}around(r=0){return s(t.around(this,r))}allclose(r,e=1e-5,n=1e-8){return t.allclose(this,r,e,n)}isclose(r,e=1e-5,n=1e-8){return s(t.isclose(this,r,e,n))}average(r,e){const n=t.average(this,e,r);return n instanceof u?s(n):n}dot(r){const e=t.dot(this,r);return e instanceof u?s(e):e}trace(){const r=t.trace(this);return r instanceof u?s(r):r}inner(r){const e=t.inner(this,r);return e instanceof u?s(e):e}tensordot(r,e=2){const n=t.tensordot(this,r,e);return n instanceof u?s(n):n}divmod(r){const e=t.divmod(this,r);return[s(e[0]),s(e[1])]}searchsorted(r,e="left"){return s(t.searchsorted(this,r,e))}sqrt(){return s(t.sqrt(this))}exp(){return s(t.exp(this))}exp2(){return s(t.exp2(this))}expm1(){return s(t.expm1(this))}log(){return s(t.log(this))}log2(){return s(t.log2(this))}log10(){return s(t.log10(this))}log1p(){return s(t.log1p(this))}absolute(){return s(t.absolute(this))}negative(){return s(t.negative(this))}sign(){return s(t.sign(this))}positive(){return s(t.positive(this))}reciprocal(){return s(t.reciprocal(this))}ceil(){return s(t.ceil(this))}fix(){return s(t.fix(this))}floor(){return s(t.floor(this))}rint(){return s(t.rint(this))}trunc(){return s(t.trunc(this))}sin(){return s(t.sin(this))}cos(){return s(t.cos(this))}tan(){return s(t.tan(this))}arcsin(){return s(t.arcsin(this))}arccos(){return s(t.arccos(this))}arctan(){return s(t.arctan(this))}degrees(){return s(t.degrees(this))}radians(){return s(t.radians(this))}sinh(){return s(t.sinh(this))}cosh(){return s(t.cosh(this))}tanh(){return s(t.tanh(this))}arcsinh(){return s(t.arcsinh(this))}arccosh(){return s(t.arccosh(this))}arctanh(){return s(t.arctanh(this))}bitwise_not(){return s(t.bitwise_not(this))}invert(){return s(t.invert(this))}logical_not(){return s(t.logical_not(this))}isfinite(){return s(t.isfinite(this))}isinf(){return s(t.isinf(this))}isnan(){return s(t.isnan(this))}isnat(){return s(t.isnat(this))}signbit(){return s(t.signbit(this))}spacing(){return s(t.spacing(this))}cbrt(){return s(t.cbrt(this))}fabs(){return s(t.fabs(this))}square(){return s(t.square(this))}conj(){return s(t.conj(this))}flatten(){return s(t.flatten(this))}argwhere(){return s(t.argwhere(this))}add(r){return s(t.add(this,r))}subtract(r){return s(t.subtract(this,r))}multiply(r){return s(t.multiply(this,r))}divide(r){return s(t.divide(this,r))}mod(r){return s(t.mod(this,r))}floor_divide(r){return s(t.floor_divide(this,r))}power(r){return s(t.power(this,r))}logaddexp(r){return s(t.logaddexp(this,r))}logaddexp2(r){return s(t.logaddexp2(this,r))}arctan2(r){return s(t.arctan2(this,r))}hypot(r){return s(t.hypot(this,r))}greater(r){return s(t.greater(this,r))}greater_equal(r){return s(t.greater_equal(this,r))}less(r){return s(t.less(this,r))}less_equal(r){return s(t.less_equal(this,r))}equal(r){return s(t.equal(this,r))}not_equal(r){return s(t.not_equal(this,r))}bitwise_and(r){return s(t.bitwise_and(this,r))}bitwise_or(r){return s(t.bitwise_or(this,r))}bitwise_xor(r){return s(t.bitwise_xor(this,r))}left_shift(r){return s(t.left_shift(this,r))}right_shift(r){return s(t.right_shift(this,r))}logical_and(r){return s(t.logical_and(this,r))}logical_or(r){return s(t.logical_or(this,r))}logical_xor(r){return s(t.logical_xor(this,r))}copysign(r){return s(t.copysign(this,r))}nextafter(r){return s(t.nextafter(this,r))}remainder(r){return s(t.remainder(this,r))}heaviside(r){return s(t.heaviside(this,r))}matmul(r){return s(t.matmul(this,r))}outer(r){return s(t.outer(this,r))}sum(r,e=!1){const n=t.sum(this,r,e);return n instanceof u?s(n):n}mean(r,e=!1){const n=t.mean(this,r,e);return n instanceof u?s(n):n}prod(r,e=!1){const n=t.prod(this,r,e);return n instanceof u?s(n):n}max(r,e=!1){const n=t.max(this,r,e);return n instanceof u?s(n):n}min(r,e=!1){const n=t.min(this,r,e);return n instanceof u?s(n):n}ptp(r,e=!1){const n=t.ptp(this,r,e);return n instanceof u?s(n):n}nansum(r,e=!1){const n=t.nansum(this,r,e);return n instanceof u?s(n):n}nanprod(r,e=!1){const n=t.nanprod(this,r,e);return n instanceof u?s(n):n}nanmean(r,e=!1){const n=t.nanmean(this,r,e);return n instanceof u?s(n):n}nanmin(r,e=!1){const n=t.nanmin(this,r,e);return n instanceof u?s(n):n}nanmax(r,e=!1){const n=t.nanmax(this,r,e);return n instanceof u?s(n):n}argmin(r){const e=t.argmin(this,r);return e instanceof u?s(e):e}argmax(r){const e=t.argmax(this,r);return e instanceof u?s(e):e}nanargmin(r){const e=t.nanargmin(this,r);return e instanceof u?s(e):e}nanargmax(r){const e=t.nanargmax(this,r);return e instanceof u?s(e):e}var(r,e=0,n=!1){const a=t.variance(this,r,e,n);return a instanceof u?s(a):a}std(r,e=0,n=!1){const a=t.std(this,r,e,n);return a instanceof u?s(a):a}nanvar(r,e=0,n=!1){const a=t.nanvar(this,r,e,n);return a instanceof u?s(a):a}nanstd(r,e=0,n=!1){const a=t.nanstd(this,r,e,n);return a instanceof u?s(a):a}all(r,e=!1){const n=t.all(this,r,e);return n instanceof u?s(n):n}any(r,e=!1){const n=t.any(this,r,e);return n instanceof u?s(n):n}median(r,e=!1){const n=t.median(this,r,e);return n instanceof u?s(n):n}nanmedian(r,e=!1){const n=t.nanmedian(this,r,e);return n instanceof u?s(n):n}percentile(r,e,n=!1){const a=t.percentile(this,r,e,n);return a instanceof u?s(a):a}quantile(r,e,n=!1){const a=t.quantile(this,r,e,n);return a instanceof u?s(a):a}nanquantile(r,e,n=!1){const a=t.nanquantile(this,r,e,n);return a instanceof u?s(a):a}nanpercentile(r,e,n=!1){const a=t.nanpercentile(this,r,e,n);return a instanceof u?s(a):a}cumsum(r){return s(t.cumsum(this,r))}cumprod(r){return s(t.cumprod(this,r))}nancumsum(r){return s(t.nancumsum(this,r))}nancumprod(r){return s(t.nancumprod(this,r))}sort(r=-1){return s(t.sort(this,r))}argsort(r=-1){return s(t.argsort(this,r))}partition(r,e=-1){return s(t.partition(this,r,e))}argpartition(r,e=-1){return s(t.argpartition(this,r,e))}diagonal(r=0,e=0,n=1){return s(t.diagonal(this,r,e,n))}resize(r){return s(t.resize(this,r))}diff(r=1,e=-1){return s(t.diff(this,r,e))}take(r,e){return s(t.take(this,r,e))}repeat(r,e){return s(t.repeat(this,r,e))}transpose(r){return s(t.transpose(this,r))}squeeze(r){return s(t.squeeze(this,r))}expand_dims(r){return s(t.expand_dims(this,r))}swapaxes(r,e){return s(t.swapaxes(this,r,e))}moveaxis(r,e){return s(t.moveaxis(this,r,e))}nonzero(){return t.nonzero(this).map(s)}}function T(...c){let r=[],e="xy";for(const i of c)i instanceof b?r.push(i):typeof i=="object"&&"indexing"in i&&(e=i.indexing||"xy");if(r.length===0)return[];if(r.length===1)return[r[0].copy()];const n=r.map(i=>i.size);e==="xy"&&r.length>=2&&(r=[r[1],r[0],...r.slice(2)],[n[0],n[1]]=[n[1],n[0]]);const a=n,o=a.length,h=[];for(let i=0;i<r.length;i++){const y=r[i],m=y.size,l=new Array(o).fill(1);l[i]=m;const f=y.reshape(...l),A=t.broadcast_to(f,a),D=b.fromStorage(A.storage.copy());h.push(D)}return e==="xy"&&h.length>=2&&([h[0],h[1]]=[h[1],h[0]]),h}export{b as NDArray,T as meshgrid};
package/dist/esm/index.js CHANGED
@@ -1 +1 @@
1
- import{Complex as K}from"./common/complex.js";import{NDArray as W}from"./full/index.js";import{NDArrayCore as Z}from"./common/ndarray-core.js";import{hasFloat16 as rr}from"./common/dtype.js";import{zeros as ar,ones as nr,empty as tr,full as or,array as sr,arange as mr,linspace as ir,logspace as ur,geomspace as pr,eye as fr,identity as br,asarray as lr,zeros_like as cr,ones_like as dr,empty_like as yr,full_like as gr,copy as _r,asanyarray as xr,asarray_chkfinite as Nr,ascontiguousarray as hr,asfortranarray as Ar,require as Sr,diag as wr,diagflat as vr,frombuffer as zr,fromfile as kr,fromfunction as Dr,fromiter as Cr,fromstring as Tr,meshgrid as Or,tri as Ir,tril as qr,triu as Pr,vander as Rr}from"./full/index.js";import{add as Lr,subtract as Fr,multiply as Mr,divide as jr,true_divide as Ur,floor_divide as Hr,mod as Br,sqrt as Vr,power as Gr,exp as Yr,exp2 as Jr,expm1 as Kr,log as Qr,log2 as Wr,log10 as Xr,log1p as Zr,logaddexp as $r,logaddexp2 as re,absolute as ee,negative as ae,sign as ne,positive as te,reciprocal as oe,cbrt as se,fabs as me,divmod as ie,square as ue,remainder as pe,heaviside as fe,float_power as be,fmod as le,frexp as ce,gcd as de,lcm as ye,ldexp as ge,modf as _e,clip as xe,maximum as Ne,minimum as he,fmax as Ae,fmin as Se,nan_to_num as we,interp as ve,unwrap as ze,sinc as ke,i0 as De}from"./full/index.js";import{power as Te,absolute as Oe}from"./full/index.js";import{sin as qe,cos as Pe,tan as Re,arcsin as Ee,arccos as Le,arctan as Fe,arctan2 as Me,hypot as je,degrees as Ue,radians as He,deg2rad as Be,rad2deg as Ve,sinh as Ge,cosh as Ye,tanh as Je,arcsinh as Ke,arccosh as Qe,arctanh as We}from"./full/index.js";import{arcsin as Ze,arccos as $e,arctan as ra,arctan2 as ea,arcsinh as aa,arccosh as na,arctanh as ta}from"./full/index.js";import{dot as sa,trace as ma,diagonal as ia,kron as ua,transpose as pa,inner as fa,outer as ba,tensordot as la,einsum as ca,einsum_path as da,vdot as ya,vecdot as ga,matrix_transpose as _a,permute_dims as xa,matvec as Na,vecmat as ha,cross as Aa,matmul as Sa,linalg as wa}from"./full/index.js";import{reshape as za,flatten as ka,ravel as Da,squeeze as Ca,expand_dims as Ta,swapaxes as Oa,moveaxis as Ia,rollaxis as qa,concatenate as Pa,stack as Ra,vstack as Ea,hstack as La,dstack as Fa,column_stack as Ma,row_stack as ja,block as Ua,split as Ha,array_split as Ba,vsplit as Va,hsplit as Ga,dsplit as Ya,unstack as Ja,tile as Ka,repeat as Qa,flip as Wa,fliplr as Xa,flipud as Za,rot90 as $a,roll as rn,resize as en,atleast_1d as an,atleast_2d as nn,atleast_3d as tn,append as on,delete_ as sn,delete_ as mn,insert as un,pad as pn}from"./full/index.js";import{concatenate as bn}from"./full/index.js";import{sum as cn,mean as dn,prod as yn,amax as gn,amin as _n,ptp as xn,argmin as Nn,argmax as hn,std as An,variance as Sn,var_ as wn,median as vn,percentile as zn,quantile as kn,average as Dn,all as Cn,any as Tn,cumsum as On,cumprod as In,nansum as qn,nanprod as Pn,nanmean as Rn,nanvar as En,nanstd as Ln,nanmin as Fn,nanmax as Mn,nanargmin as jn,nanargmax as Un,nancumsum as Hn,nancumprod as Bn,nanmedian as Vn,nanquantile as Gn,nanpercentile as Yn}from"./full/index.js";import{amax as Kn,amin as Qn,cumsum as Wn,cumprod as Xn}from"./full/index.js";import{logical_and as $n,logical_or as rt,logical_not as et,logical_xor as at,isfinite as nt,isinf as tt,isnan as ot,isnat as st,isneginf as mt,isposinf as it,iscomplex as ut,iscomplexobj as pt,isreal as ft,isrealobj as bt,real_if_close as lt,isfortran as ct,isscalar as dt,iterable as yt,isdtype as gt,promote_types as _t,copysign as xt,signbit as Nt,nextafter as ht,spacing as At,greater as St,greater_equal as wt,less as vt,less_equal as zt,equal as kt,not_equal as Dt,isclose as Ct,allclose as Tt}from"./full/index.js";import{sort as It,argsort as qt,lexsort as Pt,partition as Rt,argpartition as Et,sort_complex as Lt,nonzero as Ft,argwhere as Mt,flatnonzero as jt,where as Ut,searchsorted as Ht,extract as Bt,count_nonzero as Vt}from"./full/index.js";import{bitwise_and as Yt,bitwise_or as Jt,bitwise_xor as Kt,bitwise_not as Qt,invert as Wt,left_shift as Xt,right_shift as Zt,packbits as $t,unpackbits as ro,bitwise_count as eo}from"./full/index.js";import{bitwise_not as no,left_shift as to,right_shift as oo}from"./full/index.js";import{around as mo,ceil as io,fix as uo,floor as po,rint as fo,trunc as bo}from"./full/index.js";import{around as co}from"./full/index.js";import{unique as go,in1d as _o,intersect1d as xo,isin as No,setdiff1d as ho,setxor1d as Ao,union1d as So,trim_zeros as wo,unique_all as vo,unique_counts as zo,unique_inverse as ko,unique_values as Do}from"./full/index.js";import{bincount as To,digitize as Oo,histogram as Io,histogram2d as qo,histogramdd as Po,correlate as Ro,convolve as Eo,cov as Lo,corrcoef as Fo,histogram_bin_edges as Mo,trapezoid as jo}from"./full/index.js";import{diff as Ho,ediff1d as Bo,gradient as Vo}from"./full/index.js";import{real as Yo,imag as Jo,conj as Ko,angle as Qo}from"./full/index.js";import{conj as Xo}from"./full/index.js";import{broadcast_to as $o,broadcast_arrays as rs,broadcast_shapes as es,take as as,put as ns,iindex as ts,bindex as os,copyto as ss,choose as ms,array_equal as is,array_equiv as us,take_along_axis as ps,put_along_axis as fs,putmask as bs,compress as ls,select as cs,place as ds,fill_diagonal as ys,diag_indices as gs,diag_indices_from as _s,tril_indices as xs,tril_indices_from as Ns,triu_indices as hs,triu_indices_from as As,mask_indices as Ss,indices as ws,ix_ as vs,ravel_multi_index as zs,unravel_index as ks,fill as Ds,item as Cs,tolist as Ts,tobytes as Os,byteswap as Is,view as qs,tofile as Ps}from"./full/index.js";import{apply_along_axis as Es,apply_over_axes as Ls,may_share_memory as Fs,shares_memory as Ms,ndim as js,shape as Us,size as Hs,geterr as Bs,seterr as Vs}from"./full/index.js";import{array2string as Ys,array_repr as Js,array_str as Ks,base_repr as Qs,binary_repr as Ws,format_float_positional as Xs,format_float_scientific as Zs,get_printoptions as $s,set_printoptions as rm,printoptions as em}from"./full/index.js";import{can_cast as nm,common_type as tm,result_type as om,min_scalar_type as sm,issubdtype as mm,typename as im,mintypecode as um}from"./full/index.js";import{poly as fm,polyadd as bm,polyder as lm,polydiv as cm,polyfit as dm,polyint as ym,polymul as gm,polysub as _m,polyval as xm,roots as Nm}from"./full/index.js";import{UnsupportedDTypeError as Am,InvalidNpyError as Sm,SUPPORTED_DTYPES as wm,DTYPE_TO_DESCR as vm}from"./io/npy/format.js";import{wasmConfig as km}from"./common/wasm/config.js";import{serializeNpy as Cm}from"./io/npy/serializer.js";import{serializeNpz as Om,serializeNpzSync as Im}from"./io/npz/serializer.js";import{serializeTxt as Pm}from"./io/txt/serializer.js";import{parseNpy as c,parseNpyHeader as d,parseNpyData as y}from"./io/npy/parser.js";import{parseNpz as g,parseNpzSync as _,loadNpz as x,loadNpzSync as N}from"./io/npz/parser.js";import{parseTxt as h,genfromtxt as A,fromregex as S}from"./io/txt/parser.js";function f(r){return s.fromStorage(r.storage)}function k(r){return f(c(r))}const D=d;function C(r,e){return f(y(r,e))}async function T(r,e={}){const a=await g(r,e),n=new Map;for(const[m,u]of a.arrays)n.set(m,f(u));return{arrays:n,skipped:a.skipped,errors:a.errors}}function O(r,e={}){const a=_(r,e),n=new Map;for(const[m,u]of a.arrays)n.set(m,f(u));return{arrays:n,skipped:a.skipped,errors:a.errors}}async function I(r,e={}){const a=await x(r,e),n={};for(const[m,u]of Object.entries(a))n[m]=f(u);return n}function q(r,e={}){const a=N(r,e),n={};for(const[m,u]of Object.entries(a))n[m]=f(u);return n}function P(r,e={}){return f(h(r,e))}function R(r,e={}){return f(A(r,e))}function E(r,e,a="float64"){return f(S(r,e,a))}import{loadNpy as Em,loadNpySync as Lm,saveNpy as Fm,saveNpySync as Mm,loadNpzFile as jm,loadNpzFileSync as Um,saveNpz as Hm,saveNpzSync as Bm,savez as Vm,savez_compressed as Gm,load as Ym,loadSync as Jm,save as Km,saveSync as Qm,loadtxt as Wm,loadtxtSync as Xm,savetxt as Zm,savetxtSync as $m,genfromtxt as ri,genfromtxtSync as ei,fromregex as ai,fromregexSync as ni}from"./io/file-ops.js";import*as o from"./common/ops/random.js";import{NDArray as s}from"./full/index.js";function t(r){return r&&typeof r=="object"&&"_data"in r&&"_shape"in r?s.fromStorage(r):r}const H={seed:o.seed,get_state:o.get_state,set_state:o.set_state,get_bit_generator:o.get_bit_generator,set_bit_generator:o.set_bit_generator,default_rng:r=>{const e=o.default_rng(r),a=n=>n instanceof s||n instanceof l?n.storage:n;return{random:n=>t(e.random(n)),integers:(n,m,u)=>t(e.integers(n,m,u)),standard_normal:n=>t(e.standard_normal(n)),normal:(n,m,u)=>t(e.normal(n,m,u)),uniform:(n,m,u)=>t(e.uniform(n,m,u)),choice:(n,m,u,b)=>t(e.choice(a(n),m,u,b instanceof s||b instanceof l?b.storage:b)),permutation:n=>t(e.permutation(a(n))),shuffle:n=>e.shuffle(n instanceof s||n instanceof l?n.storage:n),exponential:(n,m)=>t(e.exponential(n,m)),poisson:(n,m)=>t(e.poisson(n,m)),binomial:(n,m,u)=>t(e.binomial(n,m,u))}},Generator:o.Generator,random:r=>t(o.random(r)),rand:(...r)=>t(o.rand(...r)),randn:(...r)=>t(o.randn(...r)),randint:(r,e,a,n)=>t(o.randint(r,e,a,n)),random_sample:r=>t(o.random_sample(r)),ranf:r=>t(o.ranf(r)),sample:r=>t(o.sample(r)),random_integers:(r,e,a)=>t(o.random_integers(r,e,a)),bytes:o.bytes,uniform:(r,e,a)=>t(o.uniform(r,e,a)),normal:(r,e,a)=>t(o.normal(r,e,a)),standard_normal:r=>t(o.standard_normal(r)),exponential:(r,e)=>t(o.exponential(r,e)),standard_exponential:r=>t(o.standard_exponential(r)),gamma:(r,e,a)=>t(o.gamma(r,e,a)),standard_gamma:(r,e)=>t(o.standard_gamma(r,e)),beta:(r,e,a)=>t(o.beta(r,e,a)),chisquare:(r,e)=>t(o.chisquare(r,e)),noncentral_chisquare:(r,e,a)=>t(o.noncentral_chisquare(r,e,a)),f:(r,e,a)=>t(o.f(r,e,a)),noncentral_f:(r,e,a,n)=>t(o.noncentral_f(r,e,a,n)),standard_cauchy:r=>t(o.standard_cauchy(r)),standard_t:(r,e)=>t(o.standard_t(r,e)),laplace:(r,e,a)=>t(o.laplace(r,e,a)),logistic:(r,e,a)=>t(o.logistic(r,e,a)),lognormal:(r,e,a)=>t(o.lognormal(r,e,a)),gumbel:(r,e,a)=>t(o.gumbel(r,e,a)),pareto:(r,e)=>t(o.pareto(r,e)),power:(r,e)=>t(o.power(r,e)),rayleigh:(r,e)=>t(o.rayleigh(r,e)),triangular:(r,e,a,n)=>t(o.triangular(r,e,a,n)),wald:(r,e,a)=>t(o.wald(r,e,a)),weibull:(r,e)=>t(o.weibull(r,e)),poisson:(r,e)=>t(o.poisson(r,e)),binomial:(r,e,a)=>t(o.binomial(r,e,a)),geometric:(r,e)=>t(o.geometric(r,e)),hypergeometric:(r,e,a,n)=>t(o.hypergeometric(r,e,a,n)),logseries:(r,e)=>t(o.logseries(r,e)),negative_binomial:(r,e,a)=>t(o.negative_binomial(r,e,a)),zipf:(r,e)=>t(o.zipf(r,e)),multinomial:(r,e,a)=>t(o.multinomial(r,e,a)),multivariate_normal:(r,e,a,n,m)=>t(o.multivariate_normal(r,e,a,n,m)),dirichlet:(r,e)=>t(o.dirichlet(r,e)),vonmises:(r,e,a)=>t(o.vonmises(r,e,a)),choice:(r,e,a,n)=>t(o.choice(r,e,a,n)),permutation:r=>t(o.permutation(r)),shuffle:r=>o.shuffle(r instanceof s||r instanceof l?r.storage:r)};import*as i from"./common/ops/fft.js";import{NDArrayCore as l}from"./common/ndarray-core.js";function p(r){return r instanceof s||r instanceof l?r.storage:r}const V={fft:(r,e,a,n)=>s.fromStorage(i.fft(p(r),e,a,n)),ifft:(r,e,a,n)=>s.fromStorage(i.ifft(p(r),e,a,n)),fft2:(r,e,a,n)=>s.fromStorage(i.fft2(p(r),e,a,n)),ifft2:(r,e,a,n)=>s.fromStorage(i.ifft2(p(r),e,a,n)),fftn:(r,e,a,n)=>s.fromStorage(i.fftn(p(r),e,a,n)),ifftn:(r,e,a,n)=>s.fromStorage(i.ifftn(p(r),e,a,n)),rfft:(r,e,a,n)=>s.fromStorage(i.rfft(p(r),e,a,n)),irfft:(r,e,a,n)=>s.fromStorage(i.irfft(p(r),e,a,n)),rfft2:(r,e,a,n)=>s.fromStorage(i.rfft2(p(r),e,a,n)),irfft2:(r,e,a,n)=>s.fromStorage(i.irfft2(p(r),e,a,n)),rfftn:(r,e,a,n)=>s.fromStorage(i.rfftn(p(r),e,a,n)),irfftn:(r,e,a,n)=>s.fromStorage(i.irfftn(p(r),e,a,n)),hfft:(r,e,a,n)=>s.fromStorage(i.hfft(p(r),e,a,n)),ihfft:(r,e,a,n)=>s.fromStorage(i.ihfft(p(r),e,a,n)),fftfreq:(r,e)=>s.fromStorage(i.fftfreq(r,e)),rfftfreq:(r,e)=>s.fromStorage(i.rfftfreq(r,e)),fftshift:(r,e)=>s.fromStorage(i.fftshift(p(r),e)),ifftshift:(r,e)=>s.fromStorage(i.ifftshift(p(r),e))},G="1.2.0";export{K as Complex,vm as DTYPE_TO_DESCR,Sm as InvalidNpyError,W as NDArray,Z as NDArrayCore,wm as SUPPORTED_DTYPES,Am as UnsupportedDTypeError,G as __version__,Oe as abs,ee as absolute,$e as acos,na as acosh,Lr as add,Cn as all,Tt as allclose,gn as amax,_n as amin,Qo as angle,Tn as any,on as append,Es as apply_along_axis,Ls as apply_over_axes,mr as arange,Le as arccos,Qe as arccosh,Ee as arcsin,Ke as arcsinh,Fe as arctan,Me as arctan2,We as arctanh,hn as argmax,Nn as argmin,Et as argpartition,qt as argsort,Mt as argwhere,mo as around,sr as array,Ys as array2string,is as array_equal,us as array_equiv,Js as array_repr,Ba as array_split,Ks as array_str,xr as asanyarray,lr as asarray,Nr as asarray_chkfinite,hr as ascontiguousarray,Ar as asfortranarray,Ze as asin,aa as asinh,ra as atan,ea as atan2,ta as atanh,an as atleast_1d,nn as atleast_2d,tn as atleast_3d,Dn as average,Qs as base_repr,Ws as binary_repr,To as bincount,os as bindex,Yt as bitwise_and,eo as bitwise_count,no as bitwise_invert,to as bitwise_left_shift,Qt as bitwise_not,Jt as bitwise_or,oo as bitwise_right_shift,Kt as bitwise_xor,Ua as block,rs as broadcast_arrays,es as broadcast_shapes,$o as broadcast_to,Is as byteswap,nm as can_cast,se as cbrt,io as ceil,ms as choose,xe as clip,Ma as column_stack,tm as common_type,ls as compress,bn as concat,Pa as concatenate,Ko as conj,Xo as conjugate,Eo as convolve,_r as copy,xt as copysign,ss as copyto,Fo as corrcoef,Ro as correlate,Pe as cos,Ye as cosh,Vt as count_nonzero,Lo as cov,Aa as cross,In as cumprod,On as cumsum,Xn as cumulative_prod,Wn as cumulative_sum,Be as deg2rad,Ue as degrees,mn as delete,sn as delete_,wr as diag,gs as diag_indices,_s as diag_indices_from,vr as diagflat,ia as diagonal,Ho as diff,Oo as digitize,jr as divide,ie as divmod,sa as dot,Ya as dsplit,Fa as dstack,Bo as ediff1d,ca as einsum,da as einsum_path,tr as empty,yr as empty_like,kt as equal,Yr as exp,Jr as exp2,Ta as expand_dims,Kr as expm1,Bt as extract,fr as eye,me as fabs,V as fft,Ds as fill,ys as fill_diagonal,uo as fix,jt as flatnonzero,ka as flatten,Wa as flip,Xa as fliplr,Za as flipud,be as float_power,po as floor,Hr as floor_divide,Ae as fmax,Se as fmin,le as fmod,Xs as format_float_positional,Zs as format_float_scientific,ce as frexp,zr as frombuffer,kr as fromfile,Dr as fromfunction,Cr as fromiter,E as fromregex,ai as fromregexFile,ni as fromregexFileSync,Tr as fromstring,or as full,gr as full_like,de as gcd,R as genfromtxt,ri as genfromtxtFile,ei as genfromtxtFileSync,pr as geomspace,$s as get_printoptions,Bs as geterr,Vo as gradient,St as greater,wt as greater_equal,rr as hasFloat16,fe as heaviside,Io as histogram,qo as histogram2d,Mo as histogram_bin_edges,Po as histogramdd,Ga as hsplit,La as hstack,je as hypot,De as i0,br as identity,ts as iindex,Jo as imag,_o as in1d,ws as indices,fa as inner,un as insert,ve as interp,xo as intersect1d,Wt as invert,Ct as isclose,ut as iscomplex,pt as iscomplexobj,gt as isdtype,nt as isfinite,ct as isfortran,No as isin,tt as isinf,ot as isnan,st as isnat,mt as isneginf,it as isposinf,ft as isreal,bt as isrealobj,dt as isscalar,mm as issubdtype,Cs as item,yt as iterable,vs as ix_,ua as kron,ye as lcm,ge as ldexp,Xt as left_shift,vt as less,zt as less_equal,Pt as lexsort,wa as linalg,ir as linspace,Ym as load,Em as loadNpy,Lm as loadNpySync,I as loadNpz,jm as loadNpzFile,Um as loadNpzFileSync,q as loadNpzSync,Jm as loadSync,Wm as loadtxt,Xm as loadtxtSync,Qr as log,Xr as log10,Zr as log1p,Wr as log2,$r as logaddexp,re as logaddexp2,$n as logical_and,et as logical_not,rt as logical_or,at as logical_xor,ur as logspace,Ss as mask_indices,Sa as matmul,_a as matrix_transpose,Na as matvec,Kn as max,Ne as maximum,Fs as may_share_memory,dn as mean,vn as median,Or as meshgrid,Qn as min,sm as min_scalar_type,he as minimum,um as mintypecode,Br as mod,_e as modf,Ia as moveaxis,Mr as multiply,we as nan_to_num,Un as nanargmax,jn as nanargmin,Bn as nancumprod,Hn as nancumsum,Mn as nanmax,Rn as nanmean,Vn as nanmedian,Fn as nanmin,Yn as nanpercentile,Pn as nanprod,Gn as nanquantile,Ln as nanstd,qn as nansum,En as nanvar,js as ndim,ae as negative,ht as nextafter,Ft as nonzero,Dt as not_equal,nr as ones,dr as ones_like,ba as outer,$t as packbits,pn as pad,k as parseNpy,C as parseNpyData,D as parseNpyHeader,T as parseNpz,O as parseNpzSync,P as parseTxt,Rt as partition,zn as percentile,xa as permute_dims,ds as place,fm as poly,bm as polyadd,lm as polyder,cm as polydiv,dm as polyfit,ym as polyint,gm as polymul,_m as polysub,xm as polyval,te as positive,Te as pow,Gr as power,em as printoptions,yn as prod,_t as promote_types,xn as ptp,ns as put,fs as put_along_axis,bs as putmask,kn as quantile,Ve as rad2deg,He as radians,H as random,Da as ravel,zs as ravel_multi_index,Yo as real,lt as real_if_close,oe as reciprocal,pe as remainder,Qa as repeat,Sr as require,za as reshape,en as resize,om as result_type,Zt as right_shift,fo as rint,rn as roll,qa as rollaxis,Nm as roots,$a as rot90,co as round,ja as row_stack,Km as save,Fm as saveNpy,Mm as saveNpySync,Hm as saveNpzFile,Bm as saveNpzFileSync,Qm as saveSync,Zm as savetxt,$m as savetxtSync,Vm as savez,Gm as savez_compressed,Ht as searchsorted,cs as select,Cm as serializeNpy,Om as serializeNpz,Im as serializeNpzSync,Pm as serializeTxt,rm as set_printoptions,ho as setdiff1d,Vs as seterr,Ao as setxor1d,Us as shape,Ms as shares_memory,ne as sign,Nt as signbit,qe as sin,ke as sinc,Ge as sinh,Hs as size,It as sort,Lt as sort_complex,At as spacing,Ha as split,Vr as sqrt,ue as square,Ca as squeeze,Ra as stack,An as std,Fr as subtract,cn as sum,Oa as swapaxes,as as take,ps as take_along_axis,Re as tan,Je as tanh,la as tensordot,Ka as tile,Os as tobytes,Ps as tofile,Ts as tolist,ma as trace,pa as transpose,jo as trapezoid,Ir as tri,qr as tril,xs as tril_indices,Ns as tril_indices_from,wo as trim_zeros,Pr as triu,hs as triu_indices,As as triu_indices_from,Ur as true_divide,bo as trunc,im as typename,So as union1d,go as unique,vo as unique_all,zo as unique_counts,ko as unique_inverse,Do as unique_values,ro as unpackbits,ks as unravel_index,Ja as unstack,ze as unwrap,Rr as vander,wn as var,Sn as variance,ya as vdot,ga as vecdot,ha as vecmat,qs as view,Va as vsplit,Ea as vstack,km as wasmConfig,Ut as where,ar as zeros,cr as zeros_like};
1
+ import{Complex as J}from"./common/complex.js";import{NDArray as Q}from"./full/index.js";import{NDArrayCore as Z}from"./common/ndarray-core.js";import{hasFloat16 as rr}from"./common/dtype.js";import{zeros as ar,ones as nr,empty as tr,full as or,array as sr,arange as mr,linspace as ir,logspace as ur,geomspace as pr,eye as fr,identity as br,asarray as lr,zeros_like as cr,ones_like as dr,empty_like as yr,full_like as gr,copy as _r,asanyarray as xr,asarray_chkfinite as Nr,ascontiguousarray as hr,asfortranarray as Ar,require as Sr,diag as wr,diagflat as vr,frombuffer as zr,fromfile as Dr,fromfunction as kr,fromiter as Cr,fromstring as Tr,meshgrid as Or,tri as Ir,tril as qr,triu as Pr,vander as Rr}from"./full/index.js";import{add as Lr,subtract as Fr,multiply as Mr,divide as jr,true_divide as Ur,floor_divide as Hr,mod as Br,sqrt as Vr,power as Gr,exp as Yr,exp2 as Wr,expm1 as Jr,log as Kr,log2 as Qr,log10 as Xr,log1p as Zr,logaddexp as $r,logaddexp2 as re,absolute as ee,negative as ae,sign as ne,positive as te,reciprocal as oe,cbrt as se,fabs as me,divmod as ie,square as ue,remainder as pe,heaviside as fe,float_power as be,fmod as le,frexp as ce,gcd as de,lcm as ye,ldexp as ge,modf as _e,clip as xe,maximum as Ne,minimum as he,fmax as Ae,fmin as Se,nan_to_num as we,interp as ve,unwrap as ze,sinc as De,i0 as ke}from"./full/index.js";import{power as Te,absolute as Oe}from"./full/index.js";import{sin as qe,cos as Pe,tan as Re,arcsin as Ee,arccos as Le,arctan as Fe,arctan2 as Me,hypot as je,degrees as Ue,radians as He,deg2rad as Be,rad2deg as Ve,sinh as Ge,cosh as Ye,tanh as We,arcsinh as Je,arccosh as Ke,arctanh as Qe}from"./full/index.js";import{arcsin as Ze,arccos as $e,arctan as ra,arctan2 as ea,arcsinh as aa,arccosh as na,arctanh as ta}from"./full/index.js";import{dot as sa,trace as ma,diagonal as ia,kron as ua,transpose as pa,inner as fa,outer as ba,tensordot as la,einsum as ca,einsum_path as da,vdot as ya,vecdot as ga,matrix_transpose as _a,permute_dims as xa,matvec as Na,vecmat as ha,cross as Aa,matmul as Sa,linalg as wa}from"./full/index.js";import{reshape as za,flatten as Da,ravel as ka,squeeze as Ca,expand_dims as Ta,swapaxes as Oa,moveaxis as Ia,rollaxis as qa,concatenate as Pa,stack as Ra,vstack as Ea,hstack as La,dstack as Fa,column_stack as Ma,row_stack as ja,block as Ua,split as Ha,array_split as Ba,vsplit as Va,hsplit as Ga,dsplit as Ya,unstack as Wa,tile as Ja,repeat as Ka,flip as Qa,fliplr as Xa,flipud as Za,rot90 as $a,roll as rn,resize as en,atleast_1d as an,atleast_2d as nn,atleast_3d as tn,append as on,delete_ as sn,delete_ as mn,insert as un,pad as pn}from"./full/index.js";import{concatenate as bn}from"./full/index.js";import{sum as cn,mean as dn,prod as yn,amax as gn,amin as _n,ptp as xn,argmin as Nn,argmax as hn,std as An,variance as Sn,var_ as wn,median as vn,percentile as zn,quantile as Dn,average as kn,all as Cn,any as Tn,cumsum as On,cumprod as In,nansum as qn,nanprod as Pn,nanmean as Rn,nanvar as En,nanstd as Ln,nanmin as Fn,nanmax as Mn,nanargmin as jn,nanargmax as Un,nancumsum as Hn,nancumprod as Bn,nanmedian as Vn,nanquantile as Gn,nanpercentile as Yn}from"./full/index.js";import{amax as Jn,amin as Kn,cumsum as Qn,cumprod as Xn}from"./full/index.js";import{logical_and as $n,logical_or as rt,logical_not as et,logical_xor as at,isfinite as nt,isinf as tt,isnan as ot,isnat as st,isneginf as mt,isposinf as it,iscomplex as ut,iscomplexobj as pt,isreal as ft,isrealobj as bt,real_if_close as lt,isfortran as ct,isscalar as dt,iterable as yt,isdtype as gt,promote_types as _t,copysign as xt,signbit as Nt,nextafter as ht,spacing as At,greater as St,greater_equal as wt,less as vt,less_equal as zt,equal as Dt,not_equal as kt,isclose as Ct,allclose as Tt}from"./full/index.js";import{sort as It,argsort as qt,lexsort as Pt,partition as Rt,argpartition as Et,sort_complex as Lt,nonzero as Ft,argwhere as Mt,flatnonzero as jt,where as Ut,searchsorted as Ht,extract as Bt,count_nonzero as Vt}from"./full/index.js";import{bitwise_and as Yt,bitwise_or as Wt,bitwise_xor as Jt,bitwise_not as Kt,invert as Qt,left_shift as Xt,right_shift as Zt,packbits as $t,unpackbits as ro,bitwise_count as eo}from"./full/index.js";import{bitwise_not as no,left_shift as to,right_shift as oo}from"./full/index.js";import{around as mo,ceil as io,fix as uo,floor as po,rint as fo,trunc as bo}from"./full/index.js";import{around as co}from"./full/index.js";import{unique as go,in1d as _o,intersect1d as xo,isin as No,setdiff1d as ho,setxor1d as Ao,union1d as So,trim_zeros as wo,unique_all as vo,unique_counts as zo,unique_inverse as Do,unique_values as ko}from"./full/index.js";import{bincount as To,digitize as Oo,histogram as Io,histogram2d as qo,histogramdd as Po,correlate as Ro,convolve as Eo,cov as Lo,corrcoef as Fo,histogram_bin_edges as Mo,trapezoid as jo}from"./full/index.js";import{diff as Ho,ediff1d as Bo,gradient as Vo}from"./full/index.js";import{real as Yo,imag as Wo,conj as Jo,angle as Ko}from"./full/index.js";import{conj as Xo}from"./full/index.js";import{broadcast_to as $o,broadcast_arrays as rs,broadcast_shapes as es,take as as,put as ns,iindex as ts,bindex as os,vindex as ss,copyto as ms,choose as is,array_equal as us,array_equiv as ps,take_along_axis as fs,put_along_axis as bs,putmask as ls,compress as cs,select as ds,place as ys,fill_diagonal as gs,diag_indices as _s,diag_indices_from as xs,tril_indices as Ns,tril_indices_from as hs,triu_indices as As,triu_indices_from as Ss,mask_indices as ws,indices as vs,ix_ as zs,ravel_multi_index as Ds,unravel_index as ks,fill as Cs,item as Ts,tolist as Os,tobytes as Is,byteswap as qs,view as Ps,tofile as Rs}from"./full/index.js";import{apply_along_axis as Ls,apply_over_axes as Fs,may_share_memory as Ms,shares_memory as js,ndim as Us,shape as Hs,size as Bs,geterr as Vs,seterr as Gs}from"./full/index.js";import{array2string as Ws,array_repr as Js,array_str as Ks,base_repr as Qs,binary_repr as Xs,format_float_positional as Zs,format_float_scientific as $s,get_printoptions as rm,set_printoptions as em,printoptions as am}from"./full/index.js";import{can_cast as tm,common_type as om,result_type as sm,min_scalar_type as mm,issubdtype as im,typename as um,mintypecode as pm}from"./full/index.js";import{poly as bm,polyadd as lm,polyder as cm,polydiv as dm,polyfit as ym,polyint as gm,polymul as _m,polysub as xm,polyval as Nm,roots as hm}from"./full/index.js";import{UnsupportedDTypeError as Sm,InvalidNpyError as wm,SUPPORTED_DTYPES as vm,DTYPE_TO_DESCR as zm}from"./io/npy/format.js";import{wasmConfig as km}from"./common/wasm/config.js";import{configureWasm as Tm}from"./common/wasm/runtime.js";import{serializeNpy as Im}from"./io/npy/serializer.js";import{serializeNpz as Pm,serializeNpzSync as Rm}from"./io/npz/serializer.js";import{serializeTxt as Lm}from"./io/txt/serializer.js";import{parseNpy as c,parseNpyHeader as d,parseNpyData as y}from"./io/npy/parser.js";import{parseNpz as g,parseNpzSync as _,loadNpz as x,loadNpzSync as N}from"./io/npz/parser.js";import{parseTxt as h,genfromtxt as A,fromregex as S}from"./io/txt/parser.js";function f(r){return s.fromStorage(r.storage)}function D(r){return f(c(r))}const k=d;function C(r,e){return f(y(r,e))}async function T(r,e={}){const a=await g(r,e),n=new Map;for(const[m,u]of a.arrays)n.set(m,f(u));return{arrays:n,skipped:a.skipped,errors:a.errors}}function O(r,e={}){const a=_(r,e),n=new Map;for(const[m,u]of a.arrays)n.set(m,f(u));return{arrays:n,skipped:a.skipped,errors:a.errors}}async function I(r,e={}){const a=await x(r,e),n={};for(const[m,u]of Object.entries(a))n[m]=f(u);return n}function q(r,e={}){const a=N(r,e),n={};for(const[m,u]of Object.entries(a))n[m]=f(u);return n}function P(r,e={}){return f(h(r,e))}function R(r,e={}){return f(A(r,e))}function E(r,e,a="float64"){return f(S(r,e,a))}import{loadNpy as Mm,loadNpySync as jm,saveNpy as Um,saveNpySync as Hm,loadNpzFile as Bm,loadNpzFileSync as Vm,saveNpz as Gm,saveNpzSync as Ym,savez as Wm,savez_compressed as Jm,load as Km,loadSync as Qm,save as Xm,saveSync as Zm,loadtxt as $m,loadtxtSync as ri,savetxt as ei,savetxtSync as ai,genfromtxt as ni,genfromtxtSync as ti,fromregex as oi,fromregexSync as si}from"./io/file-ops.js";import*as o from"./common/ops/random.js";import{NDArray as s}from"./full/index.js";function t(r){return r&&typeof r=="object"&&"_data"in r&&"_shape"in r?s.fromStorage(r):r}const H={seed:o.seed,get_state:o.get_state,set_state:o.set_state,get_bit_generator:o.get_bit_generator,set_bit_generator:o.set_bit_generator,default_rng:r=>{const e=o.default_rng(r),a=n=>n instanceof s||n instanceof l?n.storage:n;return{random:n=>t(e.random(n)),integers:(n,m,u)=>t(e.integers(n,m,u)),standard_normal:n=>t(e.standard_normal(n)),normal:(n,m,u)=>t(e.normal(n,m,u)),uniform:(n,m,u)=>t(e.uniform(n,m,u)),choice:(n,m,u,b)=>t(e.choice(a(n),m,u,b instanceof s||b instanceof l?b.storage:b)),permutation:n=>t(e.permutation(a(n))),shuffle:n=>e.shuffle(n instanceof s||n instanceof l?n.storage:n),exponential:(n,m)=>t(e.exponential(n,m)),poisson:(n,m)=>t(e.poisson(n,m)),binomial:(n,m,u)=>t(e.binomial(n,m,u))}},Generator:o.Generator,random:r=>t(o.random(r)),rand:(...r)=>t(o.rand(...r)),randn:(...r)=>t(o.randn(...r)),randint:(r,e,a,n)=>t(o.randint(r,e,a,n)),random_sample:r=>t(o.random_sample(r)),ranf:r=>t(o.ranf(r)),sample:r=>t(o.sample(r)),random_integers:(r,e,a)=>t(o.random_integers(r,e,a)),bytes:o.bytes,uniform:(r,e,a)=>t(o.uniform(r,e,a)),normal:(r,e,a)=>t(o.normal(r,e,a)),standard_normal:r=>t(o.standard_normal(r)),exponential:(r,e)=>t(o.exponential(r,e)),standard_exponential:r=>t(o.standard_exponential(r)),gamma:(r,e,a)=>t(o.gamma(r,e,a)),standard_gamma:(r,e)=>t(o.standard_gamma(r,e)),beta:(r,e,a)=>t(o.beta(r,e,a)),chisquare:(r,e)=>t(o.chisquare(r,e)),noncentral_chisquare:(r,e,a)=>t(o.noncentral_chisquare(r,e,a)),f:(r,e,a)=>t(o.f(r,e,a)),noncentral_f:(r,e,a,n)=>t(o.noncentral_f(r,e,a,n)),standard_cauchy:r=>t(o.standard_cauchy(r)),standard_t:(r,e)=>t(o.standard_t(r,e)),laplace:(r,e,a)=>t(o.laplace(r,e,a)),logistic:(r,e,a)=>t(o.logistic(r,e,a)),lognormal:(r,e,a)=>t(o.lognormal(r,e,a)),gumbel:(r,e,a)=>t(o.gumbel(r,e,a)),pareto:(r,e)=>t(o.pareto(r,e)),power:(r,e)=>t(o.power(r,e)),rayleigh:(r,e)=>t(o.rayleigh(r,e)),triangular:(r,e,a,n)=>t(o.triangular(r,e,a,n)),wald:(r,e,a)=>t(o.wald(r,e,a)),weibull:(r,e)=>t(o.weibull(r,e)),poisson:(r,e)=>t(o.poisson(r,e)),binomial:(r,e,a)=>t(o.binomial(r,e,a)),geometric:(r,e)=>t(o.geometric(r,e)),hypergeometric:(r,e,a,n)=>t(o.hypergeometric(r,e,a,n)),logseries:(r,e)=>t(o.logseries(r,e)),negative_binomial:(r,e,a)=>t(o.negative_binomial(r,e,a)),zipf:(r,e)=>t(o.zipf(r,e)),multinomial:(r,e,a)=>t(o.multinomial(r,e,a)),multivariate_normal:(r,e,a,n,m)=>t(o.multivariate_normal(r,e,a,n,m)),dirichlet:(r,e)=>t(o.dirichlet(r,e)),vonmises:(r,e,a)=>t(o.vonmises(r,e,a)),choice:(r,e,a,n)=>t(o.choice(r,e,a,n)),permutation:r=>t(o.permutation(r)),shuffle:r=>o.shuffle(r instanceof s||r instanceof l?r.storage:r)};import*as i from"./common/ops/fft.js";import{NDArrayCore as l}from"./common/ndarray-core.js";function p(r){return r instanceof s||r instanceof l?r.storage:r}const V={fft:(r,e,a,n)=>s.fromStorage(i.fft(p(r),e,a,n)),ifft:(r,e,a,n)=>s.fromStorage(i.ifft(p(r),e,a,n)),fft2:(r,e,a,n)=>s.fromStorage(i.fft2(p(r),e,a,n)),ifft2:(r,e,a,n)=>s.fromStorage(i.ifft2(p(r),e,a,n)),fftn:(r,e,a,n)=>s.fromStorage(i.fftn(p(r),e,a,n)),ifftn:(r,e,a,n)=>s.fromStorage(i.ifftn(p(r),e,a,n)),rfft:(r,e,a,n)=>s.fromStorage(i.rfft(p(r),e,a,n)),irfft:(r,e,a,n)=>s.fromStorage(i.irfft(p(r),e,a,n)),rfft2:(r,e,a,n)=>s.fromStorage(i.rfft2(p(r),e,a,n)),irfft2:(r,e,a,n)=>s.fromStorage(i.irfft2(p(r),e,a,n)),rfftn:(r,e,a,n)=>s.fromStorage(i.rfftn(p(r),e,a,n)),irfftn:(r,e,a,n)=>s.fromStorage(i.irfftn(p(r),e,a,n)),hfft:(r,e,a,n)=>s.fromStorage(i.hfft(p(r),e,a,n)),ihfft:(r,e,a,n)=>s.fromStorage(i.ihfft(p(r),e,a,n)),fftfreq:(r,e)=>s.fromStorage(i.fftfreq(r,e)),rfftfreq:(r,e)=>s.fromStorage(i.rfftfreq(r,e)),fftshift:(r,e)=>s.fromStorage(i.fftshift(p(r),e)),ifftshift:(r,e)=>s.fromStorage(i.ifftshift(p(r),e))},G="1.3.0";export{J as Complex,zm as DTYPE_TO_DESCR,wm as InvalidNpyError,Q as NDArray,Z as NDArrayCore,vm as SUPPORTED_DTYPES,Sm as UnsupportedDTypeError,G as __version__,Oe as abs,ee as absolute,$e as acos,na as acosh,Lr as add,Cn as all,Tt as allclose,gn as amax,_n as amin,Ko as angle,Tn as any,on as append,Ls as apply_along_axis,Fs as apply_over_axes,mr as arange,Le as arccos,Ke as arccosh,Ee as arcsin,Je as arcsinh,Fe as arctan,Me as arctan2,Qe as arctanh,hn as argmax,Nn as argmin,Et as argpartition,qt as argsort,Mt as argwhere,mo as around,sr as array,Ws as array2string,us as array_equal,ps as array_equiv,Js as array_repr,Ba as array_split,Ks as array_str,xr as asanyarray,lr as asarray,Nr as asarray_chkfinite,hr as ascontiguousarray,Ar as asfortranarray,Ze as asin,aa as asinh,ra as atan,ea as atan2,ta as atanh,an as atleast_1d,nn as atleast_2d,tn as atleast_3d,kn as average,Qs as base_repr,Xs as binary_repr,To as bincount,os as bindex,Yt as bitwise_and,eo as bitwise_count,no as bitwise_invert,to as bitwise_left_shift,Kt as bitwise_not,Wt as bitwise_or,oo as bitwise_right_shift,Jt as bitwise_xor,Ua as block,rs as broadcast_arrays,es as broadcast_shapes,$o as broadcast_to,qs as byteswap,tm as can_cast,se as cbrt,io as ceil,is as choose,xe as clip,Ma as column_stack,om as common_type,cs as compress,bn as concat,Pa as concatenate,Tm as configureWasm,Jo as conj,Xo as conjugate,Eo as convolve,_r as copy,xt as copysign,ms as copyto,Fo as corrcoef,Ro as correlate,Pe as cos,Ye as cosh,Vt as count_nonzero,Lo as cov,Aa as cross,In as cumprod,On as cumsum,Xn as cumulative_prod,Qn as cumulative_sum,Be as deg2rad,Ue as degrees,mn as delete,sn as delete_,wr as diag,_s as diag_indices,xs as diag_indices_from,vr as diagflat,ia as diagonal,Ho as diff,Oo as digitize,jr as divide,ie as divmod,sa as dot,Ya as dsplit,Fa as dstack,Bo as ediff1d,ca as einsum,da as einsum_path,tr as empty,yr as empty_like,Dt as equal,Yr as exp,Wr as exp2,Ta as expand_dims,Jr as expm1,Bt as extract,fr as eye,me as fabs,V as fft,Cs as fill,gs as fill_diagonal,uo as fix,jt as flatnonzero,Da as flatten,Qa as flip,Xa as fliplr,Za as flipud,be as float_power,po as floor,Hr as floor_divide,Ae as fmax,Se as fmin,le as fmod,Zs as format_float_positional,$s as format_float_scientific,ce as frexp,zr as frombuffer,Dr as fromfile,kr as fromfunction,Cr as fromiter,E as fromregex,oi as fromregexFile,si as fromregexFileSync,Tr as fromstring,or as full,gr as full_like,de as gcd,R as genfromtxt,ni as genfromtxtFile,ti as genfromtxtFileSync,pr as geomspace,rm as get_printoptions,Vs as geterr,Vo as gradient,St as greater,wt as greater_equal,rr as hasFloat16,fe as heaviside,Io as histogram,qo as histogram2d,Mo as histogram_bin_edges,Po as histogramdd,Ga as hsplit,La as hstack,je as hypot,ke as i0,br as identity,ts as iindex,Wo as imag,_o as in1d,vs as indices,fa as inner,un as insert,ve as interp,xo as intersect1d,Qt as invert,Ct as isclose,ut as iscomplex,pt as iscomplexobj,gt as isdtype,nt as isfinite,ct as isfortran,No as isin,tt as isinf,ot as isnan,st as isnat,mt as isneginf,it as isposinf,ft as isreal,bt as isrealobj,dt as isscalar,im as issubdtype,Ts as item,yt as iterable,zs as ix_,ua as kron,ye as lcm,ge as ldexp,Xt as left_shift,vt as less,zt as less_equal,Pt as lexsort,wa as linalg,ir as linspace,Km as load,Mm as loadNpy,jm as loadNpySync,I as loadNpz,Bm as loadNpzFile,Vm as loadNpzFileSync,q as loadNpzSync,Qm as loadSync,$m as loadtxt,ri as loadtxtSync,Kr as log,Xr as log10,Zr as log1p,Qr as log2,$r as logaddexp,re as logaddexp2,$n as logical_and,et as logical_not,rt as logical_or,at as logical_xor,ur as logspace,ws as mask_indices,Sa as matmul,_a as matrix_transpose,Na as matvec,Jn as max,Ne as maximum,Ms as may_share_memory,dn as mean,vn as median,Or as meshgrid,Kn as min,mm as min_scalar_type,he as minimum,pm as mintypecode,Br as mod,_e as modf,Ia as moveaxis,Mr as multiply,we as nan_to_num,Un as nanargmax,jn as nanargmin,Bn as nancumprod,Hn as nancumsum,Mn as nanmax,Rn as nanmean,Vn as nanmedian,Fn as nanmin,Yn as nanpercentile,Pn as nanprod,Gn as nanquantile,Ln as nanstd,qn as nansum,En as nanvar,Us as ndim,ae as negative,ht as nextafter,Ft as nonzero,kt as not_equal,nr as ones,dr as ones_like,ba as outer,$t as packbits,pn as pad,D as parseNpy,C as parseNpyData,k as parseNpyHeader,T as parseNpz,O as parseNpzSync,P as parseTxt,Rt as partition,zn as percentile,xa as permute_dims,ys as place,bm as poly,lm as polyadd,cm as polyder,dm as polydiv,ym as polyfit,gm as polyint,_m as polymul,xm as polysub,Nm as polyval,te as positive,Te as pow,Gr as power,am as printoptions,yn as prod,_t as promote_types,xn as ptp,ns as put,bs as put_along_axis,ls as putmask,Dn as quantile,Ve as rad2deg,He as radians,H as random,ka as ravel,Ds as ravel_multi_index,Yo as real,lt as real_if_close,oe as reciprocal,pe as remainder,Ka as repeat,Sr as require,za as reshape,en as resize,sm as result_type,Zt as right_shift,fo as rint,rn as roll,qa as rollaxis,hm as roots,$a as rot90,co as round,ja as row_stack,Xm as save,Um as saveNpy,Hm as saveNpySync,Gm as saveNpzFile,Ym as saveNpzFileSync,Zm as saveSync,ei as savetxt,ai as savetxtSync,Wm as savez,Jm as savez_compressed,Ht as searchsorted,ds as select,Im as serializeNpy,Pm as serializeNpz,Rm as serializeNpzSync,Lm as serializeTxt,em as set_printoptions,ho as setdiff1d,Gs as seterr,Ao as setxor1d,Hs as shape,js as shares_memory,ne as sign,Nt as signbit,qe as sin,De as sinc,Ge as sinh,Bs as size,It as sort,Lt as sort_complex,At as spacing,Ha as split,Vr as sqrt,ue as square,Ca as squeeze,Ra as stack,An as std,Fr as subtract,cn as sum,Oa as swapaxes,as as take,fs as take_along_axis,Re as tan,We as tanh,la as tensordot,Ja as tile,Is as tobytes,Rs as tofile,Os as tolist,ma as trace,pa as transpose,jo as trapezoid,Ir as tri,qr as tril,Ns as tril_indices,hs as tril_indices_from,wo as trim_zeros,Pr as triu,As as triu_indices,Ss as triu_indices_from,Ur as true_divide,bo as trunc,um as typename,So as union1d,go as unique,vo as unique_all,zo as unique_counts,Do as unique_inverse,ko as unique_values,ro as unpackbits,ks as unravel_index,Wa as unstack,ze as unwrap,Rr as vander,wn as var,Sn as variance,ya as vdot,ga as vecdot,ha as vecmat,Ps as view,ss as vindex,Va as vsplit,Ea as vstack,km as wasmConfig,Ut as where,ar as zeros,cr as zeros_like};
@@ -1 +1 @@
1
- import{NDArrayCore as D}from"../../common/ndarray-core.js";import{ArrayStorage as m}from"../../common/storage.js";import{getTypedArrayConstructor as g,hasFloat16 as U,isBigIntDType as I,isComplexDType as S}from"../../common/dtype.js";import{float16BytesToTypedArray as x}from"../../common/float16-conv.js";import{NPY_MAGIC as N,parseDescriptor as C,InvalidNpyError as A}from"./format.js";function _(r){const e=r instanceof ArrayBuffer?new Uint8Array(r):r,t=T(e);return v(e,t)}function T(r){if(r.length<10)throw new A("File too small to be a valid NPY file");for(let c=0;c<N.length;c++)if(r[c]!==N[c])throw new A("Invalid NPY magic number");const e=r[6],t=r[7];if(e!==1&&e!==2&&e!==3)throw new A(`Unsupported NPY version: ${e}.${t}`);let n,a;e===1?(n=r[8]|r[9]<<8,a=10):(n=r[8]|r[9]<<8|r[10]<<16|r[11]<<24,a=12);const w=a+n;if(r.length<w)throw new A("File truncated: header extends beyond file");const l=r.slice(a,w),p=new TextDecoder("utf-8").decode(l).trim(),o=F(p);return{version:{major:e,minor:t},header:o,dataOffset:w}}function v(r,e){const{header:t,dataOffset:n}=e,{dtype:a,needsByteSwap:w,itemsize:l}=C(t.descr),p=t.shape.reduce((h,u)=>h*u,1),o=p*l,c=r.length-n;if(c<o)throw new A(`File truncated: expected ${o} bytes of data, got ${c}`);const y=new ArrayBuffer(o);new Uint8Array(y).set(r.subarray(n,n+o));const s=M(y,a,p,w,l),f=t.shape;let i;if(t.fortran_order&&f.length>1){const h=[...f].reverse(),u=m.fromData(s,h,a);i=$(u,h)}else i=m.fromData(s,[...f],a);return new D(i)}function F(r){const e=r.match(/'descr'\s*:\s*'([^']+)'/),t=r.match(/'fortran_order'\s*:\s*(True|False)/),n=r.match(/'shape'\s*:\s*\(([^)]*)\)/);if(!e||!t||!n)throw new A(`Failed to parse NPY header: ${r}`);const a=e[1],w=t[1]==="True",l=n[1].trim();let p;return l===""?p=[]:p=l.split(",").map(o=>o.trim()).filter(o=>o!=="").map(o=>{const c=parseInt(o,10);if(isNaN(c))throw new A(`Invalid shape value: ${o}`);return c}),{descr:a,fortran_order:w,shape:p}}function M(r,e,t,n,a){const w=S(e);if(e==="float16"&&!U){let y=r;if(n){const d=new Uint8Array(r),s=new Uint8Array(r.byteLength);for(let f=0;f<t;f++){const i=f*2;s[i]=d[i+1],s[i+1]=d[i]}y=s.buffer}return x(y,0,t,!1)}const l=g(e);if(!l)throw new A(`Cannot create array for dtype: ${e}`);const p=w?t*2:t;if(!n)return new l(r,0,p);const o=new Uint8Array(r),c=new Uint8Array(r.byteLength);if(w){const y=a/2;for(let d=0;d<t*2;d++){const s=d*y;for(let f=0;f<y;f++)c[s+f]=o[s+y-1-f]}}else for(let y=0;y<t;y++){const d=y*a;for(let s=0;s<a;s++)c[d+s]=o[d+a-1-s]}return new l(c.buffer,0,p)}function $(r,e){const t=e.length,n=r.size,a=r.dtype,w=g(a);if(!w)throw new A(`Cannot create array for dtype: ${a}`);const l=new w(n),p=[...e].reverse(),o=B(e),c=B(p),y=new Array(t).fill(0);for(let d=0;d<n;d++){let s=d;for(let i=0;i<t;i++){const h=o[i];y[i]=Math.floor(s/h),s=s%h}let f=0;for(let i=0;i<t;i++)f+=y[t-1-i]*c[i];I(a),l[f]=r.iget(d)}return m.fromData(l,p,a)}function B(r){const e=new Array(r.length);let t=1;for(let n=r.length-1;n>=0;n--)e[n]=t,t*=r[n];return e}export{_ as parseNpy,v as parseNpyData,T as parseNpyHeader};
1
+ import{NDArrayCore as U}from"../../common/ndarray-core.js";import{ArrayStorage as g}from"../../common/storage.js";import{getTypedArrayConstructor as B,hasFloat16 as x,isBigIntDType as F,isComplexDType as C}from"../../common/dtype.js";import{float16BytesToTypedArray as v}from"../../common/float16-conv.js";import{wasmMalloc as M,getSharedMemory as b}from"../../common/wasm/runtime.js";import{NPY_MAGIC as I,parseDescriptor as $,InvalidNpyError as m}from"./format.js";function k(r){const e=r instanceof ArrayBuffer?new Uint8Array(r):r,t=P(e);return L(e,t)}function P(r){if(r.length<10)throw new m("File too small to be a valid NPY file");for(let f=0;f<I.length;f++)if(r[f]!==I[f])throw new m("Invalid NPY magic number");const e=r[6],t=r[7];if(e!==1&&e!==2&&e!==3)throw new m(`Unsupported NPY version: ${e}.${t}`);let a,n;e===1?(a=r[8]|r[9]<<8,n=10):(a=r[8]|r[9]<<8|r[10]<<16|r[11]<<24,n=12);const u=n+a;if(r.length<u)throw new m("File truncated: header extends beyond file");const d=r.slice(n,u),c=new TextDecoder("utf-8").decode(d).trim(),o=Y(c);return{version:{major:e,minor:t},header:o,dataOffset:u}}function L(r,e){const{header:t,dataOffset:a}=e,{dtype:n,needsByteSwap:u,itemsize:d}=$(t.descr),c=t.shape.reduce((h,w)=>h*w,1),o=c*d,f=r.length-a;if(f<o)throw new m(`File truncated: expected ${o} bytes of data, got ${f}`);const s=t.shape,i=C(n)?c*2:c,l=t.fortran_order&&s.length>1;if(!u&&!l&&!(n==="float16"&&!x)){const h=B(n);if(h){const w=M(o);if(w){const T=b();return new Uint8Array(T.buffer,w.ptr,o).set(r.subarray(a,a+o)),new U(g.fromWasmRegion([...s],n,w,i,h))}}}const A=new ArrayBuffer(o);new Uint8Array(A).set(r.subarray(a,a+o));const D=H(A,n,c,u,d);let N;if(l){const h=[...s].reverse(),w=g.fromData(D,h,n);N=_(w,h)}else N=g.fromData(D,[...s],n);return new U(N)}function Y(r){const e=r.match(/'descr'\s*:\s*'([^']+)'/),t=r.match(/'fortran_order'\s*:\s*(True|False)/),a=r.match(/'shape'\s*:\s*\(([^)]*)\)/);if(!e||!t||!a)throw new m(`Failed to parse NPY header: ${r}`);const n=e[1],u=t[1]==="True",d=a[1].trim();let c;return d===""?c=[]:c=d.split(",").map(o=>o.trim()).filter(o=>o!=="").map(o=>{const f=parseInt(o,10);if(isNaN(f))throw new m(`Invalid shape value: ${o}`);return f}),{descr:n,fortran_order:u,shape:c}}function H(r,e,t,a,n){const u=C(e);if(e==="float16"&&!x){let s=r;if(a){const y=new Uint8Array(r),i=new Uint8Array(r.byteLength);for(let l=0;l<t;l++){const p=l*2;i[p]=y[p+1],i[p+1]=y[p]}s=i.buffer}return v(s,0,t,!1)}const d=B(e);if(!d)throw new m(`Cannot create array for dtype: ${e}`);const c=u?t*2:t;if(!a)return new d(r,0,c);const o=new Uint8Array(r),f=new Uint8Array(r.byteLength);if(u){const s=n/2;for(let y=0;y<t*2;y++){const i=y*s;for(let l=0;l<s;l++)f[i+l]=o[i+s-1-l]}}else for(let s=0;s<t;s++){const y=s*n;for(let i=0;i<n;i++)f[y+i]=o[y+n-1-i]}return new d(f.buffer,0,c)}function _(r,e){const t=e.length,a=r.size,n=r.dtype,u=B(n);if(!u)throw new m(`Cannot create array for dtype: ${n}`);const d=new u(a),c=[...e].reverse(),o=S(e),f=S(c),s=new Array(t).fill(0);for(let y=0;y<a;y++){let i=y;for(let p=0;p<t;p++){const A=o[p];s[p]=Math.floor(i/A),i=i%A}let l=0;for(let p=0;p<t;p++)l+=s[t-1-p]*f[p];F(n),d[l]=r.iget(y)}return g.fromData(d,c,n)}function S(r){const e=new Array(r.length);let t=1;for(let a=r.length-1;a>=0;a--)e[a]=t,t*=r[a];return e}export{k as parseNpy,L as parseNpyData,P as parseNpyHeader};
@@ -1 +1 @@
1
- import{ZIP_LOCAL_SIGNATURE as D,ZIP_END_SIGNATURE as b,ZIP_STORED as g,ZIP_DEFLATED as Z}from"./types.js";async function O(r){const s=h(r),e=new Map;for(const o of s){const a=await M(o);e.set(o.name,a)}return e}function P(r){const s=h(r),e=new Map;for(const o of s){if(o.compressionMethod!==g)throw new Error(`Cannot read compressed entry synchronously: ${o.name}. Use readZip() (async) for DEFLATE-compressed files.`);e.set(o.name,o.compressedData)}return e}function h(r){const s=r instanceof ArrayBuffer?new Uint8Array(r):r,e=new DataView(s.buffer,s.byteOffset,s.byteLength),o=[];let a=-1;for(let t=s.length-22;t>=0;t--)if(e.getUint32(t,!0)===b){a=t;break}if(a===-1)throw new Error("Invalid ZIP file: end of central directory not found");const c=e.getUint32(a+16,!0),m=e.getUint16(a+10,!0),f=[];let n=c;for(let t=0;t<m&&e.getUint32(n,!0)===33639248;t++){const y=e.getUint16(n+10,!0),p=e.getUint32(n+16,!0),l=e.getUint32(n+20,!0),d=e.getUint32(n+24,!0),u=e.getUint16(n+28,!0),w=e.getUint16(n+30,!0),U=e.getUint16(n+32,!0),A=e.getUint32(n+42,!0),E=s.slice(n+46,n+46+u),S=new TextDecoder("utf-8").decode(E);f.push({name:S,compressionMethod:y,crc32:p,compressedSize:l,uncompressedSize:d,localHeaderOffset:A}),n=n+46+u+w+U}for(const t of f){const i=t.localHeaderOffset;if(e.getUint32(i,!0)!==D)throw new Error(`Invalid local file header at offset ${i}`);const p=e.getUint16(i+26,!0),l=e.getUint16(i+28,!0),d=i+30+p+l,u=s.slice(d,d+t.compressedSize);o.push({name:t.name,compressedData:u,compressionMethod:t.compressionMethod,crc32:t.crc32,compressedSize:t.compressedSize,uncompressedSize:t.uncompressedSize})}return o}async function M(r){if(r.compressionMethod===g)return r.compressedData;if(r.compressionMethod===Z)return await L(r.compressedData);throw new Error(`Unsupported compression method: ${r.compressionMethod}`)}async function L(r){if(typeof DecompressionStream>"u")throw new Error("DecompressionStream is not available. This environment does not support the Compression Streams API. Please use a modern browser or Node.js 18+.");const s=new DecompressionStream("deflate-raw"),e=new Uint8Array(r.length);e.set(r);const o=s.writable.getWriter();o.write(e),o.close();const a=s.readable.getReader(),c=[];for(;;){const{done:t,value:i}=await a.read();if(t)break;c.push(i)}const m=c.reduce((t,i)=>t+i.length,0),f=new Uint8Array(m);let n=0;for(const t of c)f.set(t,n),n+=t.length;return f}export{O as readZip,P as readZipSync};
1
+ import{ZIP_LOCAL_SIGNATURE as D,ZIP_END_SIGNATURE as b,ZIP_STORED as g,ZIP_DEFLATED as Z}from"./types.js";async function O(r){const s=h(r),e=new Map;for(const o of s){const a=await M(o);e.set(o.name,a)}return e}function P(r){const s=h(r),e=new Map;for(const o of s){if(o.compressionMethod!==g)throw new Error(`Cannot read compressed entry synchronously: ${o.name}. Use readZip() (async) for DEFLATE-compressed files.`);e.set(o.name,o.compressedData)}return e}function h(r){const s=r instanceof ArrayBuffer?new Uint8Array(r):r,e=new DataView(s.buffer,s.byteOffset,s.byteLength),o=[];let a=-1;for(let t=s.length-22;t>=0;t--)if(e.getUint32(t,!0)===b){a=t;break}if(a===-1)throw new Error("Invalid ZIP file: end of central directory not found");const c=e.getUint32(a+16,!0),m=e.getUint16(a+10,!0),f=[];let n=c;for(let t=0;t<m&&e.getUint32(n,!0)===33639248;t++){const y=e.getUint16(n+10,!0),p=e.getUint32(n+16,!0),l=e.getUint32(n+20,!0),d=e.getUint32(n+24,!0),u=e.getUint16(n+28,!0),w=e.getUint16(n+30,!0),U=e.getUint16(n+32,!0),A=e.getUint32(n+42,!0),E=s.slice(n+46,n+46+u),S=new TextDecoder("utf-8").decode(E);f.push({name:S,compressionMethod:y,crc32:p,compressedSize:l,uncompressedSize:d,localHeaderOffset:A}),n=n+46+u+w+U}for(const t of f){const i=t.localHeaderOffset;if(e.getUint32(i,!0)!==D)throw new Error(`Invalid local file header at offset ${i}`);const p=e.getUint16(i+26,!0),l=e.getUint16(i+28,!0),d=i+30+p+l,u=s.subarray(d,d+t.compressedSize);o.push({name:t.name,compressedData:u,compressionMethod:t.compressionMethod,crc32:t.crc32,compressedSize:t.compressedSize,uncompressedSize:t.uncompressedSize})}return o}async function M(r){if(r.compressionMethod===g)return r.compressedData;if(r.compressionMethod===Z)return await L(r.compressedData);throw new Error(`Unsupported compression method: ${r.compressionMethod}`)}async function L(r){if(typeof DecompressionStream>"u")throw new Error("DecompressionStream is not available. This environment does not support the Compression Streams API. Please use a modern browser or Node.js 18+.");const s=new DecompressionStream("deflate-raw"),e=new Uint8Array(r.length);e.set(r);const o=s.writable.getWriter();o.write(e),o.close();const a=s.readable.getReader(),c=[];for(;;){const{done:t,value:i}=await a.read();if(t)break;c.push(i)}const m=c.reduce((t,i)=>t+i.length,0),f=new Uint8Array(m);let n=0;for(const t of c)f.set(t,n),n+=t.length;return f}export{O as readZip,P as readZipSync};