Skip to content

Commit

Permalink
Fix to allow a correct use of the bounds and scales setter
Browse files Browse the repository at this point in the history
  • Loading branch information
Delca committed May 21, 2015
1 parent b3cc8e0 commit e41e510
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ namespace roboptim
template<class U>
struct BoundsAndScalesSetter
{
void setBounds(typename Function::intervals_t& bounds);
void setScales(typename U::scales_t& scales);
BoundsAndScalesSetter<U>& setBounds(typename Function::intervals_t& bounds);
BoundsAndScalesSetter<U>& setScales(typename U::scales_t& scales);

private:
std::pair<typename Function::intervals_t, typename U::scales_t>& bNSPair_;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -236,17 +236,21 @@ ProblemFactory<U>::ProblemFactory()
// ---- //

template<class U>
void BoundsAndScalesSetter<U>::setBounds(typename Function::intervals_t& bounds)
BoundsAndScalesSetter<U>& BoundsAndScalesSetter<U>::setBounds(typename Function::intervals_t& bounds)
{
this->bNSPair_.first.clear();
this->bNSPair_.first.insert(this->bNSPair_.first.end(), bounds.begin(), bounds.end());

return *this;
}

template<class U>
void BoundsAndScalesSetter<U>::setScales(typename U::scales_t& scales)
BoundsAndScalesSetter<U>& BoundsAndScalesSetter<U>::setScales(typename U::scales_t& scales)
{
this->bNSPair_.second.clear();
this->bNSPair_.second.insert(this->bNSPair_.second.end(), scales.begin(), scales.end());

return *this;
}

template<class U>
Expand Down

0 comments on commit e41e510

Please sign in to comment.