NHacker Next
  • new
  • past
  • show
  • ask
  • show
  • jobs
  • submit
Show HN: High-Performance Wavelet Matrix for Python, Implemented in Rust (pypi.org)
joshlk 27 minutes ago [-]
What's a good reference to learn about Wavelet Matrices?
yourdetect 1 hours ago [-]
Does this contain unsafe? Even the Linux kernel's Rust code have memory safety bugs. https://news.ycombinator.com/item?id=46309536
simgt 1 hours ago [-]
> git clone https://github.com/math-hiyoko/wavelet-matrix.git && find wavelet-matrix -type f -name '*.rs' -exec grep 'unsafe' {} +

No.

math-hiyoko 1 hours ago [-]
No, the library itself does not use unsafe Rust at all. The Python bindings are built using PyO3, which internally uses unsafe (as required to interface with the CPython C API), but that is fully encapsulated within PyO3. The core data structure and algorithms remain purely safe Rust.
koolala 6 hours ago [-]
Can a wavelet be used with SIMD 128bit operations? Or are they used with 4x4 Matrix operators? Are wavelets good for that kind of math?
mrkeen 5 hours ago [-]
> Can a wavelet be used with SIMD 128bit operations?

Popcount works great in this context, but that only gives you linear speedups. Doing rank/select in O(1) instead of O(N) is a bigger win, and you get that by precomputing superblocks.

> Or are they used with 4x4 Matrix operators? Are wavelets good for that kind of math?

Nope, different kind of matrix. Just refers to a nicer packing of a wavelet tree with space wasted by bookkeeping pointers between tree nodes.

atoav 2 hours ago [-]
Looks good to me. Have you considered adding a really practical realworld example? As someone who loves looking at examples I like your small examples in the readme, but it still leaves me wondering a bit what I actually would use this library for.

Many people don't know what you would use wavelets for or where they really shine. I for example know wavelets are used in image compression algorithms but that's about it. I am curious where else this could be applied.

heya1993 8 hours ago [-]
[flagged]
Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact
Rendered at 10:41:32 GMT+0000 (Coordinated Universal Time) with Vercel.