Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to minimize C++ function using boost?

so I have a function like

int f(int i, int j, int c, double d) {
    /*...any operations with i, j, c, d affect on some return int we have*/
}

Is there any thing in boost or STD that would take my function and find the input arguments that minimize my function output?

like image 567
Rella Avatar asked Sep 21 '25 06:09

Rella


2 Answers

I assume you're trying to do a "simple" mathematical multi-dimensional minimization.

GSL has some functions to help you with this. I wouldn't look any further ;)

like image 57
rubenvb Avatar answered Sep 22 '25 22:09

rubenvb


I understand you to be looking for code to perform mathematical optimization.

Boost does not have anything to do this as far as I know, and neither does the standard library; however, NLopt may be what you're looking for.

like image 36
zwol Avatar answered Sep 22 '25 20:09

zwol