CMS 3D CMS Logo

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 #ifndef BORDEREDBANDMATRIX_H_
9 #define BORDEREDBANDMATRIX_H_
10 
11 #include<iostream>
12 #include<vector>
13 #include<math.h>
14 #include<cstdlib>
15 #include "TVectorD.h"
16 #include "TMatrixD.h"
17 #include "TMatrixDSym.h"
18 #include "VMatrix.h"
19 
21 namespace gbl {
22 
24 
57 public:
59  virtual ~BorderedBandMatrix();
60  void resize(unsigned int nSize, unsigned int nBorder = 1,
61  unsigned int nBand = 5);
62  void solveAndInvertBorderedBand(const VVector &aRightHandSide,
63  VVector &aSolution);
64  void addBlockMatrix(double aWeight,
65  const std::vector<unsigned int>* anIndex,
66  const std::vector<double>* aVector);
67  TMatrixDSym getBlockMatrix(const std::vector<unsigned int> anIndex) const;
68  void printMatrix() const;
69 
70 private:
71  unsigned int numSize;
72  unsigned int numBorder;
73  unsigned int numBand;
74  unsigned int numCol;
78 
79  void decomposeBand();
80  VVector solveBand(const VVector &aRightHandSide) const;
81  VMatrix solveBand(const VMatrix &aRightHandSide) const;
83  VMatrix bandOfAVAT(const VMatrix &anArray,
84  const VSymMatrix &aSymArray) const;
85 };
86 }
87 #endif /* BORDEREDBANDMATRIX_H_ */
void printMatrix() const
Print bordered band matrix.
void addBlockMatrix(double aWeight, const std::vector< unsigned int > *anIndex, const std::vector< double > *aVector)
Add symmetric block matrix.
Simple Matrix based on std::vector<double>
Definition: VMatrix.h:41
(Symmetric) Bordered Band Matrix.
BorderedBandMatrix()
Create bordered band matrix.
unsigned int numCol
Band matrix size.
VMatrix invertBand()
Invert band part.
VMatrix theMixed
Mixed part.
void decomposeBand()
(root free) Cholesky decomposition of band part: C=LDL^T
Namespace for the general broken lines package.
unsigned int numBorder
Border size.
Simple symmetric Matrix based on std::vector<double>
Definition: VMatrix.h:64
VSymMatrix theBorder
Border part.
void resize(unsigned int nSize, unsigned int nBorder=1, unsigned int nBand=5)
Resize bordered band matrix.
VMatrix theBand
Band part.
VMatrix bandOfAVAT(const VMatrix &anArray, const VSymMatrix &aSymArray) const
Calculate band part of: &#39;anArray * aSymArray * anArray.T&#39;.
Simple Vector based on std::vector<double>
Definition: VMatrix.h:21
TMatrixDSym getBlockMatrix(const std::vector< unsigned int > anIndex) const
Retrieve symmetric block matrix.
unsigned int numSize
Matrix size.
VVector solveBand(const VVector &aRightHandSide) const
Solve for band part.
void solveAndInvertBorderedBand(const VVector &aRightHandSide, VVector &aSolution)
Solve linear equation system, partially calculate inverse.
unsigned int numBand
Band width.