From: bangerth Date: Sun, 21 Aug 2011 00:34:10 +0000 (+0000) Subject: Qualify a call to a function in the base class with this->. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7dd8db69f0b22e5bc5e635b8af9f53eeac068f9b;p=dealii-svn.git Qualify a call to a function in the base class with this->. git-svn-id: https://svn.dealii.org/trunk@24136 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/include/deal.II/lac/precondition_block.templates.h b/deal.II/include/deal.II/lac/precondition_block.templates.h index 133557cc44..a0c7b49038 100644 --- a/deal.II/include/deal.II/lac/precondition_block.templates.h +++ b/deal.II/include/deal.II/lac/precondition_block.templates.h @@ -74,7 +74,7 @@ void PreconditionBlock::initialize ( const AdditionalData parameters) { const unsigned int bsize = parameters.block_size; - + clear(); Assert (M.m() == M.n(), ExcNotQuadratic()); A = &M; @@ -85,7 +85,7 @@ void PreconditionBlock::initialize ( const unsigned int nblocks = A->m()/bsize; this->reinit(nblocks, blocksize, parameters.same_diagonal, parameters.inversion); - + if (parameters.invert_diagonal) { if (permutation.size() == M.m()) @@ -114,18 +114,18 @@ void PreconditionBlock::invert_permuted_diagblocks( { Assert (A!=0, ExcNotInitialized()); Assert (blocksize!=0, ExcNotInitialized()); - + const MATRIX &M=*A; Assert (this->inverses_ready()==0, ExcInverseMatricesAlreadyExist()); AssertDimension (permutation.size(), M.m()); AssertDimension (inverse_permutation.size(), M.m()); - + FullMatrix M_cell(blocksize); if (this->same_diagonal()) { deallog << "PreconditionBlock uses only one diagonal block" << std::endl; - + for (unsigned int row_cell=0; row_cell::invert_permuted_diagblocks( // row, column are the global numbering // of the unkowns. M_cell = 0; - + for (unsigned int cell=0; cellsize(); ++cell) { const unsigned int cell_start = cell*blocksize; @@ -184,14 +184,14 @@ void PreconditionBlock::invert_permuted_diagblocks( //if (entry->column()column()]column()]-cell_start; if (column_cell >= blocksize) continue; M_cell(row_cell, column_cell) = entry->value(); } } - + if (this->store_diagonals()) this->diagonal(cell) = M_cell; switch (this->inversion) @@ -208,7 +208,7 @@ void PreconditionBlock::invert_permuted_diagblocks( break; default: Assert(false, ExcNotImplemented()); - + } } } @@ -226,13 +226,13 @@ void PreconditionBlock::forward_step ( const bool transpose_diagonal) const { Assert (this->A!=0, ExcNotInitialized()); - + const MATRIX &M=*this->A; - + if (permutation.size() != 0) Assert (permutation.size() == M.m() || permutation.size() == this->size(), ExcMessage("Permutation vector size must be equal to either the number of blocks or the dimension of the system")); - + const bool permuted = (permutation.size() == M.m()); const bool cell_permuted = (permutation.size() == this->size()); @@ -240,7 +240,7 @@ void PreconditionBlock::forward_step ( // if (permuted) deallog << " point"; // if (cell_permuted) deallog << " block"; // deallog << std::endl; - + Vector b_cell(this->blocksize), x_cell(this->blocksize); // cell_row, cell_column are the @@ -267,7 +267,7 @@ void PreconditionBlock::forward_step ( // deallog << std::endl << cell << '-' << block_start // << '-' << permuted_block_start << (permuted ? 't' : 'f') << '\t'; - + for (row = permuted_block_start, row_cell = 0; row_cell < this->blocksize; ++row_cell, ++row) @@ -275,7 +275,7 @@ void PreconditionBlock::forward_step ( // deallog << ' ' << row; const typename MATRIX::const_iterator row_end = M.end(row); typename MATRIX::const_iterator entry = M.begin(row); - + b_cell_row=src(row); for (; entry != row_end; ++entry) { @@ -284,7 +284,7 @@ void PreconditionBlock::forward_step ( ? inverse_permutation[column] : column; b_cell_row -= entry->value() * prev(column); -//TODO:[GK] Find out if this is really once column and once permuted +//TODO:[GK] Find out if this is really once column and once permuted if (!this->inverses_ready() && inverse_permuted_column >= block_start && inverse_permuted_column < block_start + this->blocksize) @@ -310,7 +310,7 @@ void PreconditionBlock::forward_step ( Householder house(M_cell); house.least_squares(x_cell,b_cell); } - + // distribute x_cell to dst for (row=permuted_block_start, row_cell=0; row_cellblocksize; @@ -329,16 +329,16 @@ void PreconditionBlock::backward_step ( const bool transpose_diagonal) const { Assert (this->A!=0, ExcNotInitialized()); - + const MATRIX &M=*this->A; if (permutation.size() != 0) Assert (permutation.size() == M.m() || permutation.size() == this->size(), ExcMessage("Permutation vector size must be equal to either the number of blocks or the dimension of the system")); - + const bool permuted = (permutation.size() == M.m()); const bool cell_permuted = (permutation.size() == this->size()); - + Vector b_cell(this->blocksize), x_cell(this->blocksize); // cell_row, cell_column are the @@ -367,7 +367,7 @@ void PreconditionBlock::backward_step ( { const typename MATRIX::const_iterator row_end = M.end(row); typename MATRIX::const_iterator entry = M.begin(row); - + b_cell_row=src(row); for (; entry != row_end; ++entry) { @@ -407,8 +407,8 @@ void PreconditionBlock::backward_step ( Householder house(M_cell); house.least_squares(x_cell,b_cell); } - - + + // distribute x_cell to dst for (row=permuted_block_start, row_cell=0; row_cellblocksize; @@ -433,7 +433,7 @@ void PreconditionBlock::invert_diagblocks() const MATRIX &M=*A; Assert (this->inverses_ready()==0, ExcInverseMatricesAlreadyExist()); - + FullMatrix M_cell(blocksize); if (this->same_diagonal()) @@ -471,7 +471,7 @@ void PreconditionBlock::invert_diagblocks() else { M_cell = 0; - + for (unsigned int cell=0; cellsize(); ++cell) { const unsigned int cell_start = cell*blocksize; @@ -485,7 +485,7 @@ void PreconditionBlock::invert_diagblocks() { if (entry->column()column()-cell_start; if (column_cell >= blocksize) continue; @@ -528,7 +528,7 @@ void PreconditionBlock::set_permutation ( { AssertDimension(p.size(), this->size()); } - + permutation.resize(p.size()); inverse_permutation.resize(p.size()); for (unsigned int k=0;k // args... typedef PreconditionBlock BaseClass; Assert(this->A!=0, ExcNotInitialized()); - + const MATRIX &M=*this->A; Vector b_cell(this->blocksize), x_cell(this->blocksize); @@ -617,7 +617,7 @@ void PreconditionBlockJacobi dst(row)+=x_cell(row_cell); else dst(row)=x_cell(row_cell); - + begin_diag_block+=this->blocksize; } } @@ -639,7 +639,7 @@ void PreconditionBlockJacobi dst(row)+=x_cell(row_cell); else dst(row)=x_cell(row_cell); - + begin_diag_block+=this->blocksize; } dst.scale(this->relaxation); @@ -695,8 +695,8 @@ void PreconditionBlockJacobi GrowingVectorMemory > mem; typename VectorMemory >::Pointer aux(mem); aux->reinit(dst); - - forward_step(*aux, dst, src, false); + + this->forward_step(*aux, dst, src, false); dst = *aux; } @@ -710,7 +710,7 @@ void PreconditionBlockJacobi GrowingVectorMemory > mem; typename VectorMemory >::Pointer aux(mem); aux->reinit(dst); - + backward_step(*aux, dst, src, true); dst = *aux; } @@ -724,13 +724,13 @@ void PreconditionBlockJacobi template PreconditionBlockSOR::PreconditionBlockSOR () : PreconditionBlock (false) - + {} template PreconditionBlockSOR::PreconditionBlockSOR (bool store) : PreconditionBlock (store) - + {} template @@ -760,14 +760,14 @@ void PreconditionBlockSOR::forward ( typedef PreconditionBlock BaseClass; Assert (this->A!=0, ExcNotInitialized()); - + const MATRIX &M=*this->A; const bool permuted = (this->permutation.size() != 0); if (permuted) { Assert (this->permutation.size() == M.m(), ExcDimensionMismatch(this->permutation.size(), M.m())); } - + Vector b_cell(this->blocksize), x_cell(this->blocksize); // cell_row, cell_column are the @@ -782,20 +782,20 @@ void PreconditionBlockSOR::forward ( // The diagonal block if the // inverses were not precomputed FullMatrix M_cell(this->blocksize); - + for (unsigned int cell=0; cell < this->size(); ++cell) { const unsigned int permuted_block_start = permuted ? this->permutation[block_start] :block_start; - + for (row = permuted_block_start, row_cell = 0; row_cell < this->blocksize; ++row_cell, ++row) { const typename MATRIX::const_iterator row_end = M.end(row); typename MATRIX::const_iterator entry = M.begin(row); - + b_cell_row=src(row); for (; entry != row_end; ++entry) { @@ -803,7 +803,7 @@ void PreconditionBlockSOR::forward ( const unsigned int inverse_permuted_column = permuted ? this->inverse_permutation[column] : column; - + if (inverse_permuted_column < block_start) b_cell_row -= entry->value() * dst(column); else if (!this->inverses_ready() && column < block_start + this->blocksize) @@ -829,13 +829,13 @@ void PreconditionBlockSOR::forward ( Householder house(M_cell); house.least_squares(x_cell,b_cell); } - + // distribute x_cell to dst for (row=permuted_block_start, row_cell=0; row_cellblocksize; ++row_cell, ++row) dst(row)=this->relaxation*x_cell(row_cell); - + block_start+=this->blocksize; } } @@ -868,7 +868,7 @@ void PreconditionBlockSOR::backward ( typedef PreconditionBlock BaseClass; Assert (this->A!=0, ExcNotInitialized()); - + const MATRIX &M=*this->A; const bool permuted = (this->permutation.size() != 0); if (permuted) @@ -904,7 +904,7 @@ void PreconditionBlockSOR::backward ( { const typename MATRIX::const_iterator row_end = M.end(row); typename MATRIX::const_iterator entry = M.begin(row); - + b_cell_row=src(row); for (; entry != row_end; ++entry) { @@ -943,15 +943,15 @@ void PreconditionBlockSOR::backward ( Householder house(M_cell); house.least_squares(x_cell,b_cell); } - - + + // distribute x_cell to dst for (row=permuted_block_start, row_cell=0; row_cellblocksize; ++row_cell, ++row) dst(row)=this->relaxation*x_cell(row_cell); block_end = block_start; - + } } @@ -1025,7 +1025,7 @@ void PreconditionBlockSOR template PreconditionBlockSSOR::PreconditionBlockSSOR () : PreconditionBlockSOR (true) - + {} @@ -1036,18 +1036,18 @@ void PreconditionBlockSSOR::vmult (Vector &d { Vector help; help.reinit(dst); - + this->forward(help, src, false, false); Vector cell_src(this->blocksize); Vector cell_dst(this->blocksize); const double scaling = (2.-this->relaxation)/this->relaxation; - + // Multiply with diagonal blocks for (unsigned int cell=0; cell < this->size(); ++cell) { unsigned int row = cell*this->blocksize; - + for (unsigned int row_cell=0; row_cellblocksize; ++row_cell) cell_src(row_cell)=help(row+row_cell); @@ -1056,7 +1056,7 @@ void PreconditionBlockSSOR::vmult (Vector &d for (unsigned int row_cell=0; row_cellblocksize; ++row_cell) help(row+row_cell) = scaling * cell_dst(row_cell); } - + this->backward(dst, help, false, false); } @@ -1067,18 +1067,18 @@ void PreconditionBlockSSOR::Tvmult (Vector & { Vector help; help.reinit(dst); - + this->backward(help, src, true, false); Vector cell_src(this->blocksize); Vector cell_dst(this->blocksize); const double scaling = (2.-this->relaxation)/this->relaxation; - + // Multiply with diagonal blocks for (unsigned int cell=0; cell < this->size(); ++cell) { unsigned int row = cell*this->blocksize; - + for (unsigned int row_cell=0; row_cellblocksize; ++row_cell) cell_src(row_cell)=help(row+row_cell); @@ -1087,7 +1087,7 @@ void PreconditionBlockSSOR::Tvmult (Vector & for (unsigned int row_cell=0; row_cellblocksize; ++row_cell) help(row+row_cell) = scaling * cell_dst(row_cell); } - + this->forward(dst, help, true, false); }