(bind-func histogram
"like the full version, but use the min and max values in the buffer as upper and lower"
(lambda (hist:HistBin* buf:float* len nbins)
(let ((lower 0.0)
(upper 0.0))
;; find max/min values
(doloop (i len)
(if (< (pref buf i) lower)
(set! lower (pref buf i)))
(if (> (pref buf i) upper)
(set! upper (pref buf i))))
(histogram:[HistBin*,HistBin*,float*,i64,float,float,i64]* hist buf len lower upper nbins))))