simple.cpp
Go to the documentation of this file.
1 /* Simple test with boost::python.
2  * Declare and bind three function, returning char*, string, and Eigen::Vector. The last
3  * function raises and error at runtime due to inadequate binding.
4  */
5 
6 #include <string>
7 
8 #include "eigenpy/fwd.hpp"
9 
10 
11 char const* testchar()
12 {
13  return "Yay char!";
14 }
15 
16 std::string teststr()
17 {
18  return "Yay str!";
19 }
20 
21 Eigen::VectorXd testeigenvec()
22 {
23  Eigen::VectorXd v(555);
24  return v;
25 }
26 
27 
29 {
30  using namespace boost::python;
31  def("char", testchar);
32  def("str", teststr);
33  def("eigenvec",testeigenvec);
34 }
BOOST_PYTHON_MODULE(libsimple)
Definition: simple.cpp:28
char const * testchar()
Definition: simple.cpp:11
Eigen::VectorXd testeigenvec()
Definition: simple.cpp:21
std::string teststr()
Definition: simple.cpp:16


eigenpy
Author(s): Justin Carpentier, Nicolas Mansard
autogenerated on Sat Apr 17 2021 02:37:59