9 added files
trf++/include/trfclhep
diff -N DiagMatrix.icc
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ DiagMatrix.icc 6 Dec 2011 03:40:15 -0000 1.1
@@ -0,0 +1,148 @@
+// -*- C++ -*-
+// ---------------------------------------------------------------------------
+//
+// This file is a part of the CLHEP - a Class Library for High Energy Physics.
+//
+//
+// Copyright Cornell University 1993, 1996, All Rights Reserved.
+//
+// This software written by Nobu Katayama and Mike Smyth, Cornell University.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions
+// are met:
+// 1. Redistributions of source code must retain the above copyright
+// notice and author attribution, this list of conditions and the
+// following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright
+// notice and author attribution, this list of conditions and the
+// following disclaimer in the documentation and/or other materials
+// provided with the distribution.
+// 3. Neither the name of the University nor the names of its contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+// Creation of derivative forms of this software for commercial
+// utilization may be subject to restriction; written permission may be
+// obtained from Cornell University.
+//
+// CORNELL MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way
+// of example, but not limitation, CORNELL MAKES NO REPRESENTATIONS OR
+// WARRANTIES OF MERCANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT
+// THE USE OF THIS SOFTWARE OR DOCUMENTATION WILL NOT INFRINGE ANY PATENTS,
+// COPYRIGHTS, TRADEMARKS, OR OTHER RIGHTS. Cornell University shall not be
+// held liable for any liability with respect to any claim by the user or any
+// other party arising from use of the program.
+//
+
+namespace CLHEP {
+
+inline HepDiagMatrix::HepDiagMatrix()
+ : m(0), nrow(0)
+{}
+
+inline int HepDiagMatrix::num_row() const { return nrow;}
+inline int HepDiagMatrix::num_col() const { return nrow;}
+inline int HepDiagMatrix::num_size() const { return nrow;}
+
+inline double & HepDiagMatrix::fast(int row,int col)
+{
+#ifdef MATRIX_BOUND_CHECK
+ if (row<1 || row>nrow || col<1 || col>nrow)
+ error("Range error in HepDiagMatrix::fast()");
+#endif
+ if (row != col)
+ error("Index error in HepDiagMatrix::fast(i,j): i != j");
+
+ return *(m.begin()+(col-1));
+}
+
+inline const double & HepDiagMatrix::fast(int row,int col) const
+{
+#ifdef MATRIX_BOUND_CHECK
+ if (row<1 || row>nrow || col<1 || col>nrow)
+ error("Range error in HepDiagMatrix::fast()");
+#endif
+ if (row == col) {
+ return *(m.begin()+(col-1));
+ } else {
+#if defined(__sun) || !defined(__GNUG__)
+//
+// Sun CC 4.0.1 has this bug.
+//
+ zero = 0;
+#endif
+ return zero;
+ }
+}
+
+inline double & HepDiagMatrix::operator()(int row, int col)
+{
+ return fast(col,row);
+}
+
+inline const double & HepDiagMatrix::operator()(int row, int col) const
+{
+ return fast(col,row);
+}
+
+inline void HepDiagMatrix::assign(const HepDiagMatrix &m2) {(*this)=m2;}
+
+inline HepDiagMatrix HepDiagMatrix::T() const {return HepDiagMatrix(*this);}
+
+inline HepDiagMatrix::HepDiagMatrix_row HepDiagMatrix::operator[] (int r)
+#ifdef HEP_GNU_OPTIMIZED_RETURN
+ return b(*this,r);
+{
+#else
+{
+ HepDiagMatrix_row b(*this,r);
+#endif
+ return b;
+}
+
+inline HepDiagMatrix::HepDiagMatrix_row_const HepDiagMatrix::operator[] (int r) const
+#ifdef HEP_GNU_OPTIMIZED_RETURN
+ return b(*this,r);
+{
+#else
+{
+ const HepDiagMatrix_row_const b(*this,r);
+#endif
+ return b;
+}
+
+inline double &HepDiagMatrix::HepDiagMatrix_row::operator[](int c)
+{
+ return _a.fast(_r+1, c+1);
+}
+
+inline const double&
+HepDiagMatrix::HepDiagMatrix_row_const::operator[](int c) const
+{
+ return _a.fast(_r+1,c+1);
+}
+
+inline HepDiagMatrix::HepDiagMatrix_row::HepDiagMatrix_row
+(HepDiagMatrix& a, int r)
+ : _a(a), _r(r)
+{}
+
+inline HepDiagMatrix::HepDiagMatrix_row_const::HepDiagMatrix_row_const
+(const HepDiagMatrix& a, int r)
+ : _a(a), _r(r)
+{}
+
+inline HepDiagMatrix HepDiagMatrix::inverse(int &ierr) const
+#ifdef HEP_GNU_OPTIMIZED_RETURN
+ return mTmp(*this);
+{
+#else
+{
+ HepDiagMatrix mTmp(*this);
+#endif
+ mTmp.invert(ierr);
+ return mTmp;
+}
+
+} // namespace CLHEP
trf++/include/trfclhep
diff -N GenMatrix.icc
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ GenMatrix.icc 6 Dec 2011 03:40:15 -0000 1.1
@@ -0,0 +1,94 @@
+// -*- C++ -*-
+// ---------------------------------------------------------------------------
+//
+// This file is a part of the CLHEP - a Class Library for High Energy Physics.
+//
+//
+// Copyright Cornell University 1993, 1996, All Rights Reserved.
+//
+// This software written by Nobu Katayama and Mike Smyth, Cornell University.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions
+// are met:
+// 1. Redistributions of source code must retain the above copyright
+// notice and author attribution, this list of conditions and the
+// following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright
+// notice and author attribution, this list of conditions and the
+// following disclaimer in the documentation and/or other materials
+// provided with the distribution.
+// 3. Neither the name of the University nor the names of its contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+// Creation of derivative forms of this software for commercial
+// utilization may be subject to restriction; written permission may be
+// obtained from Cornell University.
+//
+// CORNELL MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way
+// of example, but not limitation, CORNELL MAKES NO REPRESENTATIONS OR
+// WARRANTIES OF MERCANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT
+// THE USE OF THIS SOFTWARE OR DOCUMENTATION WILL NOT INFRINGE ANY PATENTS,
+// COPYRIGHTS, TRADEMARKS, OR OTHER RIGHTS. Cornell University shall not be
+// held liable for any liability with respect to any claim by the user or any
+// other party arising from use of the program.
+//
+
+namespace CLHEP {
+
+// swap
+//
+inline void HepGenMatrix::swap(int &i,int &j) {int t=i;i=j;j=t;}
+#ifdef DISABLE_ALLOC
+inline void HepGenMatrix::swap(std::vector<double >& i, std::vector<double >& j) {
+ std::vector<double > t=i;i=j;j=t;
+}
+#else
+inline void HepGenMatrix::swap(std::vector<double,Alloc<double,25> >& i, std::vector<double,Alloc<double,25> >& j) {
+ std::vector<double,Alloc<double,25> > t=i;i=j;j=t;
+}
+#endif
+
+//
+// operator [] (I cannot make it virtual because return types are different.)
+// Therefore I will have to use the virtual operator (,).
+//
+inline double &HepGenMatrix::HepGenMatrix_row::operator[](int c) {
+ return _a(_r+1,c+1);
+}
+
+inline const double &HepGenMatrix::HepGenMatrix_row_const::
+operator[](int c) const {
+ return _a(_r+1,c+1);
+}
+
+inline HepGenMatrix::HepGenMatrix_row HepGenMatrix::operator[](int r) {
+ HepGenMatrix_row b(*this,r);
+ return b;
+}
+
+inline const HepGenMatrix::HepGenMatrix_row_const HepGenMatrix::
+operator[](int r) const{
+ HepGenMatrix_row_const b(*this,r);
+ return b;
+}
+
+inline HepGenMatrix::HepGenMatrix_row::HepGenMatrix_row(HepGenMatrix&a,int r)
+: _a(a) {
+ _r = r;
+}
+
+inline HepGenMatrix::HepGenMatrix_row_const::
+HepGenMatrix_row_const (const HepGenMatrix&a, int r)
+ : _a(a) {
+ _r = r;
+}
+
+
+} // namespace CLHEP
+
+
+// -----------------------------------------------------------------
+
+
trf++/include/trfclhep
diff -N Matrix.icc
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ Matrix.icc 6 Dec 2011 03:40:15 -0000 1.1
@@ -0,0 +1,120 @@
+// -*- C++ -*-
+// ---------------------------------------------------------------------------
+//
+// This file is a part of the CLHEP - a Class Library for High Energy Physics.
+//
+//
+// Copyright Cornell University 1993, 1996, All Rights Reserved.
+//
+// This software written by Nobu Katayama and Mike Smyth, Cornell University.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions
+// are met:
+// 1. Redistributions of source code must retain the above copyright
+// notice and author attribution, this list of conditions and the
+// following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright
+// notice and author attribution, this list of conditions and the
+// following disclaimer in the documentation and/or other materials
+// provided with the distribution.
+// 3. Neither the name of the University nor the names of its contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+// Creation of derivative forms of this software for commercial
+// utilization may be subject to restriction; written permission may be
+// obtained from Cornell University.
+//
+// CORNELL MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way
+// of example, but not limitation, CORNELL MAKES NO REPRESENTATIONS OR
+// WARRANTIES OF MERCANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT
+// THE USE OF THIS SOFTWARE OR DOCUMENTATION WILL NOT INFRINGE ANY PATENTS,
+// COPYRIGHTS, TRADEMARKS, OR OTHER RIGHTS. Cornell University shall not be
+// held liable for any liability with respect to any claim by the user or any
+// other party arising from use of the program.
+//
+// This is the definitions of the inline member functions of the
+// HepMatrix class
+//
+
+namespace CLHEP {
+
+inline HepMatrix::HepMatrix()
+ : m(0), nrow(0), ncol(0), size(0) {}
+
+inline HepMatrix::HepMatrix_row HepMatrix::operator[] (int r)
+#ifdef HEP_GNU_OPTIMIZED_RETURN
+ return b(*this,r);
+{
+#else
+{
+ HepMatrix_row b(*this,r);
+#endif
+ return b;
+}
+
+inline const HepMatrix::HepMatrix_row_const HepMatrix::operator[] (int r) const
+#ifdef HEP_GNU_OPTIMIZED_RETURN
+ return b(*this,r);
+{
+#else
+{
+ HepMatrix_row_const b(*this,r);
+#endif
+ return b;
+}
+
+inline double &HepMatrix::HepMatrix_row::operator[](int c) {
+#ifdef MATRIX_BOUND_CHECK
+ if (_r<0 || _r>=_a.num_row() || c<0 || c>=_a.num_col())
+ HepGenMatrix::error("Range error in HepMatrix::operator[][]");
+#endif
+ return *(_a.m.begin()+_r*_a.ncol+c);
+}
+
+inline const double &HepMatrix::HepMatrix_row_const::operator[](int c) const
+{
+#ifdef MATRIX_BOUND_CHECK
+ if (_r<0 || _r>=_a.num_row() || c<0 || c>=_a.num_col())
+ HepGenMatrix::error("Range error in HepMatrix::operator[][]");
+#endif
+ return *(_a.m.begin()+_r*_a.ncol+c);
+}
+
+inline HepMatrix::HepMatrix_row::HepMatrix_row(HepMatrix&a,int r)
+: _a(a) {
+ _r = r;
+}
+
+inline HepMatrix::HepMatrix_row_const::HepMatrix_row_const
+(const HepMatrix&a, int r)
+ : _a(a)
+{
+ _r = r;
+}
+
+// This function swaps two Matrices without doing a full copy.
+inline void swap(HepMatrix &m1,HepMatrix &m2) {
+ HepGenMatrix::swap(m1.m,m2.m);
+/*** commented
+ HepGenMatrix::swap(m1.nrow,m2.nrow);
+ HepGenMatrix::swap(m1.ncol,m2.ncol);
+ HepGenMatrix::swap(m1.size,m2.size);
+*/
+}
+
+ /*-ap inline */ HepMatrix HepMatrix::inverse(int &ierr) const
+#ifdef HEP_GNU_OPTIMIZED_RETURN
+ return mTmp(*this);
+{
+#else
+{
+ HepMatrix mTmp(*this);
+#endif
+ mTmp.invert(ierr);
+ return mTmp;
+}
+
+} // namespace CLHEP
+
trf++/include/trfclhep
diff -N RandFlat.icc
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ RandFlat.icc 6 Dec 2011 03:40:15 -0000 1.1
@@ -0,0 +1,162 @@
+// $Id: RandFlat.icc,v 1.1 2011/12/06 03:40:15 ngraf Exp $
+// -*- C++ -*-
+//
+// -----------------------------------------------------------------------
+// HEP Random
+// --- RandFlat ---
+// inlined functions implementation file
+// -----------------------------------------------------------------------
+// This file is part of Geant4 (simulation toolkit for HEP).
+
+// =======================================================================
+// Gabriele Cosmo - Created: 5th September 1995
+// Peter Urban - ShootBit() and related stuff added: 5th Sep 1996
+// Gabriele Cosmo - Additional methods to fill arrays specifying
+// boundaries: 24th Jul 1997
+// - Fixed bug in shootInt(m,n): 25th Sep 1997
+// J.Marraffino - Added default arguments as attributes: 16th Feb 1998
+// M.Fischler - Corrected initialization of deleteEngine which should
+// be true for all constructors taking HepRandomEngine*.
+// =======================================================================
+
+namespace CLHEP {
+
+inline RandFlat::RandFlat(HepRandomEngine & anEngine)
+: HepRandom(), firstUnusedBit(0), localEngine(&anEngine, do_nothing_deleter()),
+ defaultWidth(1.0), defaultA(0.0), defaultB(1.0) {}
+
+inline RandFlat::RandFlat(HepRandomEngine & anEngine, double width )
+: HepRandom(), firstUnusedBit(0), localEngine(&anEngine, do_nothing_deleter()),
+ defaultWidth(width), defaultA(0.0), defaultB(width) {}
+
+inline RandFlat::RandFlat(HepRandomEngine & anEngine, double a,
+ double b )
+: HepRandom(), firstUnusedBit(0), localEngine(&anEngine, do_nothing_deleter()),
+ defaultWidth(b-a), defaultA(a), defaultB(b) {}
+
+inline RandFlat::RandFlat(HepRandomEngine * anEngine)
+: HepRandom(), firstUnusedBit(0), localEngine(anEngine),
+ defaultWidth(1.0), defaultA(0.0), defaultB(1.0) {}
+
+inline RandFlat::RandFlat(HepRandomEngine * anEngine, double width )
+: HepRandom(), firstUnusedBit(0), localEngine(anEngine),
+ defaultWidth(width), defaultA(0.0), defaultB(width) {}
+
+inline RandFlat::RandFlat(HepRandomEngine * anEngine, double a,
+ double b )
+: HepRandom(), firstUnusedBit(0), localEngine(anEngine),
+ defaultWidth(b-a), defaultA(a), defaultB(b) {}
+
+inline double RandFlat::shoot(double a, double b) {
+ return (b-a)* shoot() + a;
+}
+
+inline double RandFlat::shoot(double width) {
+ return width * shoot();
+}
+
+inline long RandFlat::shootInt(long n) {
+ return long(shoot()*double(n));
+}
+
+inline long RandFlat::shootInt(long m, long n) {
+ return long(shoot()*double(n-m)) + m;
+}
+
+inline void RandFlat::shootBits() {
+ const double factor= 2.0*MSB; // this should fit into a double!
+ staticFirstUnusedBit= MSB;
+ staticRandomInt= (unsigned long)(factor*shoot());
+}
+
+inline int RandFlat::shootBit() {
+ if (staticFirstUnusedBit==0)
+ shootBits();
+ unsigned long temp= staticFirstUnusedBit&staticRandomInt;
+ staticFirstUnusedBit>>= 1;
+ return temp!=0;
+}
+
+//---------------------
+
+inline double RandFlat::shoot(HepRandomEngine* anEngine) {
+ return anEngine->flat();
+}
+
+
+inline double RandFlat::shoot(HepRandomEngine* anEngine,
+ double a, double b) {
+ return (b-a)* anEngine->flat() + a;
+}
+
+inline double RandFlat::shoot(HepRandomEngine* anEngine,
+ double width) {
+ return width * anEngine->flat();
+}
+
+inline long RandFlat::shootInt(HepRandomEngine* anEngine,
+ long n) {
+ return long(anEngine->flat()*double(n));
+}
+
+inline long RandFlat::shootInt(HepRandomEngine* anEngine,
+ long m, long n) {
+ return long(double(n-m)*anEngine->flat()) + m;
+}
+
+inline void RandFlat::shootArray(HepRandomEngine* anEngine,
+ const int size, double* vect) {
+ anEngine->flatArray(size,vect);
+}
+
+inline void RandFlat::shootBits(HepRandomEngine* engine) {
+ const double factor= 2.0*MSB; // this should fit into a double!
+ staticFirstUnusedBit= MSB;
+ staticRandomInt= (unsigned long)(factor*shoot(engine));
+}
+
+inline int RandFlat::shootBit(HepRandomEngine* engine) {
+ if (staticFirstUnusedBit==0)
+ shootBits(engine);
+ unsigned long temp= staticFirstUnusedBit&staticRandomInt;
+ staticFirstUnusedBit>>= 1;
+ return temp!=0;
+}
+
+//---------------------
+
+inline double RandFlat::fire() {
+ return (defaultB-defaultA)*localEngine->flat()+defaultA;
+}
+
+inline double RandFlat::fire(double a, double b) {
+ return (b-a)* localEngine->flat() + a;
+}
+
+inline double RandFlat::fire(double width) {
+ return width * localEngine->flat();
+}
+
+inline long RandFlat::fireInt(long n) {
+ return long(localEngine->flat()*double(n));
+}
+
+inline long RandFlat::fireInt(long m, long n) {
+ return long(localEngine->flat()*double(n-m)) + m;
+}
+
+inline void RandFlat::fireBits() {
+ const double factor= 2.0*MSB; // this should fit into a double!
+ firstUnusedBit= MSB;
+ randomInt= (unsigned long)(factor*localEngine->flat());
+}
+
+inline int RandFlat::fireBit() {
+ if (firstUnusedBit==0)
+ fireBits();
+ unsigned long temp= firstUnusedBit&randomInt;
+ firstUnusedBit>>= 1;
+ return temp!=0;
+}
+
+} // namespace CLHEP
trf++/include/trfclhep
diff -N RandGauss.icc
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ RandGauss.icc 6 Dec 2011 03:40:15 -0000 1.1
@@ -0,0 +1,44 @@
+// $Id: RandGauss.icc,v 1.1 2011/12/06 03:40:15 ngraf Exp $
+// -*- C++ -*-
+//
+// -----------------------------------------------------------------------
+// HEP Random
+// --- RandGauss ---
+// inlined functions implementation file
+// -----------------------------------------------------------------------
+// This file is part of Geant4 (simulation toolkit for HEP).
+
+// =======================================================================
+// Gabriele Cosmo - Created: 19th August 1998
+// =======================================================================
+
+namespace CLHEP {
+
+inline RandGauss::RandGauss(HepRandomEngine & anEngine, double mean,
+ double stdDev )
+: HepRandom(), defaultMean(mean), defaultStdDev(stdDev),
+ localEngine(&anEngine, do_nothing_deleter()), set(false), nextGauss(0.0){}
+
+inline RandGauss::RandGauss(HepRandomEngine * anEngine, double mean,
+ double stdDev )
+: HepRandom(), defaultMean(mean), defaultStdDev(stdDev),
+ localEngine(anEngine), set(false), nextGauss(0.0) {}
+
+inline double RandGauss::shoot(double mean, double stdDev) {
+ return shoot()*stdDev + mean;
+}
+
+inline double RandGauss::shoot(HepRandomEngine* anEngine,
+ double mean, double stdDev) {
+ return shoot(anEngine)*stdDev + mean;
+}
+
+inline double RandGauss::fire() {
+ return normal()*defaultStdDev + defaultMean;
+}
+
+inline double RandGauss::fire(double mean, double stdDev) {
+ return normal()*stdDev + mean;
+}
+
+} // namespace CLHEP
trf++/include/trfclhep
diff -N Random.icc
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ Random.icc 6 Dec 2011 03:40:15 -0000 1.1
@@ -0,0 +1,32 @@
+// $Id: Random.icc,v 1.1 2011/12/06 03:40:15 ngraf Exp $
+// -*- C++ -*-
+//
+// -----------------------------------------------------------------------
+// HEP Random
+// --- HepRandom ---
+// inlined functions implementation file
+// -----------------------------------------------------------------------
+// This file is part of Geant4 (simulation toolkit for HEP).
+
+// =======================================================================
+// Gabriele Cosmo - Created: 5th September 1995
+// - Added methods for engine status: 19th November 1996
+// - operator()() is now virtual: 28th July 1997
+// - Simplified initialisation of static generator: 5th Jan 1999
+// =======================================================================
+
+namespace CLHEP {
+
+inline double HepRandom::flat(HepRandomEngine* theNewEngine)
+{
+ return theNewEngine->flat();
+}
+
+inline void HepRandom::flatArray(HepRandomEngine* theNewEngine,
+ const int size, double* vect)
+{
+ theNewEngine->flatArray(size,vect);
+}
+
+} // namespace CLHEP
+
trf++/include/trfclhep
diff -N RandomEngine.icc
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ RandomEngine.icc 6 Dec 2011 03:40:15 -0000 1.1
@@ -0,0 +1,70 @@
+// $Id: RandomEngine.icc,v 1.1 2011/12/06 03:40:15 ngraf Exp $
+// -*- C++ -*-
+//
+// -----------------------------------------------------------------------
+// HEP Random
+// --- HepRandomEngine ---
+// inlined functions implementation file
+// -----------------------------------------------------------------------
+// This file is part of Geant4 (simulation toolkit for HEP).
+
+// =======================================================================
+// Gabriele Cosmo - Created: 5th September 1995
+// - Added == and != operators: 19th November 1996
+// - Moved seeds table to HepRandom: 19th March 1998
+// =======================================================================
+
+#include <cmath>
+
+namespace CLHEP {
+
+inline bool HepRandomEngine::operator==(const HepRandomEngine& engine) {
+ return (this==&engine);
+}
+
+inline bool HepRandomEngine::operator!=(const HepRandomEngine& engine) {
+ return (this!=&engine);
+}
+
+inline double HepRandomEngine::exponent_bit_32() {
+ static double exponent_bit_32 = std::pow(2.0, 32.0);
+ return exponent_bit_32;
+}
+
+inline double HepRandomEngine::mantissa_bit_12() {
+ static double mantissa_bit_12 = std::pow(0.5, 12.0);
+ return mantissa_bit_12;
+}
+
+inline double HepRandomEngine::mantissa_bit_24() {
+ static double mantissa_bit_24 = std::pow(0.5, 24.0);
+ return mantissa_bit_24;
+}
+
+inline double HepRandomEngine::twoToMinus_32() {
+ static double twoToMinus_32 = std::ldexp(1.0, -32);
+ return twoToMinus_32;
+}
+
+inline double HepRandomEngine::twoToMinus_48() {
+ static double twoToMinus_48 = std::ldexp(1.0, -48);
+ return twoToMinus_48;
+}
+
+inline double HepRandomEngine::twoToMinus_49() {
+ static double twoToMinus_49 = std::ldexp(1.0, -49);
+ return twoToMinus_49;
+}
+
+inline double HepRandomEngine::twoToMinus_53() {
+ static double twoToMinus_53 = std::ldexp(1.0, -53);
+ return twoToMinus_53;
+}
+
+inline double HepRandomEngine::nearlyTwoToMinus_54() {
+ static double nearlyTwoToMinus_54 = std::ldexp(1.0, -54)
+ - std::ldexp(1.0, -100);
+ return nearlyTwoToMinus_54;
+}
+
+} // namespace CLHEP
trf++/include/trfclhep
diff -N SymMatrix.icc
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ SymMatrix.icc 6 Dec 2011 03:40:15 -0000 1.1
@@ -0,0 +1,151 @@
+// -*- C++ -*-
+// ---------------------------------------------------------------------------
+//
+// This file is a part of the CLHEP - a Class Library for High Energy Physics.
+//
+//
+// Copyright Cornell University 1993, 1996, All Rights Reserved.
+//
+// This software written by Nobu Katayama and Mike Smyth, Cornell University.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions
+// are met:
+// 1. Redistributions of source code must retain the above copyright
+// notice and author attribution, this list of conditions and the
+// following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright
+// notice and author attribution, this list of conditions and the
+// following disclaimer in the documentation and/or other materials
+// provided with the distribution.
+// 3. Neither the name of the University nor the names of its contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+// Creation of derivative forms of this software for commercial
+// utilization may be subject to restriction; written permission may be
+// obtained from Cornell University.
+//
+// CORNELL MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way
+// of example, but not limitation, CORNELL MAKES NO REPRESENTATIONS OR
+// WARRANTIES OF MERCANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT
+// THE USE OF THIS SOFTWARE OR DOCUMENTATION WILL NOT INFRINGE ANY PATENTS,
+// COPYRIGHTS, TRADEMARKS, OR OTHER RIGHTS. Cornell University shall not be
+// held liable for any liability with respect to any claim by the user or any
+// other party arising from use of the program.
+//
+// This is the definitions of the inline member functions of the
+// HepSymMatrix class
+//
+
+namespace CLHEP {
+
+inline HepSymMatrix::HepSymMatrix()
+ : m(0), nrow(0), size(0)
+{}
+
+inline int HepSymMatrix::num_row() const { return nrow;}
+inline int HepSymMatrix::num_col() const { return nrow;}
+inline int HepSymMatrix::num_size() const { return size;}
+
+inline double & HepSymMatrix::fast(int row,int col)
+{
+#ifdef MATRIX_BOUND_CHECK
+ if(row<1||row>num_row() || col<1||col>num_col())
+ error("Range error in HepSymMatrix::fast()");
+#endif
+ return *(m.begin()+(row*(row-1))/2+(col-1));
+}
+inline const double & HepSymMatrix::fast(int row,int col) const
+{
+#ifdef MATRIX_BOUND_CHECK
+ if(row<1||row>num_row() || col<1||col>num_col())
+ error("Range error in HepSymMatrix::fast()");
+#endif
+ return *(m.begin()+(row*(row-1))/2+(col-1));
+}
+
+inline double & HepSymMatrix::operator()(int row, int col)
+ {return (row>=col? fast(row,col) : fast(col,row));}
+inline const double & HepSymMatrix::operator()(int row, int col) const
+ {return (row>=col? fast(row,col) : fast(col,row));}
+
+inline void HepSymMatrix::assign(const HepSymMatrix &m2)
+ {(*this)=m2;}
+
+inline HepSymMatrix HepSymMatrix::T() const {return HepSymMatrix(*this);}
+
+inline HepSymMatrix::HepSymMatrix_row HepSymMatrix::operator[] (int r)
+#ifdef HEP_GNU_OPTIMIZED_RETURN
+ return b(*this,r);
+{
+#else
+{
+ HepSymMatrix_row b(*this,r);
+#endif
+ return b;
+}
+
+inline HepSymMatrix::HepSymMatrix_row_const HepSymMatrix::operator[] (int r) const
+#ifdef HEP_GNU_OPTIMIZED_RETURN
+ return b(*this,r);
+{
+#else
+{
+ const HepSymMatrix_row_const b(*this,r);
+#endif
+ return b;
+}
+
+inline double &HepSymMatrix::HepSymMatrix_row::operator[](int c)
+{
+#ifdef MATRIX_BOUND_CHECK
+ if(_r<0||_r>=_a.nrow || c<0||c>=_a.nrow)
+ error("Range error in HepSymMatrix::operator[][]");
+#endif
+ if (_r >= c ) {
+ return *(_a.m.begin() + (_r+1)*_r/2 + c);
+ } else {
+ return *(_a.m.begin() + (c+1)*c/2 + _r);
+ }
+}
+
+inline const double &
+HepSymMatrix::HepSymMatrix_row_const::operator[](int c) const
+{
+#ifdef MATRIX_BOUND_CHECK
+ if(_r<0||_r>=_a.nrow || c<0||c>=_a.nrow)
+ error("Range error in HepSymMatrix::operator[][]");
+#endif
+ if (_r >= c ) {
+ return *(_a.m.begin() + (_r+1)*_r/2 + c);
+ } else {
+ return *(_a.m.begin() + (c+1)*c/2 + _r);
+ }
+}
+
+inline HepSymMatrix::HepSymMatrix_row::HepSymMatrix_row(HepSymMatrix &a,
+ int r)
+ : _a(a), _r(r)
+{}
+
+inline HepSymMatrix::HepSymMatrix_row_const::HepSymMatrix_row_const
+(const HepSymMatrix&a,int r)
+ : _a(a), _r(r)
+{}
+
+inline HepSymMatrix HepSymMatrix::inverse(int &ifail) const
+#ifdef HEP_GNU_OPTIMIZED_RETURN
+ return mTmp(*this);
+{
+#else
+{
+ HepSymMatrix mTmp(*this);
+#endif
+ mTmp.invert(ifail);
+ return mTmp;
+}
+
+} // namespace CLHEP
+
+
trf++/include/trfclhep
diff -N Vector.icc
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ Vector.icc 6 Dec 2011 03:40:15 -0000 1.1
@@ -0,0 +1,94 @@
+// -*- C++ -*-
+// ---------------------------------------------------------------------------
+//
+// This file is a part of the CLHEP - a Class Library for High Energy Physics.
+//
+//
+// Copyright Cornell University 1993, 1996, All Rights Reserved.
+//
+// This software written by Nobu Katayama and Mike Smyth, Cornell University.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions
+// are met:
+// 1. Redistributions of source code must retain the above copyright
+// notice and author attribution, this list of conditions and the
+// following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright
+// notice and author attribution, this list of conditions and the
+// following disclaimer in the documentation and/or other materials
+// provided with the distribution.
+// 3. Neither the name of the University nor the names of its contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+// Creation of derivative forms of this software for commercial
+// utilization may be subject to restriction; written permission may be
+// obtained from Cornell University.
+//
+// CORNELL MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way
+// of example, but not limitation, CORNELL MAKES NO REPRESENTATIONS OR
+// WARRANTIES OF MERCANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT
+// THE USE OF THIS SOFTWARE OR DOCUMENTATION WILL NOT INFRINGE ANY PATENTS,
+// COPYRIGHTS, TRADEMARKS, OR OTHER RIGHTS. Cornell University shall not be
+// held liable for any liability with respect to any claim by the user or any
+// other party arising from use of the program.
+//
+
+#include <cmath>
+#include <stdlib.h>
+
+namespace CLHEP {
+
+// Swap two vectors without doing a full copy.
+inline void swap(HepVector &v1,HepVector &v2) {
+ HepGenMatrix::swap(v1.m,v2.m);
+ HepGenMatrix::swap(v1.nrow,v2.nrow);
+}
+
+inline HepVector::HepVector()
+ : m(0), nrow(0)
+{}
+
+inline double HepVector::normsq() const {return dot((*this),(*this));}
+inline double HepVector::norm() const {return sqrt(normsq());}
+
+inline double & HepVector::operator()(int row)
+{
+#ifdef MATRIX_BOUND_CHECK
+ if(row<1 || row>nrow)
+ error("Range error in HepVector::operator()");
+#endif
+
+ return *(m.begin()+row-1);
+}
+inline const double & HepVector::operator()(int row) const
+{
+#ifdef MATRIX_BOUND_CHECK
+ if(row<1 || row>nrow)
+ error("Range error in HepVector::operator()");
+#endif
+
+ return *(m.begin()+row-1);
+}
+inline double & HepVector::operator[](int row)
+{
+#ifdef MATRIX_BOUND_CHECK
+ if(row<0 || row>=nrow)
+ error("Range error in HepVector::operator[]");
+#endif
+
+ return *(m.begin()+row);
+}
+inline const double & HepVector::operator[](int row) const
+{
+#ifdef MATRIX_BOUND_CHECK
+ if(row<0 || row>=nrow)
+ error("Range error in HepVector::operator[]");
+#endif
+
+ return *(m.begin()+row);
+}
+
+} // namespace CLHEP
+
CVSspam 0.2.12