-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
unstable type change #149
Comments
Your example above works fine for me, in the sense that I don't get a type error. The solver does not converge to full accuracy though because the default tolerances are probably too tight for a Float32 problem. What error do you get, and what version are you using? |
Sorry late reply, this is the error message: [48519] signal (6): Abort trap: 6 Saving session... [Process completed]` Versioninfo: julia> using Clarabel (@v1.10) pkg> st Clarabel (@v1.10) pkg> |
That seems weird - does that happen on the current stable version Julia (1.9.3)? |
Still error though no crash of Julia: `
|
Current version of the Clarabel package is 0.6.0 - perhaps try |
Noticed as well, though needed to upgrade a lot of packages. Now it provided a solution though status is ALMOST_SOLVED but anyway seems to give correct answer 👍 A bit strange that v1.10-beta3 is crashing and it seems because of Julia itself. Thanks anyway for your patience and quick replies! julia> solution32 = Clarabel.solve!(solver32)
problem: settings: iter pcost dcost gap pres dres k/t μ step0 6.7343e+00 -1.5943e+01 3.37e+00 0.00e+00 8.40e-01 1.00e+00 1.75e+00 ------
|
I would guess that the reason you are getting "almost solved" is that the values in the default settings are really chosen with Float64 in mind. It is likely that the tolerances are way too tight for Float32 data. See relevant comment at the end of this issue: #105 |
I don't know that there is anything to do here, so will close. |
Trying multiple types on example in documentation seems to give an error when changing to Float32 ( Float64 and BigFloat works fine).
`using Clarabel, SparseArrays, LinearAlgebra
P = sparse([3.0 1 -1; 0 4 2; 0 0 5])
q = [1, 2, -3.0]
equality constraint
Aeq = [1.0 1.0 -1.0]
beq = [1.0]
inequality constraint
Aineq = [0.0 1.0 0.0
0.0 0.0 1.0]
bineq = [2.0, 2.0]
SOC constraint
Asoc = -I(3) * 1.0
bsoc = [0.0, 0.0, 0.0]
Clarabel.jl constraint data
A_ = sparse([Aeq; Aineq; Asoc])
b_ = [beq; bineq; bsoc]
A = sparse([Aeq; Aineq])
b = [beq; bineq]
Clarabel.jl cone specification
#cones = [Clarabel.ZeroConeT(1), Clarabel.NonnegativeConeT(2), Clarabel.SecondOrderConeT(3)]
cones = [Clarabel.ZeroConeT(1), Clarabel.NonnegativeConeT(2)]
const T = Float64
settings = Clarabel.Settings{T}()
settings64 = Clarabel.Settings{Float64}(
verbose=true,
direct_solve_method=:qdldl)
solver64 = Clarabel.Solver{Float64}()
Clarabel.setup!(solver64, P, q, A, b, cones, settings64)
solution64 = Clarabel.solve!(solver64)
settings32 = Clarabel.Settings{Float32}(
verbose=true,
direct_solve_method=:qdldl)
solver32 = Clarabel.Solver{Float32}()
Clarabel.setup!(solver32, Float32.(P), Float32.(q), Float32.(A), Float32.(b), cones, settings32)
solution32 = Clarabel.solve!(solver32)
`
Hope I have done some elementary error.
The text was updated successfully, but these errors were encountered: