struct Kmeans { Int nn, mm, kk, nchg; MatDoub data, means; VecInt assign, count; Kmeans(MatDoub &ddata, MatDoub &mmeans) : nn(ddata.nrows()), mm(ddata.ncols()), kk(mmeans.nrows()), data(ddata), means(mmeans), assign(nn), count(kk) { estep(); mstep(); } Int estep() { Int k,m,n,kmin; Doub dmin,d; nchg = 0; for (k=0;k 0) for (m=0;m