Index: trunk/SophyaLib/SkyMap/spherehealpix.cc
===================================================================
--- trunk/SophyaLib/SkyMap/spherehealpix.cc	(revision 1304)
+++ 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);
+}
+
+
 
 
