From ee658da3404304f8f3e2d4273057d5db0e1182b2 Mon Sep 17 00:00:00 2001
From: Francois Bleibel <fbleibel@gmail.com>
Date: Fri, 18 Jun 2010 14:26:50 +0900
Subject: [PATCH] Put everything in namespace sot (global objects included).
 Corrected some resulting bugs.

---
 include/CMakeLists.txt                        |  2 +-
 include/sot-core/derivator.h                  |  6 +--
 include/sot-core/exception-abstract.h         |  5 ++-
 include/sot-core/exception-dynamic.h          |  3 +-
 include/sot-core/exception-factory.h          |  3 +-
 include/sot-core/exception-feature.h          |  3 +-
 include/sot-core/exception-signal.h           |  3 +-
 include/sot-core/exception-task.h             |  3 +-
 include/sot-core/exception-tools.h            |  3 +-
 include/sot-core/exception-traces.h           |  3 +-
 include/sot-core/factory.h                    |  9 ++--
 include/sot-core/feature-1d.h                 |  3 +-
 include/sot-core/feature-abstract.h           |  3 +-
 include/sot-core/feature-generic.h            |  2 +
 include/sot-core/feature-joint-limits.h       |  3 ++
 include/sot-core/feature-line-distance.h      |  2 +
 include/sot-core/feature-point6d-relative.h   |  3 +-
 include/sot-core/feature-point6d.h            |  3 +-
 include/sot-core/feature-task.h               |  3 +-
 include/sot-core/feature-vector3.h            |  2 +
 include/sot-core/feature-visual-point.h       |  3 +-
 include/sot-core/fir-filter.h                 |  1 -
 include/sot-core/flags.h                      |  2 +
 include/sot-core/gain-adaptive.h              |  4 +-
 include/sot-core/gain-hyperbolic.h            |  4 +-
 include/sot-core/integrator-abstract.h        |  8 ++++
 include/sot-core/integrator-euler.h           |  6 +++
 include/sot-core/matrix-constant.h            |  5 ++-
 include/sot-core/matrix-force.h               | 15 +++++--
 include/sot-core/matrix-homogeneous.h         | 11 ++---
 include/sot-core/matrix-rotation.h            |  7 +--
 include/sot-core/matrix-twist.h               | 16 ++++---
 include/sot-core/memory-task-sot.h            |  4 ++
 .../{task-multi-bound.h => multi-bound.h}     |  3 ++
 include/sot-core/op-point-modifier.h          |  4 ++
 include/sot-core/pool.h                       | 12 ++++--
 include/sot-core/signal-cast.h                |  8 +++-
 .../solver-hierarchical-inequalities.h        |  6 +++
 include/sot-core/sot-h.h                      |  4 +-
 include/sot-core/sot-qr.h                     |  5 ++-
 include/sot-core/sot.h                        |  2 +
 include/sot-core/task-abstract.h              |  7 ++-
 include/sot-core/task-conti.h                 |  4 +-
 include/sot-core/task-pd.h                    |  4 +-
 include/sot-core/task-unilateral.h            |  3 +-
 include/sot-core/task.h                       |  3 +-
 include/sot-core/unary-op.h                   |  4 +-
 include/sot-core/vector-constant.h            |  4 +-
 include/sot-core/vector-quaternion.h          |  3 ++
 include/sot-core/vector-roll-pitch-yaw.h      |  4 +-
 include/sot-core/vector-rotation.h            |  6 ++-
 include/sot-core/vector-to-rotation.h         |  4 +-
 include/sot-core/vector-utheta.h              |  6 +++
 include/sot-core/weighted-sot.h               |  5 ++-
 src/debug/debug.cpp                           |  8 ++--
 src/exception/exception-abstract.cpp          |  4 ++
 src/exception/exception-dynamic.cpp           |  2 +
 src/exception/exception-factory.cpp           |  1 +
 src/exception/exception-feature.cpp           |  1 +
 src/exception/exception-signal.cpp            |  2 +
 src/exception/exception-task.cpp              |  2 +
 src/exception/exception-tools.cpp             |  2 +
 src/exception/exception-traces.cpp            |  2 +
 src/factory/factory.cpp                       |  7 ++-
 src/factory/pool.cpp                          |  8 +++-
 src/feature/feature-1d.cpp                    |  2 +
 src/feature/feature-abstract.cpp              |  2 +
 src/feature/feature-generic.cpp               |  2 +
 src/feature/feature-joint-limits.cpp          |  2 +
 src/feature/feature-line-distance.cpp         |  2 +
 src/feature/feature-point6d-relative.cpp      |  2 +
 src/feature/feature-point6d.cpp               |  2 +
 src/feature/feature-task.cpp                  |  2 +
 src/feature/feature-vector3.cpp               |  4 +-
 src/feature/feature-visual-point.cpp          |  5 ++-
 src/math/matrix-force.cpp                     |  3 ++
 src/math/matrix-homogeneous.cpp               |  3 ++
 src/math/matrix-rotation.cpp                  |  2 +
 src/math/matrix-twist.cpp                     |  3 ++
 src/math/op-point-modifior.cpp                |  2 +
 src/math/vector-quaternion.cpp                |  2 +
 src/math/vector-roll-pitch-yaw.cpp            |  2 +
 src/math/vector-utheta.cpp                    |  1 +
 src/matrix/binary-op.cpp                      |  4 +-
 src/matrix/derivator.cpp                      |  8 ++--
 src/matrix/fir-filter.cpp                     |  4 +-
 src/matrix/integrator-abstract.cpp            |  6 ++-
 src/matrix/integrator-euler.cpp               |  6 ++-
 src/matrix/matrix-constant.cpp                |  5 ++-
 src/matrix/unary-op.cpp                       |  6 +++
 src/matrix/vector-constant.cpp                |  4 ++
 src/matrix/vector-to-rotation.cpp             |  2 +
 src/signal/signal-cast.cpp                    |  2 +
 src/sot/flags.cpp                             |  9 +++-
 src/sot/memory-task-sot.cpp                   |  2 +
 src/sot/solver-hierarchical-inequalities.cpp  |  8 ++++
 src/sot/sot-h.cpp                             |  2 +
 src/sot/sot-qr.cpp                            |  2 +
 src/sot/sot.cpp                               |  2 +
 src/sot/weighted-sot.cpp                      |  2 +
 src/task/gain-adaptative.cpp                  |  3 ++
 src/task/gain-hyperbolic.cpp                  |  3 ++
 src/task/multi-bound.cpp                      | 43 +++++++++++--------
 src/task/task-abstract.cpp                    |  2 +
 src/task/task-conti.cpp                       |  6 +--
 src/task/task-pd.cpp                          |  3 ++
 src/task/task-unilateral.cpp                  |  2 +
 src/task/task.cpp                             |  2 +
 108 files changed, 368 insertions(+), 106 deletions(-)
 rename include/sot-core/{task-multi-bound.h => multi-bound.h} (98%)

diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt
index 05cdacc1..2121db12 100644
--- a/include/CMakeLists.txt
+++ b/include/CMakeLists.txt
@@ -67,7 +67,7 @@ task-abstract.h
 task-unilateral.h
 task-pd.h
 task-conti.h
-task-multi-bound.h
+multi-bound.h
 constraint.h
 gain-adaptive.h
 task.h
diff --git a/include/sot-core/derivator.h b/include/sot-core/derivator.h
index cde2caf1..81107f0c 100644
--- a/include/sot-core/derivator.h
+++ b/include/sot-core/derivator.h
@@ -32,15 +32,15 @@ namespace ml = maal::boost;
 
 /* SOT */
 #include <sot-core/flags.h>
-#include <dynamic-graph/entity.h>
 #include <sot-core/pool.h>
+#include <dynamic-graph/entity.h>
 #include <dynamic-graph/all-signals.h>
 #include <sot-core/vector-quaternion.h>
 
 /* STD */
 #include <string>
 
-
+namespace sot {
 /* --------------------------------------------------------------------- */
 /* --- CLASS ----------------------------------------------------------- */
 /* --------------------------------------------------------------------- */
@@ -108,7 +108,7 @@ class sotDerivator
 
 };
 
-
+} // using namespace sot
 
 
 
diff --git a/include/sot-core/exception-abstract.h b/include/sot-core/exception-abstract.h
index c84791fa..459a90bd 100644
--- a/include/sot-core/exception-abstract.h
+++ b/include/sot-core/exception-abstract.h
@@ -31,6 +31,7 @@
 #include <string>                  /* Classe string.     */
 #include <sot-core/sot-core-api.h>
 
+
 // Uncomment this macros to have lines parameter on the throw display
 // #define SOT_EXCEPTION_PASSING_PARAM 
 
@@ -38,6 +39,7 @@
 /* --- CLASS ----------------------------------------------------------- */
 /* --------------------------------------------------------------------- */
 
+namespace sot {
 
 /* \class sotExceptionAbstract
  */
@@ -93,7 +95,7 @@ public:
   
   /** Print the error structure. */
   SOT_CORE_EXPORT friend std::ostream & operator << (std::ostream & os,
-				     const sotExceptionAbstract & err);
+				     const sot::sotExceptionAbstract & err);
 
 #ifdef SOT_EXCEPTION_PASSING_PARAM 
  public:
@@ -137,6 +139,7 @@ public:
 #  define SOT_THROW throw
 #endif //#ifdef SOT_EXCEPTION_PASSING_PARAM 
 
+} // namespace sot
 
 #endif /* #ifndef __SOT_ABSTRACT_EXCEPTION_H */
 
diff --git a/include/sot-core/exception-dynamic.h b/include/sot-core/exception-dynamic.h
index 8f733108..5f41b26e 100644
--- a/include/sot-core/exception-dynamic.h
+++ b/include/sot-core/exception-dynamic.h
@@ -32,6 +32,7 @@
 /* --- CLASS ----------------------------------------------------------- */
 /* --------------------------------------------------------------------- */
 
+namespace sot {
 
 /* \class sotExceptionDynamic
  */
@@ -66,7 +67,7 @@ public:
 };
 
 
-
+} // namespace sot
 
 
 #endif /* #ifndef __SOT_DYNAMIC_EXCEPTION_H */
diff --git a/include/sot-core/exception-factory.h b/include/sot-core/exception-factory.h
index feedd212..3fb2c35c 100644
--- a/include/sot-core/exception-factory.h
+++ b/include/sot-core/exception-factory.h
@@ -32,6 +32,7 @@
 /* --- CLASS ----------------------------------------------------------- */
 /* --------------------------------------------------------------------- */
 
+namespace sot {
 
 /* \class sotExceptionFactory
  */
@@ -67,7 +68,7 @@ public:
 };
 
 
-
+} // namespace sot
 
 
 #endif /* #ifndef __SOT_EXCEPTION_FACTORY_H */
diff --git a/include/sot-core/exception-feature.h b/include/sot-core/exception-feature.h
index 71e4c2c8..c26efc4a 100644
--- a/include/sot-core/exception-feature.h
+++ b/include/sot-core/exception-feature.h
@@ -32,6 +32,7 @@
 /* --- CLASS ----------------------------------------------------------- */
 /* --------------------------------------------------------------------- */
 
+namespace sot {
 
 /* \class sotExceptionFeature
  */
@@ -61,7 +62,7 @@ public:
 };
 
 
-
+} // namespace sot
 
 
 #endif /* #ifndef __SOT_EXCEPTION_FEATURE_H */
diff --git a/include/sot-core/exception-signal.h b/include/sot-core/exception-signal.h
index e091c399..323b324e 100644
--- a/include/sot-core/exception-signal.h
+++ b/include/sot-core/exception-signal.h
@@ -32,6 +32,7 @@
 /* --- CLASS ----------------------------------------------------------- */
 /* --------------------------------------------------------------------- */
 
+namespace sot {
 
 /* \class sotExceptionSignal
  */
@@ -67,7 +68,7 @@ public:
 };
 
 
-
+} // namespace sot
 
 
 #endif /* #ifndef __SOT_SIGNAL_EXCEPTION_H */
diff --git a/include/sot-core/exception-task.h b/include/sot-core/exception-task.h
index b5845ab2..079bfd82 100644
--- a/include/sot-core/exception-task.h
+++ b/include/sot-core/exception-task.h
@@ -32,6 +32,7 @@
 /* --- CLASS ----------------------------------------------------------- */
 /* --------------------------------------------------------------------- */
 
+namespace sot {
 
 /* \class sotExceptionTask
  */
@@ -62,7 +63,7 @@ public:
 
 };
 
-
+} // namespace sot
 
 
 
diff --git a/include/sot-core/exception-tools.h b/include/sot-core/exception-tools.h
index 9e1236d6..3ffe2d58 100644
--- a/include/sot-core/exception-tools.h
+++ b/include/sot-core/exception-tools.h
@@ -32,6 +32,7 @@
 /* --- CLASS ----------------------------------------------------------- */
 /* --------------------------------------------------------------------- */
 
+namespace sot {
 
 /* \class sotExceptionTools
  */
@@ -62,7 +63,7 @@ public:
 
 };
 
-
+} // namespace sot
 
 
 
diff --git a/include/sot-core/exception-traces.h b/include/sot-core/exception-traces.h
index 1ab6e848..e2c4f37f 100644
--- a/include/sot-core/exception-traces.h
+++ b/include/sot-core/exception-traces.h
@@ -32,6 +32,7 @@
 /* --- CLASS ----------------------------------------------------------- */
 /* --------------------------------------------------------------------- */
 
+namespace sot {
 
 /* \class sotExceptionTraces
  */
@@ -61,7 +62,7 @@ public:
 
 };
 
-
+} // namespace sot
 
 
 
diff --git a/include/sot-core/factory.h b/include/sot-core/factory.h
index e37fad4d..8939c0e4 100644
--- a/include/sot-core/factory.h
+++ b/include/sot-core/factory.h
@@ -31,12 +31,15 @@
 #include <string>
 
 /* --- SOT --- */
-class sotFeatureAbstract;
-class sotTaskAbstract;
 #include <sot-core/exception-factory.h>
 #include <sot-core/sot-core-api.h>
 #include <dynamic-graph/factory.h>
 
+namespace sot {
+
+class sotFeatureAbstract;
+class sotTaskAbstract;
+
 /* --------------------------------------------------------------------- */
 /* --- FACTORY ---------------------------------------------------------- */
 /* --------------------------------------------------------------------- */
@@ -149,7 +152,7 @@ class SOT_CORE_EXPORT sotTaskRegisterer
   sotTaskRegisterer reg##_##sotTaskType( className,&sotTaskMaker##_##sotTaskType );   \
   }                                                       \
 
-
+} // namespace sot
 
 #endif /* #ifndef __SOT_FACTORY_HH__ */
 
diff --git a/include/sot-core/feature-1d.h b/include/sot-core/feature-1d.h
index 1ad8d271..a906f5d7 100644
--- a/include/sot-core/feature-1d.h
+++ b/include/sot-core/feature-1d.h
@@ -47,6 +47,7 @@
 /* --- CLASS ----------------------------------------------------------- */
 /* --------------------------------------------------------------------- */
 
+namespace sot {
 
 /*!
   \class sotFeature1D
@@ -132,7 +133,7 @@ class SOTFEATURE1D_EXPORT sotFeature1D
 
 } ;
 
-
+} // namespace sot
 
 #endif // #ifndef __SOT_FEATURE_1D_HH__
 
diff --git a/include/sot-core/feature-abstract.h b/include/sot-core/feature-abstract.h
index 12b1b337..2e09c8f0 100644
--- a/include/sot-core/feature-abstract.h
+++ b/include/sot-core/feature-abstract.h
@@ -39,6 +39,7 @@ namespace ml = maal::boost;
 /* STD */
 #include <string>
 using namespace dynamicgraph;
+namespace sot {
 
 /* --------------------------------------------------------------------- */
 /* --- CLASS ----------------------------------------------------------- */
@@ -182,7 +183,7 @@ class SOT_CORE_EXPORT sotFeatureAbstract
 
 };
 
-
+} // namespace sot
 
 
 
diff --git a/include/sot-core/feature-generic.h b/include/sot-core/feature-generic.h
index 280e1d6c..27407155 100644
--- a/include/sot-core/feature-generic.h
+++ b/include/sot-core/feature-generic.h
@@ -47,6 +47,7 @@
 /* --- CLASS ----------------------------------------------------------- */
 /* --------------------------------------------------------------------- */
 
+namespace sot {
 
 /*!
   \class sotFeatureGeneric
@@ -148,6 +149,7 @@ class SOTFEATUREGENERIC_EXPORT sotFeatureGeneric
 
 } ;
 
+} // namespace sot
 
 
 #endif // #ifndef __SOT_FEATURE_GENERIC_HH__
diff --git a/include/sot-core/feature-joint-limits.h b/include/sot-core/feature-joint-limits.h
index bf07615e..6b81bbe8 100644
--- a/include/sot-core/feature-joint-limits.h
+++ b/include/sot-core/feature-joint-limits.h
@@ -47,6 +47,7 @@
 /* --- CLASS ----------------------------------------------------------- */
 /* --------------------------------------------------------------------- */
 
+namespace sot {
 
 /*!
   \class sotFeatureJointLimits
@@ -105,6 +106,8 @@ class SOTFEATUREJOINTLIMITS_EXPORT sotFeatureJointLimits
 
 } ;
 
+} // namespace sot
+
 #endif // #ifndef __SOT_FEATURE_JOINTLIMITS_HH__
 
 /*
diff --git a/include/sot-core/feature-line-distance.h b/include/sot-core/feature-line-distance.h
index 01ee9ddc..f19fe1ef 100644
--- a/include/sot-core/feature-line-distance.h
+++ b/include/sot-core/feature-line-distance.h
@@ -48,6 +48,7 @@
 /* --- CLASS ----------------------------------------------------------- */
 /* --------------------------------------------------------------------- */
 
+namespace sot {
 
 /*!
   \class sotFeatureLineDistance
@@ -98,6 +99,7 @@ class SOTFEATURELINEDISTANCE_EXPORT sotFeatureLineDistance
 } ;
 
 
+} // namespace sot
 
 #endif // #ifndef __SOT_FEATURE_LINEDISTANCE_HH__
 
diff --git a/include/sot-core/feature-point6d-relative.h b/include/sot-core/feature-point6d-relative.h
index 3243d3d9..3bc31071 100644
--- a/include/sot-core/feature-point6d-relative.h
+++ b/include/sot-core/feature-point6d-relative.h
@@ -49,6 +49,7 @@
 /* --- CLASS ----------------------------------------------------------- */
 /* --------------------------------------------------------------------- */
 
+namespace sot {
 
 /*!
   \class sotFeaturePoint6dRelative
@@ -105,7 +106,7 @@ class SOTFEATUREPOINT6DRELATIVE_EXPORT sotFeaturePoint6dRelative
 
 } ;
 
-
+} // namespace sot
 
 #endif // #ifndef __SOT_FEATURE_POINT6DRELATIVE_HH__
 
diff --git a/include/sot-core/feature-point6d.h b/include/sot-core/feature-point6d.h
index 2b345b5c..c9b460c4 100644
--- a/include/sot-core/feature-point6d.h
+++ b/include/sot-core/feature-point6d.h
@@ -48,6 +48,7 @@
 /* --- CLASS ----------------------------------------------------------- */
 /* --------------------------------------------------------------------- */
 
+namespace sot {
 
 /*!
   \class sotFeaturePoint6d
@@ -111,7 +112,7 @@ class SOTFEATUREPOINT6D_EXPORT sotFeaturePoint6d
 
 } ;
 
-
+} // namespace sot
 
 #endif // #ifndef __SOT_FEATURE_POINT6D_HH__
 
diff --git a/include/sot-core/feature-task.h b/include/sot-core/feature-task.h
index 1ecbed5b..d8f9aa8a 100644
--- a/include/sot-core/feature-task.h
+++ b/include/sot-core/feature-task.h
@@ -48,6 +48,7 @@
 /* --- CLASS ----------------------------------------------------------- */
 /* --------------------------------------------------------------------- */
 
+namespace sot {
 
 class SOTFEATURETASK_EXPORT sotFeatureTask 
 : public sotFeatureGeneric
@@ -92,7 +93,7 @@ class SOTFEATURETASK_EXPORT sotFeatureTask
 
 } ;
 
-
+} // namespace sot
 
 #endif // #ifndef __SOT_FEATURE_TASK_HH__
 
diff --git a/include/sot-core/feature-vector3.h b/include/sot-core/feature-vector3.h
index 80379550..27b98615 100644
--- a/include/sot-core/feature-vector3.h
+++ b/include/sot-core/feature-vector3.h
@@ -48,6 +48,7 @@
 /* --- CLASS ----------------------------------------------------------- */
 /* --------------------------------------------------------------------- */
 
+namespace sot {
 
 /*!
   \class sotFeatureVector3
@@ -95,6 +96,7 @@ class SOTFEATUREVECTOR3_EXPORT sotFeatureVector3
 
 } ;
 
+} // namespace sot
 
 
 #endif // #ifndef __SOT_FEATURE_VECTOR3_HH__
diff --git a/include/sot-core/feature-visual-point.h b/include/sot-core/feature-visual-point.h
index 614fffb1..a6272ec5 100644
--- a/include/sot-core/feature-visual-point.h
+++ b/include/sot-core/feature-visual-point.h
@@ -47,6 +47,7 @@
 /* --- CLASS ----------------------------------------------------------- */
 /* --------------------------------------------------------------------- */
 
+namespace sot {
 
 /*!
   \class sotFeatureVisualPoint
@@ -99,7 +100,7 @@ class SOTFEATUREVISUALPOINT_EXPORT sotFeatureVisualPoint
 
 } ;
 
-
+} // namespace sot
 
 #endif // #ifndef __SOT_FEATURE_VISUALPOINT_HH__
 
diff --git a/include/sot-core/fir-filter.h b/include/sot-core/fir-filter.h
index 144abde7..e7a641f6 100644
--- a/include/sot-core/fir-filter.h
+++ b/include/sot-core/fir-filter.h
@@ -33,7 +33,6 @@ namespace ml = maal::boost;
 
 #include <dynamic-graph/entity.h>
 #include <dynamic-graph/all-signals.h>
-#include <dynamic-graph/all-signals.h>
 
 namespace detail
 {
diff --git a/include/sot-core/flags.h b/include/sot-core/flags.h
index ee3e5ec0..d044e0cd 100644
--- a/include/sot-core/flags.h
+++ b/include/sot-core/flags.h
@@ -37,6 +37,7 @@
 /* --- CLASS ----------------------------------------------------------- */
 /* --------------------------------------------------------------------- */
 
+namespace sot {
 
 class SOT_CORE_EXPORT sotFlags
 {
@@ -99,5 +100,6 @@ SOT_CORE_EXPORT extern const sotFlags FLAG_LINE_6;
 SOT_CORE_EXPORT extern const sotFlags FLAG_LINE_7;
 SOT_CORE_EXPORT extern const sotFlags FLAG_LINE_8;
 
+} // namespace sot
 
 #endif /* #ifndef __SOT_FLAGS_H */
diff --git a/include/sot-core/gain-adaptive.h b/include/sot-core/gain-adaptive.h
index bd30df20..8965a763 100644
--- a/include/sot-core/gain-adaptive.h
+++ b/include/sot-core/gain-adaptive.h
@@ -52,6 +52,8 @@ namespace ml = maal::boost;
 /* --- CLASS ----------------------------------------------------------- */
 /* --------------------------------------------------------------------- */
 
+namespace sot {
+
 class SOTGAINADAPTATIVE_EXPORT sotGainAdaptative
 : public Entity
 {
@@ -106,7 +108,7 @@ class SOTGAINADAPTATIVE_EXPORT sotGainAdaptative
 			    std::ostream& os );
 };
 
-
+} // namespace sot
 
 
 
diff --git a/include/sot-core/gain-hyperbolic.h b/include/sot-core/gain-hyperbolic.h
index 2339350e..3de809e0 100644
--- a/include/sot-core/gain-hyperbolic.h
+++ b/include/sot-core/gain-hyperbolic.h
@@ -53,6 +53,8 @@ namespace ml = maal::boost;
 /* --- CLASS ----------------------------------------------------------- */
 /* --------------------------------------------------------------------- */
 
+namespace sot {
+
 class SOTGAINHYPERBOLIC_EXPORT sotGainHyperbolic
 : public Entity
 {
@@ -110,7 +112,7 @@ class SOTGAINHYPERBOLIC_EXPORT sotGainHyperbolic
 			    std::ostream& os );
 };
 
-
+} // namespace sot
 
 
 
diff --git a/include/sot-core/integrator-abstract.h b/include/sot-core/integrator-abstract.h
index 48cb2313..4b8b3b2a 100644
--- a/include/sot-core/integrator-abstract.h
+++ b/include/sot-core/integrator-abstract.h
@@ -45,6 +45,8 @@ namespace ml = maal::boost;
 /* --- CLASS ----------------------------------------------------------- */
 /* --------------------------------------------------------------------- */
 
+namespace sot {
+
 /*! \brief integrates an ODE. If Y is the output and X the input, the
  * following equation is integrated:
  * a_p * d(p)Y / dt^p + .... + a_0 Y = b_m * d(m)X / dt^m + ... . b_0 X
@@ -138,4 +140,10 @@ class sotIntegratorAbstract
   std::vector<coefT> denominator;
 };
 
+
+} // namespace sot
+
+
+
+
 #endif
diff --git a/include/sot-core/integrator-euler.h b/include/sot-core/integrator-euler.h
index efbeda93..c786f02a 100644
--- a/include/sot-core/integrator-euler.h
+++ b/include/sot-core/integrator-euler.h
@@ -33,6 +33,7 @@
 /* --- CLASS ----------------------------------------------------------- */
 /* --------------------------------------------------------------------- */
 
+namespace sot {
 
 /*!
  * \class sotIntegratorEuler
@@ -128,4 +129,9 @@ public:
   }
 };
 
+} // namespace sot
+
+
+
+
 #endif
diff --git a/include/sot-core/matrix-constant.h b/include/sot-core/matrix-constant.h
index ef0c264f..6c096cbd 100644
--- a/include/sot-core/matrix-constant.h
+++ b/include/sot-core/matrix-constant.h
@@ -29,6 +29,9 @@ namespace ml = maal::boost;
 /* --------------------------------------------------------------------- */
 /* --- MATRIX ---------------------------------------------------------- */
 /* --------------------------------------------------------------------- */
+
+namespace sot {
+
 class sotMatrixConstant
 : public Entity
 {
@@ -59,7 +62,7 @@ public:
 
 };
     
-
+} // namespace sot
 
 
 
diff --git a/include/sot-core/matrix-force.h b/include/sot-core/matrix-force.h
index ca89c9e9..ea34b5fa 100644
--- a/include/sot-core/matrix-force.h
+++ b/include/sot-core/matrix-force.h
@@ -23,16 +23,21 @@
 
 /* --- Matrix --- */
 #include <MatrixAbstractLayer/boost.h>
+#include <sot-core/sot-core-api.h>
 namespace ml = maal::boost;
 
-class sotMatrixHomogeneous;
-class sotMatrixTwist;
-
-#include <sot-core/sot-core-api.h>
 
 /* --------------------------------------------------------------------- */
 /* --------------------------------------------------------------------- */
 /* --------------------------------------------------------------------- */
+
+namespace sot {
+
+
+class sotMatrixHomogeneous;
+class sotMatrixTwist;
+
+
 class SOT_CORE_EXPORT sotMatrixForce
 : public ml::Matrix
 {
@@ -57,6 +62,8 @@ class SOT_CORE_EXPORT sotMatrixForce
   sotMatrixTwist transpose( void ) const;
 
  };
+
+} // namespace sot
     
 
 #endif /* #ifndef __SOT_MATRIX_FORCE_H__ */
diff --git a/include/sot-core/matrix-homogeneous.h b/include/sot-core/matrix-homogeneous.h
index e46c062e..cdaaf15b 100644
--- a/include/sot-core/matrix-homogeneous.h
+++ b/include/sot-core/matrix-homogeneous.h
@@ -23,15 +23,16 @@
 
 /* --- Matrix --- */
 #include <MatrixAbstractLayer/boost.h>
-namespace ml = maal::boost;
-
-class sotMatrixRotation;
-
 #include <sot-core/sot-core-api.h>
+namespace ml = maal::boost;
 
 /* --------------------------------------------------------------------- */
 /* --------------------------------------------------------------------- */
 /* --------------------------------------------------------------------- */
+namespace sot {
+
+class sotMatrixRotation;
+
 class SOT_CORE_EXPORT sotMatrixHomogeneous
 : public ml::Matrix
 {
@@ -64,7 +65,7 @@ class SOT_CORE_EXPORT sotMatrixHomogeneous
 
  };
     
-
+} // namespace sot
 
 
 #endif /* #ifndef __SOT_MATRIX_HOMOGENEOUS_H__ */
diff --git a/include/sot-core/matrix-rotation.h b/include/sot-core/matrix-rotation.h
index f558d40c..2fc4cfad 100644
--- a/include/sot-core/matrix-rotation.h
+++ b/include/sot-core/matrix-rotation.h
@@ -22,13 +22,14 @@
 
 
 /* --- Matrix --- */
+
+#include <sot-core/sot-core-api.h>
 #include <MatrixAbstractLayer/boost.h>
 namespace ml = maal::boost;
 
+namespace sot {
 class sotVectorUTheta;
 
-#include <sot-core/sot-core-api.h>
-
 /* --------------------------------------------------------------------- */
 /* --------------------------------------------------------------------- */
 /* --------------------------------------------------------------------- */
@@ -45,7 +46,7 @@ class SOT_CORE_EXPORT sotMatrixRotation
   sotMatrixRotation& operator= ( sotVectorUTheta&th ) { fromVector(th); return *this; } 
 };
     
-
+} // namespace sot
 #endif /* #ifndef __SOT_MATRIX_ROTATION_H__ */
 
 
diff --git a/include/sot-core/matrix-twist.h b/include/sot-core/matrix-twist.h
index 9e6a1f53..54174a58 100644
--- a/include/sot-core/matrix-twist.h
+++ b/include/sot-core/matrix-twist.h
@@ -23,16 +23,19 @@
 
 /* --- Matrix --- */
 #include <MatrixAbstractLayer/boost.h>
-namespace ml = maal::boost;
-
-class sotMatrixHomogeneous;
-class sotMatrixForce;
-
 #include <sot-core/sot-core-api.h>
 
+namespace ml = maal::boost;
+
 /* --------------------------------------------------------------------- */
 /* --------------------------------------------------------------------- */
 /* --------------------------------------------------------------------- */
+namespace sot {
+
+
+class sotMatrixHomogeneous;
+class sotMatrixForce;
+
 class SOT_CORE_EXPORT sotMatrixTwist
 : public ml::Matrix
 {
@@ -56,7 +59,8 @@ class SOT_CORE_EXPORT sotMatrixTwist
   sotMatrixForce& transpose( sotMatrixForce& Vt ) const;
   sotMatrixForce transpose( void ) const;
  };
-    
+
+} // namespace sot
 
 #endif /* #ifndef __SOT_MATRIX_TWIST_H__ */
 
diff --git a/include/sot-core/memory-task-sot.h b/include/sot-core/memory-task-sot.h
index e505ef60..9c3c859f 100644
--- a/include/sot-core/memory-task-sot.h
+++ b/include/sot-core/memory-task-sot.h
@@ -44,6 +44,8 @@
 /* --- CLASS ----------------------------------------------------------- */
 /* --------------------------------------------------------------------- */
 
+namespace sot {
+
 class SOTSOT_CORE_EXPORT sotMemoryTaskSOT
 : public sotTaskAbstract::sotMemoryTaskAbstract, public Entity
 {
@@ -87,4 +89,6 @@ class SOTSOT_CORE_EXPORT sotMemoryTaskSOT
 			    std::ostream& os );
 };
 
+} //namespace sot
+
 #endif // __SOT_MEMORY_TASK_HH
diff --git a/include/sot-core/task-multi-bound.h b/include/sot-core/multi-bound.h
similarity index 98%
rename from include/sot-core/task-multi-bound.h
rename to include/sot-core/multi-bound.h
index 42809510..815e4c20 100644
--- a/include/sot-core/task-multi-bound.h
+++ b/include/sot-core/multi-bound.h
@@ -39,6 +39,8 @@
 /* --- CLASS ----------------------------------------------------------- */
 /* --------------------------------------------------------------------- */
 
+namespace sot {
+
 class SOT_CORE_EXPORT sotMultiBound
 {
  public:
@@ -78,6 +80,7 @@ typedef std::vector< sotMultiBound > sotVectorMultiBound;
 SOT_CORE_EXPORT std::ostream& operator<< (std::ostream& os, const sotVectorMultiBound& v );
 SOT_CORE_EXPORT std::istream& operator>> (std::istream& os, sotVectorMultiBound& v );
 
+} // namespace sot
 
 
 #endif // #ifndef __SOT_sotMultiBound_H__
diff --git a/include/sot-core/op-point-modifier.h b/include/sot-core/op-point-modifier.h
index 3f17958d..8486bf80 100644
--- a/include/sot-core/op-point-modifier.h
+++ b/include/sot-core/op-point-modifier.h
@@ -47,6 +47,9 @@ namespace ml = maal::boost;
 /* --------------------------------------------------------------------- */
 /* --- VECTOR ---------------------------------------------------------- */
 /* --------------------------------------------------------------------- */
+
+namespace sot {
+
 class SOTOPPOINTMODIFIOR_EXPORT sotOpPointModifior
 : public Entity
 {
@@ -79,5 +82,6 @@ public:
 
 };
 
+} // namespace sot
 
 #endif //  __SOT_OP_POINT_MODIFIOR_H__ 
diff --git a/include/sot-core/pool.h b/include/sot-core/pool.h
index 7f21be7a..1c8cd35d 100644
--- a/include/sot-core/pool.h
+++ b/include/sot-core/pool.h
@@ -38,13 +38,17 @@
 #include <sot-core/sot-core-api.h>
 #include <dynamic-graph/pool.h>
 
-class sotFeatureAbstract;
-class sotTaskAbstract;
-
 /* --------------------------------------------------------------------- */
 /* --- CLASS ----------------------------------------------------------- */
 /* --------------------------------------------------------------------- */
 
+namespace sot {
+
+// Preliminary declarations
+class sotFeatureAbstract;
+class sotTaskAbstract;
+
+
 /*! @ingroup factory
   \brief This class keep tracks of all the objects in the stack of Tasks.
 
@@ -137,6 +141,8 @@ class SOT_CORE_EXPORT sotPoolStorage
 
 SOT_CORE_EXPORT extern sotPoolStorage sotPool;
 
+} // namespace sot
+
 #endif /* #ifndef __SOT_POOL_HH__ */
 
 
diff --git a/include/sot-core/signal-cast.h b/include/sot-core/signal-cast.h
index 2cf622c2..b4d5f823 100644
--- a/include/sot-core/signal-cast.h
+++ b/include/sot-core/signal-cast.h
@@ -31,7 +31,7 @@
 #include <sot-core/vector-quaternion.h>
 #include <sot-core/vector-roll-pitch-yaw.h>
 #include <sot-core/matrix-force.h>
-#include <sot-core/task-multi-bound.h>
+#include <sot-core/multi-bound.h>
 #include <sot-core/sot-core-api.h>
 #ifdef WIN32
 #include <sot-core/sotUtilsWindows.h>
@@ -41,6 +41,10 @@
 /* -------------------------------------------------------------------------- */
 /* --- CLASS ---------------------------------------------------------------- */
 /* -------------------------------------------------------------------------- */
+
+namespace sot {
+
+
 class sotFeatureAbstract;
 
 
@@ -192,7 +196,7 @@ SOT_SIGNAL_CAST_DEFINITION_MATRIX(sotMatrixHomogeneous);
 SOT_SIGNAL_CAST_DEFINITION_MATRIX(sotMatrixTwist);
 SOT_SIGNAL_CAST_DEFINITION_MATRIX(sotMatrixForce);
 
-
+} // namespace sot
 
 
 #endif // #ifndef __SOT_SIGNAL_CAST_HH__
diff --git a/include/sot-core/solver-hierarchical-inequalities.h b/include/sot-core/solver-hierarchical-inequalities.h
index 8a46fb9a..8a79b239 100644
--- a/include/sot-core/solver-hierarchical-inequalities.h
+++ b/include/sot-core/solver-hierarchical-inequalities.h
@@ -53,6 +53,8 @@
 /* --- CLASS ----------------------------------------------------------- */
 /* --------------------------------------------------------------------- */
 
+namespace sot {
+
 class SOTSOTH_EXPORT ConstraintMem
 {
 public:
@@ -293,5 +295,9 @@ public:
 };
 
 
+} // namespace sot
+
+
+
 #endif // #ifdef __SOT_sotSolverHierarchicalInequalities_HH__
 
diff --git a/include/sot-core/sot-h.h b/include/sot-core/sot-h.h
index db668874..d0ebe4e9 100644
--- a/include/sot-core/sot-h.h
+++ b/include/sot-core/sot-h.h
@@ -50,6 +50,8 @@
 /* --- CLASS ----------------------------------------------------------- */
 /* --------------------------------------------------------------------- */
 
+namespace sot {
+
 class SOTSOTH_EXPORT sotSOTH
 :public sotSOT
 {
@@ -126,7 +128,7 @@ class SOTSOTH_EXPORT sotSOTH
 
 };
 
-
+} // namespace sot
 
 
 
diff --git a/include/sot-core/sot-qr.h b/include/sot-core/sot-qr.h
index 7b4b371a..991b6692 100644
--- a/include/sot-core/sot-qr.h
+++ b/include/sot-core/sot-qr.h
@@ -66,6 +66,9 @@ namespace ml = maal::boost;
 
 
 */
+
+namespace sot {
+
 class SOTSOTQR_EXPORT sotSOTQr
 :public Entity
 {
@@ -266,7 +269,7 @@ class SOTSOTQR_EXPORT sotSOTQr
 
 };
 
-
+} // namespace sot
 
 
 
diff --git a/include/sot-core/sot.h b/include/sot-core/sot.h
index 4f0e8898..63fb0238 100644
--- a/include/sot-core/sot.h
+++ b/include/sot-core/sot.h
@@ -59,6 +59,7 @@ namespace ml = maal::boost;
 /* --- CLASS ----------------------------------------------------------- */
 /* --------------------------------------------------------------------- */
 
+namespace sot {
 
 /*! @ingroup stackoftasks
   \brief This class implements the Stack of Task.
@@ -283,6 +284,7 @@ class SOTSOT_CORE_EXPORT sotSOT
 
 };
 
+} // namespace sot
 
 
 
diff --git a/include/sot-core/task-abstract.h b/include/sot-core/task-abstract.h
index 68f7bc54..ab639ed9 100644
--- a/include/sot-core/task-abstract.h
+++ b/include/sot-core/task-abstract.h
@@ -38,12 +38,15 @@ namespace ml = maal::boost;
 #include <dynamic-graph/entity.h>
 #include <dynamic-graph/all-signals.h>
 #include <dynamic-graph/all-signals.h>
-#include <sot-core/task-multi-bound.h>
+#include <sot-core/multi-bound.h>
 #include <sot-core/sot-core-api.h>
 
 /* --------------------------------------------------------------------- */
 /* --- CLASS ----------------------------------------------------------- */
 /* --------------------------------------------------------------------- */
+
+namespace sot {
+
 class SOT_CORE_EXPORT sotTaskAbstract
 : public Entity
 {
@@ -89,6 +92,8 @@ class SOT_CORE_EXPORT sotTaskAbstract
  public:
 };
 
+} // namespace sot
+
 
 
 
diff --git a/include/sot-core/task-conti.h b/include/sot-core/task-conti.h
index 010d2d1a..992f89a6 100644
--- a/include/sot-core/task-conti.h
+++ b/include/sot-core/task-conti.h
@@ -58,7 +58,7 @@ namespace ml = maal::boost;
 /* --- CLASS ----------------------------------------------------------- */
 /* --------------------------------------------------------------------- */
 
-
+namespace sot {
 
 class SOTTASKCONTI_EXPORT sotTaskConti
 : public sotTask
@@ -103,7 +103,7 @@ class SOTTASKCONTI_EXPORT sotTaskConti
 			    std::ostream& os );
 };
 
-
+} // namespace sot
 
 
 
diff --git a/include/sot-core/task-pd.h b/include/sot-core/task-pd.h
index 6d28b55b..fbabd245 100644
--- a/include/sot-core/task-pd.h
+++ b/include/sot-core/task-pd.h
@@ -48,7 +48,7 @@
 /* --- CLASS ----------------------------------------------------------- */
 /* --------------------------------------------------------------------- */
 
-
+namespace sot {
 
 class SOTTASKPD_EXPORT sotTaskPD
 : public sotTask
@@ -82,7 +82,7 @@ class SOTTASKPD_EXPORT sotTaskPD
 
 };
 
-
+} // namespace sot
 
 
 
diff --git a/include/sot-core/task-unilateral.h b/include/sot-core/task-unilateral.h
index dddb35b4..2ddd8865 100644
--- a/include/sot-core/task-unilateral.h
+++ b/include/sot-core/task-unilateral.h
@@ -60,6 +60,7 @@ namespace ml = maal::boost;
 /* --- CLASS ----------------------------------------------------------- */
 /* --------------------------------------------------------------------- */
 
+namespace sot {
 
 class SOTTASKUNILATERAL_EXPORT sotTaskUnilateral
 : public sotTask
@@ -90,7 +91,7 @@ class SOTTASKUNILATERAL_EXPORT sotTaskUnilateral
   void display( std::ostream& os ) const;
 };
 
-
+} // namespace sot
 
 
 
diff --git a/include/sot-core/task.h b/include/sot-core/task.h
index 8d10d9e8..6e981637 100644
--- a/include/sot-core/task.h
+++ b/include/sot-core/task.h
@@ -82,6 +82,7 @@ namespace ml = maal::boost;
 
  */
 
+namespace sot {
 
 class SOTTASK_EXPORT sotTask
 : public sotTaskAbstract
@@ -134,7 +135,7 @@ class SOTTASK_EXPORT sotTask
   virtual std::ostream& writeGraph( std::ostream& os ) const;
 };
 
-
+} // namespace sot
 
 
 
diff --git a/include/sot-core/unary-op.h b/include/sot-core/unary-op.h
index 24b6660a..e9888d72 100644
--- a/include/sot-core/unary-op.h
+++ b/include/sot-core/unary-op.h
@@ -46,6 +46,8 @@ namespace ml = maal::boost;
 /* --- CLASS ----------------------------------------------------------- */
 /* --------------------------------------------------------------------- */
 
+namespace sot {
+
 template< class Tin,class Tout,typename Operator >
 class sotUnaryOp
 :public Entity
@@ -90,7 +92,7 @@ class sotUnaryOp
 
 };
 
-
+} // namespace sot
 
 
 
diff --git a/include/sot-core/vector-constant.h b/include/sot-core/vector-constant.h
index b39ec101..84a4fbce 100644
--- a/include/sot-core/vector-constant.h
+++ b/include/sot-core/vector-constant.h
@@ -28,6 +28,8 @@ namespace ml = maal::boost;
 /* --------------------------------------------------------------------- */
 /* --- VECTOR ---------------------------------------------------------- */
 /* --------------------------------------------------------------------- */
+namespace sot{
+
 class sotVectorConstant
 : public Entity
 {
@@ -57,7 +59,7 @@ public:
 
 };
     
-
+} // namespace sot
 
 
 
diff --git a/include/sot-core/vector-quaternion.h b/include/sot-core/vector-quaternion.h
index 8d4771ac..28a75301 100644
--- a/include/sot-core/vector-quaternion.h
+++ b/include/sot-core/vector-quaternion.h
@@ -27,6 +27,8 @@
 /* --------------------------------------------------------------------- */
 /* --------------------------------------------------------------------- */
 /* --------------------------------------------------------------------- */
+namespace sot {
+
 class SOT_CORE_EXPORT sotVectorQuaternion
 : public sotVectorRotation
 {
@@ -45,6 +47,7 @@ class SOT_CORE_EXPORT sotVectorQuaternion
 
 };
     
+}
 
 
 #endif /* #ifndef __SOT_VECTOR_QUATERNION_H__ */
diff --git a/include/sot-core/vector-roll-pitch-yaw.h b/include/sot-core/vector-roll-pitch-yaw.h
index 5fecfa04..7e9eda4d 100644
--- a/include/sot-core/vector-roll-pitch-yaw.h
+++ b/include/sot-core/vector-roll-pitch-yaw.h
@@ -27,6 +27,8 @@
 /* --------------------------------------------------------------------- */
 /* --------------------------------------------------------------------- */
 /* --------------------------------------------------------------------- */
+namespace sot {
+
 class SOT_CORE_EXPORT sotVectorRollPitchYaw
 : public sotVectorRotation
 {
@@ -40,6 +42,6 @@ class SOT_CORE_EXPORT sotVectorRollPitchYaw
 
 };
     
-
+} // namespace sot
 
 #endif /* #ifndef __SOT_VECTOR_ROLLPITCHYAW_H__ */
diff --git a/include/sot-core/vector-rotation.h b/include/sot-core/vector-rotation.h
index 9da8469e..829e5333 100644
--- a/include/sot-core/vector-rotation.h
+++ b/include/sot-core/vector-rotation.h
@@ -31,6 +31,9 @@ namespace ml = maal::boost;
 /* --------------------------------------------------------------------- */
 /* --------------------------------------------------------------------- */
 /* --------------------------------------------------------------------- */
+
+namespace sot {
+
 class SOT_CORE_EXPORT sotVectorRotation
 : public ml::Vector
 {
@@ -42,7 +45,8 @@ class SOT_CORE_EXPORT sotVectorRotation
   virtual sotVectorRotation& fromMatrix( const sotMatrixRotation& rot ) = 0;
   virtual sotMatrixRotation& toMatrix( sotMatrixRotation& rot ) const = 0;
 };
-    
+
+} // namespace sot
 
 #endif /* #ifndef __SOT_VECTOR_ROTATION_H__ */
 
diff --git a/include/sot-core/vector-to-rotation.h b/include/sot-core/vector-to-rotation.h
index 20a4e9ae..29e5da1b 100644
--- a/include/sot-core/vector-to-rotation.h
+++ b/include/sot-core/vector-to-rotation.h
@@ -35,6 +35,8 @@ namespace ml = maal::boost;
 /* --------------------------------------------------------------------- */
 /* --- VECTOR ---------------------------------------------------------- */
 /* --------------------------------------------------------------------- */
+namespace sot {
+
 class sotVectorToRotation
 : public Entity
 {
@@ -70,7 +72,7 @@ public:
 
 };
     
-
+} // namespace sot
 
 
 
diff --git a/include/sot-core/vector-utheta.h b/include/sot-core/vector-utheta.h
index 983d89c0..5f859468 100644
--- a/include/sot-core/vector-utheta.h
+++ b/include/sot-core/vector-utheta.h
@@ -27,6 +27,10 @@
 /* --------------------------------------------------------------------- */
 /* --------------------------------------------------------------------- */
 /* --------------------------------------------------------------------- */
+
+namespace sot {
+
+
 class SOT_CORE_EXPORT sotVectorUTheta
 : public sotVectorRotation
 {
@@ -39,6 +43,8 @@ class SOT_CORE_EXPORT sotVectorUTheta
   virtual sotMatrixRotation& toMatrix( sotMatrixRotation& rot ) const;
 
 };
+
+} // namespace sot
     
 
 
diff --git a/include/sot-core/weighted-sot.h b/include/sot-core/weighted-sot.h
index e4974669..f1e09fd1 100644
--- a/include/sot-core/weighted-sot.h
+++ b/include/sot-core/weighted-sot.h
@@ -63,6 +63,9 @@ namespace ml = maal::boost;
 
 
 */
+
+namespace sot {
+
 class SOTWEIGHTEDSOT_CORE_EXPORT sotWeightedSOT
 :public sotSOT
 {
@@ -104,7 +107,7 @@ class SOTWEIGHTEDSOT_CORE_EXPORT sotWeightedSOT
 
 };
 
-
+} // namespace sot
 
 
 
diff --git a/src/debug/debug.cpp b/src/debug/debug.cpp
index bedea1a7..4e54feb5 100644
--- a/src/debug/debug.cpp
+++ b/src/debug/debug.cpp
@@ -64,9 +64,6 @@ std::ofstream debugfile; //( "/dev/null", std::ios::trunc&std::ios::out );
 
 #endif
 
-DebugTrace sotDEBUGFLOW(debugfile);
-DebugTrace sotERRORFLOW(debugfile);
-
 
 void DebugTrace::openFile( const char * filename )
 {
@@ -86,3 +83,8 @@ void DebugTrace::closeFile( const char * filename )
 //DebugTrace sotDEBUGFLOW(std::cout);
 //DebugTrace sotERRORFLOW(std::cerr);
 
+/// Debug objects instances
+namespace sot {
+DebugTrace sotDEBUGFLOW(debugfile);
+DebugTrace sotERRORFLOW(debugfile);
+}
diff --git a/src/exception/exception-abstract.cpp b/src/exception/exception-abstract.cpp
index 90742085..14a19e53 100644
--- a/src/exception/exception-abstract.cpp
+++ b/src/exception/exception-abstract.cpp
@@ -23,6 +23,7 @@
 #include <sot-core/debug.h>
 
 using namespace std;
+using namespace sot;
 
 /* ------------------------------------------------------------------------- */
 /* --- CONSTRUCTORS -------------------------------------------------------- */
@@ -99,6 +100,8 @@ Param( const int& _line, const char * _function, const char * _file )
 /* --- OP << --------------------------------------------------------------- */
 /* ------------------------------------------------------------------------- */
 
+
+namespace sot {
 ostream &
 operator << (ostream & os,
 	     const sotExceptionAbstract & error)
@@ -114,6 +117,7 @@ operator << (ostream & os,
     return os;
 }
 
+}
 
 
 
diff --git a/src/exception/exception-dynamic.cpp b/src/exception/exception-dynamic.cpp
index 5aa538c3..bb3d95aa 100644
--- a/src/exception/exception-dynamic.cpp
+++ b/src/exception/exception-dynamic.cpp
@@ -21,6 +21,8 @@
 #include <stdarg.h>
 #include <cstdio>
 
+using namespace sot;
+
 /* --------------------------------------------------------------------- */
 /* --- CLASS ----------------------------------------------------------- */
 /* --------------------------------------------------------------------- */
diff --git a/src/exception/exception-factory.cpp b/src/exception/exception-factory.cpp
index 1d170e27..60fff81d 100644
--- a/src/exception/exception-factory.cpp
+++ b/src/exception/exception-factory.cpp
@@ -23,6 +23,7 @@
 #include <cstdio>
 
 using namespace sot;
+
 /* --------------------------------------------------------------------- */
 /* --- CLASS ----------------------------------------------------------- */
 /* --------------------------------------------------------------------- */
diff --git a/src/exception/exception-feature.cpp b/src/exception/exception-feature.cpp
index bf45cbb2..1bd27faf 100644
--- a/src/exception/exception-feature.cpp
+++ b/src/exception/exception-feature.cpp
@@ -21,6 +21,7 @@
 #include <stdarg.h>
 #include <cstdio>
 
+using namespace sot;
 
 /* --------------------------------------------------------------------- */
 /* --- CLASS ----------------------------------------------------------- */
diff --git a/src/exception/exception-signal.cpp b/src/exception/exception-signal.cpp
index 890c95b7..ac7aba2b 100644
--- a/src/exception/exception-signal.cpp
+++ b/src/exception/exception-signal.cpp
@@ -21,6 +21,8 @@
 #include <stdarg.h>
 #include <cstdio>
 
+using namespace sot;
+
 /* --------------------------------------------------------------------- */
 /* --- CLASS ----------------------------------------------------------- */
 /* --------------------------------------------------------------------- */
diff --git a/src/exception/exception-task.cpp b/src/exception/exception-task.cpp
index 99c0df6e..5aaac417 100644
--- a/src/exception/exception-task.cpp
+++ b/src/exception/exception-task.cpp
@@ -22,6 +22,8 @@
 #include <cstdio>
 
 
+using namespace sot;
+
 /* --------------------------------------------------------------------- */
 /* --- CLASS ----------------------------------------------------------- */
 /* --------------------------------------------------------------------- */
diff --git a/src/exception/exception-tools.cpp b/src/exception/exception-tools.cpp
index 2b77b6dd..b0a53545 100644
--- a/src/exception/exception-tools.cpp
+++ b/src/exception/exception-tools.cpp
@@ -21,6 +21,8 @@
 #include <stdarg.h>
 #include <cstdio>
 
+using namespace sot;
+
 /* --------------------------------------------------------------------- */
 /* --- CLASS ----------------------------------------------------------- */
 /* --------------------------------------------------------------------- */
diff --git a/src/exception/exception-traces.cpp b/src/exception/exception-traces.cpp
index 38c46fc8..125b0a78 100644
--- a/src/exception/exception-traces.cpp
+++ b/src/exception/exception-traces.cpp
@@ -21,6 +21,8 @@
 #include <stdarg.h>
 #include <cstdio>
 
+using namespace sot;
+
 /* --------------------------------------------------------------------- */
 /* --- CLASS ----------------------------------------------------------- */
 /* --------------------------------------------------------------------- */
diff --git a/src/factory/factory.cpp b/src/factory/factory.cpp
index beb3be88..d6b9f484 100644
--- a/src/factory/factory.cpp
+++ b/src/factory/factory.cpp
@@ -27,6 +27,8 @@
 #include <sot-core/factory.h>
 
 using namespace std;
+using namespace sot;
+
 
 /* --------------------------------------------------------------------- */
 /* --- CLASS ----------------------------------------------------------- */
@@ -202,6 +204,7 @@ commandLine( const std::string& cmdLine,std::istringstream& cmdArgs,
 
 
 
-
+/// The global sotFactory object
+namespace sot {
 sotFactoryStorage sotFactory;
-
+}
diff --git a/src/factory/pool.cpp b/src/factory/pool.cpp
index bb747f24..b7ed526b 100644
--- a/src/factory/pool.cpp
+++ b/src/factory/pool.cpp
@@ -28,6 +28,9 @@
 #include <dynamic-graph/entity.h>
 #include <list>
 
+using namespace sot;
+
+
 /* --------------------------------------------------------------------- */
 /* --- CLASS ----------------------------------------------------------- */
 /* --------------------------------------------------------------------- */
@@ -244,6 +247,7 @@ commandLine( const std::string& objectName,const std::string& functionName,
     }
 }
 
-
+/// The global sotPool object
+namespace sot {
 sotPoolStorage sotPool;
-
+}
diff --git a/src/feature/feature-1d.cpp b/src/feature/feature-1d.cpp
index 3a9ac538..6c16ddfa 100644
--- a/src/feature/feature-1d.cpp
+++ b/src/feature/feature-1d.cpp
@@ -31,6 +31,8 @@ using namespace std;
 #include <sot-core/factory.h>
 SOT_FACTORY_FEATURE_PLUGIN(sotFeature1D,"Feature1D");
 
+using namespace sot;
+
 /* --------------------------------------------------------------------- */
 /* --- CLASS ----------------------------------------------------------- */
 /* --------------------------------------------------------------------- */
diff --git a/src/feature/feature-abstract.cpp b/src/feature/feature-abstract.cpp
index 5c0b6203..5165bf3e 100644
--- a/src/feature/feature-abstract.cpp
+++ b/src/feature/feature-abstract.cpp
@@ -20,6 +20,8 @@
 #include <sot-core/feature-abstract.h>
 #include <sot-core/pool.h>
 
+using namespace sot;
+
 const std::string 
 sotFeatureAbstract::CLASS_NAME = "FeatureAbstract";
 
diff --git a/src/feature/feature-generic.cpp b/src/feature/feature-generic.cpp
index cdd9ced3..6c3b537d 100644
--- a/src/feature/feature-generic.cpp
+++ b/src/feature/feature-generic.cpp
@@ -31,6 +31,8 @@ using namespace std;
 #include <sot-core/factory.h>
 SOT_FACTORY_FEATURE_PLUGIN(sotFeatureGeneric,"FeatureGeneric");
 
+using namespace sot;
+
 /* --------------------------------------------------------------------- */
 /* --- CLASS ----------------------------------------------------------- */
 /* --------------------------------------------------------------------- */
diff --git a/src/feature/feature-joint-limits.cpp b/src/feature/feature-joint-limits.cpp
index f13ecb27..2cf50b6c 100644
--- a/src/feature/feature-joint-limits.cpp
+++ b/src/feature/feature-joint-limits.cpp
@@ -35,6 +35,8 @@ SOT_FACTORY_FEATURE_PLUGIN(sotFeatureJointLimits,"FeatureJointLimits");
 /* --- CLASS ----------------------------------------------------------- */
 /* --------------------------------------------------------------------- */
 
+using namespace sot;
+
 const double sotFeatureJointLimits::THRESHOLD_DEFAULT = .9;
 
 
diff --git a/src/feature/feature-line-distance.cpp b/src/feature/feature-line-distance.cpp
index dd9087f2..3b491522 100644
--- a/src/feature/feature-line-distance.cpp
+++ b/src/feature/feature-line-distance.cpp
@@ -33,6 +33,8 @@
 
 using namespace std;
 
+using namespace sot;
+
 #include <sot-core/factory.h>
 SOT_FACTORY_FEATURE_PLUGIN(sotFeatureLineDistance,"FeatureLineDistance");
 
diff --git a/src/feature/feature-point6d-relative.cpp b/src/feature/feature-point6d-relative.cpp
index 4612b58d..95d7428b 100644
--- a/src/feature/feature-point6d-relative.cpp
+++ b/src/feature/feature-point6d-relative.cpp
@@ -33,6 +33,8 @@
 #include <dynamic-graph/pool.h>
 
 using namespace std;
+using namespace sot;
+
 
 #include <sot-core/factory.h>
 SOT_FACTORY_FEATURE_PLUGIN(sotFeaturePoint6dRelative,"FeaturePoint6dRelative");
diff --git a/src/feature/feature-point6d.cpp b/src/feature/feature-point6d.cpp
index 5718527f..354b1c65 100644
--- a/src/feature/feature-point6d.cpp
+++ b/src/feature/feature-point6d.cpp
@@ -35,6 +35,8 @@
 
 using namespace std;
 
+using namespace sot;
+
 #include <sot-core/factory.h>
 SOT_FACTORY_FEATURE_PLUGIN(sotFeaturePoint6d,"FeaturePoint6d");
 
diff --git a/src/feature/feature-task.cpp b/src/feature/feature-task.cpp
index 4995f32a..72d79f9b 100644
--- a/src/feature/feature-task.cpp
+++ b/src/feature/feature-task.cpp
@@ -28,6 +28,8 @@
 #include <sot-core/exception-feature.h>
 #include <dynamic-graph/pool.h>
 using namespace std;
+using namespace sot;
+
 
 #include <sot-core/factory.h>
 SOT_FACTORY_FEATURE_PLUGIN(sotFeatureTask,"FeatureTask");
diff --git a/src/feature/feature-vector3.cpp b/src/feature/feature-vector3.cpp
index 9721af26..1e691586 100644
--- a/src/feature/feature-vector3.cpp
+++ b/src/feature/feature-vector3.cpp
@@ -32,10 +32,12 @@
 #include <sot-core/matrix-homogeneous.h>
 #include <sot-core/matrix-rotation.h>
 #include <sot-core/vector-utheta.h>
+#include <sot-core/factory.h>
 
+using namespace sot;
 using namespace std;
 
-#include <sot-core/factory.h>
+
 SOT_FACTORY_FEATURE_PLUGIN(sotFeatureVector3,"FeatureVector3");
 
 /* --------------------------------------------------------------------- */
diff --git a/src/feature/feature-visual-point.cpp b/src/feature/feature-visual-point.cpp
index 06955d77..3d355106 100644
--- a/src/feature/feature-visual-point.cpp
+++ b/src/feature/feature-visual-point.cpp
@@ -26,9 +26,12 @@
 #include <sot-core/feature-visual-point.h>
 #include <sot-core/exception-feature.h>
 #include <sot-core/debug.h>
+#include <sot-core/factory.h>
 using namespace std;
+using namespace sot;
+
+
 
-#include <sot-core/factory.h>
 SOT_FACTORY_FEATURE_PLUGIN(sotFeatureVisualPoint,"FeatureVisualPoint");
 
 /* --------------------------------------------------------------------- */
diff --git a/src/math/matrix-force.cpp b/src/math/matrix-force.cpp
index 31f36a82..32b21089 100644
--- a/src/math/matrix-force.cpp
+++ b/src/math/matrix-force.cpp
@@ -23,6 +23,9 @@
 #include <sot-core/matrix-twist.h>
 #include <sot-core/debug.h>
 
+using namespace sot;
+
+
 sotMatrixForce& sotMatrixForce::
 buildFrom( const sotMatrixHomogeneous& M )
 {
diff --git a/src/math/matrix-homogeneous.cpp b/src/math/matrix-homogeneous.cpp
index 59309779..364c4258 100644
--- a/src/math/matrix-homogeneous.cpp
+++ b/src/math/matrix-homogeneous.cpp
@@ -21,6 +21,9 @@
 #include <sot-core/matrix-rotation.h>
 #include <sot-core/debug.h>
 
+using namespace sot;
+
+
 sotMatrixHomogeneous& sotMatrixHomogeneous::
 buildFrom( const sotMatrixRotation& rot, const ml::Vector& trans )
 {
diff --git a/src/math/matrix-rotation.cpp b/src/math/matrix-rotation.cpp
index 1ec358b1..4f81cc09 100644
--- a/src/math/matrix-rotation.cpp
+++ b/src/math/matrix-rotation.cpp
@@ -21,6 +21,8 @@
 #include <sot-core/vector-utheta.h>
 
 using namespace std;
+using namespace sot;
+
 
 void sotMatrixRotation::fromVector( sotVectorUTheta& vec )
 {
diff --git a/src/math/matrix-twist.cpp b/src/math/matrix-twist.cpp
index 01744ff2..806e20e2 100644
--- a/src/math/matrix-twist.cpp
+++ b/src/math/matrix-twist.cpp
@@ -23,6 +23,9 @@
 #include <sot-core/matrix-force.h>
 #include <sot-core/debug.h>
 
+using namespace sot;
+
+
 sotMatrixTwist& sotMatrixTwist::
 buildFrom( const sotMatrixHomogeneous& M )
 {
diff --git a/src/math/op-point-modifior.cpp b/src/math/op-point-modifior.cpp
index ae5b7ced..124d4175 100644
--- a/src/math/op-point-modifior.cpp
+++ b/src/math/op-point-modifior.cpp
@@ -27,6 +27,8 @@
 SOT_FACTORY_ENTITY_PLUGIN(sotOpPointModifior,"OpPointModifior");
 
 using namespace std;
+using namespace sot;
+
 
 
 /* --------------------------------------------------------------------- */
diff --git a/src/math/vector-quaternion.cpp b/src/math/vector-quaternion.cpp
index b9e9f3b9..8c41f267 100644
--- a/src/math/vector-quaternion.cpp
+++ b/src/math/vector-quaternion.cpp
@@ -20,6 +20,8 @@
 #include <sot-core/vector-quaternion.h>
 #include <sot-core/debug.h>
 using namespace std;
+using namespace sot;
+
 
 static const double ANGLE_MINIMUM = 0.0001;
 static const double SINC_MINIMUM = 1e-8;
diff --git a/src/math/vector-roll-pitch-yaw.cpp b/src/math/vector-roll-pitch-yaw.cpp
index 6d2aac0c..db7719e3 100644
--- a/src/math/vector-roll-pitch-yaw.cpp
+++ b/src/math/vector-roll-pitch-yaw.cpp
@@ -20,6 +20,8 @@
 #include <sot-core/vector-roll-pitch-yaw.h>
 #include <sot-core/debug.h>
 using namespace std;
+using namespace sot;
+
 
 static const double ANGLE_MINIMUM = 0.0001;
 static const double SINC_MINIMUM = 1e-8;
diff --git a/src/math/vector-utheta.cpp b/src/math/vector-utheta.cpp
index ddad6c61..3a3b76a8 100644
--- a/src/math/vector-utheta.cpp
+++ b/src/math/vector-utheta.cpp
@@ -20,6 +20,7 @@
 #include <sot-core/vector-utheta.h>
 #include <sot-core/debug.h>
 using namespace std;
+using namespace sot;
 
 static const double ANGLE_MINIMUM = 0.0001;
 static const double SINC_MINIMUM = 1e-8;
diff --git a/src/matrix/binary-op.cpp b/src/matrix/binary-op.cpp
index 2d5a21ed..9fb0373c 100644
--- a/src/matrix/binary-op.cpp
+++ b/src/matrix/binary-op.cpp
@@ -28,8 +28,6 @@
 
 #include <deque>
 
-using namespace sot;
-
 namespace sot {
 
 #define SOT_FACTORY_TEMPLATE_ENTITY_PLUGIN_ExE_E_CMD(sotClassType,sotType,index,className,CMDLINE,CMDHELP)  \
@@ -76,6 +74,8 @@ struct sotAdder
 };
 
 typedef BinaryOp<Vector,Vector,Vector,sotAdder<Vector> > advector;
+
+
 SOT_FACTORY_TEMPLATE_ENTITY_PLUGIN_ExE_E_CMD
 (advector,vector,ad_vector,"Add<vector>"
 ,else if( cmdLine=="coeff1" ){ cmdArgs>>op.coeff1; } 
diff --git a/src/matrix/derivator.cpp b/src/matrix/derivator.cpp
index 54209ab3..42bf4f76 100644
--- a/src/matrix/derivator.cpp
+++ b/src/matrix/derivator.cpp
@@ -20,7 +20,8 @@
 #include <sot-core/derivator.h>
 #include <sot-core/factory.h>
 
-
+using namespace sot;
+using namespace ml;
 
 #define SOT_FACTORY_TEMPLATE_ENTITY_PLUGIN(sotClassType,sotType,className)              \
   template<>                                                                            \
@@ -40,13 +41,12 @@
 					  &regFunction##_##sotType##_##sotClassType );                   \
   }
 
-using namespace ml;
+namespace sot {
 SOT_FACTORY_TEMPLATE_ENTITY_PLUGIN(sotDerivator,double,"Derivator");
 SOT_FACTORY_TEMPLATE_ENTITY_PLUGIN(sotDerivator,Vector,"Derivator");
 SOT_FACTORY_TEMPLATE_ENTITY_PLUGIN(sotDerivator,Matrix,"Derivator");
 SOT_FACTORY_TEMPLATE_ENTITY_PLUGIN(sotDerivator,sotVectorQuaternion,"Derivator");
-
-
+}
 
 //SOT_FACTORY_TEMPLATE_ENTITY_PLUGIN(sotDerivator,double,"T");
 
diff --git a/src/matrix/fir-filter.cpp b/src/matrix/fir-filter.cpp
index ebafaa3b..04594d71 100644
--- a/src/matrix/fir-filter.cpp
+++ b/src/matrix/fir-filter.cpp
@@ -18,9 +18,11 @@
  * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
 
 #include <sot-core/fir-filter.h>
-
 #include <sot-core/factory.h>
 
+using namespace sot;
+
+
 #define SOT_FACTORY_TEMPLATE_ENTITY_PLUGIN(sotClassType,sotSigType,sotCoefType,id,className) \
   template<>								\
   std::string sotClassType<sotSigType,sotCoefType>::			\
diff --git a/src/matrix/integrator-abstract.cpp b/src/matrix/integrator-abstract.cpp
index 8a82926b..43eb2414 100644
--- a/src/matrix/integrator-abstract.cpp
+++ b/src/matrix/integrator-abstract.cpp
@@ -18,9 +18,11 @@
  * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
 
 #include <sot-core/integrator-abstract.h>
-
 #include <sot-core/factory.h>
 
+using namespace sot;
+
+
 #define SOT_FACTORY_TEMPLATE_ENTITY_PLUGIN(sotClassType,sotSigType,sotCoefType,className)   \
   template<>                                                                                \
   std::string sotClassType<sotSigType,sotCoefType>::                                        \
@@ -34,8 +36,10 @@
 
 
 using namespace ml;
+namespace sot {
 SOT_FACTORY_TEMPLATE_ENTITY_PLUGIN(sotIntegratorAbstract,double,double,"integratorAbstract");
 SOT_FACTORY_TEMPLATE_ENTITY_PLUGIN(sotIntegratorAbstract,Vector,Matrix,"integratorAbstract");
+}
 
 #if 0
   extern "C" {
diff --git a/src/matrix/integrator-euler.cpp b/src/matrix/integrator-euler.cpp
index 2e64db88..472bfbaf 100644
--- a/src/matrix/integrator-euler.cpp
+++ b/src/matrix/integrator-euler.cpp
@@ -18,9 +18,11 @@
  * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
 
 #include <sot-core/integrator-euler.h>
-
 #include <sot-core/factory.h>
 
+using namespace sot;
+
+
 #define SOT_FACTORY_TEMPLATE_ENTITY_PLUGIN(sotClassType,sotSigType,sotCoefType,className)   \
   template<>                                                                                \
   std::string sotClassType<sotSigType,sotCoefType>::                                        \
@@ -43,4 +45,6 @@
 
 using namespace ml;
 using namespace std;
+namespace sot {
 SOT_FACTORY_TEMPLATE_ENTITY_PLUGIN(sotIntegratorEuler,Vector,Matrix,"integratorEuler");
+}
diff --git a/src/matrix/matrix-constant.cpp b/src/matrix/matrix-constant.cpp
index 198475ae..e68b9175 100644
--- a/src/matrix/matrix-constant.cpp
+++ b/src/matrix/matrix-constant.cpp
@@ -18,13 +18,14 @@
  * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
 
 #include <sot-core/matrix-constant.h>
-
 #include <sot-core/factory.h>
-SOT_FACTORY_ENTITY_PLUGIN(sotMatrixConstant,"MatrixConstant");
 
 using namespace std;
+using namespace sot;
 
 
+SOT_FACTORY_ENTITY_PLUGIN(sotMatrixConstant,"MatrixConstant");
+
 /* --------------------------------------------------------------------- */
 /* --- MATRIX ---------------------------------------------------------- */
 /* --------------------------------------------------------------------- */
diff --git a/src/matrix/unary-op.cpp b/src/matrix/unary-op.cpp
index af850414..cc05a161 100644
--- a/src/matrix/unary-op.cpp
+++ b/src/matrix/unary-op.cpp
@@ -28,6 +28,8 @@
 #include <sot-core/vector-quaternion.h>
 
 
+using namespace sot;
+
 
 
 #define SOT_FACTORY_TEMPLATE_ENTITY_PLUGIN_E_E(sotClassType,sotType,index,className,CMDLINE,CMDHELP)    \
@@ -60,6 +62,8 @@
 
 using namespace ml;
 
+namespace sot {
+
 template< typename matrixgen >
 struct sotInverser
 {
@@ -464,3 +468,5 @@ res=r;
 
 typedef sotUnaryOp<ml::Vector,ml::Vector,sotDirtyMemory> v2mDirtyMemory;
 SOT_FACTORY_TEMPLATE_ENTITY_PLUGIN_E_E(v2mDirtyMemory,vector,v2mDM_,"DirtyMemory", ,"");
+
+} // namespace sot
diff --git a/src/matrix/vector-constant.cpp b/src/matrix/vector-constant.cpp
index 49e7c9f1..f0b13307 100644
--- a/src/matrix/vector-constant.cpp
+++ b/src/matrix/vector-constant.cpp
@@ -20,9 +20,13 @@
 #include <sot-core/vector-constant.h>
 
 #include <sot-core/factory.h>
+
+namespace sot  {
 SOT_FACTORY_ENTITY_PLUGIN(sotVectorConstant,"VectorConstant");
+}
 
 using namespace std;
+using namespace sot;
 
 
 /* --------------------------------------------------------------------- */
diff --git a/src/matrix/vector-to-rotation.cpp b/src/matrix/vector-to-rotation.cpp
index 61bd872e..dd7b5db5 100644
--- a/src/matrix/vector-to-rotation.cpp
+++ b/src/matrix/vector-to-rotation.cpp
@@ -25,6 +25,8 @@
 SOT_FACTORY_ENTITY_PLUGIN(sotVectorToRotation,"VectorToRotation");
 
 using namespace std;
+using namespace sot;
+
 
 
 /* --------------------------------------------------------------------- */
diff --git a/src/signal/signal-cast.cpp b/src/signal/signal-cast.cpp
index 30016a87..c3e104d8 100644
--- a/src/signal/signal-cast.cpp
+++ b/src/signal/signal-cast.cpp
@@ -23,6 +23,8 @@
 #include <sot-core/feature-abstract.h>
 
 using namespace std;
+using namespace sot;
+
 
 #ifdef WIN32
 #include < Windows.h >
diff --git a/src/sot/flags.cpp b/src/sot/flags.cpp
index a196b2d3..0ba1216d 100644
--- a/src/sot/flags.cpp
+++ b/src/sot/flags.cpp
@@ -25,12 +25,15 @@
 
 /*! System framework */
 #include <stdlib.h>
+#include <list>
 
 /*! Local Framework */
 #include <sot-core/flags.h>
 #include <sot-core/debug.h>
 
 using namespace std;
+using namespace sot;
+
 /* --------------------------------------------------------------------- */
 /* --- CLASS ----------------------------------------------------------- */
 /* --------------------------------------------------------------------- */
@@ -87,6 +90,7 @@ operator[] (const unsigned int& i) const
   return res;
 }
 
+namespace sot {
 char operator>> (const sotFlags& f,const int& i)
 {
   const div_t q = div(i,8); 
@@ -96,6 +100,7 @@ char operator>> (const sotFlags& f,const int& i)
   
   return res;
 }
+} // namespace sot
 
 bool sotFlags::
 operator() (const int& i) const
@@ -234,6 +239,7 @@ unset( const unsigned int & idx )
 
 
 /* --------------------------------------------------------------------- */
+namespace sot {
 std::ostream& operator<< (std::ostream& os, const sotFlags& fl )
 {
   if( fl.reverse ) os << "...11111 ";
@@ -247,8 +253,6 @@ std::ostream& operator<< (std::ostream& os, const sotFlags& fl )
   return os;
 }
 
-#include <list>
-
 static char MASK [] = { 0,1,3,7,15,31,63,127,255 };
 
 std::istream& operator>> (std::istream& is, sotFlags& fl )
@@ -367,6 +371,7 @@ std::istream& operator>> (std::istream& is, sotFlags& fl )
   return is;
 }
 
+} // namespace sot
 
 /* --------------------------------------------------------------------- */
 const sotFlags FLAG_LINE_1( (char)0x1 );
diff --git a/src/sot/memory-task-sot.cpp b/src/sot/memory-task-sot.cpp
index 3d0c86b1..384727ca 100644
--- a/src/sot/memory-task-sot.cpp
+++ b/src/sot/memory-task-sot.cpp
@@ -21,6 +21,8 @@
 #include <sot-core/memory-task-sot.h>
 #include <sot-core/debug.h>
 
+using namespace sot;
+
 
 const std::string sotMemoryTaskSOT::CLASS_NAME = "MemoryTaskSOT";
 
diff --git a/src/sot/solver-hierarchical-inequalities.cpp b/src/sot/solver-hierarchical-inequalities.cpp
index d50c9a24..fc8fb7de 100644
--- a/src/sot/solver-hierarchical-inequalities.cpp
+++ b/src/sot/solver-hierarchical-inequalities.cpp
@@ -24,6 +24,7 @@
 
 //#define WITH_CHRONO
 
+
 //#define VP_DEBUG
 #define VP_DEBUG_MODE 45
 #include <sot-core/debug.h>
@@ -34,6 +35,7 @@
 // sotIneq__INIT sotIneq_initiator;
 
 #include <sot-core/solver-hierarchical-inequalities.h>
+using namespace sot;
 
 #ifndef WIN32
 #  include <sys/time.h>
@@ -48,6 +50,9 @@
 #  include <Winsock2.h>
 #endif /*WIN32*/
 #define FORTRAN_ID( id ) id##_
+
+
+
 /* ---------------------------------------------------------- */
 /* --- BINDING FORTRAN -------------------------------------- */
 /* ---------------------------------------------------------- */
@@ -167,6 +172,7 @@ ConstraintMem( const ConstraintMem& clone )
   sotDEBUG(15) << "ConstraintMem cloning" << std::endl;
 }
 
+namespace sot {
 std::ostream& operator<<( std::ostream& os,const ConstraintMem::BoundSideType& bs )
 {
   switch( bs )
@@ -210,6 +216,8 @@ std::ostream & operator<< (std::ostream& os,const ConstraintMem &c )
   return os;
 }
 
+} // namespace sot
+
 /* ---------------------------------------------------------- */
 /* Specify the size of the constraint matrix, for pre-alocation. */
 void sotSolverHierarchicalInequalities::
diff --git a/src/sot/sot-h.cpp b/src/sot/sot-h.cpp
index 5340813d..86759ffa 100644
--- a/src/sot/sot-h.cpp
+++ b/src/sot/sot-h.cpp
@@ -36,6 +36,8 @@
 
 
 using namespace std;
+using namespace sot;
+
 
 /* --------------------------------------------------------------------- */
 /* --- CLASS ----------------------------------------------------------- */
diff --git a/src/sot/sot-qr.cpp b/src/sot/sot-qr.cpp
index 640da451..34d36738 100644
--- a/src/sot/sot-qr.cpp
+++ b/src/sot/sot-qr.cpp
@@ -39,6 +39,8 @@
 
 #define FORTRAN_ID( id ) id##_
 using namespace std;
+using namespace sot;
+
 
 /* --------------------------------------------------------------------- */
 /* --- CLASS ----------------------------------------------------------- */
diff --git a/src/sot/sot.cpp b/src/sot/sot.cpp
index 144b711a..1fb1149d 100644
--- a/src/sot/sot.cpp
+++ b/src/sot/sot.cpp
@@ -40,6 +40,8 @@
 #include <sot-core/memory-task-sot.h>
 
 using namespace std;
+using namespace sot;
+
 
 /* --------------------------------------------------------------------- */
 /* --- CLASS ----------------------------------------------------------- */
diff --git a/src/sot/weighted-sot.cpp b/src/sot/weighted-sot.cpp
index f6e0f597..02a3de6a 100644
--- a/src/sot/weighted-sot.cpp
+++ b/src/sot/weighted-sot.cpp
@@ -29,6 +29,8 @@
 #include <sot-core/task.h>
 #include <sot-core/debug.h>
 using namespace std;
+using namespace sot;
+
 
 /* --------------------------------------------------------------------- */
 /* --- CLASS ----------------------------------------------------------- */
diff --git a/src/task/gain-adaptative.cpp b/src/task/gain-adaptative.cpp
index 3dc99908..5f3bece0 100644
--- a/src/task/gain-adaptative.cpp
+++ b/src/task/gain-adaptative.cpp
@@ -28,6 +28,9 @@
 #include <sot-core/debug.h>
 #include <sot-core/factory.h>
 #include <sot-core/exception-signal.h>
+
+using namespace sot;
+
 SOT_FACTORY_ENTITY_PLUGIN(sotGainAdaptative,"GainAdaptative");
 
 const double sotGainAdaptative::
diff --git a/src/task/gain-hyperbolic.cpp b/src/task/gain-hyperbolic.cpp
index 714235e6..7db40dac 100644
--- a/src/task/gain-hyperbolic.cpp
+++ b/src/task/gain-hyperbolic.cpp
@@ -28,6 +28,9 @@
 #include <sot-core/factory.h>
 #include <sot-core/debug.h>
 #include <sot-core/exception-signal.h>
+
+using namespace sot;
+
 SOT_FACTORY_ENTITY_PLUGIN(sotGainHyperbolic,"GainHyperbolic");
 
 const double sotGainHyperbolic::
diff --git a/src/task/multi-bound.cpp b/src/task/multi-bound.cpp
index 0c722bb3..ab0865fe 100644
--- a/src/task/multi-bound.cpp
+++ b/src/task/multi-bound.cpp
@@ -2,7 +2,7 @@
  * Copyright Projet Gepetto, Laas, CNRS, 2009
  *+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  *
- * File:      task-multi-bound.h
+ * File:      multi-bound.cpp
  * Project:   SOT
  * Author:    Nicolas Mansard
  *
@@ -18,11 +18,14 @@
  * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
 
 
-#include <sot-core/task-multi-bound.h>
+#include <sot-core/multi-bound.h>
 #define VP_DEBUG
 #define VP_DEBUG_MODE 25
 #include <sot-core/debug.h>
 
+using namespace sot;
+
+
 sotMultiBound::
 sotMultiBound( const double x )
   : mode(MODE_SINGLE),boundSingle(x)
@@ -142,6 +145,24 @@ setSingleBound( double boundValue )
   boundSingle=boundValue;
 }
 
+inline static void SOT_MULTI_BOUND_CHECK_C(std::istream& is,
+                                           char check,
+                                           sotVectorMultiBound& v)
+{
+  char c;
+  is.get(c);
+  if(c!=check)
+    {
+      v.resize(0);
+      sotERROR << "Error while parsing vector multi-bound. Waiting for a '" << check
+               << "'. Get '" << c << "' instead. " << std::endl;
+      SOT_THROW sotExceptionTask(sotExceptionTask::PARSER_MULTI_BOUND,
+                                 "Error parsing vector multi-bound.");
+    }
+}
+
+namespace sot {
+
 std::ostream& operator<< ( std::ostream& os, const sotMultiBound & m  )
 {
   switch( m.mode )
@@ -227,22 +248,6 @@ std::ostream& operator<< (std::ostream& os, const sotVectorMultiBound& v )
   return os<<")";
 }
 
-inline static void SOT_MULTI_BOUND_CHECK_C(std::istream& is,
-                                           char check,
-                                           sotVectorMultiBound& v)
-{
-  char c;
-  is.get(c);
-  if(c!=check)
-    {
-      v.resize(0);
-      sotERROR << "Error while parsing vector multi-bound. Waiting for a '" << check
-               << "'. Get '" << c << "' instead. " << std::endl;
-      SOT_THROW sotExceptionTask(sotExceptionTask::PARSER_MULTI_BOUND,
-                                 "Error parsing vector multi-bound.");
-    }
-}
-
 std::istream& operator>> (std::istream& is, sotVectorMultiBound& v )
 {
   unsigned int vali;
@@ -264,3 +269,5 @@ std::istream& operator>> (std::istream& is, sotVectorMultiBound& v )
 
   return is;
 }
+
+} // namespace sot
diff --git a/src/task/task-abstract.cpp b/src/task/task-abstract.cpp
index a4a0dbdc..4ce0dfa4 100644
--- a/src/task/task-abstract.cpp
+++ b/src/task/task-abstract.cpp
@@ -25,6 +25,8 @@
 #include <sot-core/task-abstract.h>
 #include <sot-core/pool.h>
 
+using namespace sot;
+
 
 /* --------------------------------------------------------------------- */
 /* --- CLASS ----------------------------------------------------------- */
diff --git a/src/task/task-conti.cpp b/src/task/task-conti.cpp
index f4b923ff..3b3c3629 100644
--- a/src/task/task-conti.cpp
+++ b/src/task/task-conti.cpp
@@ -26,11 +26,11 @@
 #include <sot-core/task-conti.h>
 #include <sot-core/debug.h>
 #include <MatrixAbstractLayer/boostVector.h>
-using namespace std;
-
+#include <sot-core/factory.h>
 
+using namespace std;
+using namespace sot;
 
-#include <sot-core/factory.h>
 SOT_FACTORY_TASK_PLUGIN(sotTaskConti,"TaskConti");
 
 
diff --git a/src/task/task-pd.cpp b/src/task/task-pd.cpp
index 4e8b8f21..70bc9b85 100644
--- a/src/task/task-pd.cpp
+++ b/src/task/task-pd.cpp
@@ -25,7 +25,10 @@
 /* SOT */
 #include <sot-core/task-pd.h>
 #include <sot-core/debug.h>
+
 using namespace std;
+using namespace sot;
+
 
 
 
diff --git a/src/task/task-unilateral.cpp b/src/task/task-unilateral.cpp
index eca644df..5d555884 100644
--- a/src/task/task-unilateral.cpp
+++ b/src/task/task-unilateral.cpp
@@ -28,7 +28,9 @@
 /* SOT */
 #include <sot-core/task-unilateral.h>
 #include <sot-core/debug.h>
+
 using namespace std;
+using namespace sot;
 
 
 
diff --git a/src/task/task.cpp b/src/task/task.cpp
index 227ece61..3d43b1f1 100644
--- a/src/task/task.cpp
+++ b/src/task/task.cpp
@@ -26,6 +26,8 @@
 #include <sot-core/task.h>
 #include <sot-core/debug.h>
 using namespace std;
+using namespace sot;
+
 
 
 
-- 
GitLab