summaryrefslogtreecommitdiffstats
path: root/src/libcola/cola.cpp
diff options
context:
space:
mode:
authorSebastian Wüst <sebi@timewaster.de>2013-10-20 15:32:08 +0000
committerSebastian Wüst <sebi@timewaster.de>2013-10-20 15:32:08 +0000
commit82908f949129e1fcbf62002799ee7b1b77986eed (patch)
treec02098dd7720cdf424f2793ecd3ddac2ea86b969 /src/libcola/cola.cpp
parentchanged text (diff)
parentFix build errors with clang 3.3 and c++11 enabled. (diff)
downloadinkscape-82908f949129e1fcbf62002799ee7b1b77986eed.tar.gz
inkscape-82908f949129e1fcbf62002799ee7b1b77986eed.zip
merge from trunk
(bzr r12417.1.24)
Diffstat (limited to 'src/libcola/cola.cpp')
-rw-r--r--src/libcola/cola.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/libcola/cola.cpp b/src/libcola/cola.cpp
index 87fbf9f79..168ef5533 100644
--- a/src/libcola/cola.cpp
+++ b/src/libcola/cola.cpp
@@ -23,7 +23,8 @@ ConstrainedMajorizationLayout
double* eweights,
double idealLength,
TestConvergence& done)
- : constrainedLayout(false),
+ : avoidOverlaps(false),
+ constrainedLayout(false),
n(rs.size()),
lapSize(n), lap2(new double*[lapSize]),
Q(lap2), Dij(new double*[lapSize]),
@@ -116,18 +117,17 @@ void ConstrainedMajorizationLayout::majlayout(
void ConstrainedMajorizationLayout::majlayout(
double** Dij, GradientProjection* gp, double* coords, double* b)
{
- double L_ij,dist_ij,degree;
/* compute the vector b */
/* multiply on-the-fly with distance-based laplacian */
for (unsigned i = 0; i < n; i++) {
- degree = 0;
if(i<lapSize) {
+ double degree = 0;
for (unsigned j = 0; j < lapSize; j++) {
if (j == i) continue;
- dist_ij = euclidean_distance(i, j);
+ double dist_ij = euclidean_distance(i, j);
if (dist_ij > 1e-30 && Dij[i][j] > 1e-30) { /* skip zero distances */
/* calculate L_ij := w_{ij}*d_{ij}/dist_{ij} */
- L_ij = 1.0 / (dist_ij * Dij[i][j]);
+ double L_ij = 1.0 / (dist_ij * Dij[i][j]);
degree -= L_ij;
b[i] += L_ij * coords[j];
}
@@ -271,7 +271,7 @@ void ConstrainedMajorizationLayout::straighten(std::vector<straightener::Edge*>&
double b[n],*coords=dim==HORIZONTAL?X:Y,dist_ub,dist_bv;
std::fill(b,b+n,0);
for(LinearConstraints::iterator i=linearConstraints.begin();
- i!= linearConstraints.end();i++) {
+ i!= linearConstraints.end();++i) {
LinearConstraint* c=*i;
if(straightenToProjection) {
Q[c->u][c->u]+=c->w*c->duu;