2 Test weave support for SWIG wrapped objects.
4 This example requires that one has weave installed. Weave is
5 distributed as part of SciPy (http://www.scipy.org). More information
6 on Weave may be had from here:
8 http://www.scipy.org/documentation/weave
10 As of November 22, 2004, this only works with weave from CVS. If
11 there is a more recent release of SciPy after this date, it should
18 from weave import converters
19 from weave import swig2_spec
21 # Weave does not support swig2 by default (yet). So add this to the
22 # list of default converters to test.
23 converters.default.insert(0, swig2_spec.swig2_converter())
26 """ A simple test case for weave."""
35 v = example.VectorBar()
40 v = example.VectorFoo()
47 std::cout << a->x << std::endl;
49 std::cout << b->y << std::endl;
51 std::cout << c->x << std::endl;
52 std::cout << c->y << std::endl;
53 std::cout << c->z << std::endl;
57 std::cout << d->y << std::endl;
59 std::cout << e->y << std::endl;
61 std::cout << f->x << std::endl;
63 std::cout << g->x << std::endl;
66 weave.inline(code, ['a', 'b', 'c', 'd', 'e', 'f', 'g'],
68 headers=['"example.h"'],
71 if __name__ == "__main__":