Import Geant4 3.0.0 source tree
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
# $Id: GNUmakefile,v 1.1 2000/11/03 16:39:29 gunter Exp $
|
||||
# --------------------------------------------------------------
|
||||
# GNUmakefile for STLInterface. Gunter Folger 3-Nov-2000.
|
||||
# --------------------------------------------------------------
|
||||
|
||||
ifndef G4INSTALL
|
||||
G4INSTALL = ../../..
|
||||
endif
|
||||
|
||||
include $(G4INSTALL)/config/architecture.gmk
|
||||
|
||||
G4DUMMY_VARIABLE:=$(shell [ ! -d $(G4INCLUDE)/g4rw ] && mkdir -p $(G4INCLUDE)/g4rw )
|
||||
|
||||
installed_includes:=$(foreach file,$(wildcard g4rw/*),$(shell test -f $(file) && echo $(file)))
|
||||
|
||||
installed_includes:=$(foreach file,$(installed_includes),$(G4INCLUDE)/$(file))
|
||||
|
||||
includes: $(installed_includes)
|
||||
|
||||
$(installed_includes): $(G4INCLUDE)/% : %
|
||||
@cp -p $< $@
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
$Id: History,v 1.22 2000/06/26 16:25:56 gcosmo Exp $
|
||||
$Id: History,v 1.24 2000/11/20 17:26:44 gcosmo Exp $
|
||||
-------------------------------------------------------------------
|
||||
|
||||
=========================================================
|
||||
@@ -21,6 +21,14 @@ committal in the CVS repository !
|
||||
STL Interface
|
||||
-------------
|
||||
|
||||
November 20, 2000 G.Cosmo
|
||||
- Fixes to remove warnings from "-Wall -ansi -pedantic" g++ compiler options:
|
||||
o fixed usage of unsigned-int (size_t) for indeces.
|
||||
|
||||
July 21, 2000 G.Cosmo
|
||||
- STLInterface/cstring.icc: extended buffer for G4String::readLine from
|
||||
256 to 1024 characters.
|
||||
|
||||
June 26, 00 G.Cosmo (STLInterface-V01-01-01)
|
||||
- Fixes for problem report #104:
|
||||
o defs.h: defined G4RWTHROW(a) to abort() in case G4NO_STD_EXCEPTIONS
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: cstring.h,v 1.8 2000/06/26 16:25:57 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// $Id: cstring.h,v 1.9 2000/11/20 17:26:44 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
@@ -53,7 +53,7 @@ public:
|
||||
inline char& operator[](size_t);
|
||||
inline char operator[](size_t) const;
|
||||
|
||||
inline int operator!() const;
|
||||
inline G4int operator!() const;
|
||||
|
||||
inline G4bool operator==(G4String) const;
|
||||
inline G4bool operator==(const char*) const;
|
||||
@@ -118,8 +118,8 @@ public:
|
||||
inline operator const char*() const;
|
||||
inline G4SubString operator()(size_t, size_t);
|
||||
|
||||
inline int compareTo(const char*, caseCompare mode=exact);
|
||||
inline int compareTo(const G4String&, caseCompare mode=exact);
|
||||
inline G4int compareTo(const char*, caseCompare mode=exact);
|
||||
inline G4int compareTo(const G4String&, caseCompare mode=exact);
|
||||
|
||||
inline G4String& prepend (const char*);
|
||||
inline G4String& append (const G4String&);
|
||||
@@ -133,8 +133,8 @@ public:
|
||||
inline G4String& remove(size_t);
|
||||
inline G4String& remove(size_t, size_t);
|
||||
|
||||
inline int first(char) const;
|
||||
inline int last(char) const;
|
||||
inline G4int first(char) const;
|
||||
inline G4int last(char) const;
|
||||
|
||||
inline G4bool contains(std_string) const;
|
||||
inline G4bool contains(char) const;
|
||||
@@ -143,20 +143,20 @@ public:
|
||||
// stripType = 1 end
|
||||
// stripType = 2 both
|
||||
//
|
||||
inline G4String strip (int stripType=trailing, char c=' ');
|
||||
inline G4String strip (G4int stripType=trailing, char c=' ');
|
||||
|
||||
inline void toLower ( void );
|
||||
inline void toUpper ( void );
|
||||
|
||||
inline G4bool isNull() const;
|
||||
|
||||
inline size_t index (const char*, int pos=0) const;
|
||||
inline size_t index (char, int pos=0) const;
|
||||
inline size_t index (const char*, G4int pos=0) const;
|
||||
inline size_t index (char, G4int pos=0) const;
|
||||
inline size_t index (const G4String&, size_t, size_t, caseCompare) const;
|
||||
|
||||
inline const char* data() const;
|
||||
|
||||
inline int strcasecompare(const char*, const char*) const;
|
||||
inline G4int strcasecompare(const char*, const char*) const;
|
||||
|
||||
inline unsigned int hash( caseCompare cmp = exact ) const;
|
||||
inline unsigned int stlhash() const;
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: cstring.icc,v 1.5 2000/06/26 16:25:57 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// $Id: cstring.icc,v 1.9 2000/11/20 20:03:16 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
@@ -71,7 +71,7 @@ char G4SubString::operator[](size_t i) const
|
||||
return mystring->operator[](mystart+i);
|
||||
}
|
||||
|
||||
int G4SubString::operator!() const
|
||||
G4int G4SubString::operator!() const
|
||||
{
|
||||
return extent==0 ? 1 : 0;
|
||||
}
|
||||
@@ -228,7 +228,7 @@ G4String::operator const char*() const
|
||||
return c_str();
|
||||
}
|
||||
|
||||
int G4String::strcasecompare(const char* s1, const char* s2) const
|
||||
G4int G4String::strcasecompare(const char* s1, const char* s2) const
|
||||
{
|
||||
#ifndef G4USE_STD_NAMESPACE
|
||||
return strcasecmp(s1,s2);
|
||||
@@ -241,14 +241,14 @@ int G4String::strcasecompare(const char* s1, const char* s2) const
|
||||
for (size_t j=0; j<=strlen(s2); j++)
|
||||
buf2[j] = tolower(s2[j]);
|
||||
|
||||
int res = strcmp(buf1, buf2);
|
||||
G4int res = strcmp(buf1, buf2);
|
||||
delete [] buf1;
|
||||
delete [] buf2;
|
||||
return res;
|
||||
#endif
|
||||
}
|
||||
|
||||
int G4String::compareTo(const char* s, caseCompare mode)
|
||||
G4int G4String::compareTo(const char* s, caseCompare mode)
|
||||
{
|
||||
if(mode==exact)
|
||||
return strcmp(c_str(),s);
|
||||
@@ -256,7 +256,7 @@ int G4String::compareTo(const char* s, caseCompare mode)
|
||||
return strcasecompare(c_str(),s);
|
||||
}
|
||||
|
||||
int G4String::compareTo(const G4String& s, caseCompare mode)
|
||||
G4int G4String::compareTo(const G4String& s, caseCompare mode)
|
||||
{
|
||||
if(mode==exact)
|
||||
return strcmp(c_str(),s.c_str());
|
||||
@@ -279,14 +279,14 @@ G4String& G4String::append(const G4String& s)
|
||||
G4std::istream&
|
||||
G4String::readLine (G4std::istream& s, G4bool skipWhite)
|
||||
{
|
||||
char tmp[256];
|
||||
char tmp[1024];
|
||||
if ( skipWhite ) {
|
||||
s >> G4std::ws;
|
||||
s.getline(tmp,256);
|
||||
s.getline(tmp,1024);
|
||||
*this=tmp;
|
||||
}
|
||||
else {
|
||||
s.getline(tmp,256);
|
||||
s.getline(tmp,1024);
|
||||
*this=tmp;
|
||||
}
|
||||
return s;
|
||||
@@ -318,20 +318,20 @@ G4String& G4String::remove(size_t pos, size_t N)
|
||||
return *this;
|
||||
}
|
||||
|
||||
int G4String::first(char c) const
|
||||
G4int G4String::first(char c) const
|
||||
{
|
||||
return find(c);
|
||||
}
|
||||
|
||||
int G4String::last(char c) const
|
||||
G4int G4String::last(char c) const
|
||||
{
|
||||
return rfind(c);
|
||||
}
|
||||
|
||||
G4bool G4String::contains(std_string s) const
|
||||
{
|
||||
int i=find(s);
|
||||
if(i != std_string::npos)
|
||||
G4int i=std_string::find(s);
|
||||
if(i != G4int(std_string::npos))
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
@@ -339,18 +339,18 @@ G4bool G4String::contains(std_string s) const
|
||||
|
||||
G4bool G4String::contains(char c) const
|
||||
{
|
||||
int i=find(c);
|
||||
if(i != std_string::npos)
|
||||
G4int i=std_string::find(c);
|
||||
if(i != G4int(std_string::npos))
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
G4String G4String::strip (int stripType, char c)
|
||||
G4String G4String::strip (G4int stripType, char c)
|
||||
{
|
||||
G4String retVal = *this;
|
||||
if(length()==0) return retVal;
|
||||
int i;
|
||||
size_t i;
|
||||
switch ( stripType ) {
|
||||
case leading:
|
||||
{
|
||||
@@ -360,10 +360,11 @@ G4String G4String::strip (int stripType, char c)
|
||||
}
|
||||
break;
|
||||
case trailing:
|
||||
{
|
||||
for(i=length()-1;i>=0;i--)
|
||||
if (std_string::operator[](i) != c) break;
|
||||
retVal = substr(0,i+1);
|
||||
{
|
||||
G4int j;
|
||||
for(j=length()-1;j>=0;j--)
|
||||
if (std_string::operator[](j) != c) break;
|
||||
retVal = substr(0,j+1);
|
||||
}
|
||||
break;
|
||||
case both:
|
||||
@@ -371,9 +372,10 @@ G4String G4String::strip (int stripType, char c)
|
||||
for(i=0;i<length();i++)
|
||||
if (std_string::operator[](i) != c) break;
|
||||
G4String tmp(substr(i,length()-i));
|
||||
for(i=tmp.length()-1;i>=0;i--)
|
||||
if (tmp.std_string::operator[](i) != c) break;
|
||||
retVal = tmp.substr(0,i+1);
|
||||
G4int k;
|
||||
for(k=tmp.length()-1;k>=0;k--)
|
||||
if (tmp.std_string::operator[](k) != c) break;
|
||||
retVal = tmp.substr(0,k+1);
|
||||
}
|
||||
}
|
||||
return retVal;
|
||||
@@ -381,7 +383,7 @@ G4String G4String::strip (int stripType, char c)
|
||||
|
||||
void G4String::toLower ( void )
|
||||
{
|
||||
for (int i=0; i<size();i++)
|
||||
for (size_t i=0; i<size();i++)
|
||||
{
|
||||
//GB:HP-UX-aCC,Linux-KCC
|
||||
std_string::operator[](i) = tolower(std_string::operator[](i));
|
||||
@@ -391,7 +393,7 @@ void G4String::toLower ( void )
|
||||
|
||||
void G4String::toUpper ( void )
|
||||
{
|
||||
for (int i=0; i<size();i++)
|
||||
for (size_t i=0; i<size();i++)
|
||||
{
|
||||
//GB:HP-UX-aCC,Linux-KCC
|
||||
std_string::operator[](i) = toupper(std_string::operator[](i));
|
||||
@@ -412,12 +414,12 @@ size_t G4String::index( const G4String& s, size_t ln,
|
||||
return std_string::find( s.c_str(), st, ln );
|
||||
}
|
||||
|
||||
size_t G4String::index (const char* str, int pos) const
|
||||
size_t G4String::index (const char* str, G4int pos) const
|
||||
{
|
||||
return std_string::find(str,pos);
|
||||
}
|
||||
|
||||
size_t G4String::index (char c, int pos) const
|
||||
size_t G4String::index (char c, G4int pos) const
|
||||
{
|
||||
return std_string::find(c,pos);
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: ctoken.h,v 1.5 1999/11/29 10:17:41 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: defs.h,v 1.8 2000/06/26 16:25:57 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: rstream.h,v 1.4 1999/11/25 10:14:45 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: rw2stl_algo.h,v 1.4 1999/11/25 10:14:45 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: tpordvec.h,v 1.7 1999/11/26 17:17:57 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: tpordvec.icc,v 1.4 2000/03/22 08:05:40 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// $Id: tpordvec.icc,v 1.5 2000/11/20 17:26:45 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
@@ -85,9 +85,8 @@ void G4RWTPtrOrderedVector<T>::clear()
|
||||
template<class T >
|
||||
void G4RWTPtrOrderedVector<T>::clearAndDestroy()
|
||||
{
|
||||
int sz;
|
||||
G4std::set<T*,G4std::greater<T*> > tmp;
|
||||
for (sz=0;sz<rwsize;sz++)
|
||||
for (size_t sz=0;sz<rwsize;sz++)
|
||||
{
|
||||
T* current;
|
||||
current=std_pvector::operator[](sz);
|
||||
@@ -201,8 +200,7 @@ T* G4RWTPtrOrderedVector<T>::removeAt( size_t i )
|
||||
if(i>=rwsize)
|
||||
G4RWTHROW(G4RWBoundsErr("G4RWTPtrOrderedVector removeAt",rwsize,i));
|
||||
iterator it=std_pvector::begin();
|
||||
int j;
|
||||
for(j=0;j<rwsize && j<i;j++) it++;
|
||||
for(size_t j=0;j<rwsize && j<i;j++) it++;
|
||||
if(it!=std_pvector::end())
|
||||
{
|
||||
T* tmp = std_pvector::operator[](i);
|
||||
@@ -234,14 +232,14 @@ void G4RWTPtrOrderedVector<T>::resize(size_t N)
|
||||
{
|
||||
if(N>std_pvector::size())
|
||||
{
|
||||
int e=N-std_pvector::size();
|
||||
for(int i=0;i<e;i++)
|
||||
size_t e=N-std_pvector::size();
|
||||
for(size_t i=0;i<e;i++)
|
||||
std_pvector::push_back(0);
|
||||
}
|
||||
else if(N>rwsize)
|
||||
{
|
||||
iterator it=std_pvector::begin();
|
||||
for(int i=0;i<N;i++,it++);
|
||||
for(size_t i=0;i<N;i++,it++);
|
||||
std_pvector::erase(it,std_pvector::end());
|
||||
}
|
||||
}
|
||||
@@ -256,7 +254,7 @@ void G4RWTPtrOrderedVector<T>::insertAt ( size_t i, T* a )
|
||||
G4RWTHROW(G4RWBoundsErr("G4RWTPtrOrderedVector insertAt",rwsize,i));
|
||||
if(rwsize<std_pvector::size())
|
||||
{
|
||||
for(int j=rwsize;j>i;j--)
|
||||
for(size_t j=rwsize;j>i;j--)
|
||||
std_pvector::operator[](j)=std_pvector::operator[](j-1);
|
||||
std_pvector::operator[](i)=a;
|
||||
rwsize++;
|
||||
@@ -264,7 +262,7 @@ void G4RWTPtrOrderedVector<T>::insertAt ( size_t i, T* a )
|
||||
else
|
||||
{
|
||||
iterator it=std_pvector::begin();
|
||||
for(int j=0;j<i;j++,it++);
|
||||
for(size_t j=0;j<i;j++,it++);
|
||||
std_pvector::insert(it,a);
|
||||
rwsize++;
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: tpsrtvec.h,v 1.8 1999/11/26 17:17:57 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: tpsrtvec.icc,v 1.6 2000/06/26 16:25:57 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// $Id: tpsrtvec.icc,v 1.7 2000/11/20 17:26:45 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
@@ -92,8 +92,8 @@ T* G4RWTPtrSortedVector<T>::find (const T* a) const
|
||||
{
|
||||
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;
|
||||
size_t t,d;
|
||||
size_t u=rwsize,l=0;
|
||||
do
|
||||
{
|
||||
d=(u-l)/2;
|
||||
@@ -125,7 +125,7 @@ void G4RWTPtrSortedVector<T>::insert ( T* a )
|
||||
{
|
||||
//We have empty entries
|
||||
iterator it=std_pvector::begin();
|
||||
for(int i=0;i<rwsize;i++,it++);
|
||||
for(size_t i=0;i<rwsize;i++,it++);
|
||||
*it=a;
|
||||
it++;
|
||||
G4std::sort(std_pvector::begin(),it,sorter);
|
||||
@@ -210,7 +210,7 @@ size_t G4RWTPtrSortedVector<T>::removeAll ( const T* a)
|
||||
iterator e=std_pvector::end();
|
||||
iterator r;
|
||||
size_t sz=0;
|
||||
int i=0;
|
||||
G4int i=0;
|
||||
for(r=std_pvector::begin();sz<rwsize;r++,sz++)
|
||||
{
|
||||
if(i==0)
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: tpvector.h,v 1.9 2000/02/11 14:09:24 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: tpvector.icc,v 1.7 2000/03/10 15:53:24 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// $Id: tpvector.icc,v 1.8 2000/11/20 17:26:45 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
@@ -103,8 +103,8 @@ void G4RWTPtrVector<T>::resize ( size_t n )
|
||||
{
|
||||
if(n>std_pvector::size())
|
||||
{
|
||||
int e=n-std_pvector::size();
|
||||
for(int i=0;i<e;i++)
|
||||
size_t e=n-std_pvector::size();
|
||||
for(size_t i=0;i<e;i++)
|
||||
std_pvector::push_back(0);
|
||||
}
|
||||
else
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: tvordvec.h,v 1.8 2000/03/10 15:53:24 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: tvordvec.icc,v 1.5 2000/06/26 16:25:57 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// $Id: tvordvec.icc,v 1.6 2000/11/20 17:26:45 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
@@ -204,8 +204,7 @@ T G4RWTValOrderedVector<T>::removeAt( size_t i )
|
||||
G4RWTHROW(G4RWBoundsErr("G4RWTValOrderedVector removeAt",rwsize,i));
|
||||
T tmp = std_vector::operator[](i);
|
||||
iterator it=std_vector::begin();
|
||||
int j;
|
||||
for(j=0;j<rwsize && j<i;j++) it++;
|
||||
for(size_t j=0;j<rwsize && j<i;j++) it++;
|
||||
if(it!=std_vector::end())
|
||||
{
|
||||
std_vector::erase(it);
|
||||
@@ -219,14 +218,14 @@ void G4RWTValOrderedVector<T>::resize(size_t N)
|
||||
{
|
||||
if(N>std_vector::size())
|
||||
{
|
||||
int e=N-std_vector::size();
|
||||
for(int i=0;i<e;i++)
|
||||
size_t e=N-std_vector::size();
|
||||
for(size_t i=0;i<e;i++)
|
||||
std_vector::push_back(T());
|
||||
}
|
||||
else if(N>rwsize )
|
||||
{
|
||||
iterator it=std_vector::begin();
|
||||
for(int i=0;i<N;i++,it++);
|
||||
for(size_t i=0;i<N;i++,it++);
|
||||
std_vector::erase(it,std_vector::end());
|
||||
}
|
||||
}
|
||||
@@ -269,7 +268,7 @@ void G4RWTValOrderedVector<T>::insertAt ( size_t i, const T& a )
|
||||
G4RWTHROW(G4RWBoundsErr("G4RWTValOrderedVector insertAt",rwsize,i));
|
||||
if(rwsize<std_vector::size())
|
||||
{
|
||||
for(int j=rwsize;j>i;j--)
|
||||
for(size_t j=rwsize;j>i;j--)
|
||||
std_vector::operator[](j)=this->std_vector::operator[](j-1);
|
||||
std_vector::operator[](i)=a;
|
||||
rwsize++;
|
||||
@@ -277,7 +276,7 @@ void G4RWTValOrderedVector<T>::insertAt ( size_t i, const T& a )
|
||||
else
|
||||
{
|
||||
iterator it=std_vector::begin();
|
||||
for(int j=0;j<i;j++,it++);
|
||||
for(size_t j=0;j<i;j++,it++);
|
||||
std_vector::insert(it,a);
|
||||
rwsize++;
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: tvvector.h,v 1.8 2000/03/10 15:53:24 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: tvvector.icc,v 1.3 2000/03/10 15:53:24 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// $Id: tvvector.icc,v 1.4 2000/11/20 17:26:45 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
@@ -99,14 +99,14 @@ void G4RWTValVector<T>::resize(size_t N)
|
||||
{
|
||||
if(N>std_vector::size())
|
||||
{
|
||||
int e=N-std_vector::size();
|
||||
for(int i=0;i<e;i++)
|
||||
size_t e=N-std_vector::size();
|
||||
for(size_t i=0;i<e;i++)
|
||||
std_vector::push_back(T());
|
||||
}
|
||||
else
|
||||
{
|
||||
iterator it=std_vector::begin();
|
||||
for(int i=1;i<=N;i++,it++);
|
||||
for(size_t i=1;i<=N;i++,it++);
|
||||
std_vector::erase(it,std_vector::end());
|
||||
}
|
||||
rwsize=N;
|
||||
|
||||
Reference in New Issue
Block a user