This is a little code to calculate contour lines of a function evaluated on a grid. The output is a 2-column matrix containing contour lines following the format of Matlab's contourc function.
The algorithm is taken from the PLPlot package, but the interface for the algorithm was written in C++. Thanks to Alan Irwin and João Cardoso of the PLPlot team for their help in understanding the code.
To use, you will need the Blitz++ library, as currently only Blitz++ Arrays are supported to handle the vectors and matrices involved. Then include the header file contourl.h in your sources, and compile with a line such as: g++ -o your_program your_program.cc contourl.cc -lblitz.I have only tested this code on a PC with Debian Woody installed, g++ version 2.95.4 and blitz++ version 20001213.
contourl is distributed under the GNU Library General Public License.
Send comments and suggestions.
|(13 May 2004)