nx_uv_stretch_candidate_t281.nx
buildroot/runtime/nx_uv_stretch_candidate_t281.nx
about
nx_uv_stretch_candidate_t281.nx -- Optimizes UV stretch energy using symmetric Dirichlet penalties and gradient-based updates.
dependencies 1 imports · 3 importers
imports: nx_uv_gram_solver_candidate_t280.nx
imported by: nx_uv_stretch_actual_t281.nxnx_uv_stretch_derivative_gate_t281.nxnx_uv_stretch_gate_t281.nx
structs
| 5 | struct UvStretch |
consts
| none |
functions
| 10 | func ust_abs(x:f64)->f64{if x<0.0{return 0.0-x};return x} |
| 11 | func ust_free(q:*UvStretch)->i64{if q==(0 as *UvStretch){return 0};if q.storage!=(0 as *u8){sys_munmap_direct(q.storage,q.bytes)};return sys_munmap_direct(q as *u8,__size_of(UvStretch))} |
| 15 | func ust_face(q:*UvStretch,t:i64,v:i64,u:f64,w:f64,deriv:i64)->f64 |
| 37 | func ust_energy(q:*UvStretch)->f64{var e:f64=0.0;var t:i64=0;while t<q.s.nt{let f:f64=ust_face(q,t,0-1,0.0,0.0,0);if f<0.0{return f};e=e+f;t=t+1};return e} |
| 38 | func ust_begin(s:*UvGramSolve)->*UvStretch |
| 61 | func ust_step(q:*UvStretch,sweeps:i64,backtracks:i64,cancel:*i64)->i64 |
| 87 | func ust_restore_scale(q:*UvStretch)->i64{var i:i64=0;while i<q.s.n*2{q.s.x[i]=q.s.x[i]*q.scale;i=i+1};return UV_OK} |