21 #define PROJECTION_H 1 25 #include "TMatrixDSym.h" 34 Projection(
int dimP,
int dimC) : m_matrixH(dimC, dimP), m_r(dimC), m_matrixV(dimC), m_offset(0), m_particle(nullptr), m_nHidden(0) {}
40 double &
H(
int row,
int col)
42 #ifdef VTK_BOUNDSCHECKING 43 assert(m_offset + row > 0 && col > 0 && m_offset + row <= m_matrixH.GetNrows() && col <= m_matrixH.GetNcols());
45 return m_matrixH(m_offset + row, col);
49 const TVectorD &
r()
const {
return m_r; }
50 TVectorD &
r() {
return m_r; }
54 #ifdef VTK_BOUNDSCHECKING 55 assert(m_offset + row > 0 && m_offset + row <= m_r.GetNrows());
57 return m_r(m_offset + row);
61 const TMatrixDSym &
V()
const {
return m_matrixV; }
63 double &
V(
int row,
int col) {
return m_matrixV(m_offset + row, m_offset + col); }
66 #ifdef VTK_BOUNDSCHECKING 67 assert(m_offset + row > 0 && m_offset + col > 0 && m_offset + row <= m_matrixV.GetNrows() && m_offset + col <= m_matrixV.GetNcols() && row >= col);
69 return m_matrixV(m_offset + row, m_offset + col);
92 TMatrixDSym W = m_matrixV;
95 return W.Similarity(m_r);
99 unsigned int offset()
const {
return m_offset; }
107 TMatrixDSym m_matrixV;
108 unsigned int m_offset;
111 unsigned int m_nHidden;
const TMatrixD & H() const
double & V(int row, int col)
void setParticle(const ParticleBase &p)
void incrementOffset(unsigned int i)
const TMatrixDSym & V() const
Projection(int dimP, int dimC)
unsigned int offset() const
const TVectorD & r() const
double & H(int row, int col)
const ParticleBase * particle() const
TMatrixT< double > TMatrixD
double & Vfast(int row, int col)