Closed july7vivian closed 7 years ago
函数如下:
float calc_sum(int e1, int e2, int rel) { float res = 0; int last1 = e1 * relationTotal * dimensionR + rel * dimensionR; int last2 = e2 * relationTotal * dimensionR + rel * dimensionR; int lastr = rel * dimensionR; for (int i = 0; i < dimensionR; i++) res += fabs(entityVec[last1 + i] + relationVec[lastr + i] - entityVec[last2 + i]); return res; }
对last1和last2的赋值不能理解
为什么不是
int last1 = e1 * dimension; int last2 = e2 * dimension;
谢谢!
应该是“int last1 = e1 dimension; int last2 = e2 dimension;”,上传的代码有些错误,我更正下 = =!
函数如下:
对last1和last2的赋值不能理解
为什么不是
int last1 = e1 * dimension; int last2 = e2 * dimension;
谢谢!