/usr/include/CLHEP/Matrix/Vector.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 | // -*- C++ -*-
// ---------------------------------------------------------------------------
//
// This file is a part of the CLHEP - a Class Library for High Energy Physics.
//
#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
|