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