static void lhisti_set(t_lhisti *x, t_float lo, t_float hi, t_float nbins) { if (nbins<1) { nbins=1; post("lhisti: number of bins is minimum 1..."); } if (hi<=lo) { post("lhisti: higher bound must be higher than lower bound..."); hi=lo+1.0f; } freebytes(x->m_lhisti, x->m_nbins); x->m_hi=hi; x->m_lo=lo; x->m_nbins=(int)nbins; x->m_scale=(float)x->m_nbins/(hi-lo); x->m_lhisti = (float*)getbytes(sizeof(float)*x->m_nbins); lhisti_clear(x); }
static void lhisti_set(t_lhisti *x, t_float lo, t_float hi, t_float nbins) { if (nbins<1) { nbins=1; logpost(x, 2, "[lhisti] number of bins is minimum 1"); } if (hi<=lo) { post("[lhisti] higher bound (%g) must be greater than lower bound (%g)", hi, lo); hi=lo+1.0f; } freebytes(x->m_lhisti, x->m_nbins); x->m_hi=hi; x->m_lo=lo; x->m_nbins=(int)nbins; x->m_scale=(t_float)x->m_nbins/(hi-lo); x->m_lhisti = (t_float*)getbytes(sizeof(t_float)*x->m_nbins); lhisti_clear(x); }