From 7ab582bfbdfd60cd4cf549b0523a09321306de3f Mon Sep 17 00:00:00 2001 From: Dimitri Alston <123396563+DimitriAlston@users.noreply.github.com> Date: Fri, 6 Jun 2025 15:11:28 -0400 Subject: [PATCH] Fix instance of `NaNMath.acos` --- Project.toml | 2 +- src/McCormick.jl | 10 +++++----- src/forward_operators/mixed_convexity.jl | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Project.toml b/Project.toml index 4123c69..78fe639 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "McCormick" uuid = "53c679d3-6890-5091-8386-c291e8c8aaa1" authors = ["Matthew Wilhelm "] -version = "0.13.9" +version = "0.13.10" [deps] DiffRules = "b552c78f-8df3-52c6-915a-8e097449b14b" diff --git a/src/McCormick.jl b/src/McCormick.jl index e2cea7c..69442b7 100644 --- a/src/McCormick.jl +++ b/src/McCormick.jl @@ -202,8 +202,8 @@ end """ $(TYPEDSIGNATURES) -Takes the concave relaxation gradient 'cc_grad', the convex relaxation gradient -'cv_grad', and the index of the midpoint returned 'id' and outputs the appropriate +Takes the concave relaxation gradient `cc_grad`, the convex relaxation gradient +`cv_grad`, and the index of the midpoint returned `id` and outputs the appropriate gradient according to McCormick relaxation rules. """ function mid_grad(cc_grad::SVector{N,Float64}, cv_grad::SVector{N,Float64}, id::Int64) where N @@ -218,8 +218,8 @@ end """ $(TYPEDSIGNATURES) -Calculates the value of the slope line segment between `(xL, f(xL))` and `(xU, f(xU))` -defaults to evaluating the derivative of the function if the interval is tight. +Calculates the value and the slope of the line segment between `(xL, f(xL))` and `(xU, f(xU))`. +Defaults to evaluating the derivative of the function if the interval is tight. """ @inline function dline_seg(f::Function, df::Function, x::Float64, xL::Float64, xU::Float64) delta = xU - xL @@ -266,7 +266,7 @@ end $(TYPEDSIGNATURES) Refines convex/concave relaxations `cv` and `cc` with associated subgradients -`cv_grad` and `cc_grad` by intersecting them with the interval boudns `xL` +`cv_grad` and `cc_grad` by intersecting them with the interval bounds `xL` and `xU`. """ function cut(xL::Float64, xU::Float64, cv::Float64, cc::Float64, diff --git a/src/forward_operators/mixed_convexity.jl b/src/forward_operators/mixed_convexity.jl index 52ad878..f054174 100644 --- a/src/forward_operators/mixed_convexity.jl +++ b/src/forward_operators/mixed_convexity.jl @@ -314,7 +314,7 @@ end flag && (p = golden_section(xL, 0.0, acos_env, xU, 0.0)) end (x <= p) && (return NaNMath.acos(x), -1.0/NaNMath.sqrt(1.0-x^2), p) - return dline_seg(acos, acos_deriv, x, p, xU)..., p + return dline_seg(NaNMath.acos, acos_deriv, x, p, xU)..., p end @inline asinh_deriv(x::Float64) = 1.0/sqrt(1.0 + x^2)