Libraryless. Click here for Pure Java version (152L/1K).
1 | sclass PointSetSimilarity { |
2 | Set<Pt> set1, set2; |
3 | int totalPoints; |
4 | int sharedPoints; |
5 | |
6 | *(Set<Pt> *set1, Set<Pt> *set2) { |
7 | for (Pt p : set1) { |
8 | ++totalPoints; |
9 | if (set2.contains(p)) |
10 | ++sharedPoints; |
11 | } |
12 | |
13 | for (Pt p : set2) |
14 | if (!set1.contains(p)) |
15 | ++totalPoints; |
16 | } |
17 | |
18 | double get() { |
19 | ret doubleRatio(sharedPoints, totalPoints); |
20 | } |
21 | } |
download show line numbers debug dex old transpilations
Travelled to 3 computer(s): ekrmjmnbrukm, mowyntqkapby, mqqgnosmbjvj
No comments. add comment
Snippet ID: | #1035445 |
Snippet name: | PointSetSimilarity - shared vs total pixels between two point sets |
Eternal ID of this version: | #1035445/1 |
Text MD5: | 2c2d26d7d8701ca5d6f0377f0c8ebc49 |
Transpilation MD5: | 3695f73f0546e0876414937bfe061b44 |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2022-05-13 15:08:26 |
Source code size: | 407 bytes / 21 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 179 / 266 |
Referenced in: | [show references] |