summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: c5c0493)
raw | patch | inline | side by side (parent: c5c0493)
author | tgdwyer <tgdwyer@users.sourceforge.net> | |
Fri, 14 Jul 2006 05:16:38 +0000 (05:16 +0000) | ||
committer | tgdwyer <tgdwyer@users.sourceforge.net> | |
Fri, 14 Jul 2006 05:16:38 +0000 (05:16 +0000) |
src/graphlayout/graphlayout.cpp | patch | blob | history | |
src/libcola/conjugate_gradient.cpp | patch | blob | history | |
src/libvpsc/remove_rectangle_overlap.cpp | patch | blob | history |
index 432f3c942c58518f9452c50c4fb7f5048af170f1..4031456369fcb74c0f37f655a9ca79e037622d78 100644 (file)
minX=min(ll[0],minX); minY=min(ll[1],minY);
maxX=max(ur[0],maxX); maxY=max(ur[1],maxY);
nodelookup[u->id]=rs.size();
- cout << "Node " << rs.size() << endl;
rs.push_back(new Rectangle(ll[0],ur[0],ll[1],ur[1]));
}
"avoidoverlaplayout");
bool avoid_overlaps = false;
bool directed = false;
- if (directed_str && !strcmp(directed_str, "true")) {
- cout << "Directed layout requested.\n";
+ if (directed_str && !strcmp(directed_str, "true")) {
directed = true;
}
- if (overlaps_str && !strcmp(overlaps_str, "true")) {
- cout << "Avoid overlaps requested.\n";
+ if (overlaps_str && !strcmp(overlaps_str, "true")) {
avoid_overlaps = true;
}
map<string,unsigned>::iterator v_pair=nodelookup.find(iv->id);
if(v_pair!=nodelookup.end()) {
unsigned v=v_pair->second;
- cout << "Edge: (" << u <<","<<v<<")"<<endl;
+ //cout << "Edge: (" << u <<","<<v<<")"<<endl;
es.push_back(make_pair(u,v));
if(conn->style->marker[SP_MARKER_LOC_END].set) {
if(directed && strcmp(conn->style->marker[SP_MARKER_LOC_END].value,"none")) {
- cout << conn->style->marker[SP_MARKER_LOC_END].value << endl;
scy.push_back(new SimpleConstraint(v, u,
(ideal_connector_length * directed_edge_height_modifier)));
}
g_slist_free(nlist);
}
}
- double width=maxX-minX;
- double height=maxY-minY;
+ //double width=maxX-minX;
+ //double height=maxY-minY;
const unsigned E = es.size();
double eweights[E];
fill(eweights,eweights+E,1);
index ed8ffbfed3d1aacbe75b00bb42115492d0df9452..67d15d6a041802d72eb9ae9417a4df9948055b08 100644 (file)
}
}
+/*
static double Linfty(valarray<double> const &vec) {
return std::max(vec.max(), -vec.min());
}
+*/
double
inner(valarray<double> const &x,
index 78df24b2287c46a725198acc33e35988149838e9..68af4c5c59de585c10d5ab175d166d43acf72c58 100644 (file)
* too much in the first pass.
*/
void removeRectangleOverlap(unsigned n, Rectangle *rs[], double xBorder, double yBorder) {
- assert(0 <= n);
try {
// The extra gap avoids numerical imprecision problems
Rectangle::setXBorder(xBorder+EXTRA_GAP);
Rectangle::setYBorder(yBorder+EXTRA_GAP);
Variable **vs=new Variable*[n];
- for(int i=0;i<n;i++) {
+ for(unsigned i=0;i<n;i++) {
vs[i]=new Variable(i,0,1);
}
Constraint **cs;
double *oldX = new double[n];
- int m=generateXConstraints(n,rs,vs,cs,true);
- for(int i=0;i<n;i++) {
+ unsigned m=generateXConstraints(n,rs,vs,cs,true);
+ for(unsigned i=0;i<n;i++) {
oldX[i]=vs[i]->desiredPosition;
}
Solver vpsc_x(n,vs,m,cs);
f.close();
#endif
vpsc_x.solve();
- for(int i=0;i<n;i++) {
+ for(unsigned i=0;i<n;i++) {
rs[i]->moveCentreX(vs[i]->position());
}
- for(int i = 0; i < m; ++i) {
+ for(unsigned i = 0; i < m; ++i) {
delete cs[i];
}
delete [] cs;
f.close();
#endif
vpsc_y.solve();
- for(int i=0;i<n;i++) {
+ for(unsigned i=0;i<n;i++) {
rs[i]->moveCentreY(vs[i]->position());
rs[i]->moveCentreX(oldX[i]);
}
delete [] oldX;
- for(int i = 0; i < m; ++i) {
+ for(unsigned i = 0; i < m; ++i) {
delete cs[i];
}
delete [] cs;
f.close();
#endif
vpsc_x2.solve();
- for(int i = 0; i < m; ++i) {
+ for(unsigned i = 0; i < m; ++i) {
delete cs[i];
}
delete [] cs;
- for(int i=0;i<n;i++) {
+ for(unsigned i=0;i<n;i++) {
rs[i]->moveCentreX(vs[i]->position());
delete vs[i];
}
delete [] vs;
} catch (char const *str) {
std::cerr<<str<<std::endl;
- for(int i=0;i<n;i++) {
+ for(unsigned i=0;i<n;i++) {
std::cerr << *rs[i]<<std::endl;
}
}