Libraryless. Click here for Pure Java version (5528L/30K).
1 | // implements BitMatrix |
2 | persistable sclass PointSetBitMatrix extends AbstractMatrix<Bool> {
|
3 | new Set<Pt> points; |
4 | |
5 | *(int *w, int *h) {}
|
6 | *(int *w, int *h, Set<Pt> *points) {}
|
7 | |
8 | public Bool get(int x, int y) { ret points.contains(pt(x, y)); }
|
9 | public void set(int x, int y, Bool a) { points.add(pt(x, y)); }
|
10 | |
11 | int nSetBits() { ret points.size(); }
|
12 | } |
Began life as a copy of #1033581
download show line numbers debug dex old transpilations
Travelled to 4 computer(s): bhatertpkbcr, ekrmjmnbrukm, mowyntqkapby, mqqgnosmbjvj
No comments. add comment
| Snippet ID: | #1033585 |
| Snippet name: | PointSetBitMatrix - Set-based implementation of BitMatrix. should be optimized |
| Eternal ID of this version: | #1033585/7 |
| Text MD5: | 3472b2949a67e9db289dc35024f6cb2d |
| Transpilation MD5: | 05378c877aef0f9ab9b89a252aea3cfb |
| Author: | stefan |
| Category: | javax |
| Type: | JavaX fragment (include) |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2022-01-06 20:46:42 |
| Source code size: | 369 bytes / 12 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 362 / 515 |
| Version history: | 6 change(s) |
| Referenced in: | [show references] |