Changeset 1393 in Sophya
- Timestamp:
- Feb 12, 2001, 6:09:03 PM (25 years ago)
- Location:
- trunk/SophyaLib/TArray
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaLib/TArray/tarray.cc
r1389 r1393 230 230 231 231 232 //! Resize array232 //! Sets or changes the array size 233 233 /*! 234 234 \param ndim : number of dimensions … … 245 245 throw( ParmError("TArray<T>::ReSize(,siz[0]>1 && size[1]>1) for Vector" ) ); 246 246 } 247 string exmsg = "TArray<T>::ReSize( )";247 string exmsg = "TArray<T>::ReSize(int_4 ...)"; 248 248 if (!UpdateSizes(ndim, siz, step, 0, exmsg)) throw( ParmError(exmsg) ); 249 249 mNDBlock.ReSize(totsize_); 250 } 251 252 //! Sets or changes the array size. 253 /*! 254 The array size and memory layout are copied from the array \b a. 255 \param a : Array used as template for setting the size and memory layout. 256 */ 257 template <class T> 258 void TArray<T>::ReSize(const TArray<T>& a) 259 { 260 if (arrtype_ != 0) { 261 if (a.NbDimensions() != 2) 262 throw( ParmError("TArray<T>::ReSize(a.NbDimensions()!=2,...) for Matrix" ) ); 263 if ((arrtype_ == 2) && (a.Size(0) > 1) && (a.Size(1) > 1)) 264 throw( ParmError("TArray<T>::ReSize(a.Size(0)>1 && a.Size(1)>1) for Vector" ) ); 265 } 266 string exmsg = "TArray<T>::ReSize(const TArray<T>&)"; 267 if (!UpdateSizes(a, exmsg)) throw( ParmError(exmsg) ); 268 mNDBlock.ReSize(totsize_); 250 269 } 251 270 -
trunk/SophyaLib/TArray/tarray.h
r1156 r1393 55 55 void CloneOrShare(const TArray<T>& a); 56 56 // Share: partage les donnees de "a" 57 58 57 void Share(const TArray<T>& a); 58 59 59 void ReSize(int_4 ndim, sa_size_t * siz, sa_size_t step=1); 60 void ReSize(const TArray<T>& a); 61 //! a synonym (alias) for method ReSize(int_4, ...) 62 inline void SetSize(int_4 ndim, sa_size_t * siz, sa_size_t step=1) 63 { ReSize(ndim, siz, step); } 64 //! a synonym (alias) for method ReSize(const TArray<T>&) 65 inline void SetSize(const TArray<T>& a) 66 { ReSize(a); } 60 67 void Realloc(int_4 ndim, sa_size_t * siz, sa_size_t step=1, bool force=false); 61 68
Note:
See TracChangeset
for help on using the changeset viewer.