fix: remove duplicate argmax_v — use NaN-safe version from sample.h

This commit is contained in:
ZacharyZcR
2026-07-19 21:15:54 +08:00
parent 93b4a8e78e
commit bc69a9a6d0
2 changed files with 3 additions and 8 deletions
+3 -3
View File
@@ -17,9 +17,9 @@ static inline double rndu(void){
/* ---- argmax over a float vector ----------------------------------------- */
static inline int argmax_v(const float *lo, int V){
int b = 0; float bv = lo[0];
for (int i = 1; i < V; i++) if (lo[i] > bv) { bv = lo[i]; b = i; }
return b;
int b=-1; float bv=-INFINITY;
for(int i=0;i<V;i++){ float x=lo[i]; if(x==x && x>bv){ bv=x; b=i; } }
return b<0?0:b;
}
/* ---- distribution buffers (reused, single-threaded decode) --------------- */