pybind_wrapper_test_script.py
Go to the documentation of this file.
1 import pybind_wrapper_test as pwt
2 
3 p2 = pwt.sub.Point2(10, 20)
4 print(p2.sum())
5 print(p2.func_with_default_args(10))
6 print(p2.func_with_default_args(10, 10))
7 p2.print_("test print")
8 
9 p22 = pwt.sub.Point2(10)
10 print(p22.y())
11 
12 p3 = pwt.Point3(10, 20, 30)
13 print(p3.sum())
14 print(p3.x(to_add=100))
15 
16 print(pwt.global_func_on_base(p2))
17 print(pwt.global_func_on_base(p3))
18 
19 # Test template class.
20 # Construct with POINT
21 template_p2 = pwt.TemplatePoint2(p2)
22 print(template_p2.overload())
23 
24 template_p3 = pwt.TemplatePoint3(p3)
25 print(template_p3.overload())
26 print(template_p3.overload(p3))
27 
28 # Construct with This
29 template_p3_copy = pwt.TemplatePoint3(template_p3)
30 print(template_p3_copy.overload())
31 print(template_p3.overload(template_p3_copy))
32 
33 # Function of template type.
34 ret_p3 = template_p3.method_on_template_type(p3)
35 print(ret_p3.z())
36 
37 # Function of This class type.
38 this = template_p3.method_on_this(p3)
39 print(this.method_on_template_type(p3).sum())
40 
41 # Static function.
42 another_this = pwt.TemplatePoint2.static_method(other=template_p2, dummy=0.0)
43 
44 # Template function of other POINT type.
45 print(another_this.template_methodPoint3(p3))
46 print(another_this.template_methodPoint2(p2))
47 
48 # Typedef template instantiation.
49 inst = pwt.Template2Point2Point3Instantiation(p2, p3)
50 inst.property_t1 = pwt.sub.Point2(100)
51 print("inst overload: ", inst.sum_x())
52 print(inst.sum_x(p2))
53 print(inst.sum_x(p3))
54 print(inst.sum_x(p2, p3))
55 print(inst.property_t1.sum())
56 
57 # Properties
58 p4 = pwt.sub2.Point4(p2, 30, 40)
59 print(p4.p.sum())
60 print(p4.sum())
61 p4.z = 40
62 print(p4.sum())
void print(const Matrix &A, const string &s, ostream &stream)
Definition: Matrix.cpp:155
const mpreal sum(const mpreal tab[], const unsigned long int n, int &status, mp_rnd_t mode=mpreal::get_default_rnd())
Definition: mpreal.h:2381


gtsam
Author(s):
autogenerated on Sat May 8 2021 02:43:44