ATLAS Offline Software
AlSymMat.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef TRKALGS_ALSYMMAT_H
6 #define TRKALGS_ALSYMMAT_H
7 
9 
10 class StatusCode;
11 template<class Element> class TMatrixTSparse;
12 typedef class TMatrixTSparse<double> TMatrixDSparse;
13 
14 namespace Trk {
15 
16 class AlVec;
17 class AlMat;
18 class AlSpaMat;
19 
25 class AlSymMat : public AlSymMatBase {
28 
29  public:
30  AlSymMat(long int);
31  AlSymMat();
32  AlSymMat(const AlSymMat&);
33  AlSymMat(const AlSpaMat&);
34  AlSymMat& operator=(const AlSpaMat&);
35 
36  ~AlSymMat();
37 
38  // OPERATORS:
39  virtual AlSymMat& operator=(const double&);
40  virtual AlSymMat& operator=(const AlSymMat&);
41  //virtual AlSymMat& operator=(const AlSpaMat&);
42  virtual AlSymMat& operator=(const AlMat&);
43  virtual AlSymMat operator+(const AlSymMat&) const;
44  virtual AlSymMat& operator+=(const AlSymMat&);
45  virtual AlSymMat operator-(const AlSymMat&) const;
46  virtual AlSymMat& operator-=(const AlSymMat&);
47  virtual AlMat operator*(const AlSymMat&) const;
48  virtual AlVec operator*(const AlVec&) const;
49  virtual AlMat operator*(const AlMat&) const;
50  virtual AlSymMat operator*(const double&) const;
51  virtual AlSymMat& operator*=(const double&);
52 
53  // ADVANCED:
54  virtual void reSize(long int Nnew) override final;
55  virtual double& elemr(long int, long int) override final;
56  virtual double elemc(long int, long int) const override final;
57 
58  virtual int invert() override final;
59  virtual void RemoveModule(int) override final;
60  virtual void RemoveAlignPar(int, int) override final;
61  virtual int RemoveCollsRows(std::vector<int>) override final;
62  virtual void SetPathBin(const std::string&) override final;
63  virtual void SetPathTxt(const std::string&) override final;
64  virtual StatusCode Write(const std::string&, bool, bool, double, float) override final;
65  virtual StatusCode CheckMatVersion(const std::string&, bool&) override final;
66  virtual StatusCode Read(const std::string&, int&, bool&, float&) override final;
67  virtual StatusCode ReadProjected(const std::string&, int&, bool&, float&) override final;
68  virtual int diagonalize(char jobz, AlVec& w, AlMat& z) override final;
69  virtual double determinant() override final;
70 
71  inline const double* ptrData() const;
72  inline double* ptrData();
73 
74  inline const std::string& pathBin() const;
75  inline const std::string& pathTxt() const;
76 
77  virtual TMatrixDSparse* makeTMatrix() override final;
78 
79 
80  protected:
81  inline long int elem(long int, long int) const;
82 
83  void copy(const AlSymMat& m);
84  void copy(const AlSpaMat& m);
85  void copy(const AlMat& m);
86 
87  double* m_ptr_data = nullptr;
88 
89  std::string m_pathbin;
90  std::string m_pathtxt;
91 
92 };
93 
94 // inline operators
95 
96 inline long int AlSymMat::elem(long int i,long int j) const {
97 #ifdef _DEBUG
98  if( i<0 ) { throw std::out_of_range( "AlSymMat::elem: Index 1 < zero! " ); };
99  if( i>=size() ) { throw std::out_of_range( "AlSymMat::elem: Index 1 too large! " ); };
100  if( j<0 ) { throw std::out_of_range( "AlSymMat::elem: Index 2 < zero! " ); };
101  if( j>=size() ) { throw std::out_of_range( "AlSymMat::elem: Index 2 too large! " ); };
102 #endif
103  if( j<=i ) {
104  return ((i+1)*i/2+j);
105  }
106  else {
107  return ((j+1)*j/2+i);
108  };
109 }
110 
111 inline const double* AlSymMat::ptrData() const {
112  return m_ptr_data;
113 }
114 
115 inline double* AlSymMat::ptrData() {
116  return m_ptr_data;
117 }
118 
119 inline const std::string& AlSymMat::pathBin() const {
120  return m_pathbin;
121 }
122 
123 inline const std::string& AlSymMat::pathTxt() const {
124  return m_pathtxt;
125 }
126 
127 } // end namespace Trk
128 
129 #endif // TRKALGS_ALSYMMAT_H
Trk::AlSymMat::RemoveAlignPar
virtual void RemoveAlignPar(int, int) override final
Definition: AlSymMat.cxx:534
python.SystemOfUnits.m
int m
Definition: SystemOfUnits.py:91
Trk::z
@ z
global position (cartesian)
Definition: ParamDefs.h:57
Trk::AlSymMat::operator+
virtual AlSymMat operator+(const AlSymMat &) const
Definition: AlSymMat.cxx:190
Trk::AlSymMat::Write
virtual StatusCode Write(const std::string &, bool, bool, double, float) override final
Definition: AlSymMat.cxx:588
Trk::AlSymMat::operator+=
virtual AlSymMat & operator+=(const AlSymMat &)
Definition: AlSymMat.cxx:206
Trk::AlSymMat::m_pathbin
std::string m_pathbin
Definition: AlSymMat.h:89
Trk::AlSymMat::elem
long int elem(long int, long int) const
Definition: AlSymMat.h:96
const
bool const RAWDATA *ch2 const
Definition: LArRodBlockPhysicsV0.cxx:560
Trk::AlSymMat::invert
virtual int invert() override final
Definition: AlSymMat.cxx:358
Trk::AlSymMat::SetPathBin
virtual void SetPathBin(const std::string &) override final
Definition: AlSymMat.cxx:576
Trk::AlSymMat::operator*=
virtual AlSymMat & operator*=(const double &)
Definition: AlSymMat.cxx:338
protected
#define protected
Definition: DetDescrConditionsDict_dict_fixes.cxx:14
Trk::AlSymMat
Definition: AlSymMat.h:26
Trk::AlSymMat::ptrData
const double * ptrData() const
Definition: AlSymMat.h:111
TMatrixDSparse
class TMatrixTSparse< double > TMatrixDSparse
Definition: AlSpaMat.h:14
Trk::AlSymMatBase::size
long int size() const
Definition: AlSymMatBase.h:145
Trk::AlSymMat::SetPathTxt
virtual void SetPathTxt(const std::string &) override final
Definition: AlSymMat.cxx:582
Trk::AlSymMat::operator=
AlSymMat & operator=(const AlSpaMat &)
Definition: AlSymMat.cxx:88
lumiFormat.i
int i
Definition: lumiFormat.py:85
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
vector
Definition: MultiHisto.h:13
Trk::AlSymMat::RemoveModule
virtual void RemoveModule(int) override final
Definition: AlSymMat.cxx:470
Trk::AlSymMat::Read
virtual StatusCode Read(const std::string &, int &, bool &, float &) override final
Definition: AlSymMat.cxx:671
Trk::AlSymMat::pathTxt
const std::string & pathTxt() const
Definition: AlSymMat.h:123
Trk::AlSymMat::elemc
virtual double elemc(long int, long int) const override final
Definition: AlSymMat.cxx:808
xAOD::double
double
Definition: CompositeParticle_v1.cxx:159
Trk::AlSymMat::m_pathtxt
std::string m_pathtxt
Definition: AlSymMat.h:90
Trk::AlSymMat::makeTMatrix
virtual TMatrixDSparse * makeTMatrix() override final
Definition: AlSymMat.cxx:831
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition: FakeTrackBuilder.h:9
Trk::AlSymMat::copy
void copy(const AlSymMat &m)
Definition: AlSymMat.cxx:109
AlSymMatBase.h
TMatrixTSparse
Definition: AlSpaMat.h:13
Trk::AlSymMat::ReadProjected
virtual StatusCode ReadProjected(const std::string &, int &, bool &, float &) override final
Definition: AlSymMat.cxx:721
Trk::AlSymMat::diagonalize
virtual int diagonalize(char jobz, AlVec &w, AlMat &z) override final
Definition: AlSymMat.cxx:452
Trk::AlSymMat::AlSymMat
AlSymMat()
Definition: AlSymMat.cxx:40
Trk::AlSymMat::RemoveCollsRows
virtual int RemoveCollsRows(std::vector< int >) override final
Definition: AlSymMat.cxx:492
Trk::AlSymMat::pathBin
const std::string & pathBin() const
Definition: AlSymMat.h:119
Trk::AlSymMat::reSize
virtual void reSize(long int Nnew) override final
Definition: AlSymMat.cxx:764
Trk::AlSymMat::operator*
virtual AlMat operator*(const AlSymMat &) const
Definition: AlSymMat.cxx:250
Trk::AlSymMat::operator-
virtual AlSymMat operator-(const AlSymMat &) const
Definition: AlSymMat.cxx:220
python.IoTestsLib.w
def w
Definition: IoTestsLib.py:200
Trk::AlSymMat::m_ptr_data
double * m_ptr_data
Definition: AlSymMat.h:87
Trk::AlSymMat::~AlSymMat
~AlSymMat()
Definition: AlSymMat.cxx:102
Trk::AlSymMat::determinant
virtual double determinant() override final
Definition: AlSymMat.cxx:387
Trk::AlSymMat::CheckMatVersion
virtual StatusCode CheckMatVersion(const std::string &, bool &) override final
Definition: AlSymMat.cxx:649
Trk::AlSymMat::elemr
virtual double & elemr(long int, long int) override final
Definition: AlSymMat.cxx:785
Trk::AlSymMat::operator-=
virtual AlSymMat & operator-=(const AlSymMat &)
Definition: AlSymMat.cxx:236