chiark / gitweb /
octave4.4
[nlopt.git] / swig / nlopt.i
1 // -*- C++ -*-
2
3 %define DOCSTRING
4 "NLopt is a multi-language library for nonlinear optimization (local or
5 global, with or without derivatives, and supporting nonlinear
6 constraints).  Complete documentation, including a Python tutorial,
7 can be found at the NLopt web page: http://ab-initio.mit.edu/nlopt"
8 %enddef
9
10 %module(docstring=DOCSTRING) nlopt
11 %{
12 #include "nlopt.hpp"
13 %}
14
15 %include "std_vector.i"
16 namespace std {
17   %template(nlopt_doublevector) vector<double>;
18 };
19
20 // prepend "nlopt_" in Guile to substitute for namespace
21 #if defined(SWIGGUILE)
22 %rename(nlopt_opt) nlopt::opt;
23 %rename(nlopt_roundoff_limited) nlopt::roundoff_limited;
24 %rename(nlopt_forced_stop) nlopt::forced_stop;
25 %rename(nlopt_srand) nlopt::srand;
26 %rename(nlopt_srand_time) nlopt::srand_time;
27 %rename(nlopt_version) nlopt::version;
28 %rename(nlopt_version_major) nlopt::version_major;
29 %rename(nlopt_version_minor) nlopt::version_minor;
30 %rename(nlopt_version_bugfix) nlopt::version_bugfix;
31 %rename(nlopt_algorithm_name) nlopt::algorithm_name;
32 %include "nlopt-enum-renames.i"
33 #endif
34
35 %include "nlopt-exceptions.i"
36
37 #ifdef SWIGGUILE
38 %include "nlopt-guile.i"
39 #endif
40
41 #ifdef SWIGPYTHON
42 %include "nlopt-python.i"
43 #endif
44
45 %include "nlopt.hpp"