24 for (n--; n>=0; n--) {
40 for (n--; n>=0; n--) {
56 for (n--; n>=0; n--) {
57 if (x1[n]+x2[n] > y[n])
88 for (n--; n>=0; n--) {
102 for (n--; n>=0; n--) {
116 for (n--; n>=0; n--) {
117 if (a*x[n]+y[n] > z[n])
130 for (n--; n>=0; n--) {
131 if (a*x[n]+y[n] < z[n])
147 real_t sum1=0.0, sum2=0.0, diff1=0.0, diff2=0.0;
149 for (i=0; i<
ncon; i++) {
150 sum1 += (v_vwgt[
i]+u1_vwgt[
i])*invtvwgt[i];
151 sum2 += (v_vwgt[
i]+u2_vwgt[
i])*invtvwgt[i];
156 for (i=0; i<
ncon; i++) {
157 diff1 +=
rabs(sum1 - (v_vwgt[i]+u1_vwgt[i])*invtvwgt[i]);
158 diff2 +=
rabs(sum2 - (v_vwgt[i]+u2_vwgt[i])*invtvwgt[i]);
161 return (diff1 - diff2 >= 0);
173 for (--n; n>=0; n--) {
174 if (x[n] > 0) nrm1 += x[
n]*x[
n];
175 if (y[n] > 0)
nrm2 += y[
n]*y[
n];
194 real_t tmp, nrm1=0.0,
nrm2=0.0, max1=0.0, max2=0.0;
196 for (i=0; i<
ncon; i++) {
197 tmp = bm1[
i]*(pt1[
i]+a1*vwgt[
i]) - ubvec[i];
200 max1 = (tmp > max1 ? tmp : max1);
202 tmp = bm2[
i]*(pt2[
i]+a2*vwgt[
i]) - ubvec[i];
205 max2 = (tmp > max2 ? tmp : max2);
217 if (max2 == max1 &&
nrm2 < nrm1)
234 pwgts = graph->
pwgts;
237 for (i=0; i<
ncon; i++) {
238 for (j=0; j<
nparts; j++) {
239 cur = pwgts[j*ncon+
i]*pijbm[j*ncon+
i];
263 pwgts = graph->
pwgts;
266 for (i=0; i<
ncon; i++) {
267 for (j=0; j<
nparts; j++) {
268 cur = pwgts[j*ncon+
i]*pijbm[j*ncon+
i] - ubvec[
i];
291 pwgts = graph->
pwgts;
293 for (max=-1.0, i=0; i<
ncon; i++) {
294 diffvec[
i] = pwgts[
i]*pijbm[
i] - ubfactors[
i];
295 for (j=1; j<
nparts; j++) {
296 cur = pwgts[j*ncon+
i]*pijbm[j*ncon+
i] - ubfactors[
i];
297 if (cur > diffvec[i])
300 if (max < diffvec[i])
318 pwgts = graph->
pwgts;
320 for (i=0; i<
ncon; i++) {
321 lbvec[
i] = pwgts[
i]*pijbm[
i];
322 for (j=1; j<
nparts; j++) {
323 cur = pwgts[j*ncon+
i]*pijbm[j*ncon+
i];
real_t rvecmaxdiff(idx_t n, real_t *x, real_t *y)
idx_t idx_t idx_t idx_t * vwgt
real_t ComputeLoadImbalance(graph_t *graph, idx_t nparts, real_t *pijbm)
real_t ComputeLoadImbalanceDiff(graph_t *graph, idx_t nparts, real_t *pijbm, real_t *ubvec)
void ComputeLoadImbalanceVec(graph_t *graph, idx_t nparts, real_t *pijbm, real_t *lbvec)
int rvecle(idx_t n, real_t *x, real_t *y)
int rvecge(idx_t n, real_t *x, real_t *y)
idx_t idx_t idx_t idx_t idx_t idx_t idx_t * nparts
Pose3 x2(Rot3::Ypr(0.0, 0.0, 0.0), l2)
NonlinearFactorGraph graph
int BetterVBalance(idx_t ncon, real_t *invtvwgt, idx_t *v_vwgt, idx_t *u1_vwgt, idx_t *u2_vwgt)
int rvecsumle(idx_t n, real_t *x1, real_t *x2, real_t *y)
real_t ComputeLoadImbalanceDiffVec(graph_t *graph, idx_t nparts, real_t *pijbm, real_t *ubfactors, real_t *diffvec)
int BetterBalanceKWay(idx_t ncon, idx_t *vwgt, real_t *ubvec, idx_t a1, idx_t *pt1, real_t *bm1, idx_t a2, idx_t *pt2, real_t *bm2)
idx_t idx_t idx_t idx_t idx_t idx_t idx_t real_t real_t * ubvec
Scalar EIGEN_BLAS_FUNC() nrm2(int *n, RealScalar *px, int *incx)
int ivecaxpygez(idx_t n, idx_t a, idx_t *x, idx_t *y, idx_t *z)
int ivecaxpylez(idx_t n, idx_t a, idx_t *x, idx_t *y, idx_t *z)
int BetterBalance2Way(idx_t n, real_t *x, real_t *y)
int ivecge(idx_t n, idx_t *x, idx_t *z)
set noclip points set clip one set noclip two set bar set border lt lw set xdata set ydata set zdata set x2data set y2data set boxwidth set dummy x
int ivecle(idx_t n, idx_t *x, idx_t *z)