Changeset 979 in Sophya for trunk/SophyaLib/SkyMap
- Timestamp:
- Apr 28, 2000, 4:09:46 PM (25 years ago)
- Location:
- trunk/SophyaLib/SkyMap
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaLib/SkyMap/localmap.cc
r908 r979 65 65 //++ 66 66 template<class T> 67 LocalMap<T>::LocalMap() 67 LocalMap<T>::LocalMap() : pixels_() 68 68 // 69 69 // … … 71 71 { 72 72 InitNul(); 73 pixels_.Reset();73 // pixels_.Reset(); 74 74 } 75 75 … … 148 148 } 149 149 150 ////////////////////////// methodes de copie/share 151 152 template<class T> 153 void LocalMap<T>::CloneOrShare(const LocalMap<T>& a) 154 { 155 recopierVariablesSimples(a); 156 pixels_.CloneOrShare(a.pixels_); 157 } 158 159 template<class T> 160 LocalMap<T>& LocalMap<T>::CopyElt(const LocalMap<T>& a) 161 { 162 if (NbPixels() < 1) 163 throw RangeCheckError("LocalMap<T>::CopyElt(const LocalMap<T>& ) - Not Allocated Array ! "); 164 if (NbPixels() != a.NbPixels()) 165 throw(SzMismatchError("LocalMap<T>::CopyElt(const LocalMap<T>&) SizeMismatch")) ; 166 recopierVariablesSimples(a); 167 int k; 168 for (k=0; k< nPix_; k++) pixels_(k) = a.pixels_(k); 169 return(*this); 170 171 } 172 150 173 template<class T> 151 174 LocalMap<T>& LocalMap<T>::Set(const LocalMap<T>& a) … … 153 176 if (this != &a) 154 177 { 155 recopierVariablesSimples(a); 156 pixels_.CloneOrShare(a.pixels_); 178 if (a.NbPixels() < 1) 179 throw RangeCheckError("LocalMap<T>::Set(a ) - Array a not allocated ! "); 180 if (NbPixels() < 1) CloneOrShare(a); 181 else CopyElt(a); 157 182 if (mInfo_) delete mInfo_; 158 183 mInfo_ = NULL; -
trunk/SophyaLib/SkyMap/localmap.h
r917 r979 198 198 void recopierVariablesSimples(const LocalMap<T>& lm); 199 199 LocalMap<T>& Set(const LocalMap<T>& a); 200 void CloneOrShare(const LocalMap<T>& a); 201 LocalMap<T>& CopyElt(const LocalMap<T>& a); 200 202 201 203 -
trunk/SophyaLib/SkyMap/spherehealpix.cc
r965 r979 177 177 178 178 template<class T> 179 SphereHEALPix<T>::SphereHEALPix() 179 SphereHEALPix<T>::SphereHEALPix() : pixels_(), sliceBeginIndex_(), 180 sliceLenght_() 180 181 181 182 //-- 182 183 { 183 184 InitNul(); 184 pixels_.Reset();185 // SetTemp(false); 185 186 } 186 187 … … 211 212 } 212 213 InitNul(); 214 // SetTemp(false); 213 215 Pixelize(m); 214 216 SetThetaSlices(); … … 222 224 //-- 223 225 { 224 if(s.mInfo_) mInfo_= new DVList(*s.mInfo_);225 226 226 nSide_= s.nSide_; 227 227 nPix_ = s.nPix_; 228 228 omeg_ = s.omeg_; 229 if(s.mInfo_) mInfo_= new DVList(*s.mInfo_); 229 230 } 230 231 //++ … … 236 237 //-- 237 238 { 238 if(s.mInfo_) mInfo_= new DVList(*s.mInfo_);239 240 239 nSide_= s.nSide_; 241 240 nPix_ = s.nPix_; 242 241 omeg_ = s.omeg_; 242 if(s.mInfo_) mInfo_= new DVList(*s.mInfo_); 243 // CloneOrShare(s); 243 244 } 244 245 … … 246 247 void SphereHEALPix<T>::CloneOrShare(const SphereHEALPix<T>& a) 247 248 { 249 nSide_= a.nSide_; 250 nPix_ = a.nPix_; 251 omeg_ = a.omeg_; 248 252 pixels_.CloneOrShare(a.pixels_); 249 253 sliceBeginIndex_.CloneOrShare(a.sliceBeginIndex_); 250 254 sliceLenght_.CloneOrShare(a.sliceLenght_); 251 } 252 255 256 // pas forcement a conserver, pas forcement a cet endroit (GLM) 257 // if (a.IsTemp() ) SetTemp(true); 258 } 259 260 ////////////////////////// methodes de copie/share 253 261 template<class T> 254 262 SphereHEALPix<T>& SphereHEALPix<T>::Set(const SphereHEALPix<T>& a) … … 256 264 if (this != &a) 257 265 { 258 nSide_= a.nSide_; 259 nPix_ = a.nPix_; 260 omeg_ = a.omeg_; 261 CloneOrShare(a); 266 267 if (a.NbPixels() < 1) 268 throw RangeCheckError("SphereHEALPix<T>::Set(a ) - Array a not allocated ! "); 269 if (NbPixels() < 1) CloneOrShare(a); 270 else CopyElt(a); 271 272 273 // CloneOrShare(a); 262 274 if (mInfo_) delete mInfo_; 263 275 mInfo_ = NULL; … … 267 279 } 268 280 269 281 template<class T> 282 SphereHEALPix<T>& SphereHEALPix<T>::CopyElt(const SphereHEALPix<T>& a) 283 { 284 if (NbPixels() < 1) 285 throw RangeCheckError("SphereHEALPix<T>::CopyElt(const SphereHEALPix<T>& ) - Not Allocated Array ! "); 286 if (NbPixels() != a.NbPixels()) 287 throw(SzMismatchError("TArray<T>::MultElt(const TArray<T>&) SizeMismatch")) ; 288 nSide_= a.nSide_; 289 nPix_ = a.nPix_; 290 omeg_ = a.omeg_; 291 int k; 292 for (k=0; k< nPix_; k++) pixels_(k) = a.pixels_(k); 293 for (k=0; k< a.sliceBeginIndex_.Size(); k++) sliceBeginIndex_(k) = a.sliceBeginIndex_(k); 294 for (k=0; k< a.sliceLenght_.Size(); k++) sliceLenght_(k) = a.sliceLenght_(k); 295 return(*this); 296 } 270 297 //++ 271 298 // Titre Destructor
Note:
See TracChangeset
for help on using the changeset viewer.