Import Geant4 6.2.0 source tree
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
# $Id: GNUmakefile,v 1.3 2001/10/11 14:04:04 gcosmo Exp $
|
||||
# $Id: GNUmakefile,v 1.4 2004/06/01 15:36:12 gcosmo Exp $
|
||||
# --------------------------------------------------------------
|
||||
# GNUmakefile for global. Gabriele Cosmo, 26/9/96.
|
||||
# --------------------------------------------------------------
|
||||
@@ -8,6 +8,8 @@ name := G4global
|
||||
SUBDIRS = management HEPNumerics
|
||||
SUBLIBS = G4globman G4hepnumerics
|
||||
|
||||
GLOBLIBS =
|
||||
|
||||
ifndef G4INSTALL
|
||||
G4INSTALL = ../..
|
||||
endif
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# $Id: GNUmakefile,v 1.1 1999/01/07 16:08:51 gunter Exp $
|
||||
# $Id: GNUmakefile,v 1.2 2004/06/11 14:18:56 gcosmo Exp $
|
||||
# --------------------------------------------------------------
|
||||
# GNUmakefile for global HEPGeometry. Gabriele Cosmo, 26/9/96.
|
||||
# --------------------------------------------------------------
|
||||
@@ -11,6 +11,7 @@ endif
|
||||
|
||||
include $(G4INSTALL)/config/architecture.gmk
|
||||
|
||||
CPPFLAGS += -I$(G4BASE)/global/management/include
|
||||
CPPFLAGS += -DG4IOS_EXPORT
|
||||
CPPFLAGS += -I$(G4BASE)/global/management/include
|
||||
|
||||
include $(G4INSTALL)/config/common.gmk
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# $Id: GNUmakefile,v 1.1 1999/01/07 16:08:53 gunter Exp $
|
||||
# $Id: GNUmakefile,v 1.2 2004/06/11 14:18:57 gcosmo Exp $
|
||||
# --------------------------------------------------------------
|
||||
# GNUmakefile for global HEPNumerics. Gabriele Cosmo, 26/9/96.
|
||||
# --------------------------------------------------------------
|
||||
@@ -11,6 +11,7 @@ endif
|
||||
|
||||
include $(G4INSTALL)/config/architecture.gmk
|
||||
|
||||
CPPFLAGS += -DG4IOS_EXPORT
|
||||
CPPFLAGS += -I$(G4BASE)/global/management/include
|
||||
|
||||
include $(G4INSTALL)/config/common.gmk
|
||||
|
||||
@@ -21,12 +21,13 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4DataInterpolation.cc,v 1.4 2001/07/11 10:00:41 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-05-02-patch-01 $
|
||||
// $Id: G4DataInterpolation.cc,v 1.5 2004/04/23 06:52:57 grichine Exp $
|
||||
// GEANT4 tag $Name: geant4-06-02 $
|
||||
//
|
||||
#include "G4DataInterpolation.hh"
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Constructor for initializing of fArgument, fFunction and fNumber data members
|
||||
|
||||
G4DataInterpolation::G4DataInterpolation( G4double pX[],
|
||||
@@ -45,6 +46,8 @@ G4DataInterpolation::G4DataInterpolation( G4double pX[],
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Constructor for cubic spline interpolation. It creates the array
|
||||
// fSecondDerivative[0,...fNumber-1] which is used in this interpolation by
|
||||
// the function
|
||||
@@ -120,7 +123,7 @@ G4DataInterpolation::G4DataInterpolation( G4double pX[],
|
||||
delete[] u ;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
////////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Destructor deletes dynamically created arrays for data members: fArgument,
|
||||
// fFunction and fSecondDerivative, all have dimension of fNumber
|
||||
@@ -132,7 +135,7 @@ G4DataInterpolation::~G4DataInterpolation()
|
||||
if(fSecondDerivative) delete[] fSecondDerivative ;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
////////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// This function returns the value P(pX), where P(x) is polynom of fNumber-1 degree
|
||||
// such that P(fArgument[i]) = fFunction[i], for i = 0, ..., fNumber-1 . This is
|
||||
@@ -147,7 +150,7 @@ G4DataInterpolation::PolynomInterpolation(G4double pX,
|
||||
G4double* c = new G4double[fNumber] ;
|
||||
G4double* d = new G4double[fNumber] ;
|
||||
diff = fabs(pX-fArgument[0]) ;
|
||||
for(i=1;i<fNumber;i++)
|
||||
for(i=0;i<fNumber;i++)
|
||||
{
|
||||
difi = fabs(pX-fArgument[i]) ;
|
||||
if(difi <diff)
|
||||
@@ -184,7 +187,7 @@ G4DataInterpolation::PolynomInterpolation(G4double pX,
|
||||
return y ;
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Given arrays fArgument[0,..,fNumber-1] and fFunction[0,..,fNumber-1] , this
|
||||
// function calculates an array of coefficients. The coefficients don't provide
|
||||
@@ -233,8 +236,8 @@ G4DataInterpolation::PolIntCoefficient( G4double cof[]) const
|
||||
|
||||
|
||||
|
||||
// ----------------------------------------------------------------
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// The function returns diagonal rational function (Bulirsch and Stoer algorithm
|
||||
// of Neville type) Pn(x)/Qm(x) where P and Q are polynoms.
|
||||
// Tests showed the method is not stable and hasn't advantage if compared with
|
||||
@@ -295,8 +298,8 @@ G4DataInterpolation::RationalPolInterpolation(G4double pX,
|
||||
return y ;
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Cubic spline interpolation in point pX for function given by the table:
|
||||
// fArgument, fFunction. The constructor, which creates fSecondDerivative, must be
|
||||
// called before. The function works optimal, if sequential calls are in random
|
||||
@@ -341,7 +344,7 @@ G4DataInterpolation::CubicSplineInterpolation(G4double pX) const
|
||||
(b*b*b - b)*fSecondDerivative[kHigh])*deltaHL*deltaHL/6.0 ;
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Return cubic spline interpolation in the point pX which is located between
|
||||
// fArgument[index] and fArgument[index+1]. It is usually called in sequence of
|
||||
@@ -368,7 +371,7 @@ G4DataInterpolation::FastCubicSpline(G4double pX,
|
||||
(b*b*b - b)*fSecondDerivative[index+1])*delta*delta/6.0 ;
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Given argument pX, returns index k, so that pX bracketed by fArgument[k] and
|
||||
// fArgument[k+1]
|
||||
@@ -404,7 +407,7 @@ G4DataInterpolation::LocateArgument(G4double pX) const
|
||||
else return kLow ;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
/////////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Given a value pX, returns a value 'index' such that pX is between fArgument[index]
|
||||
// and fArgument[index+1]. fArgument MUST BE MONOTONIC, either increasing or
|
||||
@@ -496,3 +499,7 @@ G4DataInterpolation::CorrelatedSearch( G4double pX,
|
||||
}
|
||||
return ;
|
||||
}
|
||||
|
||||
//
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# $Id: GNUmakefile,v 1.1 2000/12/12 14:47:56 gunter Exp $
|
||||
# $Id: GNUmakefile,v 1.2 2004/06/11 14:18:58 gcosmo Exp $
|
||||
# --------------------------------------------------------------
|
||||
# GNUmakefile for global HEPRandom. Gunter Folger 12-Dec-2000.
|
||||
# note: this needed only to created "installed" include files.
|
||||
@@ -10,4 +10,6 @@ endif
|
||||
|
||||
include $(G4INSTALL)/config/architecture.gmk
|
||||
|
||||
CPPFLAGS += -DG4IOS_EXPORT
|
||||
|
||||
include $(G4INSTALL)/config/common.gmk
|
||||
|
||||
+39
-1
@@ -1,4 +1,4 @@
|
||||
$Id: History,v 1.121 2004/03/15 11:23:48 gcosmo Exp $
|
||||
$Id: History,v 1.128 2004/06/11 15:11:14 gcosmo Exp $
|
||||
-------------------------------------------------------------------
|
||||
|
||||
=========================================================
|
||||
@@ -17,6 +17,44 @@ committal in the CVS repository !
|
||||
* Reverse chronological order (last date on top), please *
|
||||
----------------------------------------------------------
|
||||
|
||||
Jun 11, 2004 G.Cosmo (global-V06-01-02c)
|
||||
- Use global flag G4IOS_EXPORT to export extern symbols for DLLs.
|
||||
Modified granular GNUmakefiles and corrected G4ios.cc to the new scheme.
|
||||
- Does NOT include developments introduced in "global-V06-01-02".
|
||||
|
||||
Jun 9, 2004 G.Cosmo (global-V06-01-02b)
|
||||
- Adopt G4DLLIMPORT/G4DLLEXPORT technique to handle extern simbols for
|
||||
allowing support of DLLs on Windows.
|
||||
- Does NOT include developments introduced in "global-V06-01-02".
|
||||
|
||||
Jun 7, 2004 G.Cosmo (global-V06-01-02a)
|
||||
- Added support for building DLLs on Windows:
|
||||
o Added macros for importing symbols.
|
||||
o Migrated G4ios and G4strstreambuf.
|
||||
- Does NOT include developments introduced in "global-V06-01-02".
|
||||
|
||||
May 26, 2004 G.Cosmo (global-V06-01-02)
|
||||
- New implementation of the G4Allocator based on a pool of memory-chunks.
|
||||
The size of a single chunk is kept at 1Kb as for the old allocator.
|
||||
This implementation replaces the old G4Allocator based on pages and no
|
||||
longer portable on the new gcc-3.4.0 compiler.
|
||||
The new allocator also supports the standard interface required for STL
|
||||
containers, in case it will be used as alternative allocator instead of
|
||||
the default std::allocator.
|
||||
o New classes: G4AllocatorPool
|
||||
o Removed classes: G4AllocatorPage, G4AllocatorUnit.
|
||||
- Added unit test for allocation of std::vector collections.
|
||||
|
||||
May 14, 2004 G.Cosmo (global-V06-01-01)
|
||||
- G4Allocator: added utility methods for explicitely deallocate storage
|
||||
and print total allocated pages size:
|
||||
ResetStorage(), GetAllocatedSize().
|
||||
- Added unit test for deallocation.
|
||||
|
||||
April 23, 2004 G.Cosmo (global-V06-01-00)
|
||||
- Fixed bug in HEPNumerics/G4DataInterpolation::PolynomInterpolation()
|
||||
for indexing in a for-loop. (V.Grichine)
|
||||
|
||||
March 15, 2004 G.Cosmo (global-V06-00-01)
|
||||
- Removed obsolete "includes" target in management/GNUmakefile.
|
||||
- Corrected comments in G4UserLimits.hh.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# $Id: GNUmakefile,v 1.4 2004/03/15 11:23:32 gcosmo Exp $
|
||||
# $Id: GNUmakefile,v 1.5 2004/06/11 14:18:58 gcosmo Exp $
|
||||
# --------------------------------------------------------------
|
||||
# GNUmakefile for global management. Gabriele Cosmo, 26/9/96.
|
||||
# --------------------------------------------------------------
|
||||
@@ -11,4 +11,6 @@ endif
|
||||
|
||||
include $(G4INSTALL)/config/architecture.gmk
|
||||
|
||||
CPPFLAGS += -DG4IOS_EXPORT
|
||||
|
||||
include $(G4INSTALL)/config/common.gmk
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4Allocator.hh,v 1.12 2003/03/25 14:56:17 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-05-02-patch-01 $
|
||||
// $Id: G4Allocator.hh,v 1.14 2004/05/14 17:40:21 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-06-02 $
|
||||
//
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
@@ -61,6 +61,14 @@ class G4Allocator
|
||||
// Malloc and Free methods to be used when overloading
|
||||
// new and delete operators in the client <Type> object
|
||||
|
||||
inline void ResetStorage();
|
||||
// Returns allocated storage to the free store, resets
|
||||
// allocator and page sizes.
|
||||
// Note: contents in memory are lost using this call !
|
||||
|
||||
inline int GetAllocatedSize();
|
||||
// Returns the size of the total memory allocated
|
||||
|
||||
private:
|
||||
|
||||
void AddNewPage();
|
||||
@@ -149,8 +157,8 @@ void G4Allocator<Type>::FreeSingle(Type* anElement)
|
||||
|
||||
// The gcc-3.1 compiler will complain and not correctly handle offsets
|
||||
// computed from non-POD types. Pointers to member data should be used
|
||||
// instead. This advanced C++ feature seems not to work on earlier
|
||||
// versions of the same compiler.
|
||||
// instead. This C++ feature seems not to work on earlier versions of
|
||||
// the same compiler.
|
||||
//
|
||||
#if (__GNUC__==3) && (__GNUC_MINOR__>0)
|
||||
Type G4AllocatorUnit<Type>::*pOffset = &G4AllocatorUnit<Type>::fElement;
|
||||
@@ -194,6 +202,54 @@ void G4Allocator<Type>::AddNewPage()
|
||||
fFreeList = &aPage->fUnits[0];
|
||||
}
|
||||
|
||||
// ************************************************************
|
||||
// ResetStorage
|
||||
// ************************************************************
|
||||
//
|
||||
template <class Type>
|
||||
void G4Allocator<Type>::ResetStorage()
|
||||
{
|
||||
// Clear all allocated storage and return it to the free store
|
||||
//
|
||||
G4AllocatorPage<Type> * aPage;
|
||||
G4AllocatorPage<Type> * aNextPage;
|
||||
|
||||
aPage = fPages;
|
||||
while (aPage != 0)
|
||||
{
|
||||
aNextPage = aPage->fNext;
|
||||
free(aPage->fUnits);
|
||||
delete aPage;
|
||||
aPage = aNextPage;
|
||||
}
|
||||
|
||||
// Reset unit&page size and allocate a single page
|
||||
//
|
||||
fPages = 0;
|
||||
fFreeList = 0;
|
||||
fUnitSize = sizeof(G4AllocatorUnit<Type>);
|
||||
fPageSize = ( (fUnitSize < 512) ? 1024 : (fUnitSize*10) );
|
||||
AddNewPage();
|
||||
}
|
||||
|
||||
// ************************************************************
|
||||
// GetAllocatedSize
|
||||
// ************************************************************
|
||||
//
|
||||
template <class Type>
|
||||
int G4Allocator<Type>::GetAllocatedSize()
|
||||
{
|
||||
G4AllocatorPage<Type> * aPage = fPages;
|
||||
int count = 0;
|
||||
|
||||
while (aPage != 0)
|
||||
{
|
||||
aPage = aPage->fNext;
|
||||
count++;
|
||||
}
|
||||
return count*fPageSize;
|
||||
}
|
||||
|
||||
// ************************************************************
|
||||
// AddNewElement
|
||||
// ************************************************************
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4Types.hh,v 1.7 2003/06/17 08:14:50 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-06-00-patch-01 $
|
||||
// $Id: G4Types.hh,v 1.9 2004/06/09 07:30:01 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-06-02 $
|
||||
//
|
||||
//
|
||||
// GEANT4 native types
|
||||
@@ -32,11 +32,26 @@
|
||||
#ifndef G4TYPES_HH
|
||||
#define G4TYPES_HH
|
||||
|
||||
// Disable warning C4786 on WIN32 architectures: identifier was truncated
|
||||
// to '255' characters in the debug information
|
||||
//
|
||||
#ifdef WIN32
|
||||
// Disable warning C4786 on WIN32 architectures:
|
||||
// identifier was truncated to '255' characters
|
||||
// in the debug information
|
||||
//
|
||||
#pragma warning ( disable : 4786 )
|
||||
//
|
||||
// Define DLL export macro for WIN32 systems for
|
||||
// importing/exporting external symbols to DLLs
|
||||
//
|
||||
#if defined G4LIB_BUILD_DLL
|
||||
#define G4DLLEXPORT __declspec( dllexport )
|
||||
#define G4DLLIMPORT __declspec( dllimport )
|
||||
#else
|
||||
#define G4DLLEXPORT
|
||||
#define G4DLLIMPORT
|
||||
#endif
|
||||
#else
|
||||
#define G4DLLEXPORT
|
||||
#define G4DLLIMPORT
|
||||
#endif
|
||||
|
||||
// Disable deprecated warnings for usage of strstream on Linux
|
||||
@@ -45,7 +60,7 @@
|
||||
#if (__GNUC__==3) && (__GNUC_MINOR__>0)
|
||||
#undef __DEPRECATED
|
||||
#endif
|
||||
|
||||
|
||||
#include <CLHEP/config/CLHEP.h>
|
||||
#include <complex>
|
||||
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4ios.hh,v 1.7 2003/06/06 16:17:14 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-05-02-patch-01 $
|
||||
// $Id: G4ios.hh,v 1.9 2004/06/09 07:30:01 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-06-02 $
|
||||
//
|
||||
//
|
||||
// ---------------------------------------------------------------
|
||||
@@ -36,20 +36,15 @@
|
||||
|
||||
#include "G4Types.hh"
|
||||
|
||||
#if defined(OO_DDL_TRANSLATION)
|
||||
/*
|
||||
* stdlib needs to be included before iostream.h
|
||||
* during oddlx runs to work around a parser
|
||||
* problem of AIX ooddlx v4.0.2 with some versions of
|
||||
* AIX system header files.
|
||||
*/
|
||||
#include <stdlib.h>
|
||||
#endif
|
||||
|
||||
#include <iostream>
|
||||
|
||||
extern std::ostream G4cout;
|
||||
extern std::ostream G4cerr;
|
||||
#if defined G4IOS_EXPORT
|
||||
extern G4DLLEXPORT std::ostream G4cout;
|
||||
extern G4DLLEXPORT std::ostream G4cerr;
|
||||
#else
|
||||
extern G4DLLIMPORT std::ostream G4cout;
|
||||
extern G4DLLIMPORT std::ostream G4cerr;
|
||||
#endif
|
||||
|
||||
#define G4cin std::cin
|
||||
#define G4endl std::endl
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4strstreambuf.hh,v 1.10 2003/06/06 16:17:14 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-05-02-patch-01 $
|
||||
// $Id: G4strstreambuf.hh,v 1.12 2004/06/09 07:30:02 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-06-02 $
|
||||
//
|
||||
//
|
||||
// ---------------------------------------------------------------
|
||||
@@ -40,8 +40,14 @@
|
||||
#include "G4coutDestination.hh"
|
||||
|
||||
class G4strstreambuf;
|
||||
extern G4strstreambuf G4coutbuf;
|
||||
extern G4strstreambuf G4cerrbuf;
|
||||
|
||||
#if defined G4IOS_EXPORT
|
||||
extern G4DLLEXPORT G4strstreambuf G4coutbuf;
|
||||
extern G4DLLEXPORT G4strstreambuf G4cerrbuf;
|
||||
#else
|
||||
extern G4DLLIMPORT G4strstreambuf G4coutbuf;
|
||||
extern G4DLLIMPORT G4strstreambuf G4cerrbuf;
|
||||
#endif
|
||||
|
||||
class G4strstreambuf : public std::streambuf
|
||||
{
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4ios.cc,v 1.6 2003/06/06 16:17:18 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-05-02-patch-01 $
|
||||
// $Id: G4ios.cc,v 1.8 2004/06/11 14:18:59 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-06-02 $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user