main.cpp
Go to the documentation of this file.
1 /*
2  * Copyright 2014-2019, CNRS
3  * Copyright 2018-2024, INRIA
4  */
5 
6 #include <boost/python/scope.hpp>
7 
10 #include "eigenpy/eigenpy.hpp"
11 #include "eigenpy/geometry.hpp"
14 #include "eigenpy/std-vector.hpp"
16 #include "eigenpy/version.hpp"
17 
18 using namespace eigenpy;
19 
20 template <typename Scalar>
22  enum { Options = 0 };
23  EIGENPY_MAKE_TYPEDEFS(Scalar, Options, s, Eigen::Dynamic, X);
24  EIGENPY_UNUSED_TYPE(VectorXs);
25  EIGENPY_UNUSED_TYPE(RowVectorXs);
26  // typedef Eigen::SparseMatrix<Scalar, Options> SparseMatrixXs;
27  typedef typename MatrixXs::RealScalar RealScalar;
28 
29  using namespace Eigen;
30  const RealScalar dummy_precision =
31  Eigen::NumTraits<RealScalar>::dummy_precision();
32 
33  bp::def("is_approx",
34  (bool (*)(const Eigen::MatrixBase<MatrixXs> &,
35  const Eigen::MatrixBase<MatrixXs> &, const RealScalar &)) &
36  is_approx,
37  (bp::arg("A"), bp::arg("B"), bp::arg("prec") = dummy_precision),
38  "Returns True if A is approximately equal to B, within the "
39  "precision determined by prec.");
40 
41  // bp::def("is_approx",
42  // (bool (*)(const Eigen::SparseMatrixBase<SparseMatrixXs> &,
43  // const Eigen::SparseMatrixBase<SparseMatrixXs> &,
44  // const RealScalar &)) &
45  // is_approx,
46  // (bp::arg("A"), bp::arg("B"), bp::arg("prec") = dummy_precision),
47  // "Returns True if A is approximately equal to B, within the "
48  // "precision determined by prec.");
49 }
50 
51 BOOST_PYTHON_MODULE(eigenpy_pywrap) {
52  enableEigenPy();
53 
54  bp::scope().attr("__version__") = eigenpy::printVersion();
55  bp::scope().attr("__eigen_version__") = eigenpy::printEigenVersion();
56  bp::scope().attr("__raw_version__") = bp::str(EIGENPY_VERSION);
57  bp::def("checkVersionAtLeast", &eigenpy::checkVersionAtLeast,
58  bp::args("major_version", "minor_version", "patch_version"),
59  "Checks if the current version of EigenPy is at least the version "
60  "provided by the input arguments.");
61 
62  bp::def("SimdInstructionSetsInUse", &Eigen::SimdInstructionSetsInUse,
63  "Get the set of SIMD instructions in use with Eigen.");
64 
69 
71 
72  {
73  bp::scope solvers = boost::python::class_<SolversScope>("solvers");
74  exposeSolvers();
76 
77  register_symbolic_link_to_registered_type<Eigen::ComputationInfo>();
78  }
79 
80  exposeIsApprox<double>();
81  exposeIsApprox<std::complex<double> >();
82 
84 }
test_CholmodSimplicialLDLT.X
X
Definition: test_CholmodSimplicialLDLT.py:17
computation-info.hpp
eigenpy::exposeAngleAxis
void EIGENPY_DLLAPI exposeAngleAxis()
Definition: angle-axis.cpp:10
eigenpy::checkVersionAtLeast
bool EIGENPY_DLLAPI checkVersionAtLeast(unsigned int major_version, unsigned int minor_version, unsigned int patch_version)
Checks if the current version of EigenPy is at least the version provided by the input arguments.
Definition: version.cpp:27
solvers.hpp
Eigen
Definition: complex.cpp:7
is-approx.hpp
eigenpy::exposeQuaternion
void EIGENPY_DLLAPI exposeQuaternion()
Definition: quaternion.cpp:12
eigenpy::enableEigenPy
void EIGENPY_DLLAPI enableEigenPy()
Definition: eigenpy.cpp:42
eigenpy::exposeComputationInfo
void exposeComputationInfo()
Definition: computation-info.hpp:11
eigenpy::exposeSolvers
void EIGENPY_DLLAPI exposeSolvers()
eigenpy::is_approx
EIGEN_DONT_INLINE bool is_approx(const Eigen::MatrixBase< MatrixType1 > &mat1, const Eigen::MatrixBase< MatrixType2 > &mat2, const typename MatrixType1::RealScalar &prec)
Definition: is-approx.hpp:13
EIGENPY_UNUSED_TYPE
#define EIGENPY_UNUSED_TYPE(type)
Definition: fwd.hpp:112
BOOST_PYTHON_MODULE
BOOST_PYTHON_MODULE(eigenpy_pywrap)
Definition: main.cpp:51
version.hpp
eigenpy::exposePreconditioners
void EIGENPY_DLLAPI exposePreconditioners()
eigenpy
Definition: alignment.hpp:14
exposeIsApprox
void exposeIsApprox()
Definition: main.cpp:21
decompositions.hpp
preconditioners.hpp
geometry.hpp
eigenpy.hpp
eigenpy::exposeDecompositions
void EIGENPY_DLLAPI exposeDecompositions()
Definition: decompositions.cpp:21
eigenpy::printVersion
std::string EIGENPY_DLLAPI printVersion(const std::string &delimiter=".")
Returns the current version of EigenPy as a string using the following standard: EIGENPY_MINOR_VERSIO...
Definition: version.cpp:13
eigenpy::exposeGeometryConversion
void EIGENPY_DLLAPI exposeGeometryConversion()
Definition: geometry-conversion.cpp:10
eigenpy::exposeStdVector
void EIGENPY_DLLAPI exposeStdVector()
Definition: std-vector.cpp:10
std-vector.hpp
EIGENPY_MAKE_TYPEDEFS
#define EIGENPY_MAKE_TYPEDEFS(Type, Options, TypeSuffix, Size, SizeSuffix)
Definition: eigen-typedef.hpp:10
eigenpy::printEigenVersion
std::string EIGENPY_DLLAPI printEigenVersion(const std::string &delimiter=".")
Returns the current version of Eigen3 as a string using the following standard: EIGEN_MINOR_VERSION....
Definition: version.cpp:20


eigenpy
Author(s): Justin Carpentier, Nicolas Mansard
autogenerated on Fri Jun 14 2024 02:15:58