Skip to content
Snippets Groups Projects
Verified Commit c4af9cfb authored by Justin Carpentier's avatar Justin Carpentier
Browse files

all: remove useless namespace bp::

parent e3b4b192
No related branches found
No related tags found
No related merge requests found
Showing
with 10 additions and 43 deletions
...@@ -9,8 +9,6 @@ ...@@ -9,8 +9,6 @@
namespace eigenpy { namespace eigenpy {
namespace bp = boost::python;
template <typename AngleAxis> template <typename AngleAxis>
class AngleAxisVisitor; class AngleAxisVisitor;
......
...@@ -9,8 +9,6 @@ ...@@ -9,8 +9,6 @@
namespace eigenpy { namespace eigenpy {
namespace bp = boost::python;
/// ///
/// \brief Add the Python method copy to allow a copy of this by calling the /// \brief Add the Python method copy to allow a copy of this by calling the
/// copy constructor. /// copy constructor.
......
...@@ -23,7 +23,6 @@ struct EigenSolverVisitor ...@@ -23,7 +23,6 @@ struct EigenSolverVisitor
template <class PyClass> template <class PyClass>
void visit(PyClass& cl) const { void visit(PyClass& cl) const {
namespace bp = boost::python;
cl.def(bp::init<>("Default constructor")) cl.def(bp::init<>("Default constructor"))
.def(bp::init<Eigen::DenseIndex>( .def(bp::init<Eigen::DenseIndex>(
bp::arg("size"), "Default constructor with memory preallocation")) bp::arg("size"), "Default constructor with memory preallocation"))
...@@ -76,7 +75,6 @@ struct EigenSolverVisitor ...@@ -76,7 +75,6 @@ struct EigenSolverVisitor
} }
static void expose(const std::string& name) { static void expose(const std::string& name) {
namespace bp = boost::python;
bp::class_<Solver>(name.c_str(), bp::no_init).def(EigenSolverVisitor()); bp::class_<Solver>(name.c_str(), bp::no_init).def(EigenSolverVisitor());
} }
......
...@@ -28,7 +28,6 @@ struct LDLTSolverVisitor ...@@ -28,7 +28,6 @@ struct LDLTSolverVisitor
template <class PyClass> template <class PyClass>
void visit(PyClass &cl) const { void visit(PyClass &cl) const {
namespace bp = boost::python;
cl.def(bp::init<>(bp::arg("self"), "Default constructor")) cl.def(bp::init<>(bp::arg("self"), "Default constructor"))
.def(bp::init<Eigen::DenseIndex>( .def(bp::init<Eigen::DenseIndex>(
bp::args("self", "size"), bp::args("self", "size"),
...@@ -106,7 +105,6 @@ struct LDLTSolverVisitor ...@@ -106,7 +105,6 @@ struct LDLTSolverVisitor
} }
static void expose(const std::string &name) { static void expose(const std::string &name) {
namespace bp = boost::python;
bp::class_<Solver>( bp::class_<Solver>(
name.c_str(), name.c_str(),
"Robust Cholesky decomposition of a matrix with pivoting.\n\n" "Robust Cholesky decomposition of a matrix with pivoting.\n\n"
......
...@@ -28,7 +28,6 @@ struct LLTSolverVisitor ...@@ -28,7 +28,6 @@ struct LLTSolverVisitor
template <class PyClass> template <class PyClass>
void visit(PyClass &cl) const { void visit(PyClass &cl) const {
namespace bp = boost::python;
cl.def(bp::init<>(bp::arg("self"), "Default constructor")) cl.def(bp::init<>(bp::arg("self"), "Default constructor"))
.def(bp::init<Eigen::DenseIndex>( .def(bp::init<Eigen::DenseIndex>(
bp::args("self", "size"), bp::args("self", "size"),
...@@ -99,7 +98,6 @@ struct LLTSolverVisitor ...@@ -99,7 +98,6 @@ struct LLTSolverVisitor
} }
static void expose(const std::string &name) { static void expose(const std::string &name) {
namespace bp = boost::python;
bp::class_<Solver>( bp::class_<Solver>(
name.c_str(), name.c_str(),
"Standard Cholesky decomposition (LL^T) of a matrix and associated " "Standard Cholesky decomposition (LL^T) of a matrix and associated "
......
...@@ -24,7 +24,6 @@ struct SelfAdjointEigenSolverVisitor ...@@ -24,7 +24,6 @@ struct SelfAdjointEigenSolverVisitor
template <class PyClass> template <class PyClass>
void visit(PyClass& cl) const { void visit(PyClass& cl) const {
namespace bp = boost::python;
cl.def(bp::init<>(bp::arg("self"), "Default constructor")) cl.def(bp::init<>(bp::arg("self"), "Default constructor"))
.def(bp::init<Eigen::DenseIndex>( .def(bp::init<Eigen::DenseIndex>(
bp::args("self", "size"), bp::args("self", "size"),
...@@ -84,7 +83,6 @@ struct SelfAdjointEigenSolverVisitor ...@@ -84,7 +83,6 @@ struct SelfAdjointEigenSolverVisitor
} }
static void expose(const std::string& name) { static void expose(const std::string& name) {
namespace bp = boost::python;
bp::class_<Solver>(name.c_str(), bp::no_init) bp::class_<Solver>(name.c_str(), bp::no_init)
.def(SelfAdjointEigenSolverVisitor()); .def(SelfAdjointEigenSolverVisitor());
} }
......
...@@ -28,7 +28,6 @@ struct IterativeSolverBaseVisitor ...@@ -28,7 +28,6 @@ struct IterativeSolverBaseVisitor
template <class PyClass> template <class PyClass>
void visit(PyClass& cl) const { void visit(PyClass& cl) const {
namespace bp = boost::python;
cl.def("analyzePattern", cl.def("analyzePattern",
(Solver & (Solver::*)(const Eigen::EigenBase<MatrixType>& matrix)) & (Solver & (Solver::*)(const Eigen::EigenBase<MatrixType>& matrix)) &
Solver::analyzePattern, Solver::analyzePattern,
...@@ -137,7 +136,6 @@ struct MINRESSolverVisitor ...@@ -137,7 +136,6 @@ struct MINRESSolverVisitor
template <class PyClass> template <class PyClass>
void visit(PyClass& cl) const { void visit(PyClass& cl) const {
namespace bp = boost::python;
cl.def(bp::init<>(bp::arg("self"), "Default constructor")) cl.def(bp::init<>(bp::arg("self"), "Default constructor"))
.def(bp::init<MatrixType>( .def(bp::init<MatrixType>(
bp::args("self", "matrix"), bp::args("self", "matrix"),
...@@ -155,7 +153,6 @@ struct MINRESSolverVisitor ...@@ -155,7 +153,6 @@ struct MINRESSolverVisitor
} }
static void expose(const std::string& name) { static void expose(const std::string& name) {
namespace bp = boost::python;
bp::class_<Solver, boost::noncopyable>( bp::class_<Solver, boost::noncopyable>(
name.c_str(), name.c_str(),
"A minimal residual solver for sparse symmetric problems.\n" "A minimal residual solver for sparse symmetric problems.\n"
......
...@@ -59,7 +59,6 @@ struct to_python_indirect< ...@@ -59,7 +59,6 @@ struct to_python_indirect<
} // namespace boost } // namespace boost
namespace eigenpy { namespace eigenpy {
namespace bp = boost::python;
template <typename MatType, typename _Scalar> template <typename MatType, typename _Scalar>
struct EigenToPy { struct EigenToPy {
......
...@@ -70,6 +70,12 @@ ...@@ -70,6 +70,12 @@
#include <boost/python.hpp> #include <boost/python.hpp>
#include <boost/python/scope.hpp> #include <boost/python/scope.hpp>
namespace eigenpy {
namespace bp = boost::python;
}
#define NO_IMPORT_ARRAY #define NO_IMPORT_ARRAY
#include "eigenpy/numpy.hpp" #include "eigenpy/numpy.hpp"
#undef NO_IMPORT_ARRAY #undef NO_IMPORT_ARRAY
...@@ -91,8 +97,6 @@ ...@@ -91,8 +97,6 @@
#define EIGENPY_UNUSED_VARIABLE(var) (void)(var) #define EIGENPY_UNUSED_VARIABLE(var) (void)(var)
#include "eigenpy/expose.hpp"
#ifdef EIGENPY_WITH_CXX11_SUPPORT #ifdef EIGENPY_WITH_CXX11_SUPPORT
#include <memory> #include <memory>
#define EIGENPY_SHARED_PTR_HOLDER_TYPE(T) ::std::shared_ptr<T> #define EIGENPY_SHARED_PTR_HOLDER_TYPE(T) ::std::shared_ptr<T>
...@@ -113,5 +117,6 @@ struct EigenFromPy; ...@@ -113,5 +117,6 @@ struct EigenFromPy;
} // namespace eigenpy } // namespace eigenpy
#include "eigenpy/alignment.hpp" #include "eigenpy/alignment.hpp"
#include "eigenpy/expose.hpp"
#endif // ifndef __eigenpy_fwd_hpp__ #endif // ifndef __eigenpy_fwd_hpp__
...@@ -10,8 +10,6 @@ ...@@ -10,8 +10,6 @@
namespace eigenpy { namespace eigenpy {
namespace bp = boost::python;
template <typename Scalar, int Options = 0> template <typename Scalar, int Options = 0>
struct EulerAnglesConvertor { struct EulerAnglesConvertor {
typedef typename Eigen::Matrix<Scalar, 3, 1, Options> Vector3; typedef typename Eigen::Matrix<Scalar, 3, 1, Options> Vector3;
......
...@@ -14,7 +14,6 @@ ...@@ -14,7 +14,6 @@
#include "eigenpy/scalar-conversion.hpp" #include "eigenpy/scalar-conversion.hpp"
namespace eigenpy { namespace eigenpy {
namespace bp = boost::python;
template <typename Scalar> template <typename Scalar>
bool np_type_is_convertible_into_scalar(const int np_type) { bool np_type_is_convertible_into_scalar(const int np_type) {
......
...@@ -65,8 +65,6 @@ class ExceptionIndex : public Exception { ...@@ -65,8 +65,6 @@ class ExceptionIndex : public Exception {
} }
}; };
namespace bp = boost::python;
template <typename QuaternionDerived> template <typename QuaternionDerived>
class QuaternionVisitor; class QuaternionVisitor;
......
...@@ -31,7 +31,6 @@ struct EIGENPY_DLLAPI Register { ...@@ -31,7 +31,6 @@ struct EIGENPY_DLLAPI Register {
template <typename Scalar> template <typename Scalar>
static PyTypeObject *getPyType() { static PyTypeObject *getPyType() {
namespace bp = boost::python;
if (!isNumpyNativeType<Scalar>()) { if (!isNumpyNativeType<Scalar>()) {
const PyTypeObject *const_py_type_ptr = const PyTypeObject *const_py_type_ptr =
bp::converter::registered_pytype<Scalar>::get_pytype(); bp::converter::registered_pytype<Scalar>::get_pytype();
...@@ -53,7 +52,6 @@ struct EIGENPY_DLLAPI Register { ...@@ -53,7 +52,6 @@ struct EIGENPY_DLLAPI Register {
template <typename Scalar> template <typename Scalar>
static PyArray_Descr *getPyArrayDescr() { static PyArray_Descr *getPyArrayDescr() {
namespace bp = boost::python;
if (!isNumpyNativeType<Scalar>()) { if (!isNumpyNativeType<Scalar>()) {
return getPyArrayDescr(getPyType<Scalar>()); return getPyArrayDescr(getPyType<Scalar>());
} else { } else {
......
...@@ -3,12 +3,13 @@ ...@@ -3,12 +3,13 @@
* Copyright 2018-2019, INRIA * Copyright 2018-2019, INRIA
*/ */
#include "eigenpy/fwd.hpp"
#ifndef __eigenpy_registration_hpp__ #ifndef __eigenpy_registration_hpp__
#define __eigenpy_registration_hpp__ #define __eigenpy_registration_hpp__
#include "eigenpy/fwd.hpp"
namespace eigenpy { namespace eigenpy {
/// ///
/// \brief Check at runtime the registration of the type T inside the boost /// \brief Check at runtime the registration of the type T inside the boost
/// python registry. /// python registry.
...@@ -19,8 +20,6 @@ namespace eigenpy { ...@@ -19,8 +20,6 @@ namespace eigenpy {
/// ///
template <typename T> template <typename T>
inline bool check_registration() { inline bool check_registration() {
namespace bp = boost::python;
const bp::type_info info = bp::type_id<T>(); const bp::type_info info = bp::type_id<T>();
const bp::converter::registration* reg = bp::converter::registry::query(info); const bp::converter::registration* reg = bp::converter::registry::query(info);
if (reg == NULL) if (reg == NULL)
...@@ -40,8 +39,6 @@ inline bool check_registration() { ...@@ -40,8 +39,6 @@ inline bool check_registration() {
/// ///
template <typename T> template <typename T>
inline bool register_symbolic_link_to_registered_type() { inline bool register_symbolic_link_to_registered_type() {
namespace bp = boost::python;
if (eigenpy::check_registration<T>()) { if (eigenpy::check_registration<T>()) {
const bp::type_info info = bp::type_id<T>(); const bp::type_info info = bp::type_id<T>();
const bp::converter::registration* reg = const bp::converter::registration* reg =
......
...@@ -24,8 +24,6 @@ ...@@ -24,8 +24,6 @@
namespace eigenpy { namespace eigenpy {
namespace bp = boost::python;
template <typename Preconditioner> template <typename Preconditioner>
struct BFGSPreconditionerBaseVisitor struct BFGSPreconditionerBaseVisitor
: public bp::def_visitor<BFGSPreconditionerBaseVisitor<Preconditioner> > { : public bp::def_visitor<BFGSPreconditionerBaseVisitor<Preconditioner> > {
......
...@@ -23,8 +23,6 @@ ...@@ -23,8 +23,6 @@
namespace eigenpy { namespace eigenpy {
namespace bp = boost::python;
template <typename Preconditioner> template <typename Preconditioner>
struct PreconditionerBaseVisitor struct PreconditionerBaseVisitor
: public bp::def_visitor<PreconditionerBaseVisitor<Preconditioner> > { : public bp::def_visitor<PreconditionerBaseVisitor<Preconditioner> > {
......
...@@ -24,8 +24,6 @@ ...@@ -24,8 +24,6 @@
namespace eigenpy { namespace eigenpy {
namespace bp = boost::python;
template <typename ConjugateGradient> template <typename ConjugateGradient>
struct ConjugateGradientVisitor struct ConjugateGradientVisitor
: public boost::python::def_visitor< : public boost::python::def_visitor<
......
...@@ -22,8 +22,6 @@ ...@@ -22,8 +22,6 @@
namespace eigenpy { namespace eigenpy {
namespace bp = boost::python;
template <typename IterativeSolver> template <typename IterativeSolver>
struct IterativeSolverVisitor : public boost::python::def_visitor< struct IterativeSolverVisitor : public boost::python::def_visitor<
IterativeSolverVisitor<IterativeSolver> > { IterativeSolverVisitor<IterativeSolver> > {
......
...@@ -24,8 +24,6 @@ ...@@ -24,8 +24,6 @@
namespace eigenpy { namespace eigenpy {
namespace bp = boost::python;
template <typename LeastSquaresConjugateGradient> template <typename LeastSquaresConjugateGradient>
struct LeastSquaresConjugateGradientVisitor struct LeastSquaresConjugateGradientVisitor
: public boost::python::def_visitor<LeastSquaresConjugateGradientVisitor< : public boost::python::def_visitor<LeastSquaresConjugateGradientVisitor<
......
...@@ -21,8 +21,6 @@ ...@@ -21,8 +21,6 @@
namespace eigenpy { namespace eigenpy {
namespace bp = boost::python;
template <typename SparseSolver> template <typename SparseSolver>
struct SparseSolverVisitor struct SparseSolverVisitor
: public bp::def_visitor<SparseSolverVisitor<SparseSolver> > { : public bp::def_visitor<SparseSolverVisitor<SparseSolver> > {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment