GeneralBrokenLines V03-01-03
using EIGEN
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
30#ifndef BORDEREDBANDMATRIX_H_
31#define BORDEREDBANDMATRIX_H_
32
33#include<iostream>
34#include<vector>
35#include<math.h>
36#include<cstdlib>
37#include "VMatrix.h"
38#include "Eigen/Core"
39
41namespace gbl {
42
44
77public:
79 virtual ~BorderedBandMatrix();
80 void resize(unsigned int nSize, unsigned int nBorder = 1,
81 unsigned int nBand = 7);
82 void setZero();
83 void solveAndInvertBorderedBand(const VVector &aRightHandSide,
84 VVector &aSolution);
85 void addBlockMatrix(double aWeight,
86 const std::vector<unsigned int>* anIndex,
87 const std::vector<double>* aVector);
88 void addBlockMatrix(double aWeight, unsigned int nSimple,
89 unsigned int* anIndex, double* aVector);
90 Eigen::MatrixXd getBlockMatrix(
91 const std::vector<unsigned int> anIndex) const;
92 Eigen::MatrixXd getBlockMatrix(unsigned int aSize,
93 unsigned int* anIndex) const;
94 void printMatrix() const;
95 double getBandCondition() const;
96
97private:
98 unsigned int numSize;
99 unsigned int numBorder;
100 unsigned int numBand;
101 unsigned int numCol;
105
106 void decomposeBand();
107 VVector solveBand(const VVector &aRightHandSide) const;
108 VMatrix solveBand(const VMatrix &aRightHandSide) const;
110 VMatrix bandOfAVAT(const VMatrix &anArray,
111 const VSymMatrix &aSymArray) const;
112};
113}
114#endif /* BORDEREDBANDMATRIX_H_ */
VMatrix definition.
(Symmetric) Bordered Band Matrix.
double getBandCondition() const
Get condition from band (decomposition)
VMatrix theMixed
Mixed part.
void printMatrix() const
Print bordered band matrix.
void decomposeBand()
(root free) Cholesky decomposition of band part: C=LDL^T
Eigen::MatrixXd getBlockMatrix(const std::vector< unsigned int > anIndex) const
Retrieve symmetric block matrix.
VSymMatrix theBorder
Border part.
unsigned int numBand
Band width.
VVector solveBand(const VVector &aRightHandSide) const
Solve for band part.
void setZero()
Set content to 0.
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 solveAndInvertBorderedBand(const VVector &aRightHandSide, VVector &aSolution)
Solve linear equation system, partially calculate inverse.
unsigned int numSize
Matrix size.
void resize(unsigned int nSize, unsigned int nBorder=1, unsigned int nBand=7)
Resize 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:64
Simple symmetric Matrix based on std::vector<double>
Definition: VMatrix.h:88
Simple Vector based on std::vector<double>
Definition: VMatrix.h:43
Namespace for the general broken lines package.