Changeset 1419 in Sophya for trunk/SophyaLib/SkyMap/localmap.cc
- Timestamp:
- Feb 23, 2001, 12:26:48 PM (25 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaLib/SkyMap/localmap.cc
r1308 r1419 101 101 recopierVariablesSimples(a); 102 102 pixels_.CloneOrShare(a.pixels_); 103 if (mInfo_) {delete mInfo_; mInfo_ = NULL;} 104 if (a.mInfo_) mInfo_ = new DVList(*(a.mInfo_)); 105 } 106 template<class T> 107 void LocalMap<T>::Share(const LocalMap<T>& a) 108 { 109 recopierVariablesSimples(a); 110 pixels_.Share(a.pixels_); 111 if (mInfo_) {delete mInfo_; mInfo_ = NULL;} 112 if (a.mInfo_) mInfo_ = new DVList(*(a.mInfo_)); 103 113 } 104 114 … … 556 566 } 557 567 568 // ...... Operations de calcul ...... 569 570 571 //! Fill a LocalMap with a constant value \b a 572 template <class T> 573 LocalMap<T>& LocalMap<T>::SetT(T a) 574 { 575 if (NbPixels() < 1) 576 throw RangeCheckError("LocalMap<T>::SetT(T ) - LocalMap not dimensionned ! "); 577 pixels_ = a; 578 return (*this); 579 } 580 581 /*! Add a constant value \b x to a LocalMap */ 582 template <class T> 583 LocalMap<T>& LocalMap<T>::Add(T a) 584 { 585 if (NbPixels()< 1) 586 throw RangeCheckError("LocalMap<T>::Add(T ) - LocalMap not dimensionned ! "); 587 pixels_ += a; 588 return (*this); 589 } 590 591 /*! Substract a constant value \b a to a LocalMap */ 592 template <class T> 593 LocalMap<T>& LocalMap<T>::Sub(T a) 594 { 595 if (NbPixels()< 1) 596 throw RangeCheckError("LocalMap<T>::Sub(T ) - LocalMap not dimensionned ! "); 597 pixels_ -= a; 598 return (*this); 599 } 600 601 /*! multiply a LocalMap by a constant value \b a */ 602 template <class T> 603 LocalMap<T>& LocalMap<T>::Mul(T a) 604 { 605 if (NbPixels()< 1) 606 throw RangeCheckError("LocalMap<T>::Mul(T ) - LocalMap not dimensionned ! "); 607 pixels_ *= a; 608 return (*this); 609 } 610 611 /*! divide a LocalMap by a constant value \b a */ 612 template <class T> 613 LocalMap<T>& LocalMap<T>::Div(T a) 614 { 615 if (NbPixels()< 1) 616 throw RangeCheckError("LocalMap<T>::Div(T ) - LocalMap not dimensionned ! "); 617 pixels_ /= a; 618 return (*this); 619 } 620 621 // >>>> Operations avec 2nd membre de type LocalMap 622 //! Add two LocalMap 623 624 template <class T> 625 LocalMap<T>& LocalMap<T>::AddElt(const LocalMap<T>& a) 626 { 627 if (nSzX_ != a.nSzX_ || nSzY_ != a.nSzY_) 628 { 629 throw(SzMismatchError("LocalMap<T>::AddElt(const LocalMap<T>&) SizeMismatch")) ; 630 } 631 pixels_ += a.pixels_; 632 return (*this); 633 } 634 635 //! Substract two LocalMap 636 template <class T> 637 LocalMap<T>& LocalMap<T>::SubElt(const LocalMap<T>& a) 638 { 639 if (nSzX_ != a.nSzX_ || nSzY_ != a.nSzY_) 640 { 641 throw(SzMismatchError("LocalMap<T>::AddElt(const LocalMap<T>&) SizeMismatch")) ; 642 } 643 pixels_ -= a.pixels_; 644 return (*this); 645 } 646 647 //! Multiply two LocalMap (elements by elements) 648 template <class T> 649 LocalMap<T>& LocalMap<T>::MulElt(const LocalMap<T>& a) 650 { 651 if (nSzX_ != a.nSzX_ || nSzY_ != a.nSzY_) 652 { 653 throw(SzMismatchError("LocalMap<T>::AddElt(const LocalMap<T>&) SizeMismatch")) ; 654 } 655 pixels_ *= a.pixels_; 656 return (*this); 657 } 658 659 660 661 558 662 559 663 //++
Note:
See TracChangeset
for help on using the changeset viewer.