Chapter 6: Python Class and Interface
Python (www.python.org) is an interpreted,
interactive, object-oriented programming language.
It is easy to learn, yet expressive, has a clear, elegant syntax, intuitive error
checking facilities and does not require a compilation step.
A Python module with a class implementing the dVegas
algorithm and interface is located in subdirectory python/. The module uses
Numerical Python for efficient array handling. The NumPy package can be obtained
from http://numpy.sourceforge.net. An example
that demonstrates the use of dVegas.py is included in file demo.py.
The directory python/cpp/ contains a Python module dVegas.py that wraps
around the C++ implementation. It can be used in cases where the performance of
the Python implementation is insufficient. To that end the shared library
_dvegasmodule.so has to be created using commands similar to
unix> g++ -c -DSIZEOF_LONG_LONG=8 -I/usr/local/python/include/python1.5
-I/usr/local/python/include/python1.5/numeric -I../../include -fPIC _dvegasmodule.cpp
unix> g++ -shared -o _dvegasmodule.so _dvegasmodule.o ../../src/dvegas.o -lCLHEP