Skip to content
Snippets Groups Projects
main.cpp 1.56 KiB
Newer Older
/*
 * Copyright 2014-2019, CNRS
Justin Carpentier's avatar
Justin Carpentier committed
 * Copyright 2018-2022, INRIA

#include "eigenpy/eigenpy.hpp"
#include "eigenpy/version.hpp"
#include "eigenpy/geometry.hpp"

#include "eigenpy/computation-info.hpp"

#include "eigenpy/solvers/solvers.hpp"
#include "eigenpy/solvers/preconditioners.hpp"
#include "eigenpy/decompositions/decompositions.hpp"
#include "eigenpy/utils/is-approx.hpp"

jcarpent's avatar
jcarpent committed
#include <boost/python/scope.hpp>
jcarpent's avatar
jcarpent committed
using namespace eigenpy;
BOOST_PYTHON_MODULE(eigenpy_pywrap)
  namespace bp = boost::python;
jcarpent's avatar
jcarpent committed
  enableEigenPy();
  bp::scope().attr("__version__") = eigenpy::printVersion();
  bp::scope().attr("__raw_version__") = bp::str(EIGENPY_VERSION);
  bp::def("checkVersionAtLeast",&eigenpy::checkVersionAtLeast,
          bp::args("major_version","minor_version","patch_version"),
          "Checks if the current version of EigenPy is at least the version provided by the input arguments.");
jcarpent's avatar
jcarpent committed
  exposeAngleAxis();
  exposeQuaternion();
  exposeGeometryConversion();
  exposeComputationInfo();
    bp::scope solvers = boost::python::class_<SolversScope>("solvers");
jcarpent's avatar
jcarpent committed
    exposeSolvers();
    exposePreconditioners();
    register_symbolic_link_to_registered_type<Eigen::ComputationInfo>();
  {
    using namespace Eigen;
    bp::def("is_approx",(bool (*)(const Eigen::MatrixBase<MatrixXd> &, const Eigen::MatrixBase<MatrixXd> &, const double &))&is_approx<MatrixXd,MatrixXd>,
Justin Carpentier's avatar
Justin Carpentier committed
            (bp::arg("A"),bp::arg("B"),bp::arg("prec") = 1e-12),
            "Returns True if A is approximately equal to B, within the precision determined by prec.");
  exposeDecompositions();