/usr/include/CLHEP/RandomObjects/RandomVector.icc is in libclhep-dev 2.1.4.1-1.2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 | // -*- C++ -*-
//
// -----------------------------------------------------------------------
// HEP Random
// --- HepRandomVector ---
// inlined functions implementation file
// -----------------------------------------------------------------------
// =======================================================================
// Mark Fischler - Created: 19th October 1998
// =======================================================================
namespace CLHEP {
inline void HepRandomVector::setSeed(long seed, int lux) {
theEngine->setSeed(seed,lux);
}
inline void HepRandomVector::setSeeds(const long* seeds, int aux) {
theEngine->setSeeds(seeds,aux);
}
inline long HepRandomVector::getSeed() const {
return theEngine->getSeed();
}
inline const long* HepRandomVector::getSeeds() const {
return theEngine->getSeeds();
}
inline void HepRandomVector::saveStatus( const char filename[] ) const {
theEngine->saveStatus( filename );
}
inline void HepRandomVector::restoreStatus( const char filename[] ) {
theEngine->restoreStatus( filename );
}
inline void HepRandomVector::showStatus() const {
theEngine->showStatus();
}
// In analogy to the HepRandom class, we inline the following, even though now
// they contain a loop to fill a vector and are thus more complicated.
inline HepVector HepRandomVector::flat() {
HepVector v;
int i;
for ( i = 0; i < v.num_row(); i++ ) {
v[i] = theEngine->flat();
}
// Instead of this loop, the engine's flatArray routine could be
// used if there were a guarantee that the memory for the HepVector
// is merely its members in order. But there is no such guarantee.
return v;
}
inline void HepRandomVector::flatArray(const int size, HepVector* vect) {
int n;
int i;
for ( n = 0; n < size; n++ ) {
for ( i = 0; i < vect[n].num_row(); i++ ) {
vect[n][i] = theEngine->flat();
// Here, the engine's flatArray routine is not good
// to use because each element of vect is std:vector
}
}
}
inline HepVector HepRandomVector::flat(HepRandomEngine* theNewEngine)
{
HepVector v;
int i;
for ( i = 0; i < v.num_row(); i++ ) {
v[i] = theNewEngine->flat();
}
return v;
}
inline void HepRandomVector::flatArray(HepRandomEngine* theNewEngine,
const int size, HepVector* vect)
{
int n;
int i;
for ( n = 0; n < size; n++ ) {
for ( i = 0; i < vect[n].num_row(); i++ ) {
vect[n][i] = theNewEngine->flat();
}
}
}
} // namespace CLHEP
|