Skip to content
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

fix socp line search failure case #141

Merged
merged 1 commit into from
Jan 6, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/solver/core/cones/socone.rs
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,14 @@ fn _step_length_soc_component<T>(x: &[T], y: &[T], αmax: T) -> T
where
T: FloatT,
{
let mut αmax = αmax;

// upper bound the step length by the maximum allowable
// step length for the scalar part of the cone
if x[0] >= T::zero() && y[0] < T::zero() {
αmax = T::min(αmax, -x[0] / y[0]);
}

// assume that x is in the SOC, and find the minimum positive root
// of the quadratic equation: ||x₁+αy₁||^2 = (x₀ + αy₀)^2

Expand Down
Loading