NLopt is a nonlinear optimization library written in C by Steven G. Johnson and licensed under the LGPL.
Questions tagged [nlopt]
144 questions
2
votes
0 answers
How do I bring NLopt to work for Python3 on macOS Catalina with homebrew?
below you first find a summary and skip hint to the main problem and then the long version with everything. This is my first question here and I hope I didn't break any rules with making the post so long and having multiple questions...
I'm happy…

Medsmiley
- 43
- 1
- 7
2
votes
0 answers
init_nloptr.c:35:19: fatal error: nlopt.h: No such file or directory
I am installing lme4 in R, but the mentioned problem occurred. I saw answers for Linux and Ubuntu. I am running on Windows, and I receive a fatal error message as shown. Can someone help, pls?
compilation terminated.
make: ***…

marktacderas
- 33
- 3
2
votes
1 answer
How to set up nlopt with multiple inequality constraints?
I have a few questions about setting up NLopt with non-linear constraints:
If the number of constraints is bigger than the number of variables, how can we set grad[ ] in the constraint function? Is there any (automatic) method to solve the problem…
2
votes
1 answer
Non Linear Optimization in R with nloptr vs Excel
I can't seem to find an answer for my particular problem. I'm trying to minimize the mean absolute error between a real value vector and a linear combination of models as follows:
library(nloptr)
df <- data.frame(
real = c(24.2418, 21.7374,…

Kean Rawr
- 33
- 1
- 6
2
votes
1 answer
How can I deal with this nloptr error in R?
init_nloptr.c:35:10: fatal error: 'nlopt.h' file not found
#include "nlopt.h"
^~~~~~~~~
1 error generated.
make: *** [init_nloptr.o] Error 1
ERROR: compilation failed for package 'nloptr'
* removing…

Khin Thet Swe
- 21
- 2
2
votes
0 answers
NLopt / nloptr Settings and Output
I have two questions regarding NLopt and one regarding nloptr, which is an R interface to NLopt. In terms of the specific method, I am aiming for a gradient based method such as "BFGS".
NLopt:
How do you choose the termination criterion? In…

tstudio
- 197
- 1
- 12
2
votes
1 answer
How to call C functions from nloptr package directly in an Rcpp package?
I am creating an R package that also has c++ codes using RcppArmadillo. One of the function needs to optimize a function. Currently, I imported the nloptr::nloptr function into c++ and then use it to optimize the function. The code is here:…

Daijiang Li
- 697
- 4
- 16
2
votes
0 answers
R: Nonlinear optimization with equality constraints
I have a TxN matrix M and a Nx1 weight vector w, where sum(w)=1.
I need to find the w, which maximises the number of positive elements in Mw.
If there is no single w, the maximum possible value for Mw is desired.
More formally, denote with…

antonio
- 10,629
- 13
- 68
- 136
2
votes
1 answer
Passing arguments to nloptr in r
I'm optimising a simple function in r using 'nloptr' and I'm having difficulty passing arguments in to the objective function. Here is the code I'm using:
require("nloptr")
Correl <- matrix(c(1,-.3,-.3,1), nrow=2, ncol=2)
Wghts <- c(.01,.99)
floor…

Simon Cullen
- 43
- 4
2
votes
1 answer
Fixed interval constraints in nlopt
I am trying to implement an optimiser for a set of black-box functions (neural networks) for which I do not have a derivative (that's probably not relevant for this question though). I want to use nlopt so I've been reading through the tutorial on…

quant
- 21,507
- 32
- 115
- 211
2
votes
0 answers
NLopt integer steps
Is there any way to force nlopt_optimize to go in integer steps?
I've tried
double* step = new double(dbSize);
for (int i = 0; i

Dimitri
- 21
- 3
2
votes
1 answer
Setting up NLOpt when working from windows cmd prompt
I am writing a c++ program from the windows cmd prompt, and compiling with mingw (g++). This program needs a non-linear optimiser and NLOpt looks like a good choice. I learnt c++ for a uni course, so the environment I was using was already set up, I…

Jekowl
- 317
- 2
- 12
2
votes
2 answers
How to use a NLopt solver together with MathProgBase?
I would like to use the MathProgBase interface to formulate an optimization problem. Furthermore, I would like to use an open-source solver, such as NLopt (or any other).
The doc at https://github.com/JuliaOpt/NLopt.jl#using-with-mathprogbase…

Harmeling
- 573
- 1
- 4
- 12
2
votes
1 answer
How to overcome version incompatibility with Abaqus and Numpy (Python's library)?
I want to run an external library of python called NLopt within Abaqus through python. The issue is that the NLopt I found is compiled against the latest release of Numpy, i.e. 1.9, whereas Abaqus 6.13-2 is compiled against Numpy 1.4. I tried to…

user3873115
- 21
- 1
2
votes
0 answers
nlopt_add_equality_constraint doesn't work
I write a program,
to minimize:
f = x^2 + y^2
constrain:
c: x-1 < 0
ceq: x+y-5=0
I got answer:
x = 0.12219
y = 5.678
which is not satisfy ceq.
I don't know how to fix it.
My complete source code is here
main function is as follow:
int main()
{
…

user2749836
- 21
- 2