AuthorsBooks::AuthorsBooks(data attributes): Model("AuthorsBooks") { data::iterator iterator; for (iterator = attributes.begin(); iterator != attributes.end(); iterator++) { modelData[iterator->first] = iterator->second; } }
double kolmogorov(int n, data d1, data d2) { std::sort(d1.begin(), d1.end()); std::sort(d2.begin(), d2.begin()); int d = 0; int i=0,j=0; while (i != n || j != n) { if (d1[i] >= d2[j]) { ++j; } if (d1[i] <= d2[j]) { ++i; } d = std::max(d, abs(i - j)); } return d/sqrt(n); }