Import Geant4 1.1.0 source tree
This commit is contained in:
@@ -5,8 +5,8 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: tpsrtvec.icc,v 1.2 1999/11/25 13:41:26 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-01-00 $
|
||||
// $Id: tpsrtvec.icc,v 1.3 2000/02/01 16:55:01 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-01-01 $
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
@@ -50,6 +50,10 @@ T* const& G4RWTPtrSortedVector<T>::operator [] (size_t n) const
|
||||
template<class T>
|
||||
T* const& G4RWTPtrSortedVector<T>::operator () (size_t n) const
|
||||
{
|
||||
#ifdef G4DEBUG
|
||||
if(n>=rwsize)
|
||||
G4RWTHROW(G4RWBoundsErr("G4RWTPtrSortedVector",rwsize,n));
|
||||
#endif
|
||||
return std_pvector::operator[](n);
|
||||
}
|
||||
|
||||
@@ -58,8 +62,6 @@ T*& G4RWTPtrSortedVector<T>::at(size_t n )
|
||||
{
|
||||
if(n>=rwsize)
|
||||
G4RWTHROW(G4RWBoundsErr("G4RWTPtrSortedVector",rwsize,n));
|
||||
if(n<std_pvector::size() && rwsize<=n)
|
||||
rwsize=n+1;
|
||||
return std_pvector::operator[](n);
|
||||
}
|
||||
|
||||
@@ -91,7 +93,7 @@ void G4RWTPtrSortedVector<T>::clearAndDestroy ()
|
||||
template<class T>
|
||||
T* G4RWTPtrSortedVector<T>::find (const T* a) const
|
||||
{
|
||||
if(!a || std_pvector::empty()) return 0;
|
||||
if(!a || std_pvector::empty() || (rwsize==0)) return 0;
|
||||
//We are sorted, so try a n log n search
|
||||
int t,d;
|
||||
int u=rwsize,l=0;
|
||||
@@ -107,7 +109,7 @@ T* G4RWTPtrSortedVector<T>::find (const T* a) const
|
||||
}
|
||||
while(d>0);
|
||||
|
||||
if(*(*this)[u]==*a)
|
||||
if ((u<rwsize) && (*(*this)[u]==*a))
|
||||
return (*this)[u];
|
||||
else
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user