Belle II Software  release-08-01-10
BorderedBandMatrix.h
Go to the documentation of this file.
1 /*
2  * BorderedBandMatrix.h
3  *
4  * Created on: Aug 14, 2011
5  * Author: kleinwrt
6  */
7 
8 
31 #ifndef BORDEREDBANDMATRIX_H_
32 #define BORDEREDBANDMATRIX_H_
33 
34 #include<iostream>
35 #include<vector>
36 #include<math.h>
37 #include<cstdlib>
38 #include "TVectorD.h"
39 #include "TMatrixD.h"
40 #include "TMatrixDSym.h"
41 #include "VMatrix.h"
42 
44 namespace gbl {
45 
47 
80 public:
82  virtual ~BorderedBandMatrix();
83  void resize(unsigned int nSize, unsigned int nBorder = 1,
84  unsigned int nBand = 5);
85  void solveAndInvertBorderedBand(const VVector &aRightHandSide,
86  VVector &aSolution);
87  void addBlockMatrix(double aWeight,
88  const std::vector<unsigned int>* anIndex,
89  const std::vector<double>* aVector);
90  TMatrixDSym getBlockMatrix(const std::vector<unsigned int> &anIndex) const;
91  void printMatrix() const;
92 
93 private:
94  unsigned int numSize;
95  unsigned int numBorder;
96  unsigned int numBand;
97  unsigned int numCol;
101 
102  void decomposeBand();
103  VVector solveBand(const VVector &aRightHandSide) const;
104  VMatrix solveBand(const VMatrix &aRightHandSide) const;
106  VMatrix bandOfAVAT(const VMatrix &anArray,
107  const VSymMatrix &aSymArray) const;
108 };
109 }
110 #endif /* BORDEREDBANDMATRIX_H_ */
VMatrix definition.
(Symmetric) Bordered Band Matrix.
void resize(unsigned int nSize, unsigned int nBorder=1, unsigned int nBand=5)
Resize bordered band matrix.
VVector solveBand(const VVector &aRightHandSide) const
Solve for band part.
TMatrixDSym getBlockMatrix(const std::vector< unsigned int > &anIndex) const
Retrieve symmetric block matrix.
void printMatrix() const
Print bordered band matrix.
unsigned int numSize
Matrix size.
VSymMatrix theBorder
Border part.
unsigned int numCol
Band matrix size.
VMatrix theMixed
Mixed part.
void addBlockMatrix(double aWeight, const std::vector< unsigned int > *anIndex, const std::vector< double > *aVector)
Add symmetric block matrix.
void decomposeBand()
(root free) Cholesky decomposition of band part: C=LDL^T
BorderedBandMatrix()
Create bordered band matrix.
unsigned int numBand
Band width.
VMatrix invertBand()
Invert band part.
unsigned int numBorder
Border size.
VMatrix bandOfAVAT(const VMatrix &anArray, const VSymMatrix &aSymArray) const
Calculate band part of: 'anArray * aSymArray * anArray.T'.
void solveAndInvertBorderedBand(const VVector &aRightHandSide, VVector &aSolution)
Solve linear equation system, partially calculate inverse.
Simple Matrix based on std::vector<double>
Definition: VMatrix.h:63
Simple symmetric Matrix based on std::vector<double>
Definition: VMatrix.h:86
Simple Vector based on std::vector<double>
Definition: VMatrix.h:43
Namespace for the general broken lines package.