From aaacc83e3fab3c943e5d3b59646109b6b92c08dd Mon Sep 17 00:00:00 2001 From: tgdwyer Date: Mon, 17 Jul 2006 06:03:13 +0000 Subject: [PATCH] cleanup, remove warnings --- src/libcola/cola.cpp | 53 ++++++++++++++++++++++++++++++++++++++ src/libcola/cola.h | 53 +++----------------------------------- src/libvpsc/solve_VPSC.cpp | 2 +- 3 files changed, 57 insertions(+), 51 deletions(-) diff --git a/src/libcola/cola.cpp b/src/libcola/cola.cpp index 3499d729a..74cab50da 100644 --- a/src/libcola/cola.cpp +++ b/src/libcola/cola.cpp @@ -1,6 +1,7 @@ #include "cola.h" #include "conjugate_gradient.h" #include "straightener.h" +#include "shortest_paths.h" namespace cola { @@ -12,6 +13,58 @@ inline double dummy_var_euclidean_dist(GradientProjection* gpx, GradientProjecti dy = gpy->dummy_vars[i]->place_r - gpy->dummy_vars[i]->place_l; return sqrt(dx*dx + dy*dy); } +ConstrainedMajorizationLayout +::ConstrainedMajorizationLayout( + vector& rs, + vector& es, + double* eweights, + double idealLength, + TestConvergence& done) + : constrainedLayout(false), + n(rs.size()), + lapSize(n), lap2(new double*[lapSize]), + Q(lap2), Dij(new double*[lapSize]), + tol(0.0001), + done(done), + X(new double[n]), + Y(new double[n]), + clusters(NULL), + linearConstraints(NULL), + gpX(NULL), + gpY(NULL), + straightenEdges(NULL) +{ + assert(rs.size()==n); + boundingBoxes = new Rectangle*[rs.size()]; + copy(rs.begin(),rs.end(),boundingBoxes); + + done.reset(); + + double** D=new double*[n]; + for(unsigned i=0;igetCentreX(); + Y[i]=rs[i]->getCentreY(); + double degree = 0; + lap2[i]=new double[n]; + Dij[i]=new double[n]; + for(unsigned j=0;j1e-30?1.f/(w*w):0; + } + lap2[i][i]=-degree; + delete [] D[i]; + } + delete [] D; +} void ConstrainedMajorizationLayout diff --git a/src/libcola/cola.h b/src/libcola/cola.h index c3cdb03c0..b56d2327e 100644 --- a/src/libcola/cola.h +++ b/src/libcola/cola.h @@ -8,18 +8,16 @@ #include #include #include -#include "shortest_paths.h" #include "gradient_projection.h" -#include #include "straightener.h" typedef vector Cluster; typedef vector Clusters; - -using vpsc::Rectangle; +namespace vpsc { class Rectangle; } namespace cola { + using vpsc::Rectangle; typedef pair Edge; // a graph component with a list of node_ids giving indices for some larger list of nodes @@ -153,52 +151,7 @@ namespace cola { vector& es, double* eweights, double idealLength, - TestConvergence& done=defaultTest) - : constrainedLayout(false), - n(rs.size()), - lapSize(n), lap2(new double*[lapSize]), - Q(lap2), Dij(new double*[lapSize]), - tol(0.0001), - done(done), - X(new double[n]), - Y(new double[n]), - clusters(NULL), - linearConstraints(NULL), - gpX(NULL), - gpY(NULL), - straightenEdges(NULL) - { - assert(rs.size()==n); - boundingBoxes = new Rectangle*[rs.size()]; - copy(rs.begin(),rs.end(),boundingBoxes); - - done.reset(); - - double** D=new double*[n]; - for(unsigned i=0;igetCentreX(); - Y[i]=rs[i]->getCentreY(); - double degree = 0; - lap2[i]=new double[n]; - Dij[i]=new double[n]; - for(unsigned j=0;j1e-30?1.f/(w*w):0; - } - lap2[i][i]=-degree; - delete [] D[i]; - } - delete [] D; - } + TestConvergence& done=defaultTest); void moveBoundingBoxes() { for(unsigned i=0;i=0) { + while(!solved&&maxtries>0) { solved=true; maxtries--; for(set::const_iterator i=bs->begin();i!=bs->end();++i) { -- 2.30.2