You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am somewhat new to C++, and wanted to use this library for a constrained minimization problem. I am practicing with sumt using a simple case $f(x) = x^2$ with initial value $2$, and I intend to minimize $f(x)$ with constraint $x \geq 1$ (i.e. the solution should be $x=1$). However, running the code outputs $x=2$ instead.
From reading the function description on the website, I originally assumed that the constraint function needed to return a vector in the form $[g_1(x), g_2(x)... g_n(x)]$ matching constraint $g_i(x) \geq 0$ for each $i \in 1...n$. This assumption seems to be wrong though, given the output. Could someone please clarify the correct implementation for the constraint function? I have included my code below.
I tested some functions and it seems to work, therefore i created a PR (#71) to add a C++ example. Note that doc is not building so, check the api docs from the source code.
Hello,
I am somewhat new to C++, and wanted to use this library for a constrained minimization problem. I am practicing with sumt using a simple case$f(x) = x^2$ with initial value $2$ , and I intend to minimize $f(x)$ with constraint $x \geq 1$ (i.e. the solution should be $x=1$ ). However, running the code outputs $x=2$ instead.
From reading the function description on the website, I originally assumed that the constraint function needed to return a vector in the form$[g_1(x), g_2(x)... g_n(x)]$ matching constraint $g_i(x) \geq 0$ for each $i \in 1...n$ . This assumption seems to be wrong though, given the output. Could someone please clarify the correct implementation for the constraint function? I have included my code below.
Many Thanks,
Sam
The text was updated successfully, but these errors were encountered: