Skip to content
Snippets Groups Projects
Commit fea0935a authored by Oliver Sander's avatar Oliver Sander Committed by sander
Browse files

replace OperatorType by MatrixType and DiscFuncType by VectorType

[[Imported from SVN: r11762]]
parent db0a17a1
No related branches found
No related tags found
No related merge requests found
template<class OperatorType, class DiscFuncType>
template<class MatrixType, class VectorType>
inline
DiscFuncType TrustRegionGSStep<OperatorType, DiscFuncType>::getSol()
VectorType TrustRegionGSStep<MatrixType, VectorType>::getSol()
{
return *(this->x_);
}
template<class OperatorType, class DiscFuncType>
template<class MatrixType, class VectorType>
inline
typename DiscFuncType::field_type TrustRegionGSStep<OperatorType, DiscFuncType>::
typename VectorType::field_type TrustRegionGSStep<MatrixType, VectorType>::
residual(unsigned int index, int blockIndex) const
{
const OperatorType& mat = *this->mat_;
const MatrixType& mat = *this->mat_;
typedef typename OperatorType::row_type RowType;
typedef typename MatrixType::row_type RowType;
typedef typename RowType::ConstIterator ColumnIterator;
/* The following loop computes
......@@ -42,11 +42,11 @@ residual(unsigned int index, int blockIndex) const
}
template<class OperatorType, class DiscFuncType>
template<class MatrixType, class VectorType>
inline
void TrustRegionGSStep<OperatorType, DiscFuncType>::iterate()
void TrustRegionGSStep<MatrixType, VectorType>::iterate()
{
const OperatorType& mat = *this->mat_;
const MatrixType& mat = *this->mat_;
const std::vector<BoxConstraint<field_type,blocksize> >& obstacles = *this->obstacles_;
// Debug: check for energy decrease
......
......@@ -12,15 +12,15 @@
/** \brief A Gauss-Seidel iterator which does not assume that the functional
is convex, but which expects a bounded admissible set.
*/
template<class OperatorType, class DiscFuncType>
class TrustRegionGSStep : public ProjectedBlockGSStep<OperatorType, DiscFuncType>
template<class MatrixType, class VectorType>
class TrustRegionGSStep : public ProjectedBlockGSStep<MatrixType, VectorType>
{
typedef typename DiscFuncType::block_type VectorBlock;
typedef typename VectorType::block_type VectorBlock;
enum {blocksize = VectorBlock::dimension};
typedef typename DiscFuncType::field_type field_type;
typedef typename VectorType::field_type field_type;
public:
......@@ -28,14 +28,14 @@
TrustRegionGSStep() {}
//! Constructor with a linear problem
TrustRegionGSStep(OperatorType& mat, DiscFuncType& x, DiscFuncType& rhs)
: LinearIterationStep<OperatorType,DiscFuncType>(mat, x, rhs)
TrustRegionGSStep(MatrixType& mat, VectorType& x, VectorType& rhs)
: LinearIterationStep<MatrixType,VectorType>(mat, x, rhs)
{}
//! Perform one iteration
virtual void iterate();
virtual DiscFuncType getSol();
virtual VectorType getSol();
field_type residual(unsigned int index, int blockIndex) const;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment