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
Branches
Tags
No related merge requests found
template<class OperatorType, class DiscFuncType> template<class MatrixType, class VectorType>
inline inline
DiscFuncType TrustRegionGSStep<OperatorType, DiscFuncType>::getSol() VectorType TrustRegionGSStep<MatrixType, VectorType>::getSol()
{ {
return *(this->x_); return *(this->x_);
} }
template<class OperatorType, class DiscFuncType> template<class MatrixType, class VectorType>
inline inline
typename DiscFuncType::field_type TrustRegionGSStep<OperatorType, DiscFuncType>:: typename VectorType::field_type TrustRegionGSStep<MatrixType, VectorType>::
residual(unsigned int index, int blockIndex) const 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; typedef typename RowType::ConstIterator ColumnIterator;
/* The following loop computes /* The following loop computes
...@@ -42,11 +42,11 @@ residual(unsigned int index, int blockIndex) const ...@@ -42,11 +42,11 @@ residual(unsigned int index, int blockIndex) const
} }
template<class OperatorType, class DiscFuncType> template<class MatrixType, class VectorType>
inline 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_; const std::vector<BoxConstraint<field_type,blocksize> >& obstacles = *this->obstacles_;
// Debug: check for energy decrease // Debug: check for energy decrease
......
...@@ -12,15 +12,15 @@ ...@@ -12,15 +12,15 @@
/** \brief A Gauss-Seidel iterator which does not assume that the functional /** \brief A Gauss-Seidel iterator which does not assume that the functional
is convex, but which expects a bounded admissible set. is convex, but which expects a bounded admissible set.
*/ */
template<class OperatorType, class DiscFuncType> template<class MatrixType, class VectorType>
class TrustRegionGSStep : public ProjectedBlockGSStep<OperatorType, DiscFuncType> class TrustRegionGSStep : public ProjectedBlockGSStep<MatrixType, VectorType>
{ {
typedef typename DiscFuncType::block_type VectorBlock; typedef typename VectorType::block_type VectorBlock;
enum {blocksize = VectorBlock::dimension}; enum {blocksize = VectorBlock::dimension};
typedef typename DiscFuncType::field_type field_type; typedef typename VectorType::field_type field_type;
public: public:
...@@ -28,14 +28,14 @@ ...@@ -28,14 +28,14 @@
TrustRegionGSStep() {} TrustRegionGSStep() {}
//! Constructor with a linear problem //! Constructor with a linear problem
TrustRegionGSStep(OperatorType& mat, DiscFuncType& x, DiscFuncType& rhs) TrustRegionGSStep(MatrixType& mat, VectorType& x, VectorType& rhs)
: LinearIterationStep<OperatorType,DiscFuncType>(mat, x, rhs) : LinearIterationStep<MatrixType,VectorType>(mat, x, rhs)
{} {}
//! Perform one iteration //! Perform one iteration
virtual void iterate(); virtual void iterate();
virtual DiscFuncType getSol(); virtual VectorType getSol();
field_type residual(unsigned int index, int blockIndex) const; 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