code wiki / (root) / nx_uv_stretch_candidate_t281.nx

nx_uv_stretch_candidate_t281.nx

buildroot/runtime/nx_uv_stretch_candidate_t281.nx

6617 B87 linesdepth 7pulls 15 transitivereach 3 importersview sourcekind librarytopic uv
docsdependenciesstructsconstsfunctions

about

nx_uv_stretch_candidate_t281.nx -- Optimizes UV stretch energy using symmetric Dirichlet penalties and gradient-based updates.

dependencies 1 imports · 3 importers

nx_uv_gram_solver_candidate_t280.n nx_uv_stretch_candidate_t281.n nx_uv_stretch_actual_t281.nx nx_uv_stretch_derivative_gate_t281 nx_uv_stretch_gate_t281.nx

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

5struct UvStretch

consts

none

functions

10func ust_abs(x:f64)->f64{if x<0.0{return 0.0-x};return x}
called by 3: ust_stepmainmain
11func 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))}
15func ust_face(q:*UvStretch,t:i64,v:i64,u:f64,w:f64,deriv:i64)->f64
called by 3: ust_energyust_stepmain calls 1: uls_finite
37func 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}
called by 4: ust_beginust_stepmainmain calls 1: ust_face
38func ust_begin(s:*UvGramSolve)->*UvStretch
61func ust_step(q:*UvStretch,sweeps:i64,backtracks:i64,cancel:*i64)->i64
87func 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}
called by 3: mainmainmain