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

Add method to set trust region radius with a separate scaling for each vector block component

[[Imported from SVN: r9952]]
parent 82373c70
No related branches found
No related tags found
No related merge requests found
...@@ -33,6 +33,24 @@ public: ...@@ -33,6 +33,24 @@ public:
} }
/** \brief Set trust region radius with a separate scaling for each vector block component
*/
void set(field_type radius, const Dune::FieldVector<field_type, blocksize>& scaling) {
radius_ = radius;
for (size_t i=0; i<obstacles_.size(); i++) {
for (int k=0; k<blocksize; k++) {
obstacles_[i].lower(k) = -radius*scaling[k];
obstacles_[i].upper(k) = radius*scaling[k];
}
}
}
/** \brief Return true if the given vector is not contained in the trust region */ /** \brief Return true if the given vector is not contained in the trust region */
bool violates(const Dune::BlockVector<Dune::FieldVector<double,blocksize> >& v) const bool violates(const Dune::BlockVector<Dune::FieldVector<double,blocksize> >& v) const
{ {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment