double
zip(int k,double s,int n)//k代表第几项,s代表带入参数,n代表总元素个数
{
//std::cout << data << std::endl;
double result = pow(k,s);
double count = 0.0;
for(int i=n;i>0;i--){
count+=pow(i,s);
}
result = result/count;
return result;
}
zipf分布c/c++
最新推荐文章于 2023-01-28 17:37:07 发布