From 269b32ee83debc03ec3eb54b41b1f05fcb483e15 Mon Sep 17 00:00:00 2001 From: "Johan B. C. Engelen" Date: Sat, 21 Sep 2013 11:10:12 +0200 Subject: partial 2geom update, fixes linker errors (duplicate code, should be fixed later) (bzr r12558) --- src/2geom/conjugate_gradient.cpp | 5 +++++ src/2geom/conjugate_gradient.h | 12 +++++++++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/2geom/conjugate_gradient.cpp b/src/2geom/conjugate_gradient.cpp index ae69d5281..588513414 100644 --- a/src/2geom/conjugate_gradient.cpp +++ b/src/2geom/conjugate_gradient.cpp @@ -36,6 +36,9 @@ /* lifted wholely from wikipedia. */ +namespace Geom +{ + using std::valarray; static void @@ -126,6 +129,8 @@ conjugate_gradient(valarray const &A, // x is solution } +} // namespace Geom + /* Local Variables: mode:c++ diff --git a/src/2geom/conjugate_gradient.h b/src/2geom/conjugate_gradient.h index a34307d4b..4f500c0e6 100644 --- a/src/2geom/conjugate_gradient.h +++ b/src/2geom/conjugate_gradient.h @@ -29,11 +29,14 @@ * */ -#ifndef _CONJUGATE_GRADIENT_H -#define _CONJUGATE_GRADIENT_H +#ifndef _2GEOM_CONJUGATE_GRADIENT_H +#define _2GEOM_CONJUGATE_GRADIENT_H #include +namespace Geom +{ + double inner(std::valarray const &x, std::valarray const &y); @@ -44,7 +47,10 @@ conjugate_gradient(std::valarray const &A, std::valarray const &b, unsigned n, double tol, unsigned max_iterations, bool ortho1); -#endif // _CONJUGATE_GRADIENT_H + +} // namespace Geom + +#endif // _2GEOM_CONJUGATE_GRADIENT_H /* Local Variables: -- cgit v1.2.3