code wiki / _hdl_build / nx_geo_simplify_gate.nx
nx_geo_simplify_gate.nx
buildroot/runtime/_hdl_build/nx_geo_simplify_gate.nx
about
nx_geo_simplify_gate.nx -- GATE for GEO-014 line simplify (Douglas-Peucker, integer). A 5-vertex
polyline along y=0 with a single 1e6-microdeg bump at the middle vertex. Three tolerances prove the
keep/drop decision tracks eps deterministically:
eps = 5e5 -> keep {P0,P2,P4} (count 3): the bump (perp 1e6) survives, the two flat vertices (perp
~447213 < eps) are dropped
eps = 2e6 -> keep {P0,P4} (count 2): even the bump is below tolerance -> straight line
eps = 1e5 -> keep all 5 (count 5): every vertex exceeds the tiny tolerance
Output order/indices are checked exactly for the eps=5e5 case ([0,2,4]).
Evidence -> knowledge/status/geo_simplify.log (GEOSIMPGATE authored=organ ... verdict=GREEN).
license_tier: ORIGINAL
dependencies 2 imports · 0 importers
imports: nx_geo_simplify.nxnx_syscalls.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| 15 | const GS_LOG: *u8 = "knowledge/status/geo_simplify.log" |
functions
| 17 | func gs_w(fd: i64, s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(fd, s, n); return 0 } |
| 18 | func gs_wn(fd: i64, v: i64) -> i64 { let bb: *u8 = sys_mmap(28); var m: i64=v; if m<0 {m=0-m; sys_write(fd,"-" as *u8,1)}; let t: *u8 = sys_mmap(28); var k: i64=0; if m==0 {t[0]=48;k=1}; while m>0 {t[k]=(48+(m%10)) as u8; m=m/10; k=k+1}; var i: i64=0; while i<k {bb[i]=t[k-1-i]; i=i+1}; sys_write(fd, bb, k); return 0 } |
| 20 | func gs_set(p: *i64, i: i64, lat: i64, lon: i64) -> i64 { p[i * 2] = lat; p[i * 2 + 1] = lon; return 0 } called by 1: main |
| 22 | func gs_emit(fd: i64, c1: i64, o0: i64, o1: i64, o2: i64, c2: i64, c3: i64, ok: i64) -> i64 |
| 31 | func main() -> i64 |