diff options
| author | Kris De Gussem <kris.degussem@gmail.com> | 2013-10-16 20:21:27 +0000 |
|---|---|---|
| committer | Kris <Kris.De.Gussem@hotmail.com> | 2013-10-16 20:21:27 +0000 |
| commit | f304ed29d6f2b92b872ffc2b218bc8398b879ef0 (patch) | |
| tree | ce3de4b6e387d4c8f7a4e3d15a3c1ce6af749f37 /src/libcola/cola.cpp | |
| parent | couple of typos affecting Path->Linked Offset (Bug 1236830) (diff) | |
| download | inkscape-f304ed29d6f2b92b872ffc2b218bc8398b879ef0.tar.gz inkscape-f304ed29d6f2b92b872ffc2b218bc8398b879ef0.zip | |
cppcheck initialisation
(bzr r12697)
Diffstat (limited to 'src/libcola/cola.cpp')
| -rw-r--r-- | src/libcola/cola.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/libcola/cola.cpp b/src/libcola/cola.cpp index 51560a79c..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]; } |
