Index: trunk/SophyaLib/SkyMap/localmap.cc
===================================================================
--- trunk/SophyaLib/SkyMap/localmap.cc	(revision 1416)
+++ trunk/SophyaLib/SkyMap/localmap.cc	(revision 1419)
@@ -101,4 +101,14 @@
       recopierVariablesSimples(a);     
       pixels_.CloneOrShare(a.pixels_);
+      if (mInfo_) {delete mInfo_; mInfo_ = NULL;}
+      if (a.mInfo_) mInfo_ = new DVList(*(a.mInfo_));
+}
+template<class T>
+void LocalMap<T>::Share(const LocalMap<T>& a)
+{
+      recopierVariablesSimples(a);     
+      pixels_.Share(a.pixels_);
+      if (mInfo_) {delete mInfo_; mInfo_ = NULL;}
+      if (a.mInfo_) mInfo_ = new DVList(*(a.mInfo_));
 }
 
@@ -556,4 +566,98 @@
 }
 
+//   ...... Operations de calcul  ......
+
+
+//! Fill a LocalMap with a constant value \b a
+template <class T>
+LocalMap<T>& LocalMap<T>::SetT(T a) 
+{
+  if (NbPixels() < 1) 
+    throw RangeCheckError("LocalMap<T>::SetT(T )  - LocalMap not dimensionned ! ");
+  pixels_ = a;
+  return (*this);
+}
+
+/*! Add a constant value \b x to a LocalMap */
+template <class T>
+LocalMap<T>& LocalMap<T>::Add(T a)
+ {
+  if (NbPixels()< 1) 
+    throw RangeCheckError("LocalMap<T>::Add(T )  - LocalMap not dimensionned ! ");
+  pixels_ += a; 
+  return (*this);
+}
+
+/*! Substract a constant value \b a to a LocalMap */
+template <class T>
+LocalMap<T>& LocalMap<T>::Sub(T a) 
+{
+  if (NbPixels()< 1) 
+    throw RangeCheckError("LocalMap<T>::Sub(T )  - LocalMap not dimensionned ! ");
+  pixels_ -= a; 
+  return (*this);
+} 
+
+/*! multiply a LocalMap by a constant value \b a */
+template <class T>
+LocalMap<T>& LocalMap<T>::Mul(T a) 
+{
+  if (NbPixels()< 1) 
+    throw RangeCheckError("LocalMap<T>::Mul(T )  - LocalMap not dimensionned ! ");
+  pixels_ *= a; 
+  return (*this);
+}
+
+/*! divide a LocalMap by a constant value \b a */
+template <class T>
+LocalMap<T>& LocalMap<T>::Div(T a) 
+{
+  if (NbPixels()< 1) 
+    throw RangeCheckError("LocalMap<T>::Div(T )  - LocalMap not dimensionned ! ");
+  pixels_ /= a; 
+  return (*this);
+} 
+
+//  >>>> Operations avec 2nd membre de type LocalMap
+//! Add two LocalMap
+
+template <class T>
+LocalMap<T>& LocalMap<T>::AddElt(const LocalMap<T>& a)
+{
+  if (nSzX_ != a.nSzX_ || nSzY_ != a.nSzY_)
+    {
+    throw(SzMismatchError("LocalMap<T>::AddElt(const LocalMap<T>&) SizeMismatch")) ;
+    }
+  pixels_ += a.pixels_;
+  return (*this);
+}
+
+//! Substract two LocalMap
+template <class T>
+LocalMap<T>& LocalMap<T>::SubElt(const LocalMap<T>& a)
+{
+  if (nSzX_ != a.nSzX_ || nSzY_ != a.nSzY_)
+    {
+    throw(SzMismatchError("LocalMap<T>::AddElt(const LocalMap<T>&) SizeMismatch")) ;
+    }
+  pixels_ -= a.pixels_;
+  return (*this);
+}
+
+//! Multiply two LocalMap (elements by elements)
+template <class T>
+LocalMap<T>& LocalMap<T>::MulElt(const LocalMap<T>& a)
+{
+  if (nSzX_ != a.nSzX_ || nSzY_ != a.nSzY_)
+    {
+    throw(SzMismatchError("LocalMap<T>::AddElt(const LocalMap<T>&) SizeMismatch")) ;
+    }
+  pixels_ *= a.pixels_;
+  return (*this);
+}
+
+
+
+
 
 //++
Index: trunk/SophyaLib/SkyMap/localmap.h
===================================================================
--- trunk/SophyaLib/SkyMap/localmap.h	(revision 1416)
+++ trunk/SophyaLib/SkyMap/localmap.h	(revision 1419)
@@ -104,6 +104,47 @@
 void print(ostream& os) const;
 
+// Operations diverses  = , +=, ...
+
+
+virtual LocalMap<T>& Set(const LocalMap<T>& a);
 inline  LocalMap<T>& operator = (const LocalMap<T>& a) {return Set(a);}
 
+// A += -= *= /= x (ajoute, soustrait, ... x a tous les elements)
+
+  //! Fill LocalMap with all elements equal to \b x
+virtual LocalMap<T>& SetT(T a); 
+inline  LocalMap<T>& operator = (T a) {return SetT(a);}
+
+//! Add \b x to all elements
+virtual LocalMap<T>& Add(T a); 
+inline  LocalMap<T>&  operator += (T x)  { return Add(x); }
+//! Substract \b x to all elements
+virtual LocalMap<T>& Sub(T a); 
+inline   LocalMap<T>&  operator -= (T x)  { return Sub(x); }
+//! Multiply all elements by \b x
+virtual LocalMap<T>& Mul(T a); 
+inline  LocalMap<T>&  operator *= (T x)  { return Mul(x); }
+//! Divide all elements by \b x
+virtual LocalMap<T>& Div(T a); 
+inline  LocalMap<T>&  operator /= (T x)  { return Div(x); }
+
+// A += -=  (ajoute, soustrait element par element les deux spheres )
+  //! Operator LocalMap += LocalMap
+  virtual LocalMap<T>&  AddElt(const LocalMap<T>& a);
+  inline  LocalMap<T>&  operator += (const LocalMap<T>& a)  { return AddElt(a); }
+
+
+
+  virtual LocalMap<T>&  SubElt(const LocalMap<T>& a);
+  //! Operator LocalMap -= LocalMap
+  inline  LocalMap<T>&  operator -= (const LocalMap<T>& a)  { return SubElt(a); }
+// Multiplication, division element par element les deux LocalMap 
+  virtual LocalMap<T>&  MulElt(const LocalMap<T>& a);
+  inline  LocalMap<T>&  operator *= (const LocalMap<T>& a)  { return MulElt(a); }
+
+
+void CloneOrShare(const LocalMap<T>& a);
+void Share(const LocalMap<T>& a);
+LocalMap<T>& CopyElt(const LocalMap<T>& a);
 
 
@@ -120,7 +161,4 @@
 
 void recopierVariablesSimples(const LocalMap<T>& lm);
-LocalMap<T>& Set(const LocalMap<T>& a);
-void CloneOrShare(const LocalMap<T>& a);
-  LocalMap<T>& CopyElt(const LocalMap<T>& a);
 
 
@@ -146,4 +184,74 @@
 };
 
+////////////////////////////////////////////////////////////////
+// Surcharge d'operateurs A (+,-,*,/) (T) x
+/*! \ingroup LocalMap \fn operator+(const LocalMap<T>&,T)
+  \brief Operator LocalMap = LocalMap + constant */
+template <class T> inline LocalMap<T> operator + (const LocalMap<T>& a, T b)
+    {LocalMap<T> result; result.CloneOrShare(a); result.SetTemp(true); 
+    result.Add(b); return result;}
+/*! \ingroup LocalMap \fn operator+(T,const LocalMap<T>&)
+  \brief Operator LocalMap = constant + LocalMap */
+template <class T> inline LocalMap<T> operator + (T b,const LocalMap<T>& a)
+    {LocalMap<T> result; result.CloneOrShare(a); result.SetTemp(true); 
+    result.Add(b); return result;}
+
+
+/*! \ingroup LocalMap\fn operator-(const LocalMap<T>&,T)
+  \brief Operator LocalMap = LocalMap - constant */
+template <class T> inline LocalMap<T> operator - (const LocalMap<T>& a, T b)
+    {LocalMap<T> result; result.CloneOrShare(a); result.SetTemp(true); 
+    result.Sub(b); return result;}
+
+/*! \ingroup  \fn operator-(T,const LocalMap<T>&)
+  \brief Operator LocalMap = constant - LocalMap */
+template <class T> inline LocalMap<T> operator - (T b,const LocalMap<T>& a)
+    {LocalMap<T> result; result.CloneOrShare(a); result.SetTemp(true); 
+    result.Sub(b,true); return result;}
+
+/*! \ingroup LocalMap \fn operator*(const LocalMap<T>&,T)
+  \brief Operator LocalMap = LocalMap * constant */
+template <class T> inline LocalMap<T> operator * (const LocalMap<T>& a, T b)
+    {LocalMap<T> result; result.CloneOrShare(a); result.SetTemp(true); 
+    result.Mul(b); return result;}
+
+/*! \ingroup LocalMap \fn operator*(T,const LocalMap<T>&)
+  \brief Operator LocalMap = constant * LocalMap */
+template <class T> inline LocalMap<T> operator * (T b,const LocalMap<T>& a)
+    {LocalMap<T> result; result.CloneOrShare(a); result.SetTemp(true); 
+    result.Mul(b); return result;}
+
+/*! \ingroup LocalMap \fn operator/(const LocalMap<T>&,T)
+  \brief Operator LocalMap = LocalMap / constant */
+template <class T> inline LocalMap<T> operator / (const LocalMap<T>& a, T b)
+    {LocalMap<T> result; result.CloneOrShare(a); result.SetTemp(true); 
+    result.Div(b); return result;}
+
+/*! \ingroup LocalMap \fn operator/(T,const LocalMap<T>&)
+  \brief Operator LocalMap = constant / LocalMap  */
+template <class T> inline LocalMap<T> operator / (T b, const LocalMap<T>& a)
+    {LocalMap<T> result; result.CloneOrShare(a); result.SetTemp(true); 
+    result.Div(b, true); return result;}
+
+////////////////////////////////////////////////////////////////
+// Surcharge d'operateurs C = A (+,-) B
+
+/*! \ingroup LocalMap \fn operator+(const LocalMap<T>&,const LocalMap<T>&)
+  \brief Operator LocalMap = LocalMap + LocalMap */
+template <class T>
+inline LocalMap<T> operator + (const LocalMap<T>& a,const LocalMap<T>& b)
+    { LocalMap<T> result; result.SetTemp(true); 
+    if (b.IsTemp())  { result.Share(b); result.AddElt(a); }
+    else { result.CloneOrShare(a); result.AddElt(b); }
+    return result; }
+
+/*! \ingroup LocalMap \fn operator-(const LocalMap<T>&,const LocalMap<T>&)
+  \brief Operator LocalMap = LocalMap - LocalMap */
+template <class T>
+inline LocalMap<T> operator - (const LocalMap<T>& a,const LocalMap<T>& b)
+    { LocalMap<T> result; result.SetTemp(true); 
+    if (b.IsTemp())  { result.Share(b); result.SubElt(a, true); }
+    else { result.CloneOrShare(a); result.SubElt(b); }
+    return result; }
 
 
Index: trunk/SophyaLib/SkyMap/pixelmap.h
===================================================================
--- trunk/SophyaLib/SkyMap/pixelmap.h	(revision 1416)
+++ trunk/SophyaLib/SkyMap/pixelmap.h	(revision 1419)
@@ -96,5 +96,7 @@
 /*! Setting pixel values to a constant */
 virtual T SetPixels(T v);
-inline T operator = (T v) { return(SetPixels(v)); }
+PixelMap<T>& SetT(T v);
+  //inline T operator = (T v) { return(SetPixels(v)); }
+inline PixelMap<T>& operator = (T v) { return(SetT(v)); }
 
 
@@ -141,4 +143,11 @@
 return(v);
 }
+template <class T>
+PixelMap<T>& PixelMap<T>::SetT(T v)
+{
+int k;
+for(k=0; k<NbPixels(); k++) PixVal(k) = v;
+return(*this);
+}
 
 
Index: trunk/SophyaLib/SkyMap/spherehealpix.cc
===================================================================
--- trunk/SophyaLib/SkyMap/spherehealpix.cc	(revision 1416)
+++ trunk/SophyaLib/SkyMap/spherehealpix.cc	(revision 1419)
@@ -127,4 +127,6 @@
 }
 
+//! Clone if \b a is not temporary, share if temporary
+/*! \sa NDataBlock::CloneOrShare(const NDataBlock<T>&) */
 template<class T>
 void SphereHEALPix<T>::CloneOrShare(const SphereHEALPix<T>& a)
@@ -136,7 +138,20 @@
   sliceBeginIndex_.CloneOrShare(a.sliceBeginIndex_);
   sliceLenght_.CloneOrShare(a.sliceLenght_);
-
-  // pas forcement a conserver, pas forcement a cet endroit (GLM)
-  //  if (a.IsTemp() ) SetTemp(true);
+  if (mInfo_) {delete mInfo_; mInfo_ = NULL;}
+  if (a.mInfo_) mInfo_ = new DVList(*(a.mInfo_));
+}
+
+//! Share data with a
+template<class T>
+void SphereHEALPix<T>::Share(const SphereHEALPix<T>& a)
+{
+  nSide_= a.nSide_;
+  nPix_ = a.nPix_;
+  omeg_ = a.omeg_;
+  pixels_.Share(a.pixels_);
+  sliceBeginIndex_.Share(a.sliceBeginIndex_);
+  sliceLenght_.Share(a.sliceLenght_);
+  if (mInfo_) {delete mInfo_; mInfo_ = NULL;}
+  if (a.mInfo_) mInfo_ = new DVList(*(a.mInfo_));
 }
 
@@ -149,5 +164,5 @@
       
       if (a.NbPixels() < 1) 
-	throw RangeCheckError("SphereHEALPix<T>::Set(a ) - Array a not allocated ! ");
+	throw RangeCheckError("SphereHEALPix<T>::Set(a ) - SphereHEALPix a not allocated ! ");
       if (NbPixels() < 1) CloneOrShare(a);
       else CopyElt(a);
@@ -165,5 +180,5 @@
 {
   if (NbPixels() < 1) 
-    throw RangeCheckError("SphereHEALPix<T>::CopyElt(const SphereHEALPix<T>& )  - Not Allocated Array ! ");
+    throw RangeCheckError("SphereHEALPix<T>::CopyElt(const SphereHEALPix<T>& )  - Not Allocated SphereHEALPix ! ");
   if (NbPixels() != a.NbPixels()) 
     throw(SzMismatchError("SphereHEALPix<T>::CopyElt(const SphereHEALPix<T>&) SizeMismatch")) ;
@@ -177,4 +192,7 @@
   return(*this);
 }
+
+
+
 //++
 // Titre	Destructor
@@ -542,4 +560,96 @@
   return  ring2nest(nSide_,k);
 }
+
+//   ...... Operations de calcul  ......
+
+//! Fill a SphereHEALPix with a constant value \b a
+template <class T>
+SphereHEALPix<T>& SphereHEALPix<T>::SetT(T a) 
+{
+  if (NbPixels() < 1) 
+    throw RangeCheckError("SphereHEALPix<T>::SetT(T )  - SphereHEALPix not dimensionned ! ");
+  pixels_ = a;
+  return (*this);
+}
+
+/*! Add a constant value \b x to a SphereHEALPix */
+template <class T>
+SphereHEALPix<T>& SphereHEALPix<T>::Add(T a)
+ {
+  if (NbPixels() < 1) 
+    throw RangeCheckError("SphereHEALPix<T>::Add(T )  - SphereHEALPix not dimensionned ! ");
+  pixels_ += a; 
+  return (*this);
+}
+
+/*! Substract a constant value \b a to a SphereHEALPix */
+template <class T>
+SphereHEALPix<T>& SphereHEALPix<T>::Sub(T a) 
+{
+  if (NbPixels() < 1) 
+    throw RangeCheckError("SphereHEALPix<T>::Sub(T )  - SphereHEALPix not dimensionned ! ");
+  pixels_ -= a; 
+  return (*this);
+} 
+
+/*! multiply a SphereHEALPix by a constant value \b a */
+template <class T>
+SphereHEALPix<T>& SphereHEALPix<T>::Mul(T a) 
+{
+  if (NbPixels() < 1) 
+    throw RangeCheckError("SphereHEALPix<T>::Mul(T )  - SphereHEALPix not dimensionned ! ");
+  pixels_ *= a; 
+  return (*this);
+}
+
+/*! divide a SphereHEALPix by a constant value \b a */
+template <class T>
+SphereHEALPix<T>& SphereHEALPix<T>::Div(T a) 
+{
+  if (NbPixels() < 1) 
+    throw RangeCheckError("SphereHEALPix<T>::Div(T )  - SphereHEALPix not dimensionned ! ");
+  pixels_ /= a; 
+  return (*this);
+} 
+
+//  >>>> Operations avec 2nd membre de type SphereHEALPix
+//! Add two SphereHEALPix
+
+template <class T>
+SphereHEALPix<T>& SphereHEALPix<T>::AddElt(const SphereHEALPix<T>& a)
+{
+  if (NbPixels() != a.NbPixels() )
+    {
+    throw(SzMismatchError("SphereHEALPix<T>::AddElt(const SphereHEALPix<T>&) SizeMismatch")) ;
+    }
+  pixels_ += a.pixels_;
+  return (*this);
+}
+
+//! Substract two SphereHEALPix
+template <class T>
+SphereHEALPix<T>& SphereHEALPix<T>::SubElt(const SphereHEALPix<T>& a)
+{
+  if (NbPixels() != a.NbPixels() )
+    {
+    throw(SzMismatchError("SphereHEALPix<T>::SubElt(const SphereHEALPix<T>&) SizeMismatch")) ;
+    }
+  pixels_ -= a.pixels_;
+  return (*this);
+}
+
+//! Multiply two SphereHEALPix (elements by elements)
+template <class T>
+SphereHEALPix<T>& SphereHEALPix<T>::MulElt(const SphereHEALPix<T>& a)
+{
+  if (NbPixels() != a.NbPixels() )
+    {
+    throw(SzMismatchError("SphereHEALPix<T>::SubElt(const SphereHEALPix<T>&) SizeMismatch")) ;
+    }
+  pixels_ *= a.pixels_;
+  return (*this);
+}
+
+
 
 
Index: trunk/SophyaLib/SkyMap/spherehealpix.h
===================================================================
--- trunk/SophyaLib/SkyMap/spherehealpix.h	(revision 1416)
+++ trunk/SophyaLib/SkyMap/spherehealpix.h	(revision 1419)
@@ -127,9 +127,52 @@
 
 
+
+ 
+
+
+
+// Operations diverses  = , +=, ...
+
+
+SphereHEALPix<T>& Set(const SphereHEALPix<T>& a);
 inline  SphereHEALPix<T>& operator = (const SphereHEALPix<T>& a) 
                                                         {return Set(a);}
 
+// A += -= *= /= x (ajoute, soustrait, ... x a tous les elements)
+
+  //! Fill SphereHEALPix with all elements equal to \b x
+virtual SphereHEALPix<T>& SetT(T a); 
+inline  SphereHEALPix<T>& operator = (T a) {return SetT(a);}
+
+//! Add \b x to all elements
+virtual SphereHEALPix<T>& Add(T a); 
+inline  SphereHEALPix<T>&  operator += (T x)  { return Add(x); }
+//! Substract \b x to all elements
+virtual SphereHEALPix<T>& Sub(T a); 
+inline   SphereHEALPix<T>&  operator -= (T x)  { return Sub(x); }
+//! Multiply all elements by \b x
+virtual SphereHEALPix<T>& Mul(T a); 
+inline  SphereHEALPix<T>&  operator *= (T x)  { return Mul(x); }
+//! Divide all elements by \b x
+virtual SphereHEALPix<T>& Div(T a); 
+inline  SphereHEALPix<T>&  operator /= (T x)  { return Div(x); }
+
+// A += -=  (ajoute, soustrait element par element les deux spheres )
+  //! Operator SphereHEALPix += SphereHEALPix
+  virtual SphereHEALPix<T>&  AddElt(const SphereHEALPix<T>& a);
+  inline  SphereHEALPix<T>&  operator += (const SphereHEALPix<T>& a)  { return AddElt(a); }
+
+
+
+  virtual SphereHEALPix<T>&  SubElt(const SphereHEALPix<T>& a);
+  //! Operator SphereHEALPix -= SphereHEALPix
+  inline  SphereHEALPix<T>&  operator -= (const SphereHEALPix<T>& a)  { return SubElt(a); }
+// Multiplication, division element par element les deux SphereHEALPix 
+  virtual SphereHEALPix<T>&  MulElt(const SphereHEALPix<T>& a);
+  inline  SphereHEALPix<T>&  operator *= (const SphereHEALPix<T>& a)  { return MulElt(a); }
+
+
  void CloneOrShare(const SphereHEALPix<T>& a);
- SphereHEALPix<T>& Set(const SphereHEALPix<T>& a);
+ void Share(const SphereHEALPix<T>& a);
  SphereHEALPix<T>& CopyElt(const SphereHEALPix<T>& a);
 
@@ -164,5 +207,74 @@
 };
 
-
+////////////////////////////////////////////////////////////////
+// Surcharge d'operateurs A (+,-,*,/) (T) x
+/*! \ingroup SphereHEALPix \fn operator+(const SphereHEALPix<T>&,T)
+  \brief Operator SphereHEALPix = SphereHEALPix + constant */
+template <class T> inline SphereHEALPix<T> operator + (const SphereHEALPix<T>& a, T b)
+    {SphereHEALPix<T> result; result.CloneOrShare(a); result.SetTemp(true); 
+    result.Add(b); return result;}
+/*! \ingroup SphereHEALPix \fn operator+(T,const SphereHEALPix<T>&)
+  \brief Operator SphereHEALPix = constant + SphereHEALPix */
+template <class T> inline SphereHEALPix<T> operator + (T b,const SphereHEALPix<T>& a)
+    {SphereHEALPix<T> result; result.CloneOrShare(a); result.SetTemp(true); 
+    result.Add(b); return result;}
+
+
+/*! \ingroup SphereHEALPix\fn operator-(const SphereHEALPix<T>&,T)
+  \brief Operator SphereHEALPix = SphereHEALPix - constant */
+template <class T> inline SphereHEALPix<T> operator - (const SphereHEALPix<T>& a, T b)
+    {SphereHEALPix<T> result; result.CloneOrShare(a); result.SetTemp(true); 
+    result.Sub(b); return result;}
+
+/*! \ingroup  \fn operator-(T,const SphereHEALPix<T>&)
+  \brief Operator SphereHEALPix = constant - SphereHEALPix */
+template <class T> inline SphereHEALPix<T> operator - (T b,const SphereHEALPix<T>& a)
+    {SphereHEALPix<T> result; result.CloneOrShare(a); result.SetTemp(true); 
+    result.Sub(b,true); return result;}
+
+/*! \ingroup SphereHEALPix \fn operator*(const SphereHEALPix<T>&,T)
+  \brief Operator SphereHEALPix = SphereHEALPix * constant */
+template <class T> inline SphereHEALPix<T> operator * (const SphereHEALPix<T>& a, T b)
+    {SphereHEALPix<T> result; result.CloneOrShare(a); result.SetTemp(true); 
+    result.Mul(b); return result;}
+
+/*! \ingroup SphereHEALPix \fn operator*(T,const SphereHEALPix<T>&)
+  \brief Operator SphereHEALPix = constant * SphereHEALPix */
+template <class T> inline SphereHEALPix<T> operator * (T b,const SphereHEALPix<T>& a)
+    {SphereHEALPix<T> result; result.CloneOrShare(a); result.SetTemp(true); 
+    result.Mul(b); return result;}
+
+/*! \ingroup SphereHEALPix \fn operator/(const SphereHEALPix<T>&,T)
+  \brief Operator SphereHEALPix = SphereHEALPix / constant */
+template <class T> inline SphereHEALPix<T> operator / (const SphereHEALPix<T>& a, T b)
+    {SphereHEALPix<T> result; result.CloneOrShare(a); result.SetTemp(true); 
+    result.Div(b); return result;}
+
+/*! \ingroup SphereHEALPix \fn operator/(T,const SphereHEALPix<T>&)
+  \brief Operator SphereHEALPix = constant / SphereHEALPix  */
+template <class T> inline SphereHEALPix<T> operator / (T b, const SphereHEALPix<T>& a)
+    {SphereHEALPix<T> result; result.CloneOrShare(a); result.SetTemp(true); 
+    result.Div(b, true); return result;}
+
+////////////////////////////////////////////////////////////////
+// Surcharge d'operateurs C = A (+,-) B
+
+/*! \ingroup SphereHEALPix \fn operator+(const SphereHEALPix<T>&,const SphereHEALPix<T>&)
+  \brief Operator SphereHEALPix = SphereHEALPix + SphereHEALPix */
+template <class T>
+inline SphereHEALPix<T> operator + (const SphereHEALPix<T>& a,const SphereHEALPix<T>& b)
+    { SphereHEALPix<T> result; result.SetTemp(true); 
+    if (b.IsTemp())  { result.Share(b); result.AddElt(a); }
+    else { result.CloneOrShare(a); result.AddElt(b); }
+    return result; }
+
+/*! \ingroup SphereHEALPix \fn operator-(const SphereHEALPix<T>&,const SphereHEALPix<T>&)
+  \brief Operator SphereHEALPix = SphereHEALPix - SphereHEALPix */
+template <class T>
+inline SphereHEALPix<T> operator - (const SphereHEALPix<T>& a,const SphereHEALPix<T>& b)
+    { SphereHEALPix<T> result; result.SetTemp(true); 
+    if (b.IsTemp())  { result.Share(b); result.SubElt(a, true); }
+    else { result.CloneOrShare(a); result.SubElt(b); }
+    return result; }
 
 } // Fin du namespace
Index: trunk/SophyaLib/SkyMap/spherethetaphi.cc
===================================================================
--- trunk/SophyaLib/SkyMap/spherethetaphi.cc	(revision 1416)
+++ trunk/SophyaLib/SkyMap/spherethetaphi.cc	(revision 1419)
@@ -55,5 +55,4 @@
 //    m is the number of slices in theta on an hemisphere (the polar cap
 //    forms the first slice).
-//    pet is a dummy parameter at the moment. 
 //--
 {
@@ -129,4 +128,20 @@
   Theta_.CloneOrShare(a.Theta_);
   pixels_.CloneOrShare(a.pixels_);
+  if (mInfo_) {delete mInfo_; mInfo_ = NULL;}
+  if (a.mInfo_) mInfo_ = new DVList(*(a.mInfo_));
+}
+template<class T>
+void  SphereThetaPhi<T>::Share(const  SphereThetaPhi<T>& a)
+{
+
+  NTheta_= a.NTheta_;
+  NPix_  = a.NPix_;
+  Omega_ = a.Omega_;
+  NPhi_.Share(a.NPhi_);
+  TNphi_.Share(a.TNphi_);
+  Theta_.Share(a.Theta_);
+  pixels_.Share(a.pixels_);
+  if (mInfo_) {delete mInfo_; mInfo_ = NULL;}
+  if (a.mInfo_) mInfo_ = new DVList(*(a.mInfo_));
 }
 
@@ -710,4 +725,96 @@
   os << endl;
 }
+
+//   ...... Operations de calcul  ......
+
+
+//! Fill a SphereThetaPhi with a constant value \b a
+template <class T>
+SphereThetaPhi<T>& SphereThetaPhi<T>::SetT(T a) 
+{
+  if (NbPixels() < 1) 
+    throw RangeCheckError("SphereThetaPhi<T>::SetT(T )  - SphereThetaPhi not dimensionned ! ");
+  pixels_ = a;
+  return (*this);
+}
+
+/*! Add a constant value \b x to a SphereThetaPhi */
+template <class T>
+SphereThetaPhi<T>& SphereThetaPhi<T>::Add(T a)
+ {
+  if (NbPixels()< 1) 
+    throw RangeCheckError("SphereThetaPhi<T>::Add(T )  - SphereThetaPhi not dimensionned ! ");
+  pixels_ += a; 
+  return (*this);
+}
+
+/*! Substract a constant value \b a to a SphereThetaPhi */
+template <class T>
+SphereThetaPhi<T>& SphereThetaPhi<T>::Sub(T a) 
+{
+  if (NbPixels()< 1) 
+    throw RangeCheckError("SphereThetaPhi<T>::Sub(T )  - SphereThetaPhi not dimensionned ! ");
+  pixels_ -= a; 
+  return (*this);
+} 
+
+/*! multiply a SphereThetaPhi by a constant value \b a */
+template <class T>
+SphereThetaPhi<T>& SphereThetaPhi<T>::Mul(T a) 
+{
+  if (NbPixels()< 1) 
+    throw RangeCheckError("SphereThetaPhi<T>::Mul(T )  - SphereThetaPhi not dimensionned ! ");
+  pixels_ *= a; 
+  return (*this);
+}
+
+/*! divide a SphereThetaPhi by a constant value \b a */
+template <class T>
+SphereThetaPhi<T>& SphereThetaPhi<T>::Div(T a) 
+{
+  if (NbPixels()< 1) 
+    throw RangeCheckError("SphereThetaPhi<T>::Div(T )  - SphereThetaPhi not dimensionned ! ");
+  pixels_ /= a; 
+  return (*this);
+} 
+
+//  >>>> Operations avec 2nd membre de type SphereThetaPhi
+//! Add two SphereThetaPhi
+
+template <class T>
+SphereThetaPhi<T>& SphereThetaPhi<T>::AddElt(const SphereThetaPhi<T>& a)
+{
+  if (NbPixels()!= a.NbPixels())
+    {
+    throw(SzMismatchError("SphereThetaPhi<T>::AddElt(const SphereThetaPhi<T>&) SizeMismatch")) ;
+    }
+  pixels_ += a.pixels_;
+  return (*this);
+}
+
+//! Substract two SphereThetaPhi
+template <class T>
+SphereThetaPhi<T>& SphereThetaPhi<T>::SubElt(const SphereThetaPhi<T>& a)
+{
+  if (NbPixels()!= a.NbPixels())
+    {
+    throw(SzMismatchError("SphereThetaPhi<T>::SubElt(const SphereThetaPhi<T>&) SizeMismatch")) ;
+    }
+  pixels_ -= a.pixels_;
+  return (*this);
+}
+
+//! Multiply two SphereThetaPhi (elements by elements)
+template <class T>
+SphereThetaPhi<T>& SphereThetaPhi<T>::MulElt(const SphereThetaPhi<T>& a)
+{
+  if (NbPixels()!= a.NbPixels())
+    {
+    throw(SzMismatchError("SphereThetaPhi<T>::SubElt(const SphereThetaPhi<T>&) SizeMismatch")) ;
+    }
+  pixels_ *= a.pixels_;
+  return (*this);
+}
+
 
 
Index: trunk/SophyaLib/SkyMap/spherethetaphi.h
===================================================================
--- trunk/SophyaLib/SkyMap/spherethetaphi.h	(revision 1416)
+++ trunk/SophyaLib/SkyMap/spherethetaphi.h	(revision 1419)
@@ -182,11 +182,56 @@
 void print(ostream& os) const;
 
+
+
+// Operations diverses  = , +=, ...
+
+
+SphereThetaPhi<T>& Set(const SphereThetaPhi<T>& a);
+inline  SphereThetaPhi<T>& operator = (const SphereThetaPhi<T>& a) 
+                                                        {return Set(a);}
+
+// A += -= *= /= x (ajoute, soustrait, ... x a tous les elements)
+
+  //! Fill SphereThetaPhi with all elements equal to \b x
+virtual SphereThetaPhi<T>& SetT(T a); 
+inline  SphereThetaPhi<T>& operator = (T a) {return SetT(a);}
+
+//! Add \b x to all elements
+virtual SphereThetaPhi<T>& Add(T a); 
+inline  SphereThetaPhi<T>&  operator += (T x)  { return Add(x); }
+//! Substract \b x to all elements
+virtual SphereThetaPhi<T>& Sub(T a); 
+inline   SphereThetaPhi<T>&  operator -= (T x)  { return Sub(x); }
+//! Multiply all elements by \b x
+virtual SphereThetaPhi<T>& Mul(T a); 
+inline  SphereThetaPhi<T>&  operator *= (T x)  { return Mul(x); }
+//! Divide all elements by \b x
+virtual SphereThetaPhi<T>& Div(T a); 
+inline  SphereThetaPhi<T>&  operator /= (T x)  { return Div(x); }
+
+// A += -=  (ajoute, soustrait element par element les deux spheres )
+  //! Operator SphereThetaPhi += SphereThetaPhi
+  virtual SphereThetaPhi<T>&  AddElt(const SphereThetaPhi<T>& a);
+  inline  SphereThetaPhi<T>&  operator += (const SphereThetaPhi<T>& a)  { return AddElt(a); }
+
+
+
+  virtual SphereThetaPhi<T>&  SubElt(const SphereThetaPhi<T>& a);
+  //! Operator SphereThetaPhi -= SphereThetaPhi
+  inline  SphereThetaPhi<T>&  operator -= (const SphereThetaPhi<T>& a)  { return SubElt(a); }
+// Multiplication, division element par element les deux SphereThetaPhi 
+  virtual SphereThetaPhi<T>&  MulElt(const SphereThetaPhi<T>& a);
+  inline  SphereThetaPhi<T>&  operator *= (const SphereThetaPhi<T>& a)  { return MulElt(a); }
+
+
   void CloneOrShare(const SphereThetaPhi<T>& a);
-
-  SphereThetaPhi<T>& Set(const SphereThetaPhi<T>& a);
+  void Share(const SphereThetaPhi<T>& a);
+
   SphereThetaPhi<T>& CopyElt(const SphereThetaPhi<T>& a);
 
-  inline  SphereThetaPhi<T>& operator = (const SphereThetaPhi<T>& a) 
-                                                       {return Set(a);}
+
+
+
+
 
  // friend declaration for classes which handle persistence and FITS IO
@@ -216,4 +261,74 @@
 };
 
+////////////////////////////////////////////////////////////////
+// Surcharge d'operateurs A (+,-,*,/) (T) x
+/*! \ingroup SphereThetaPhi \fn operator+(const SphereThetaPhi<T>&,T)
+  \brief Operator SphereThetaPhi = SphereThetaPhi + constant */
+template <class T> inline SphereThetaPhi<T> operator + (const SphereThetaPhi<T>& a, T b)
+    {SphereThetaPhi<T> result; result.CloneOrShare(a); result.SetTemp(true); 
+    result.Add(b); return result;}
+/*! \ingroup SphereThetaPhi \fn operator+(T,const SphereThetaPhi<T>&)
+  \brief Operator SphereThetaPhi = constant + SphereThetaPhi */
+template <class T> inline SphereThetaPhi<T> operator + (T b,const SphereThetaPhi<T>& a)
+    {SphereThetaPhi<T> result; result.CloneOrShare(a); result.SetTemp(true); 
+    result.Add(b); return result;}
+
+
+/*! \ingroup SphereThetaPhi\fn operator-(const SphereThetaPhi<T>&,T)
+  \brief Operator SphereThetaPhi = SphereThetaPhi - constant */
+template <class T> inline SphereThetaPhi<T> operator - (const SphereThetaPhi<T>& a, T b)
+    {SphereThetaPhi<T> result; result.CloneOrShare(a); result.SetTemp(true); 
+    result.Sub(b); return result;}
+
+/*! \ingroup  \fn operator-(T,const SphereThetaPhi<T>&)
+  \brief Operator SphereThetaPhi = constant - SphereThetaPhi */
+template <class T> inline SphereThetaPhi<T> operator - (T b,const SphereThetaPhi<T>& a)
+    {SphereThetaPhi<T> result; result.CloneOrShare(a); result.SetTemp(true); 
+    result.Sub(b,true); return result;}
+
+/*! \ingroup SphereThetaPhi \fn operator*(const SphereThetaPhi<T>&,T)
+  \brief Operator SphereThetaPhi = SphereThetaPhi * constant */
+template <class T> inline SphereThetaPhi<T> operator * (const SphereThetaPhi<T>& a, T b)
+    {SphereThetaPhi<T> result; result.CloneOrShare(a); result.SetTemp(true); 
+    result.Mul(b); return result;}
+
+/*! \ingroup SphereThetaPhi \fn operator*(T,const SphereThetaPhi<T>&)
+  \brief Operator SphereThetaPhi = constant * SphereThetaPhi */
+template <class T> inline SphereThetaPhi<T> operator * (T b,const SphereThetaPhi<T>& a)
+    {SphereThetaPhi<T> result; result.CloneOrShare(a); result.SetTemp(true); 
+    result.Mul(b); return result;}
+
+/*! \ingroup SphereThetaPhi \fn operator/(const SphereThetaPhi<T>&,T)
+  \brief Operator SphereThetaPhi = SphereThetaPhi / constant */
+template <class T> inline SphereThetaPhi<T> operator / (const SphereThetaPhi<T>& a, T b)
+    {SphereThetaPhi<T> result; result.CloneOrShare(a); result.SetTemp(true); 
+    result.Div(b); return result;}
+
+/*! \ingroup SphereThetaPhi \fn operator/(T,const SphereThetaPhi<T>&)
+  \brief Operator SphereThetaPhi = constant / SphereThetaPhi  */
+template <class T> inline SphereThetaPhi<T> operator / (T b, const SphereThetaPhi<T>& a)
+    {SphereThetaPhi<T> result; result.CloneOrShare(a); result.SetTemp(true); 
+    result.Div(b, true); return result;}
+
+////////////////////////////////////////////////////////////////
+// Surcharge d'operateurs C = A (+,-) B
+
+/*! \ingroup SphereThetaPhi \fn operator+(const SphereThetaPhi<T>&,const SphereThetaPhi<T>&)
+  \brief Operator SphereThetaPhi = SphereThetaPhi + SphereThetaPhi */
+template <class T>
+inline SphereThetaPhi<T> operator + (const SphereThetaPhi<T>& a,const SphereThetaPhi<T>& b)
+    { SphereThetaPhi<T> result; result.SetTemp(true); 
+    if (b.IsTemp())  { result.Share(b); result.AddElt(a); }
+    else { result.CloneOrShare(a); result.AddElt(b); }
+    return result; }
+
+/*! \ingroup SphereThetaPhi \fn operator-(const SphereThetaPhi<T>&,const SphereThetaPhi<T>&)
+  \brief Operator SphereThetaPhi = SphereThetaPhi - SphereThetaPhi */
+template <class T>
+inline SphereThetaPhi<T> operator - (const SphereThetaPhi<T>& a,const SphereThetaPhi<T>& b)
+    { SphereThetaPhi<T> result; result.SetTemp(true); 
+    if (b.IsTemp())  { result.Share(b); result.SubElt(a, true); }
+    else { result.CloneOrShare(a); result.SubElt(b); }
+    return result; }
 
 
