Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Discussion options

You must be logged in to vote

Ignore the request for a MWE. I think the issue is that you are likely trying to change the direct_solve_method after the first solve. Clarabel won't allow this because it would require re-allocation of internal data structures to support a different linear solve method. The only updates that are allowed (e.g. when doing multiple solves) are ones that only change the problem data.

So this works:

import cvxpy as cp
import numpy as np

# Generate a random non-trivial quadratic program.
m = 15
n = 10
p = 5
np.random.seed(1)
P = np.random.randn(n, n)
P = P.T @ P
q = np.random.randn(n)
G = np.random.randn(m, n)
h = G @ np.random.randn(n)
A = np.random.randn(p, n)
b = np.random.randn(p)

# Defi…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@Tonyhasaheart
Comment options

Answer selected by Tonyhasaheart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants