-
Notifications
You must be signed in to change notification settings - Fork 2
/
LuaNLopt API Documentation.html
132 lines (132 loc) · 15 KB
/
LuaNLopt API Documentation.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"><html><META http-equiv="Content-Type" content="text/html; charset=Latin-1"><head><title>2012-10-10 LuaNLopt API Documentation</title></head><body><table border=0 cellspacing=0 align="left"><tr valign=top><td><h4>1</h4></td><td style="padding-left:1em"><h4>
<strong>Abstract</strong></h4></td><tr valign=top><td>1.1</td><td style="padding-left:2em">
This is a projection of the NLopt C API as documented in <a href="http://ab-initio.mit.edu/wiki/index.php/NLopt_Reference"><ins>ab-initio.mit.edu/.../NLopt_Reference</ins></a> to Lua.</td><tr valign=top><td>1.2</td><td style="padding-left:2em">
Author: Rochus Keller, rkeller@nmr.ch</td><tr valign=top><td>1.3</td><td style="padding-left:2em">
Issue: 2012-10-14</td><tr valign=top><td><h4>2</h4></td><td style="padding-left:1em"><h4>
<strong>Definitions</strong></h4></td><tr valign=top><td>2.1</td><td style="padding-left:2em">
<code>nlopt</code></td><tr valign=top><td>2.1.1</td><td style="padding-left:3em">
This is the module object generated by the statement <code>require "LuaNLopt"</code>.</td><tr valign=top><td>2.2</td><td style="padding-left:2em">
<code>nlopt_opt</code></td><tr valign=top><td>2.2.1</td><td style="padding-left:3em">
This is an object of the type <code>nlopt_opt </code>generated by nlopt.create or <code>nlopt_opt:copy()</code>.</td><tr valign=top><td>2.2.2</td><td style="padding-left:3em">
Note the ":" syntax in contrast to "."</td><tr valign=top><td>2.3</td><td style="padding-left:2em">
<code>nlopt.algorithm</code></td><tr valign=top><td>2.3.1</td><td style="padding-left:3em">
Arguments of this type are integers which are members of the enumeration <code>nlopt.algorithm</code>.</td><tr valign=top><td>2.3.2</td><td style="padding-left:3em">
The elements <code>NLOPT_GN_DIRECT</code> etc. of the enumeration of the C API are mapped to <code>nlopt.algorithm.GN_DIRECT</code> etc.</td><tr valign=top><td>2.4</td><td style="padding-left:2em">
<code>any</code> </td><tr valign=top><td>2.4.1</td><td style="padding-left:3em">
is any valid Lua type</td><tr valign=top><td>2.5</td><td style="padding-left:2em">
<code>array</code></td><tr valign=top><td>2.5.1</td><td style="padding-left:3em">
is a Lua table used as an array of double; remember indices in Lua start with 1, not with 0!</td><tr valign=top><td>2.6</td><td style="padding-left:2em">
<code>nlopt.result</code></td><tr valign=top><td>2.6.1</td><td style="padding-left:3em">
Arguments of this type are integers which are members of the enumeration <code>nlopt.result</code>. </td><tr valign=top><td>2.6.2</td><td style="padding-left:3em">
The elements <code>NLOPT_FAILURE</code> etc. of the enumeration of the C API are mapped to <code>nlopt.result.FAILURE</code> etc.</td><tr valign=top><td>2.7</td><td style="padding-left:2em">
<code>n</code></td><tr valign=top><td>2.7.1</td><td style="padding-left:3em">
The number of dimensions passed to <code>nlopt.create</code></td><tr valign=top><td><h4>3</h4></td><td style="padding-left:1em"><h4>
API signatures</h4></td><tr valign=top><td>3.1</td><td style="padding-left:2em">
For a description of the functions see <a href="http://ab-initio.mit.edu/wiki/index.php/NLopt_Reference"><ins>ab-initio.mit.edu/.../NLopt_Reference</ins></a></td><tr valign=top><td><h4>3.2</h4></td><td style="padding-left:2em"><h4>
Functions of module nlopt</h4></td><tr valign=top><td>3.2.1</td><td style="padding-left:3em">
<code>nlopt.create(nlopt.algorithm algorithm, integer n)</code></td><tr valign=top><td>3.2.1.1</td><td style="padding-left:4em">
returns <code>nlopt_opt</code> </td><tr valign=top><td>3.2.2</td><td style="padding-left:3em">
<code>nlopt.algorithm_name(nlopt.algorithm algorithm)</code></td><tr valign=top><td>3.2.2.1</td><td style="padding-left:4em">
returns <code>string</code></td><tr valign=top><td>3.2.3</td><td style="padding-left:3em">
<code>nlopt.srand( integer seed )</code></td><tr valign=top><td>3.2.4</td><td style="padding-left:3em">
<code>nlopt.srand_time()</code></td><tr valign=top><td>3.2.5</td><td style="padding-left:3em">
<code>nlopt.version()</code></td><tr valign=top><td>3.2.5.1</td><td style="padding-left:4em">
returns <code>major, minor, bugfix</code></td><tr valign=top><td>3.2.5.2</td><td style="padding-left:4em">
Note that the output parameters are mapped to return values.</td><tr valign=top><td><h4>3.3</h4></td><td style="padding-left:2em"><h4>
<strong>Methods of object </strong><code>nlopt_opt</code></h4></td><tr valign=top><td>3.3.1</td><td style="padding-left:3em">
<code>nlopt_opt:copy()</code></td><tr valign=top><td>3.3.1.1</td><td style="padding-left:4em">
returns <code>nlopt_opt</code></td><tr valign=top><td>3.3.2</td><td style="padding-left:3em">
<code>nlopt_opt:get_algorithm()</code></td><tr valign=top><td>3.3.2.1</td><td style="padding-left:4em">
returns <code>nlopt.algorithm</code></td><tr valign=top><td>3.3.3</td><td style="padding-left:3em">
<code>nlopt_opt:get_dimension( nlopt_opt opt)</code></td><tr valign=top><td>3.3.3.1</td><td style="padding-left:4em">
returns <code>integer</code></td><tr valign=top><td>3.3.4</td><td style="padding-left:3em">
<code>nlopt_opt:set_min_objective( function func, any f_data)</code></td><tr valign=top><td>3.3.4.1</td><td style="padding-left:4em">
returns <code>nlopt.result</code></td><tr valign=top><td>3.3.4.2</td><td style="padding-left:4em">
<code>func</code> is a Lua function with the following signature</td><tr valign=top><td>3.3.4.2.1</td><td style="padding-left:5em">
<code>f(integer n, array x[1..n], array grad[1..n] | nil, any f_data)</code></td><tr valign=top><td>3.3.4.2.1.1</td><td style="padding-left:6em">
returns <code>double</code></td><tr valign=top><td>3.3.5</td><td style="padding-left:3em">
<code>nlopt_opt:set_max_objective( function func, any f_data )</code></td><tr valign=top><td>3.3.5.1</td><td style="padding-left:4em">
returns <code>nlopt.result</code></td><tr valign=top><td>3.3.6</td><td style="padding-left:3em">
<code>nlopt_opt:set_lower_bounds( array lb[1..n] )</code></td><tr valign=top><td>3.3.6.1</td><td style="padding-left:4em">
returns <code>nlopt.result</code></td><tr valign=top><td>3.3.7</td><td style="padding-left:3em">
<code>nlopt_opt:set_upper_bounds( array ub[1..n] )</code></td><tr valign=top><td>3.3.7.1</td><td style="padding-left:4em">
returns <code>nlopt.result</code></td><tr valign=top><td>3.3.8</td><td style="padding-left:3em">
<code>nlopt_opt:set_lower_bounds1( double lb )</code></td><tr valign=top><td>3.3.8.1</td><td style="padding-left:4em">
returns <code>nlopt.result</code></td><tr valign=top><td>3.3.9</td><td style="padding-left:3em">
<code>nlopt_opt:set_upper_bounds1( double ub )</code></td><tr valign=top><td>3.3.9.1</td><td style="padding-left:4em">
returns <code>nlopt.result</code></td><tr valign=top><td>3.3.10</td><td style="padding-left:3em">
<code>nlopt_opt:get_lower_bounds()</code></td><tr valign=top><td>3.3.10.1</td><td style="padding-left:4em">
returns <code>nlopt.result</code>, <code>array[ 1..n]</code></td><tr valign=top><td>3.3.10.2</td><td style="padding-left:4em">
Note that the output parameter is mapped to a return value.</td><tr valign=top><td>3.3.11</td><td style="padding-left:3em">
<code>nlopt_opt:get_upper_bounds()</code></td><tr valign=top><td>3.3.11.1</td><td style="padding-left:4em">
returns <code>nlopt.result</code>, <code>array[ 1..n]</code></td><tr valign=top><td>3.3.11.2</td><td style="padding-left:4em">
Note that the output parameter is mapped to a return value.</td><tr valign=top><td>3.3.12</td><td style="padding-left:3em">
<code>nlopt_opt:add_inequality_constraint( function func, any fc_data, double tol)</code></td><tr valign=top><td>3.3.12.1</td><td style="padding-left:4em">
returns <code>nlopt.result </code></td><tr valign=top><td>3.3.13</td><td style="padding-left:3em">
<code>nlopt_opt:add_equality_constraint( function func, any fc_data, double tol)</code></td><tr valign=top><td>3.3.13.1</td><td style="padding-left:4em">
returns <code>nlopt.result </code></td><tr valign=top><td>3.3.14</td><td style="padding-left:3em">
<code>nlopt_opt:remove_inequality_constraints()</code></td><tr valign=top><td>3.3.14.1</td><td style="padding-left:4em">
returns <code>nlopt.result </code></td><tr valign=top><td>3.3.15</td><td style="padding-left:3em">
<code>nlopt_opt:remove_equality_constraints()</code></td><tr valign=top><td>3.3.15.1</td><td style="padding-left:4em">
returns <code>nlopt.result </code></td><tr valign=top><td>3.3.16</td><td style="padding-left:3em">
<code>nlopt_opt:add_inequality_mconstraint( integer m, function mfunc, any c_data, array tol[1..m] | nil)</code></td><tr valign=top><td>3.3.16.1</td><td style="padding-left:4em">
returns <code>nlopt.result </code></td><tr valign=top><td>3.3.16.2</td><td style="padding-left:4em">
mfunc is a Lua function with the following signature</td><tr valign=top><td>3.3.16.2.1</td><td style="padding-left:5em">
<code>c( integer m, array result[1..m], integer n, array x[1..n], array grad[1..n*m], any f_data)</code></td><tr valign=top><td>3.3.17</td><td style="padding-left:3em">
<code>nlopt_opt:add_equality_mconstraint( integer m, function mfunc, any c_data, array tol[1..m] | nil)</code></td><tr valign=top><td>3.3.17.1</td><td style="padding-left:4em">
returns <code>nlopt.result </code></td><tr valign=top><td>3.3.18</td><td style="padding-left:3em">
<code>nlopt_opt:set_stopval( double stopval )</code></td><tr valign=top><td>3.3.18.1</td><td style="padding-left:4em">
returns <code>nlopt.result </code></td><tr valign=top><td>3.3.19</td><td style="padding-left:3em">
<code>nlopt_opt:get_stopval()</code></td><tr valign=top><td>3.3.19.1</td><td style="padding-left:4em">
returns <code>double</code></td><tr valign=top><td>3.3.20</td><td style="padding-left:3em">
<code>nlopt_opt:set_ftol_rel( double tol)</code></td><tr valign=top><td>3.3.20.1</td><td style="padding-left:4em">
returns <code>nlopt.result </code></td><tr valign=top><td>3.3.21</td><td style="padding-left:3em">
<code>nlopt_opt:get_ftol_rel()</code></td><tr valign=top><td>3.3.21.1</td><td style="padding-left:4em">
returns <code>double</code></td><tr valign=top><td>3.3.22</td><td style="padding-left:3em">
<code>nlopt_opt:set_ftol_abs( double tol )</code></td><tr valign=top><td>3.3.22.1</td><td style="padding-left:4em">
returns <code>nlopt.result </code></td><tr valign=top><td>3.3.23</td><td style="padding-left:3em">
<code>nlopt_opt:get_ftol_abs()</code></td><tr valign=top><td>3.3.23.1</td><td style="padding-left:4em">
returns <code>double</code></td><tr valign=top><td>3.3.24</td><td style="padding-left:3em">
<code>nlopt_opt:set_xtol_rel( double tol )</code></td><tr valign=top><td>3.3.24.1</td><td style="padding-left:4em">
returns <code>nlopt.result </code></td><tr valign=top><td>3.3.25</td><td style="padding-left:3em">
<code>nlopt_opt:get_xtol_rel()</code></td><tr valign=top><td>3.3.25.1</td><td style="padding-left:4em">
returns <code>double</code></td><tr valign=top><td>3.3.26</td><td style="padding-left:3em">
<code>nlopt_opt:set_xtol_abs( array tol[1..n] )</code></td><tr valign=top><td>3.3.26.1</td><td style="padding-left:4em">
returns <code>nlopt.result </code></td><tr valign=top><td>3.3.27</td><td style="padding-left:3em">
<code>nlopt_opt:get_xtol_abs()</code></td><tr valign=top><td>3.3.27.1</td><td style="padding-left:4em">
returns <code>nlopt.result</code>, <code>array[1..n]</code></td><tr valign=top><td>3.3.27.2</td><td style="padding-left:4em">
Note that the output parameter is mapped to a return value.</td><tr valign=top><td>3.3.28</td><td style="padding-left:3em">
<code>nlopt_opt:set_xtol_abs1( double tol )</code></td><tr valign=top><td>3.3.28.1</td><td style="padding-left:4em">
returns <code>nlopt.result </code></td><tr valign=top><td>3.3.29</td><td style="padding-left:3em">
<code>nlopt_opt:set_maxeval( integer maxeval )</code></td><tr valign=top><td>3.3.29.1</td><td style="padding-left:4em">
returns <code>nlopt.result </code></td><tr valign=top><td>3.3.30</td><td style="padding-left:3em">
<code>nlopt_opt:get_maxeval()</code></td><tr valign=top><td>3.3.30.1</td><td style="padding-left:4em">
returns <code>integer</code></td><tr valign=top><td>3.3.31</td><td style="padding-left:3em">
<code>nlopt_opt:set_maxtime( double maxtime )</code></td><tr valign=top><td>3.3.31.1</td><td style="padding-left:4em">
returns <code>nlopt.result </code></td><tr valign=top><td>3.3.32</td><td style="padding-left:3em">
<code>nlopt_opt:get_maxtime()</code></td><tr valign=top><td>3.3.32.1</td><td style="padding-left:4em">
returns <code>double</code></td><tr valign=top><td>3.3.33</td><td style="padding-left:3em">
<code>nlopt_opt:force_stop()</code></td><tr valign=top><td>3.3.33.1</td><td style="padding-left:4em">
returns <code>nlopt.result </code></td><tr valign=top><td>3.3.34</td><td style="padding-left:3em">
<code>nlopt_opt:set_force_stop( integer val )</code></td><tr valign=top><td>3.3.34.1</td><td style="padding-left:4em">
returns <code>nlopt.result </code></td><tr valign=top><td>3.3.35</td><td style="padding-left:3em">
<code>nlopt_opt:get_force_stop()</code></td><tr valign=top><td>3.3.35.1</td><td style="padding-left:4em">
returns <code>integer</code></td><tr valign=top><td>3.3.36</td><td style="padding-left:3em">
<code>nlopt_opt:optimize( array x[1..n] )</code></td><tr valign=top><td>3.3.36.1</td><td style="padding-left:4em">
returns <code>nlopt.result</code>, <code>double</code></td><tr valign=top><td>3.3.36.2</td><td style="padding-left:4em">
Note that the output parameter is mapped to a return value.</td><tr valign=top><td>3.3.37</td><td style="padding-left:3em">
<code>nlopt_opt:set_local_optimizer( nlopt_opt local_opt )</code></td><tr valign=top><td>3.3.37.1</td><td style="padding-left:4em">
returns <code>nlopt.result</code></td><tr valign=top><td>3.3.38</td><td style="padding-left:3em">
<code>nlopt_opt:set_initial_step( array dx[1..n] )</code></td><tr valign=top><td>3.3.38.1</td><td style="padding-left:4em">
returns <code>nlopt.result</code></td><tr valign=top><td>3.3.39</td><td style="padding-left:3em">
<code>nlopt_opt:set_initial_step1( double dx )</code></td><tr valign=top><td>3.3.39.1</td><td style="padding-left:4em">
returns <code>nlopt.result</code></td><tr valign=top><td>3.3.40</td><td style="padding-left:3em">
<code>nlopt_opt:get_initial_step( array x[1..n] )</code></td><tr valign=top><td>3.3.40.1</td><td style="padding-left:4em">
returns <code>nlopt.result</code>, <code>array[1..n]</code></td><tr valign=top><td>3.3.40.2</td><td style="padding-left:4em">
Note that the output parameter is mapped to a return value.</td><tr valign=top><td>3.3.41</td><td style="padding-left:3em">
<code>nlopt_opt:set_population( integer pop )</code></td><tr valign=top><td>3.3.41.1</td><td style="padding-left:4em">
returns <code>nlopt.result</code></td><tr valign=top><td>3.3.42</td><td style="padding-left:3em">
<code>nlopt_opt:set_vector_storage( integer M )</code></td><tr valign=top><td>3.3.42.1</td><td style="padding-left:4em">
returns <code>nlopt.result</code></td><tr valign=top><td>3.3.43</td><td style="padding-left:3em">
<code>nlopt_opt:get_vector_storage()</code></td><tr valign=top><td>3.3.43.1</td><td style="padding-left:4em">
returns <code>nlopt.result</code>, <code>integer</code></td></table></body></html>