Changeset 958 in Sophya for trunk/SophyaLib/TArray
- Timestamp:
- Apr 18, 2000, 3:38:53 PM (25 years ago)
- Location:
- trunk/SophyaLib/TArray
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaLib/TArray/basarr.cc
r926 r958 61 61 { 62 62 uint_8 rs = step; 63 for( intk=0; k<ndim; k++) rs *= siz[k];63 for(uint_4 k=0; k<ndim; k++) rs *= siz[k]; 64 64 return(rs+offset); 65 65 } … … 285 285 { 286 286 if (ndim_ != a.ndim_) return(false); 287 for( intk=0; k<ndim_; k++)287 for(uint_4 k=0; k<ndim_; k++) 288 288 if (size_[k] != a.size_[k]) return(false); 289 289 // $CHECK$ Reza doit-on verifier ca … … 301 301 uint_4 size[BASEARRAY_MAXNDIMS]; 302 302 uint_4 step[BASEARRAY_MAXNDIMS]; 303 for( intk=0; k<ndim_; k++) {303 for(uint_4 k=0; k<ndim_; k++) { 304 304 if (size_[k] < 2) continue; 305 305 size[ndim] = size_[k]; … … 324 324 uint_4 size[BASEARRAY_MAXNDIMS]; 325 325 uint_4 step[BASEARRAY_MAXNDIMS]; 326 for( intk=0; k<ndim_; k++) {326 for(uint_4 k=0; k<ndim_; k++) { 327 327 size[ndim] = size_[k]; 328 328 step[ndim] = step_[k]; … … 338 338 uint_4 BaseArray::MinStepKA() const 339 339 { 340 for( intka=0; ka<ndim_; ka++)340 for(uint_4 ka=0; ka<ndim_; ka++) 341 341 if (step_[ka] == minstep_) return(ka); 342 342 return(0); … … 348 348 uint_4 ka = 0; 349 349 uint_4 mx = size_[0]; 350 for( intk=0; k<ndim_; k++)350 for(uint_4 k=0; k<ndim_; k++) 351 351 if (size_[k] > mx) { ka = k; mx = size_[k]; } 352 352 return(ka); … … 370 370 //#endif 371 371 uint_4 idx[BASEARRAY_MAXNDIMS]; 372 intk;372 uint_4 k; 373 373 uint_8 rest = i; 374 374 idx[ka] = 0; … … 392 392 393 393 uint_4 idx[BASEARRAY_MAXNDIMS]; 394 intk;394 uint_4 k; 395 395 uint_8 rest = ip; 396 396 for(k=0; k<ndim_; k++) { … … 424 424 os << "\n--- " << InfoString() ; 425 425 os << " ND=" << ndim_ << " SizeX*Y*...= " ; 426 for( intk=0; k<ndim_; k++) {426 for(uint_4 k=0; k<ndim_; k++) { 427 427 os << size_[k]; 428 428 if (k<ndim_-1) os << "x"; … … 431 431 if (prt_lev_ > 0) { 432 432 os << " TotSize= " << totsize_ << " Step(X Y ...)=" ; 433 for( intk=0; k<ndim_; k++) os << step_[k] << " " ;433 for(uint_4 k=0; k<ndim_; k++) os << step_[k] << " " ; 434 434 os << " Offset= " << offset_ << endl; 435 435 } … … 483 483 484 484 totsize_ = 1; 485 intk;485 uint_4 k; 486 486 for(k=0; k<BASEARRAY_MAXNDIMS; k++) { 487 487 size_[k] = 1; … … 530 530 531 531 totsize_ = 1; 532 intk;532 uint_4 k; 533 533 for(k=0; k<BASEARRAY_MAXNDIMS; k++) { 534 534 size_[k] = 1; … … 584 584 585 585 totsize_ = 1; 586 intk;586 uint_4 k; 587 587 for(k=0; k<BASEARRAY_MAXNDIMS; k++) { 588 588 size_[k] = 1; … … 629 629 if ( (ndim > ndim_) || (ndim < 1) ) 630 630 throw(SzMismatchError("BaseArray::UpdateSubArraySizes( ... ) NDim Error") ); 631 intk;631 uint_4 k; 632 632 for(k=0; k<ndim; k++) 633 633 if ( (siz[k]*step[k]+pos[k]) > size_[k] ) -
trunk/SophyaLib/TArray/fioarr.h
r926 r958 34 34 }; 35 35 36 //! Write TArray \b obj into POutPersist stream \b os 36 /*! \ingroup TArray \fn operator<<(POutPersist&,TArray<T>&) 37 \brief Write TArray \b obj into POutPersist stream \b os */ 37 38 template <class T> 38 39 inline POutPersist& operator << (POutPersist& os, TArray<T> & obj) 39 40 { FIO_TArray<T> fio(&obj); fio.Write(os); return(os); } 40 41 41 //! Read TArray \b obj from PInPersist stream \b os 42 /*! \ingroup TArray \fn operator>>(PInPersist&,TArray<T>&) 43 \brief Read TArray \b obj from PInPersist stream \b os */ 42 44 template <class T> 43 45 inline PInPersist& operator >> (PInPersist& is, TArray<T> & obj) -
trunk/SophyaLib/TArray/matharr.h
r942 r958 33 33 #if !defined(__GNUG__) 34 34 // see below for g++ 35 /*! \ingroup TArray \fn fabs(const TArray<T>& a) 36 \brief computation on TArray */ 35 37 template <class T> 36 38 inline TArray<T> fabs(const TArray<T>& a) 37 39 { MathArray<T> ma; return( ma.ApplyFunction(a, fabs) ); } 38 40 41 /*! \ingroup TArray \fn sqrt(const TArray<T>& a) 42 \brief computation on TArray */ 39 43 template <class T> 40 44 inline TArray<T> sqrt(const TArray<T>& a) 41 45 { MathArray<T> ma; return( ma.ApplyFunction(a, sqrt) ); } 42 46 47 /*! \ingroup TArray \fn sin(const TArray<T>& a) 48 \brief computation on TArray */ 43 49 template <class T> 44 50 inline TArray<T> sin(const TArray<T>& a) 45 51 { MathArray<T> ma; return( ma.ApplyFunction(a, sin) ); } 46 52 53 /*! \ingroup TArray \fn cos(const TArray<T>& a) 54 \brief computation on TArray */ 47 55 template <class T> 48 56 inline TArray<T> cos(const TArray<T>& a) 49 57 { MathArray<T> ma; return( ma.ApplyFunction(a, cos) ); } 50 58 59 /*! \ingroup TArray \fn tan(const TArray<T>& a) 60 \brief computation on TArray */ 51 61 template <class T> 52 62 inline TArray<T> tan(const TArray<T>& a) 53 63 { MathArray<T> ma; return( ma.ApplyFunction(a, tan) ); } 54 64 65 /*! \ingroup TArray \fn asin(const TArray<T>& a) 66 \brief computation on TArray */ 55 67 template <class T> 56 68 inline TArray<T> asin(const TArray<T>& a) 57 69 { MathArray<T> ma; return( ma.ApplyFunction(a, asin) ); } 58 70 71 /*! \ingroup TArray \fn acos(const TArray<T>& a) 72 \brief computation on TArray */ 59 73 template <class T> 60 74 inline TArray<T> acos(const TArray<T>& a) 61 75 { MathArray<T> ma; return( ma.ApplyFunction(a, acos) ); } 62 76 77 /*! \ingroup TArray \fn atan(const TArray<T>& a) 78 \brief computation on TArray */ 63 79 template <class T> 64 80 inline TArray<T> atan(const TArray<T>& a) 65 81 { MathArray<T> ma; return( ma.ApplyFunction(a, atan) ); } 66 82 83 /*! \ingroup TArray \fn exp(const TArray<T>& a) 84 \brief computation on TArray */ 67 85 template <class T> 68 86 inline TArray<T> exp(const TArray<T>& a) 69 87 { MathArray<T> ma; return( ma.ApplyFunction(a, exp) ); } 70 88 89 /*! \ingroup TArray \fn lof(const TArray<T>& a) 90 \brief computation on TArray */ 71 91 template <class T> 72 92 inline TArray<T> log(const TArray<T>& a) 73 93 { MathArray<T> ma; return( ma.ApplyFunction(a, log) ); } 74 94 95 /*! \ingroup TArray \fn log10(const TArray<T>& a) 96 \brief computation on TArray */ 75 97 template <class T> 76 98 inline TArray<T> log10(const TArray<T>& a) … … 83 105 #endif 84 106 85 //! Return \b mean and \b sigma of elements of array \b a 107 /*! \ingroup TArray \fn MeanSigma(const TArray<T>&,double&,double&) 108 \brief Return \b mean and \b sigma of elements of array \b a */ 86 109 template <class T> 87 110 inline double MeanSigma(const TArray<T>& a, double & mean, double & sig) 88 111 { MathArray<T> ma; return( ma.MeanSigma(a, mean, sig) ); } 89 112 90 //! Return \b mean of elements of array \b a 113 /*! \ingroup TArray \fn Mean(const TArray<T>&) 114 \brief Return \b mean of elements of array \b a */ 91 115 template <class T> 92 116 inline double Mean(const TArray<T>& a) -
trunk/SophyaLib/TArray/sopemtx.h
r956 r958 48 48 //------------------------------------------------------------ 49 49 50 /*! \ingroup TArray 51 \fn LinSolveInPlace(TMatrix<r_4>&, TVector<r_4>&) 50 /*! \ingroup TArray \fn LinSolveInPlace(TMatrix<r_4>&,TVector<r_4>&) 52 51 \brief Solve A*C = B for C in place and return determinant 53 52 */ … … 59 58 } 60 59 61 /*! \ingroup TArray 62 \fn LinSolveInPlace (TMatrix<r_8>&, TVector<r_8>&) 60 /*! \ingroup TArray \fn LinSolveInPlace(TMatrix<r_8>&,TVector<r_8>&) 63 61 \brief Solve A*X = B in place and return determinant 64 62 */ -
trunk/SophyaLib/TArray/tarray.cc
r926 r958 334 334 uint_8 step = AvgStep(); 335 335 pe = Data(); 336 for(k=0; k<totsize_; k++ ) pe[k*step] = seq(k);336 for(k=0; k<totsize_; k++ ) pe[k*step] = (T) seq(k); 337 337 } 338 338 else { // Non regular data spacing ... … … 344 344 for(j=0; j<naxa; j++) { 345 345 pe = mNDBlock.Begin()+Offset(ka,j); 346 for(k=0; k<gpas; k++) pe[k*step] = seq(j*gpas+k);346 for(k=0; k<gpas; k++) pe[k*step] = (T) seq(j*gpas+k); 347 347 } 348 348 } … … 807 807 { 808 808 if (maxprt < 0) maxprt = max_nprt_; 809 int_4 npr = 0;809 uint_4 npr = 0; 810 810 Show(os, si); 811 811 if (ndim_ < 1) return; … … 822 822 if(k0 > 0) os << ", "; 823 823 os << Elem(k0, k1, k2, k3, k4); npr++; 824 if (npr >= maxprt) {824 if (npr >= (uint_4) maxprt) { 825 825 if (npr < totsize_) os << "\n .... " << endl; return; 826 826 } -
trunk/SophyaLib/TArray/tarray.h
r956 r958 165 165 // Surcharge d'operateurs A (+,-,*,/) (T) x 166 166 167 //! Operator TArray = TArray + constant 167 /*! \ingroup TArray \fn operator+(const TArray<T>&,T) 168 \brief Operator TArray = TArray + constant */ 168 169 template <class T> inline TArray<T> operator + (const TArray<T>& a, T b) 169 170 {TArray<T> result(a); result.SetTemp(true); result.Add(b); return result;} 170 171 171 //! Operator TArray = constant + TArray 172 /*! \ingroup TArray \fn operator+(T,const TArray<T>&) 173 \brief Operator TArray = constant + TArray */ 172 174 template <class T> inline TArray<T> operator + (T b,const TArray<T>& a) 173 175 {TArray<T> result(a); result.SetTemp(true); result.Add(b); return result;} 174 176 175 //! Operator TArray = TArray - constant 177 /*! \ingroup TArray \fn operator-(const TArray<T>&,T) 178 \brief Operator TArray = TArray - constant */ 176 179 template <class T> inline TArray<T> operator - (const TArray<T>& a, T b) 177 180 {TArray<T> result(a); result.SetTemp(true); result.Sub(b); return result;} 178 181 179 //! Operator TArray = constant - TArray 182 /*! \ingroup TArray \fn operator-(T,const TArray<T>&) 183 \brief Operator TArray = constant - TArray */ 180 184 template <class T> inline TArray<T> operator - (T b,const TArray<T>& a) 181 185 {TArray<T> result(a); result.SetTemp(true); result.SubInv(b); return result;} 182 186 183 //! Operator TArray = TArray * constant 187 /*! \ingroup TArray \fn operator*(const TArray<T>&,T) 188 \brief Operator TArray = TArray * constant */ 184 189 template <class T> inline TArray<T> operator * (const TArray<T>& a, T b) 185 190 {TArray<T> result(a); result.SetTemp(true); result.Mul(b); return result;} 186 191 187 //! Operator TArray = constant * TArray 192 /*! \ingroup TArray \fn operator*(T,const TArray<T>&) 193 \brief Operator TArray = constant * TArray */ 188 194 template <class T> inline TArray<T> operator * (T b,const TArray<T>& a) 189 195 {TArray<T> result(a); result.SetTemp(true); result.Mul(b); return result;} 190 196 191 //! Operator TArray = TArray / constant 197 /*! \ingroup TArray \fn operator/(const TArray<T>&,T) 198 \brief Operator TArray = TArray / constant */ 192 199 template <class T> inline TArray<T> operator / (const TArray<T>& a, T b) 193 200 {TArray<T> result(a); result.SetTemp(true); result.DivInv(b); return result;} … … 196 203 // Surcharge d'operateurs C = A (+,-) B 197 204 198 //! Operator TArray = TArray + TArray 205 /*! \ingroup TArray \fn operator+(const TArray<T>&,const TArray<T>&) 206 \brief Operator TArray = TArray + TArray */ 199 207 template <class T> 200 208 inline TArray<T> operator + (const TArray<T>& a,const TArray<T>& b) 201 209 {TArray<T> result(a); result.SetTemp(true); result.AddElt(b); return result;} 202 210 203 //! Operator TArray = TArray - TArray 211 /*! \ingroup TArray \fn operator-(const TArray<T>&,const TArray<T>&) 212 \brief Operator TArray = TArray - TArray */ 204 213 template <class T> 205 214 inline TArray<T> operator - (const TArray<T>& a,const TArray<T>& b) -
trunk/SophyaLib/TArray/tmatrix.cc
r926 r958 1 // $Id: tmatrix.cc,v 1. 7 2000-04-13 18:39:14ansari Exp $1 // $Id: tmatrix.cc,v 1.8 2000-04-18 13:38:52 ansari Exp $ 2 2 // C.Magneville 04/99 3 3 #include "machdefs.h" … … 290 290 { 291 291 if (maxprt < 0) maxprt = max_nprt_; 292 int_4 npr = 0;292 uint_4 npr = 0; 293 293 Show(os, si); 294 294 if (ndim_ < 1) return; … … 299 299 if(kc > 0) os << ", "; 300 300 os << (*this)(kr, kc); npr++; 301 if (npr >= maxprt) {301 if (npr >= (uint_4) maxprt) { 302 302 if (npr < totsize_) os << "\n .... " << endl; return; 303 303 } -
trunk/SophyaLib/TArray/tmatrix.h
r956 r958 126 126 } 127 127 128 129 128 // Surcharge d'operateurs C = A (+,-) B 130 129 // $CHECK$ Reza 3/4/2000 Pas necessaire de redefinir les operateurs … … 132 131 // Doit-on le faire aussi pour les constantes ? - Fin de $CHECK$ Reza 3/4/2000 133 132 134 //! + : add matrixes \b a and \b b 133 /*! \ingroup TArray \fn operator+(const TMatrix<T>&,const TMatrix<T>&) 134 \brief + : add matrixes \b a and \b b */ 135 135 template <class T> 136 136 inline TMatrix<T> operator + (const TMatrix<T>& a,const TMatrix<T>& b) 137 137 {TMatrix<T> result(a); result.SetTemp(true); result.AddElt(b); return result;} 138 138 139 //! - : substract matrixes \b a and \b b 139 /*! \ingroup TArray \fn operator-(const TMatrix<T>&,const TMatrix<T>&) 140 \brief \- : substract matrixes \b a and \b b */ 140 141 template <class T> 141 142 inline TMatrix<T> operator - (const TMatrix<T>& a,const TMatrix<T>& b) … … 143 144 144 145 // Surcharge d'operateurs C = A * B 145 //! - : multiply matrixes \b a and \b b 146 /*! \ingroup TArray \fn operator*(const TMatrix<T>&,const TMatrix<T>&) 147 \brief * : multiply matrixes \b a and \b b */ 146 148 template <class T> inline TMatrix<T> operator * (const TMatrix<T>& a, const TMatrix<T>& b) 147 149 { TMatrix<T> result(a); result.SetTemp(true); return(result.Multiply(b)); }
Note:
See TracChangeset
for help on using the changeset viewer.