return NULL;
flow->paths = scf_vector_alloc();
- if (!flow->paths)
- goto _paths_error;
-
- flow->ppins = scf_vector_alloc();
- if (!flow->ppins)
- goto _ppins_error;
-
- flow->npins = scf_vector_alloc();
- if (!flow->npins)
- goto _npins_error;
+ if (!flow->paths) {
+ ses_flow_free(flow);
+ return NULL;
+ }
return flow;
-
-_npins_error:
- scf_vector_free(flow->ppins);
-_ppins_error:
- scf_vector_free(flow->paths);
-_paths_error:
- free(flow);
- return NULL;
}
void ses_flow_free(ses_flow_t* flow)
if (flow->paths)
scf_vector_free(flow->paths);
- if (flow->ppins)
- scf_vector_free(flow->ppins);
+ free(flow);
+ }
+}
+
+void ses_flow_jr(ses_flow_t* flow)
+{
+ if (!flow)
+ return;
- if (flow->npins)
- scf_vector_free(flow->npins);
+ flow->pr = 0;
+ flow->jpr = 0;
- free(flow);
+ flow->nr = 0;
+ flow->jnr = 0;
+
+ if (!flow->paths || !flow->vip)
+ return;
+
+ ses_path_t* path;
+ ScfEpin* p;
+ ScfEpin* vip = flow->vip;
+
+ int i;
+ int j;
+
+ for (i = 0; i < flow->paths->size; i++) {
+ path = flow->paths->data[i];
+
+ for (j = 0; j < path->pins->size; j++) {
+ p = path->pins->data[j];
+
+ if (p->lid == vip->lid) {
+
+ vip = path->pins->data[0];
+
+ flow->pr += p->pr;
+ flow->jpr += p->jpr;
+
+ scf_loge("flow->pr: %lg + j%lg, c%ldp%ld->pr: %lg + j%lg, vip c%ldp%ld->pr: %lg + j%lg\n",
+ flow->pr, flow->jpr, p->cid, p->id, p->pr, p->jpr, vip->cid, vip->id, vip->pr, vip->jpr);
+ break;
+ }
+ }
+ }
+
+ vip = flow->vip;
+
+ for (i = 0; i < flow->paths->size; i++) {
+ path = flow->paths->data[i];
+
+ for (j = 0; j < path->pins->size; j++) {
+ p = path->pins->data[j];
+
+ if (p->lid == vip->lid) {
+
+ vip = path->pins->data[path->pins->size - 1];
+
+ flow->nr += vip->pr - p->pr;
+ flow->jnr += vip->jpr - p->jpr;
+
+ scf_loge("flow->nr: %lg + j%lg, c%ldp%ld->pr: %lg + j%lg, vip c%ldp%ld->pr: %lg + j%lg\n",
+ flow->nr, flow->jnr, p->cid, p->id, p->pr, p->jpr, vip->cid, vip->id, vip->pr, vip->jpr);
+ break;
+ }
+ }
}
}