Closed taranjitsinghb closed 2 years ago
It always get stuck at creating a diagonal matrix of an array variable.
Can you provide the error message you're getting? Are you using Julia v1 (or later)?
If you're using Julia v1.0 or later, then my best guess is that your error comes from this line (in the misdp_cardls
function)
dz = diagm(z);
The diagm
syntac is deprecated in v1, instead you should use
dz = Diagonal(z)
@mtanneau Thank you for the tip. It was indeed getting stuck there. I changed it to:
dz = Diagonal(z);
However, it still gets stuck at the conversion of Diagonal as variable type for the expression
1/rho*A*dz*A'
it throuws the following error
ERROR: LoadError: MethodError: Cannot `convert` an object of type JuMP.GenericQuadExpr{Float64,Varia
ble} to an object of type JuMP.GenericAffExpr{Float64,Variable}
This looks more like a JuMP-related than Pajarito-related error... I would suggest you open an issue with JuMP directly
@mtanneau Thank you for the tip. It was indeed getting stuck there. I changed it to:
dz = Diagonal(z);
However, it still gets stuck at the conversion of Diagonal as variable type for the expression
1/rho*A*dz*A'
it throuws the following error
ERROR: LoadError: MethodError: Cannot `convert` an object of type JuMP.GenericQuadExpr{Float64,Varia ble} to an object of type JuMP.GenericAffExpr{Float64,Variable}
You can make:
1/rho*A*(Matrix{Float64}(I, d, d).*z)*A'
It works for me.
Closing as stale and because this doesn't look like a bug in Pajarito.
Hi, I am considering to solve a misdp problem. I found this example online and thought, I would try to see if this works. However, It always get stuck at creating a diagonal matrix of an array variable.