Changeset 2421 in Sophya
- Timestamp:
- Aug 8, 2003, 3:07:06 PM (22 years ago)
- Location:
- trunk/SophyaLib/TArray
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaLib/TArray/sopemtx.cc
r2322 r2421 619 619 { 620 620 uint_4 n = x.NElts(); 621 if (n != y.NElts()) THROW(sizeMismatchErr); 621 if (n != y.NElts()) 622 throw SzMismatchError("LinFitter<T>::LinFit(x,y,nf,f,c)/Error x.NElts() <> y.Nelts() "); 622 623 623 624 TMatrix<T> fx(nf,n); … … 643 644 { 644 645 uint_4 n = y.NElts(); 645 if (n != fx.NCol()) THROW(sizeMismatchErr); 646 if (n != fx.NCol()) 647 throw SzMismatchError("LinFitter<T>::LinFit(fx, y, c)/Error y.NElts() <> fx.Nelts() "); 646 648 647 649 uint_4 nf = fx.NRows(); … … 656 658 c = fx * y; 657 659 658 if(SimpleMatrixOperation<T>::GausPiv(a,c)==(T) 0) THROW(singMatxErr); 660 if(SimpleMatrixOperation<T>::GausPiv(a,c)==(T) 0) 661 throw SingMatrixExc("LinFitter<T>::LinFit(fx, y, c) - Non invertible matrix (by GausPiv())"); 659 662 660 663 r_8 xi2 = 0., ax; … … 691 694 { 692 695 uint_4 n = x.NElts(); 693 if (n != y.NElts()) THROW(sizeMismatchErr); 696 if (n != y.NElts()) 697 throw SzMismatchError("LinFitter<T>::LinFit(x,y,errY2,nf,f,c,errC)/Error x.NElts() <> y.Nelts() "); 694 698 695 699 TMatrix<T> fx(nf, n); … … 720 724 { 721 725 uint_4 n = y.NElts(); 722 if( n != errY2.NElts()) THROW(sizeMismatchErr); 723 if( n != fx.NCol()) THROW(sizeMismatchErr); 724 726 if( n != errY2.NElts()) 727 throw SzMismatchError("LinFitter<T>::LinFit(fx,y,errY2,c,errC)/Error y.NElts() <> errY2.Nelts() "); 728 if( n != fx.NCol()) 729 throw SzMismatchError("LinFitter<T>::LinFit(fx,y,errY2,c,errC)/Error y.NElts() <> fx.NCols() "); 725 730 uint_4 nf = fx.NRows(); 726 731 … … 748 753 } 749 754 750 if(SimpleMatrixOperation<T>::GausPiv(a,d)==(T) 0) THROW(singMatxErr); 755 if(SimpleMatrixOperation<T>::GausPiv(a,d)==(T) 0) 756 throw SingMatrixExc("LinFitter<T>::LinFit(...ErrY2...) - Non invertible matrix (by GausPiv())"); 757 751 758 752 759 for(uint_4 l=0; l<nf; l++) { -
trunk/SophyaLib/TArray/tmatrix.cc
r2267 r2421 1 // $Id: tmatrix.cc,v 1.2 3 2002-11-15 09:35:44ansari Exp $1 // $Id: tmatrix.cc,v 1.24 2003-08-08 13:07:06 ansari Exp $ 2 2 // C.Magneville 04/99 3 3 #include "machdefs.h" … … 291 291 */ 292 292 template <class T> 293 TMatrix<T> TMatrix<T>::Transpose() 293 TMatrix<T> TMatrix<T>::Transpose() const 294 294 { 295 295 TMatrix<T> tm(*this); … … 305 305 */ 306 306 template <class T> 307 TMatrix<T> TMatrix<T>::Transpose(short mm) 307 TMatrix<T> TMatrix<T>::Transpose(short mm) const 308 308 { 309 309 if (mm == SameMemoryMapping) mm = GetMemoryMapping(); … … 322 322 */ 323 323 template <class T> 324 TMatrix<T> TMatrix<T>::Rearrange(short mm) 324 TMatrix<T> TMatrix<T>::Rearrange(short mm) const 325 325 { 326 326 if ( mm == SameMemoryMapping) mm = GetMemoryMapping(); -
trunk/SophyaLib/TArray/tmatrix.h
r1581 r2421 42 42 // Size - Changing the Size 43 43 //! return number of rows 44 inline sa_size_t NRows() const {return Size(marowi_); }44 inline sa_size_t NRows() const {return size_[marowi_]; } 45 45 //! return number of columns 46 inline sa_size_t NCols() const {return Size(macoli_); }46 inline sa_size_t NCols() const {return size_[macoli_]; } 47 47 //! return number of columns 48 inline sa_size_t NCol() const {return Size(macoli_); } // back-compat Peida48 inline sa_size_t NCol() const {return size_[macoli_]; } // back-compat Peida 49 49 50 50 void ReSize(sa_size_t r,sa_size_t c, short mm=BaseArray::SameMemoryMapping); … … 74 74 // Operations matricielles 75 75 TMatrix<T>& TransposeSelf(); 76 TMatrix<T> Transpose() ;76 TMatrix<T> Transpose() const; 77 77 //mm = SameMemoryMapping or CMemoryMapping or FortranMemoryMapping 78 TMatrix<T> Transpose(short mm) ;78 TMatrix<T> Transpose(short mm) const ; 79 79 // Rearranging Matrix Elements 80 TMatrix<T> Rearrange(short mm) ;80 TMatrix<T> Rearrange(short mm) const; 81 81 82 82 // Operateur d'affectation
Note:
See TracChangeset
for help on using the changeset viewer.