예제 #1
0
파일: graph.hpp 프로젝트: vdeepak13/sill
  void register_basic_functions() {
    using namespace boost::python;

    std::pair<edge_iterator,edge_iterator> (Graph::*edges)() const = &Graph::edges;
    bool (Graph::*contains_vert)(const vertex&) const            = &Graph::contains;
    bool (Graph::*contains_edge)(const edge&) const              = &Graph::contains;
    bool (Graph::*contains_vp)(const vertex&, const vertex&) const = &Graph::contains; 
    const vertex_property& (Graph::*get_vp)(const vertex&) const = &Graph::operator[];
    const edge_property&   (Graph::*get_ep)(const edge&)   const = &Graph::operator[];
    
    c_.def("vertices", &Graph::vertices)
      .def("edges", edges)
      .def("in_edges", &Graph::in_edges)
      .def("out_edges", &Graph::out_edges)
      .def("contains", contains_vert)
      .def("contains", contains_edge)
      .def("contains", contains_vp)
      .def("get_edge", &Graph::get_edge)
      .def("in_degree", &Graph::in_degree)
      .def("out_degree", &Graph::out_degree)
      .def("degree", &Graph::degree)
      .def("empty", &Graph::empty)
      .def("num_vertices", &Graph::num_vertices)
      .def("num_edges", &Graph::num_edges)
      .def("reverse", &Graph::reverse)
      .def("__contains__", contains_vert)
      .def("__contains__", contains_edge)
      .def("__getitem__", get_vp, PropertyCallPolicy())
      .def("__getitem__", get_ep, PropertyCallPolicy())
      .def("null_vertex", &Graph::null_vertex, return_vertex_policy<vertex>())
      .def(self == self)
      .def(self_ns::str(self));
  }
예제 #2
0
 read_write_property_map(boost::python::class_<T, Basis, HeldType, NonCopyable>& pm)
 {
   pm.def("__getitem__", &getitem)
     .def("__setitem__", &setitem)
     ;
   
   using detail::property_map_extras;
   property_map_extras(pm, type<PropertyMap>(), 0);
 }
예제 #3
0
 static void def_init(boost::python::class_<wt> &klass) {
   using namespace boost::python;
   klass.def(init<NormalEquations &,                    // normal_equations
             cctbx::xray::observations<FloatType> const &,         // miller_indices+data+sigmas
             af::const_ref<std::complex<FloatType> > const &,      // f_mask
             WeightingSchemeType<FloatType> const &,               // weighting_scheme
             boost::optional<FloatType>,                           // scale_factor
             OneMillerIndexLinearisation &,                        // f_calc_function
             scitbx::sparse::matrix<FloatType> const &,            // jacobian_transpose_matching_grad_fc
             cctbx::xray::extinction_correction<FloatType> &,      // extinction
             optional<bool> >                                      // objective_only=false
             ());
 }
예제 #4
0
  lvalue_property_map(boost::python::class_<T, Basis, HeldType, NonCopyable>& pm)
  {
    using boost::python::class_;
    using boost::python::no_init;
    using boost::python::return_value_policy;
    using boost::python::return_internal_reference;

    pm.def("__getitem__", &getitem, return_internal_reference<1>())
      .def("__setitem__", &setitem)
      ;

    detail::property_map_extras(pm, type<PropertyMap>(), 0);
  }
예제 #5
0
 readable_property_map(boost::python::class_<T, Basis, HeldType, NonCopyable>& pm)
 {
   pm.def("__getitem__", &getitem);
 }
예제 #6
0
 void bind_typed_matrix4_extra(bpy::class_<UnalignedMatrix44<double> >& X)
 {
     X.def(bpy::init<UnalignedMatrix44<float> >());
 }