@@ -37,7 +37,7 @@ namespace pycppad
3737 // .def("swap", &ADFun::swap, bp::args("self", "f"))
3838 .def (" from_json" , &ADFun::from_json, bp::args (" self" , " json" ))
3939 // .def("from_graph", &ADFun::from_graph, bp::args("self", "graph_obj"))
40- .def (" to_json" , &ADFun::to_json, bp::arg (" self" ))
40+ // .def("to_json", &ADFun::to_json, bp::arg("self"))
4141 .def (" size_order" , &ADFun::size_order, bp::arg (" self" ))
4242 .def (" Dependent" ,&Dependent,
4343 bp::args (" self" , " x" , " y" ))
@@ -74,13 +74,28 @@ namespace pycppad
7474 return f;
7575 }
7676
77+ protected:
78+
79+ static std::string & get_class_name ()
80+ {
81+ static std::string class_name;
82+ return class_name;
83+ }
84+
85+ static void set_class_name (const std::string & class_name)
86+ {
87+ get_class_name () = class_name;
88+ }
89+
90+
7791 public:
78- static void expose ()
92+ static void expose (const std::string & class_name = " ADFun " )
7993 {
80- bp::class_<ADFun, boost::noncopyable>(" ADFun" ,
81- " Class used to hold function objects.\n\n " ,
82- bp::init<>())
83- .def (ADFunVisitor<Scalar>());
94+ set_class_name (class_name);
95+ bp::class_<ADFun, boost::noncopyable>(class_name.c_str (),
96+ " Class used to hold function objects.\n\n " ,
97+ bp::init<>())
98+ .def (ADFunVisitor<Scalar>());
8499
85100 }
86101 };
0 commit comments