Skip to content

Commit

Permalink
Doc: Fixed links
Browse files Browse the repository at this point in the history
  • Loading branch information
jschueller committed Oct 25, 2024
1 parent 64762dd commit 3d8c5de
Show file tree
Hide file tree
Showing 9 changed files with 64 additions and 64 deletions.
26 changes: 13 additions & 13 deletions doc/docs/NLopt_Algorithms.md

Large diffs are not rendered by default.

24 changes: 12 additions & 12 deletions doc/docs/NLopt_C-plus-plus_Reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,12 @@ void nlopt::opt::set_max_objective(nlopt::func f, void* f_data);
```


where `f` is of the same form as the [C objective function](NLopt_Reference#objective-function).
where `f` is of the same form as the [C objective function](NLopt_Reference.md#objective-function).

Bound constraints
-----------------

The [bound constraints](NLopt_Reference#bound-constraints) can be specified by calling the methods:
The [bound constraints](NLopt_Reference.md#bound-constraints) can be specified by calling the methods:

```
void nlopt::opt::set_lower_bounds(const std::vector`<double>` &lb);
Expand Down Expand Up @@ -132,7 +132,7 @@ where the first two functions set their arguments (which must be vectors of leng
Nonlinear constraints
---------------------

Just as for [nonlinear constraints in C](NLopt_Reference#nonlinear-constraints), you can specify nonlinear inequality and equality constraints by the methods:
Just as for [nonlinear constraints in C](NLopt_Reference.md#nonlinear-constraints), you can specify nonlinear inequality and equality constraints by the methods:

```
void nlopt::opt::add_inequality_constraint(nlopt::vfunc fc, void *fc_data, double tol=0);
Expand All @@ -152,7 +152,7 @@ void nlopt::opt::remove_equality_constraints();

### Vector-valued constraints

Just as for [nonlinear constraints in C](NLopt_Reference#vector-valued-constraints), you can specify nonlinear inequality and equality constraints by the methods:
Just as for [nonlinear constraints in C](NLopt_Reference.md#vector-valued-constraints), you can specify nonlinear inequality and equality constraints by the methods:

```
void nlopt::opt::add_inequality_mconstraint(nlopt::mfunc c, void *c_data, const vector`<double>` &tol);
Expand All @@ -167,7 +167,7 @@ Here, `tol` is a vector of the tolerances in each constraint dimension; the dime
Stopping criteria
-----------------

As explained in the [C API Reference](NLopt_Reference#stopping-criteria) and the [Introduction](NLopt_Introduction#termination-conditions)), you have multiple options for different stopping criteria that you can specify. (Unspecified stopping criteria are disabled; i.e., they have innocuous defaults.)
As explained in the [C API Reference](NLopt_Reference.md#stopping-criteria) and the [Introduction](NLopt_Introduction.md#termination-conditions)), you have multiple options for different stopping criteria that you can specify. (Unspecified stopping criteria are disabled; i.e., they have innocuous defaults.)

For each stopping criteria, there are (at least) two method: a `set` method to specify the stopping criterion, and a `get` method to retrieve the current value for that criterion. The meanings of each criterion are exactly the same as in the C API.

Expand Down Expand Up @@ -248,7 +248,7 @@ Request the number of evaluations.

### Forced termination

In certain cases, the caller may wish to *force* the optimization to halt, for some reason unknown to NLopt. For example, if the user presses Ctrl-C, or there is an error of some sort in the objective function. You can do this by throwing *any* exception inside your objective/constraint functions: the exception will be caught, the optimization will be halted gracefully, and another exception (possibly not the same one) will be rethrown. See [Exceptions](#exceptions), below. The C++ equivalent of `nlopt_forced_stop` from the [C API](NLopt_Reference#forced-termination) is to throw an `nlopt::forced_stop` exception.
In certain cases, the caller may wish to *force* the optimization to halt, for some reason unknown to NLopt. For example, if the user presses Ctrl-C, or there is an error of some sort in the objective function. You can do this by throwing *any* exception inside your objective/constraint functions: the exception will be caught, the optimization will be halted gracefully, and another exception (possibly not the same one) will be rethrown. See [Exceptions](#exceptions), below. The C++ equivalent of `nlopt_forced_stop` from the [C API](NLopt_Reference.md#forced-termination) is to throw an `nlopt::forced_stop` exception.


Algorithm-specific parameters
Expand All @@ -262,7 +262,7 @@ 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.md#algorithm-specific-parameters) functions of the corresponding names.


Performing the optimization
Expand All @@ -289,12 +289,12 @@ nlopt::result nlopt::opt::last_optimize_result() const;

### Return values

The possible return values are the same as the [return values in the C API](NLopt_Reference#return-values), except that the `NLOPT_` prefix is replaced with the `nlopt::` namespace. That is, `NLOPT_SUCCESS` becomes `nlopt::SUCCESS`, etcetera.
The possible return values are the same as the [return values in the C API](NLopt_Reference.md#return-values), except that the `NLOPT_` prefix is replaced with the `nlopt::` namespace. That is, `NLOPT_SUCCESS` becomes `nlopt::SUCCESS`, etcetera.

Exceptions
----------

The [Error codes (negative return values)](NLopt_Reference#error-codes-negative-return-values) in the C API are replaced in the C++ API by thrown exceptions. The following exceptions are thrown by the various routines:
The [Error codes (negative return values)](NLopt_Reference.md#error-codes-negative-return-values) in the C API are replaced in the C++ API by thrown exceptions. The following exceptions are thrown by the various routines:

```
std::runtime_error
Expand Down Expand Up @@ -339,7 +339,7 @@ This function makes a copy of the `local_opt` object, so you can freely destroy
Initial step size
-----------------

Just as in the C API, you can [get and set the initial step sizes](NLopt_Reference#initial-step-size) for derivative-free optimization algorithms. The C++ equivalents of the C functions are the following methods:
Just as in the C API, you can [get and set the initial step sizes](NLopt_Reference.md#initial-step-size) for derivative-free optimization algorithms. The C++ equivalents of the C functions are the following methods:

```
void nlopt::opt::set_initial_step(const std::vector<double> &dx);
Expand All @@ -351,7 +351,7 @@ void nlopt::opt::get_initial_step(const std::vector<double> &x, std::vector<
Stochastic population
---------------------

Just as in the C API, you can [get and set the initial population](NLopt_Reference#stochastic-population) for stochastic optimization algorithms, by the methods:
Just as in the C API, you can [get and set the initial population](NLopt_Reference.md#stochastic-population) for stochastic optimization algorithms, by the methods:

```
void nlopt::opt::set_population(unsigned pop);
Expand Down Expand Up @@ -383,7 +383,7 @@ void nlopt::srand_time();
Vector storage for limited-memory quasi-Newton algorithms
---------------------------------------------------------

Just as in the C API, you can get and set the [number *M* of stored vectors](NLopt_Reference#vector-storage-for-limited-memory-quasi-newton-algorithms) for limited-memory quasi-Newton algorithms, via the methods:
Just as in the C API, you can get and set the [number *M* of stored vectors](NLopt_Reference.md#vector-storage-for-limited-memory-quasi-newton-algorithms) for limited-memory quasi-Newton algorithms, via the methods:

```
void nlopt::opt::set_vector_storage(unsigned M);
Expand Down
10 changes: 5 additions & 5 deletions doc/docs/NLopt_Deprecated_API_Reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ where *compiler* is `cc`, `f77`, `g++`, or whatever is appropriate for your mach

*Note:* the `-lnlopt` `-lm` options, which link to the NLopt library (and the math library, which it requires), must come *after* your source/object files. In general, the rule is that if *A* depends upon *B*, then *A* must come before *B* in the link command.

*Note:* the above example assumes that you have installed the NLopt library in a place where the compiler knows to find it (e.g. in a standard directory like `/usr/lib` or `/usr/local/lib`). If you installed somewhere else (e.g. in your home directory if you are not a system administrator), then you will need to use a `-L` flag to tell the compiler where to find the library. See [the installation manual](NLopt_Installation#changing-the-installation-directory).
*Note:* the above example assumes that you have installed the NLopt library in a place where the compiler knows to find it (e.g. in a standard directory like `/usr/lib` or `/usr/local/lib`). If you installed somewhere else (e.g. in your home directory if you are not a system administrator), then you will need to use a `-L` flag to tell the compiler where to find the library. See [the installation manual](NLopt_Installation.md#changing-the-installation-directory).

C/C++ programming interface
---------------------------
Expand Down Expand Up @@ -69,7 +69,7 @@ Starting guess and returned optimum:
- `x` — an array of length `n` of the optimization parameters `x[0]`, ..., `x[n-1]`. On input, a starting guess for the optimum parameters; on output, the best found values of the parameters. (For a *local* optimization routine, the starting guess `x` determines which local optimum is found.) The starting guess is required to satisfy the bound constraints `lb` and `ub`; it need not satisfy the nonlinear inequality constraints `fc` (although it might be more efficient if you have a feasible starting guess.)
- `minf` — on output, the minimum value of the objective function that was found (corresponding to the output value of the parameters `x`).

The remaining parameters specify the termination conditions. Please read the [introduction to the termination conditions](NLopt_Introduction#termination-conditions) for a general overview of these criteria. (In particular, note that you do *not* need to use *all* of these conditions; typically, you will use only one or two, and set the remainder to innocuous values.)
The remaining parameters specify the termination conditions. Please read the [introduction to the termination conditions](NLopt_Introduction.md#termination-conditions) for a general overview of these criteria. (In particular, note that you do *not* need to use *all* of these conditions; typically, you will use only one or two, and set the remainder to innocuous values.)

- `minf_max` — stop if the objective function value drops below `minf_max`. (Set to `-HUGE_VAL` to ignore.)
- `ftol_rel`, `ftol_abs` — relative and absolute tolerances in the objective function value. (Set to zero to ignore.)
Expand Down Expand Up @@ -152,7 +152,7 @@ In particular, the constraint function `fc` will be called (at most) `m` times f

### Mixed global/local search algorithm

Some of the [global optimization algorithms](NLopt_Algorithms#Global_optimization.md) (currently, only MLSL) combine some global search scheme with a separate local optimization algorithm for local searches. For example, MLSL performs a sequence of local searches from semi-random starting points.
Some of the [global optimization algorithms](NLopt_Algorithms.md#global-optimization) (currently, only MLSL) combine some global search scheme with a separate local optimization algorithm for local searches. For example, MLSL performs a sequence of local searches from semi-random starting points.

Using the following functions, you can control *which* local search algorithm is used for MLSL (and any similar algorithm that is added in the future), as well as specifying a maximum number of function evaluations for the local search:

Expand Down Expand Up @@ -239,7 +239,7 @@ The parameters are similar to those of `nlopt_minimize_constrained` (see also th
- `x` (double precision array(`n`), IN/OUT) — on input, an initial guess for the optimization parameters; on output, the best parameters found
- `minf` (double precision, OUT) — on output, the minimum value of the objective function that was found

Termination conditions (see [introduction](NLopt_Introduction#termination-conditions)):
Termination conditions (see [introduction](NLopt_Introduction.md#termination-conditions)):

- `minf_max` (double precision, IN) — stop if the an objective function value ≤ `minf_max` is found (set to `-Infinity`, or a huge negative number, to ignore).
- `ftol_rel`, `ftol_abs` (double precision, IN) — relative and absolute tolerances in the objective function value (ignored if zero).
Expand Down Expand Up @@ -419,7 +419,7 @@ If you have no nonlinear constraints, i.e. `fc` = `fc_data` = `{}`, then it is e
- `stop.maxtime` — maximum run time in seconds
- `stop.verbose`&gt; 0 indicates verbose output

You do *not* need to set all of these fields; termination conditions corresponding to any fields that you do not set are ignored. As discussed in the [introduction](NLopt_Introduction#termination-conditions), normally you only want one or two of these conditions. For example to set a relative **x** tolerance of 10<sup>−4</sup> and run for no more than 5 minutes, you would do:
You do *not* need to set all of these fields; termination conditions corresponding to any fields that you do not set are ignored. As discussed in the [introduction](NLopt_Introduction.md#termination-conditions), normally you only want one or two of these conditions. For example to set a relative **x** tolerance of 10<sup>−4</sup> and run for no more than 5 minutes, you would do:

```
stop.xtol_rel = 1e-4;
Expand Down
Loading

0 comments on commit 3d8c5de

Please sign in to comment.