Questions tagged [cvxopt]

A Python package for convex optimization, including solvers for linear programming, quadratic programming, semidefinite programming and more.

There is an official web site of the CVXOPT package. The official description of the package is given there as follows:

CVXOPT is a free software package for convex optimization based on the Python programming language. It can be used with the interactive Python interpreter, on the command line by executing Python scripts, or integrated in other software via Python extension modules. Its main purpose is to make the development of software for convex optimization applications straightforward by building on Python’s extensive standard library and on the strengths of Python as a high-level programming language.

227 questions
4
votes
1 answer

Python pip library search paths

I'm trying to install the python package cvxopt via pip into a virtual environment on a Centos 6 system. Since lapack is a prerequisite, and since I don't have superuser access to the system, I've installed lapack locally using the following: $…
Tom
  • 18,685
  • 15
  • 71
  • 81
4
votes
0 answers

How to install CVXOPT with Enthought python (Canopy)

Before I start, let me put alternative titles for this post: How to compile CVXOPT with Intel MKL ? How to change __init__.py in CVXOPT to compile with Intel MKL ? Let me explain the issue. I am trying to install pystruct with Enthought python…
kayhan
  • 373
  • 3
  • 11
3
votes
1 answer

problem with cvxopt on mac //incompatible architecture

I need cvxopt to run some portfolio optimization scripts. I have a MacBook pro with an M1 chip running Monterey 12.3, Python 3.10.2 and pip 22.0.4. I installed cvxopt with pip, also installed Rosetta2 but I keep getting the following…
Allanon
  • 31
  • 1
3
votes
1 answer

How to use cplex or gurobi solver with cvxopt in Python?

I have a very large linear programming problem (over 10,000 equations and 20,000 variables). The optimization problem is even included in a loop and solved many times. As a result, I want to use sparse matrices with an efficient solver to perform…
Zihang
  • 33
  • 4
3
votes
1 answer

Python: CVXPY SolverError

Purpose: I am trying to use cvxpy in python to maximize the dual_func, however I get the below SolverError, I believe it may be Variables having different dimensions, but cant seem to figure out the issue. I have tried using other solvers like ECOS,…
OGARCH
  • 97
  • 1
  • 4
3
votes
1 answer

How to fix the TypeError: G must be a 'd' matrix?

Objective: trying to run toy dataset through an optimization process. I am encountering the following error: --------------------------------------------------------------------------- TypeError Traceback (most recent…
Student
  • 1,197
  • 4
  • 22
  • 39
3
votes
0 answers

python cvxopt solver ValueError: domain error

I have a python 2.7 code translating it into python 3.6 code. When I run: from cvxopt import solvers, matrix (...) P = matrix(P) q = matrix(q) G = matrix(G) h = matrix(h) A = matrix(A) b = matrix(b) sol = solvers.qp(P, q, G, h, A, b) I get this…
jalazbe
  • 1,801
  • 3
  • 19
  • 40
3
votes
0 answers

Python 3.6 cvxopt.base ImportError: DLL load failed: The specified module could not be found

I am running Python 3.6.4 :: Anaconda custom (64-bit) on a Windows 10 x64 system, with a script that attempts to load QP_Solver from cvxopt. This was working fine until today, when running the same python script gave the following error. Simply…
Nyxynyx
  • 61,411
  • 155
  • 482
  • 830
3
votes
1 answer

Problems by installing CVXOPT

I need to install the package cvxopt, but one error occurs: c:\users\user\appdata\local\temp\pycharm-packaging1.tmp\cvxopt\src\c\cvxopt.h(31) : fatal error C1083: Cannot open include file: 'complex.h': No such file or directory error: command…
Jotwege
  • 93
  • 7
3
votes
2 answers

converting numpy vector to cvxopt

This may be a very silly question, but I have been struggling with it and couldn't find it readily in the documentation. I am trying to do a quadratic programming using the description given here. The documentation here covers only conversion of 2…
uday
  • 6,453
  • 13
  • 56
  • 94
3
votes
1 answer

CVXOPT L1 norm approximation - Illegal value of ldB

Following the example on L1 norm approximation given here, with the following code, from l1 import l1 from cvxopt import normal m, n = 500, 100 P, q = normal(m,n), normal(m,1) u = l1(P,q) everything works okay. However when I change m to be…
3
votes
1 answer

Building diagonal block matrix with some blocks as variable CVXPY

I want to generate a (diagonal) block matrix (preferably sparse) in CVXPY. Some blocks can be eye(m) or anything but I have a block which is: from cvxopt import * import cvxpy as cvx import numpy as np import scipy W = cvx.Variable(m,1) W_diag =…
hoot
  • 65
  • 9
3
votes
2 answers

Pandas: conversion to/from cvxopt matrices

Given a Pandas dataframe, what is the best way (readability OR execution speed) to convert to a cvxopt matrix or vice versa? Currently I am doing: cvxMat = matrix(pdObj.as_matrix()) pdObj[:]=np.array(cvxMat) Also, is there a reasonably readable way…
ARF
  • 7,420
  • 8
  • 45
  • 72
2
votes
1 answer

Optimization integer programming with covariance matrix

I am trying to do a optimization problem which requires the calculation of a new covariance matrix affected by the variable within the implementation. I am able to do so with scipy optimization Minimize using numpy.cov within my objective function.…
Wee Darren
  • 21
  • 1
2
votes
0 answers

black box function in CVXPY

Suppose I have a function f(x) which I know to be convex on the domain I am interested in (for example, sin(x) on [0, Pi], but it may be some black box user-defined function). Is there any way to tell this to CVXPY?
Igor Rivin
  • 4,632
  • 2
  • 23
  • 35
1 2
3
15 16