diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/2geom/conjugate_gradient.cpp | 5 | ||||
| -rw-r--r-- | 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<double> 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 <valarray> +namespace Geom +{ + double inner(std::valarray<double> const &x, std::valarray<double> const &y); @@ -44,7 +47,10 @@ conjugate_gradient(std::valarray<double> const &A, std::valarray<double> const &b, unsigned n, double tol, unsigned max_iterations, bool ortho1); -#endif // _CONJUGATE_GRADIENT_H + +} // namespace Geom + +#endif // _2GEOM_CONJUGATE_GRADIENT_H /* Local Variables: |
