Changeset 1419 in Sophya for trunk/SophyaLib/SkyMap/spherethetaphi.cc
- Timestamp:
- Feb 23, 2001, 12:26:48 PM (25 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaLib/SkyMap/spherethetaphi.cc
r980 r1419 55 55 // m is the number of slices in theta on an hemisphere (the polar cap 56 56 // forms the first slice). 57 // pet is a dummy parameter at the moment.58 57 //-- 59 58 { … … 129 128 Theta_.CloneOrShare(a.Theta_); 130 129 pixels_.CloneOrShare(a.pixels_); 130 if (mInfo_) {delete mInfo_; mInfo_ = NULL;} 131 if (a.mInfo_) mInfo_ = new DVList(*(a.mInfo_)); 132 } 133 template<class T> 134 void SphereThetaPhi<T>::Share(const SphereThetaPhi<T>& a) 135 { 136 137 NTheta_= a.NTheta_; 138 NPix_ = a.NPix_; 139 Omega_ = a.Omega_; 140 NPhi_.Share(a.NPhi_); 141 TNphi_.Share(a.TNphi_); 142 Theta_.Share(a.Theta_); 143 pixels_.Share(a.pixels_); 144 if (mInfo_) {delete mInfo_; mInfo_ = NULL;} 145 if (a.mInfo_) mInfo_ = new DVList(*(a.mInfo_)); 131 146 } 132 147 … … 710 725 os << endl; 711 726 } 727 728 // ...... Operations de calcul ...... 729 730 731 //! Fill a SphereThetaPhi with a constant value \b a 732 template <class T> 733 SphereThetaPhi<T>& SphereThetaPhi<T>::SetT(T a) 734 { 735 if (NbPixels() < 1) 736 throw RangeCheckError("SphereThetaPhi<T>::SetT(T ) - SphereThetaPhi not dimensionned ! "); 737 pixels_ = a; 738 return (*this); 739 } 740 741 /*! Add a constant value \b x to a SphereThetaPhi */ 742 template <class T> 743 SphereThetaPhi<T>& SphereThetaPhi<T>::Add(T a) 744 { 745 if (NbPixels()< 1) 746 throw RangeCheckError("SphereThetaPhi<T>::Add(T ) - SphereThetaPhi not dimensionned ! "); 747 pixels_ += a; 748 return (*this); 749 } 750 751 /*! Substract a constant value \b a to a SphereThetaPhi */ 752 template <class T> 753 SphereThetaPhi<T>& SphereThetaPhi<T>::Sub(T a) 754 { 755 if (NbPixels()< 1) 756 throw RangeCheckError("SphereThetaPhi<T>::Sub(T ) - SphereThetaPhi not dimensionned ! "); 757 pixels_ -= a; 758 return (*this); 759 } 760 761 /*! multiply a SphereThetaPhi by a constant value \b a */ 762 template <class T> 763 SphereThetaPhi<T>& SphereThetaPhi<T>::Mul(T a) 764 { 765 if (NbPixels()< 1) 766 throw RangeCheckError("SphereThetaPhi<T>::Mul(T ) - SphereThetaPhi not dimensionned ! "); 767 pixels_ *= a; 768 return (*this); 769 } 770 771 /*! divide a SphereThetaPhi by a constant value \b a */ 772 template <class T> 773 SphereThetaPhi<T>& SphereThetaPhi<T>::Div(T a) 774 { 775 if (NbPixels()< 1) 776 throw RangeCheckError("SphereThetaPhi<T>::Div(T ) - SphereThetaPhi not dimensionned ! "); 777 pixels_ /= a; 778 return (*this); 779 } 780 781 // >>>> Operations avec 2nd membre de type SphereThetaPhi 782 //! Add two SphereThetaPhi 783 784 template <class T> 785 SphereThetaPhi<T>& SphereThetaPhi<T>::AddElt(const SphereThetaPhi<T>& a) 786 { 787 if (NbPixels()!= a.NbPixels()) 788 { 789 throw(SzMismatchError("SphereThetaPhi<T>::AddElt(const SphereThetaPhi<T>&) SizeMismatch")) ; 790 } 791 pixels_ += a.pixels_; 792 return (*this); 793 } 794 795 //! Substract two SphereThetaPhi 796 template <class T> 797 SphereThetaPhi<T>& SphereThetaPhi<T>::SubElt(const SphereThetaPhi<T>& a) 798 { 799 if (NbPixels()!= a.NbPixels()) 800 { 801 throw(SzMismatchError("SphereThetaPhi<T>::SubElt(const SphereThetaPhi<T>&) SizeMismatch")) ; 802 } 803 pixels_ -= a.pixels_; 804 return (*this); 805 } 806 807 //! Multiply two SphereThetaPhi (elements by elements) 808 template <class T> 809 SphereThetaPhi<T>& SphereThetaPhi<T>::MulElt(const SphereThetaPhi<T>& a) 810 { 811 if (NbPixels()!= a.NbPixels()) 812 { 813 throw(SzMismatchError("SphereThetaPhi<T>::SubElt(const SphereThetaPhi<T>&) SizeMismatch")) ; 814 } 815 pixels_ *= a.pixels_; 816 return (*this); 817 } 818 712 819 713 820
Note:
See TracChangeset
for help on using the changeset viewer.