3 #ifndef DUNE_BLOCK_TRIDIAGONAL_MATRIX_HH
4 #define DUNE_BLOCK_TRIDIAGONAL_MATRIX_HH
6 #include <dune/common/fmatrix.hh>
24 template <
class B,
class A=std::allocator<B> >
70 for (
int i=1; i<size-1; i++)
81 for (
int i=1; i<size-1; i++) {
112 void solve (V& x,
const V& rhs)
const {
116 (*this)[0][0].solve(x[0],rhs[0]);
122 std::vector<block_type> c(this->
N()-1);
123 for (
size_t i=0; i<this->
N()-1; i++)
124 c[i] = (*
this)[i][i+1];
128 FMatrixHelp::invertMatrix((*
this)[0][0], a_00_inv);
132 FMatrixHelp::multMatrix(a_00_inv, c_0_tmp, c[0]);
135 typename V::block_type d_0_tmp = d[0];
136 (*this)[0][0].solve(d[0], d_0_tmp);
138 for (
unsigned int i = 1; i < this->
N(); i++) {
142 FMatrixHelp::multMatrix(c[i-1], (*
this)[i][i-1], tmp);
150 FMatrixHelp::multMatrix(tmp,
id, c[i]);
154 (*this)[i][i-1].mmv(d[i-1], d[i]);
155 typename V::block_type tmpVec = d[i];
162 x[this->
N() - 1] = d[this->
N() - 1];
163 for (
int i = this->
N() - 2; i >= 0; i--) {
166 c[i].mmv(x[i+1], x[i]);
182 void endrowsizes () {}
184 void endindices () {}