Changeset 979 in Sophya for trunk/SophyaLib/SkyMap/spherehealpix.cc
- Timestamp:
- Apr 28, 2000, 4:09:46 PM (25 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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.