Skip to content

Commit

Permalink
Add missing using namespace boost.
Browse files Browse the repository at this point in the history
  • Loading branch information
Benjamin Chrétien committed May 5, 2015
1 parent eb5a8ef commit dc65dd3
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
4 changes: 4 additions & 0 deletions src/tnlp.cc
Expand Up @@ -15,6 +15,8 @@
// You should have received a copy of the GNU Lesser General Public License
// along with roboptim. If not, see <http://www.gnu.org/licenses/>.

#include <boost/shared_ptr.hpp>

#include <coin/IpIpoptApplication.hpp>
#include <coin/IpTNLP.hpp>

Expand All @@ -38,6 +40,8 @@ namespace roboptim
Index& nnz_h_lag,
TNLP::IndexStyleEnum& index_style)
{
using namespace boost;

n = static_cast<Index> (solver_.problem ().function ().inputSize ());
m = static_cast<Index> (constraintsOutputSize ());

Expand Down
17 changes: 13 additions & 4 deletions src/tnlp.hxx
Expand Up @@ -17,6 +17,9 @@

#ifndef ROBOPTIM_CORE_PLUGING_IPOPT_TNLP_HXX
# define ROBOPTIM_CORE_PLUGING_IPOPT_TNLP_HXX

# include <boost/shared_ptr.hpp>

# include <boost/mpl/assert.hpp>
# include <boost/mpl/at.hpp>
# include <boost/mpl/size.hpp>
Expand Down Expand Up @@ -91,6 +94,8 @@ namespace roboptim
Function::size_type
computeConstraintsOutputSize (const T& solver)
{
using namespace boost;

BOOST_MPL_ASSERT_RELATION
( (boost::mpl::size<typename T::problem_t::constraintsList_t>::value),
==, 2);
Expand All @@ -99,13 +104,13 @@ namespace roboptim
// constraint type and the linear function type is the
// first.
typedef typename
boost::mpl::at<typename T::problem_t::constraintsList_t,
boost::mpl::int_<1> >::type
mpl::at<typename T::problem_t::constraintsList_t,
mpl::int_<1> >::type
nonLinearFunction_t;

typedef typename
boost::mpl::at<typename T::problem_t::constraintsList_t,
boost::mpl::int_<0> >::type
mpl::at<typename T::problem_t::constraintsList_t,
mpl::int_<0> >::type
linearFunction_t;

Function::size_type result = 0;
Expand Down Expand Up @@ -230,6 +235,8 @@ namespace roboptim
Tnlp<T>::get_function_linearity (Index ROBOPTIM_DEBUG_ONLY(m),
LinearityType* const_types)
{
using namespace boost;

assert (constraintsOutputSize () - m == 0);

typedef typename solver_t::problem_t::constraints_t::const_iterator
Expand Down Expand Up @@ -481,6 +488,8 @@ namespace roboptim
Number obj_factor,
const Number* lambda)
{
using namespace boost;

typedef solver_t::problem_t::constraints_t::const_iterator citer_t;

TwiceDifferentiableFunction::hessian_t fct_h =
Expand Down

0 comments on commit dc65dd3

Please sign in to comment.