Clustering one-dimensional data was only possible when storing it column-based. But a std::vector is interpreted as matrix with height=1
Additionally, made conditionals more readable
{
const int SPP_TRIALS = 3;
Mat data0 = _data.getMat();
- bool isrow = data0.rows == 1 && data0.channels() > 1;
- int N = !isrow ? data0.rows : data0.cols;
- int dims = (!isrow ? data0.cols : 1)*data0.channels();
+ bool isrow = data0.rows == 1;
+ int N = isrow ? data0.cols : data0.rows;
+ int dims = (isrow ? 1 : data0.cols)*data0.channels();
int type = data0.depth();
attempts = std::max(attempts, 1);