Skip to content

Commit

Permalink
Add code escaping
Browse files Browse the repository at this point in the history
  • Loading branch information
jd-foster committed Nov 2, 2023
1 parent bcac431 commit b15f2cc
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/operators.jl
Original file line number Diff line number Diff line change
Expand Up @@ -454,19 +454,19 @@ end

function Base.:+(A::Matrix, x::AbstractJuMPScalar)
return error(

Check warning on line 456 in src/operators.jl

View check run for this annotation

Codecov / codecov/patch

src/operators.jl#L455-L456

Added lines #L455 - L456 were not covered by tests
"Addition between a Matrix and a JuMP variable is not supported: instead of A + x, " *
"prefer A .+ x for element-wise addition, or if you are modifying the diagonal entries of the matrix " *
"do A + x * LinearAlgebra.I(n), where n is the diagonal length."
"Addition between a Matrix and a JuMP variable is not supported: instead of `A + x`, " *
"prefer `A .+ x` for element-wise addition, or if you are modifying the diagonal entries of the matrix " *
"do `A + x * LinearAlgebra.I(n)`, where `n` is the diagonal length."
)
end

Base.:+(x::AbstractJuMPScalar, A::Matrix) = A + x

Check warning on line 463 in src/operators.jl

View check run for this annotation

Codecov / codecov/patch

src/operators.jl#L463

Added line #L463 was not covered by tests

function Base.:-(A::Matrix, x::AbstractJuMPScalar)
return error(

Check warning on line 466 in src/operators.jl

View check run for this annotation

Codecov / codecov/patch

src/operators.jl#L465-L466

Added lines #L465 - L466 were not covered by tests
"Subtraction between a Matrix and a JuMP variable is not supported: instead of A - x, " *
"prefer A .- x for element-wise subtraction, or if you are modifying the diagonal entries of the matrix " *
"do A - x * LinearAlgebra.I(n), where n is the diagonal length."
"Subtraction between a Matrix and a JuMP variable is not supported: instead of `A - x`, " *
"prefer `A .- x` for element-wise subtraction, or if you are modifying the diagonal entries of the matrix " *
"do `A - x * LinearAlgebra.I(n)`, where `n` is the diagonal length."
)
end

Expand Down

0 comments on commit b15f2cc

Please sign in to comment.