BOBYQA algorithm

M.J.D. Powell's BOBYQA algorithm using a mexfunction created with dlib's C++ implementation
725 Downloads
Updated 18 Jan 2019

View License

This is a gateway function to use M.J.D. Powell's BOBYQA algorithm (Bound Optimization BY Quadratic Approximation) in MATLAB.
The C++ implementation of dlib (http://dlib.net) is compiled into a mex function to evaluate a MATLAB objective function.

The algorithm consits of four parts:

* The "bobyqa.m" MATLAB file contains the documentation, sets default values and calls the mex function (in .zip file).
* The "bobyqasub.m" MATLAB file is called by the mex function to evaluate the objective function which is MATLAB code (in .zip file).
* The "bobyqa_alg.cpp" file contains the C++ source code to create the mex function (in .zip file).
* The dlib source code containing the BOBYQA algorithm (download latest release at http://sourceforge.net/projects/dclib/files/latest/download).

The folder "/dlib-XX.YY" (XX.YY is your dlib version, e.g. dlib-19.16 for version 19.16) and the three files have to be copied into the same directory.

Run

bobyqa()

to display individual information on how to compile the mex function.
Further information as well as an example can be found inside the "bobyqa.m" file.

I have recieved several complaints that the first version of this was not working for some people (see comments). I cannot reproduce the described problems on my computer. If you encounter problems, please check your compiler settings (I used the MinGW-Add-On). If the problems persist, contact me and I will try to assist you in resolving your issues (might take a bit of time).

Comment: An analogous gateway function can probably be set up for the other C++ implementations if you find a good library.

Cite As

Ulrich Römer (2026). BOBYQA algorithm (https://www.mathworks.com/matlabcentral/fileexchange/48689-bobyqa-algorithm), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2014a
Compatible with any release
Platform Compatibility
Windows macOS Linux
Categories
Find more on Call C++ from MATLAB in Help Center and MATLAB Answers
Version Published Release Notes
2.0.0.0

Modified the source code structure and added comments to make it easier to understand.
Tested on two different (Windows 10) PCs with dlib-19.16, Matlab R2017b/R2018b and the default MinGW64 Compiler (C++).

1.0.0.0