Skip to content

Commit

Permalink
Fix API typos (#541)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexriegler authored Jan 6, 2024
1 parent 51334fc commit b2caea2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions doc/docs/NLopt_C-plus-plus_Reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -256,13 +256,13 @@ Algorithm-specific parameters

Certain NLopt optimization algorithms allow you to specify additional parameters by calling
```
nlopt_result nlopt::opt::set_param(const char *name, double val);
void nlopt::opt::set_param(const char *name, double val);
bool nlopt::opt::has_param(const char *name);
double nlopt::opt::get_param(const char *name, double defaultval);
unsigned nlopt::opt::num_params();
const char *nlopt::opt::nth_param(unsigned n);
```
where the string `name` is the name of an algorithm-specific parameter and `val` is the value you are setting the parameter to. These functions are equivalent to the [C API](NLopt_Reference#algorithm-specific-parameters) functions of the corresponding names.
where the string `name` is the name of an algorithm-specific parameter and `val` is the value you are setting the parameter to. These functions are equivalent to the [C API](NLopt_Reference#algorithm-specific-parameters) functions of the corresponding names.


Performing the optimization
Expand Down
4 changes: 2 additions & 2 deletions doc/docs/NLopt_Reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -310,11 +310,11 @@ Certain NLopt optimization algorithms allow you to specify additional parameters
nlopt_result nlopt_set_param(nlopt_opt opt, const char *name, double val);
```

where the string `name` is the name of an algorithm-specific parameter and `val` is the value you are setting the parameter to. For example, the MMA algorithm has a parameter `"inner_maxeval"`, an upper bound on the number of "inner" iterations of the algorithm, which you can set via `nlopt_set_param(opt, "inner_maxeval", 100)`.
where the string `name` is the name of an algorithm-specific parameter and `val` is the value you are setting the parameter to. For example, the MMA algorithm has a parameter `"inner_maxeval"`, an upper bound on the number of "inner" iterations of the algorithm, which you can set via `nlopt_set_param(opt, "inner_maxeval", 100)`.

You can also check whether a parameter is set or get the current value of a parameter with
```c
double nlopt_has_param(const nlopt_opt opt, const char *name);
int nlopt_has_param(const nlopt_opt opt, const char *name);
double nlopt_get_param(const nlopt_opt opt, const char *name, double defaultval);
```
where `defaultval` is returned by `nlopt_get_param` if the parameter `name` has not been set.
Expand Down

0 comments on commit b2caea2

Please sign in to comment.