File |
Line |
edu/uci/ics/jung/algorithms/layout/SpringLayout.java |
268 |
edu/uci/ics/jung/algorithms/layout/SpringLayout2.java |
109 |
xyd.setLocation(xyd.getX()+Math.max(-5, Math.min(5, vd.dx)),
xyd.getY()+Math.max(-5, Math.min(5, vd.dy)));
Dimension d = getSize();
int width = d.width;
int height = d.height;
if (xyd.getX() < 0) {
xyd.setLocation(0, xyd.getY());// setX(0);
} else if (xyd.getX() > width) {
xyd.setLocation(width, xyd.getY()); //setX(width);
}
if (xyd.getY() < 0) {
xyd.setLocation(xyd.getX(),0);//setY(0);
} else if (xyd.getY() > height) {
xyd.setLocation(xyd.getX(), height); //setY(height);
}
}
} catch(ConcurrentModificationException cme) {
moveNodes();
}
}
}
|
File |
Line |
edu/uci/ics/jung/algorithms/layout/FRLayout.java |
212 |
edu/uci/ics/jung/algorithms/layout/FRLayout2.java |
208 |
xyd.setLocation(newX, newY);
}
protected void calcAttraction(E e) {
Pair<V> endpoints = getGraph().getEndpoints(e);
V v1 = endpoints.getFirst();
V v2 = endpoints.getSecond();
boolean v1_locked = isLocked(v1);
boolean v2_locked = isLocked(v2);
if(v1_locked && v2_locked) {
// both locked, do nothing
return;
}
Point2D p1 = transform(v1);
Point2D p2 = transform(v2);
if(p1 == null || p2 == null) return;
double xDelta = p1.getX() - p2.getX();
double yDelta = p1.getY() - p2.getY();
double deltaLength = Math.max(EPSILON, p1.distance(p2));
|
File |
Line |
edu/uci/ics/jung/algorithms/layout/KKLayout.java |
326 |
edu/uci/ics/jung/algorithms/layout/KKLayout.java |
360 |
double dEdym = 0;
for (int i = 0; i < vertices.length; i++) {
if (i != m) {
double dist = dm[m][i];
double l_mi = L * dist;
double k_mi = K / (dist * dist);
double dx = xydata[m].getX() - xydata[i].getX();
double dy = xydata[m].getY() - xydata[i].getY();
double d = Math.sqrt(dx * dx + dy * dy);
double common = k_mi * (1 - l_mi / d);
|
File |
Line |
edu/uci/ics/jung/algorithms/scoring/KStepMarkov.java |
126 |
edu/uci/ics/jung/algorithms/scoring/PageRankWithPriors.java |
73 |
collectDisappearingPotential(v);
double v_input = 0;
for (E e : graph.getInEdges(v))
{
// For graphs, the code below is equivalent to
// V w = graph.getOpposite(v, e);
// total_input += (getCurrentValue(w) * getEdgeWeight(w,e).doubleValue());
// For hypergraphs, this divides the potential coming from w
// by the number of vertices in the connecting edge e.
int incident_count = getAdjustedIncidentCount(e);
for (V w : graph.getIncidentVertices(e))
{
if (!w.equals(v) || hyperedges_are_self_loops)
v_input += (getCurrentValue(w) *
getEdgeWeight(w,e).doubleValue() / incident_count);
}
}
// modify total_input according to alpha
double new_value = alpha > 0 ?
v_input * (1 - alpha) + getVertexPrior(v) * alpha :
v_input;
setOutputValue(v, new_value);
|