#include"ses_core.h"
-int ses_paths_find_flow(ses_flow_t* flow, scf_vector_t* paths, ScfEpin* vip, ses_path_t* bridge)
-{
- ses_path_t* path;
- ScfEpin* p;
-
- int i;
- int j;
-
- for (i = 0; i < paths->size; i++) {
- path = paths->data[i];
-
- if (path == bridge)
- continue;
-
- for (j = 0; j < path->pins->size; j++) {
- p = path->pins->data[j];
-
- if (vip ->lid == p->lid) {
- flow->vip = p;
-
- if (scf_vector_add(flow->paths, path) < 0)
- return -1;
- return 1;
- }
- }
-
- if (!path->childs)
- continue;
-
- int ret = ses_paths_find_flow(flow, path->childs, vip, bridge);
- if (ret < 0)
- return ret;
-
- if (1 == ret) {
- if (scf_vector_add(flow->paths, path) < 0)
- return -1;
- return 1;
- }
- }
-
- return 0;
-}
-
static void inline __ses_bridge_i(double* i0, double* i1, double* i2, double* i3, double* i4,
double* v0, double* v1, double* v4, double V,
double R0, double R1, double R2, double R3, double R4,
}
}
+int ses_paths_find_flow(ses_flow_t* flow, scf_vector_t* paths, ScfEpin* vip, ses_path_t* bridge)
+{
+ ses_path_t* path;
+ ScfEpin* p;
+
+ int i;
+ int j;
+
+ for (i = 0; i < paths->size; i++) {
+ path = paths->data[i];
+
+ if (path == bridge)
+ continue;
+
+ for (j = 0; j < path->pins->size; j++) {
+ p = path->pins->data[j];
+
+ if (vip ->lid == p->lid) {
+ flow->vip = p;
+
+ if (scf_vector_add(flow->paths, path) < 0)
+ return -1;
+ return 1;
+ }
+ }
+
+ if (!path->childs)
+ continue;
+
+ int ret = ses_paths_find_flow(flow, path->childs, vip, bridge);
+ if (ret < 0)
+ return ret;
+
+ if (1 == ret) {
+ if (scf_vector_add(flow->paths, path) < 0)
+ return -1;
+ return 1;
+ }
+ }
+
+ return 0;
+}
+
void ses_flow_v_pos(ses_flow_t* flow, double a, double ja)
{
if (!flow || !flow->paths || flow->paths->size <= 0 || !flow->vip)