Comments (7)
Could this give a better error message? For example,
Base.:-(a::Matrix, b::Union{JuMP.GenericVariableRef, JuMP.GenericAffExpr}) = error(
"Subtraction between a Matrix and a JuMP variable is not supported: instead of A - x, " *
"do 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."
)
from jump.jl.
I don't know what we can or should do here. The answer is to force people to use I(2)
.
from jump.jl.
I don't really want to add MutableArithmetics.UniformScaling{<:AbstractMutable}
and have to deal with all the consequences?
from jump.jl.
Yes it seems like a rabbit hole. Maybe we could try to convince LinearAlgebra to accept Any instead of Number. I think they thought that they are only implementing * with Number. This is fine but they can still allow Any in the constructor when it's called explicitly. In a Matrix they didn't force the entries to be Number so why do it in UniformScaling ?
from jump.jl.
Perhaps open an issue? This will be easier with upgradable stdlibs.
from jump.jl.
Closing as too hard to fix. It can't be a common issue, because I don't remember it coming up on Discourse.
from jump.jl.
Yes, I think such error message for :+(::Matrix, ::AbstractJuMPScalar)
would be useful
from jump.jl.
Related Issues (20)
- @variable macro fails to resolve variables in 1.18.0 HOT 2
- jump.dev is down HOT 1
- Model printing is rather verbose HOT 5
- Diagnostics request: using variable in variable container bounds HOT 4
- && and || do not short-circuit in macros HOT 3
- Add support for MOI.ScalarQuadraticCoefficientChange
- Tools to test JuMP models
- NumFOCUS: GSoC 2024 Update HOT 1
- Error vcat(::NonlinearExpr, ::VariableRef, ::Float64) HOT 5
- Increase performance of SOC constraints HOT 4
- Iterating SparseAxisArray does not preserve order HOT 4
- How to improve the speed to build a complex model? HOT 2
- Coefficients of complex variables created with a GenericModel are always Float64
- LinearAlgebra.hermitian is incorrect
- *(::Real, ::Hermitian) is not hermitian HOT 5
- Cannot `convert` an object of type Float64 to an object of type JuMP.NonlinearExpr HOT 3
- Documentation Request: List whether a solver supports Indicator Constraints HOT 4
- Bullet point alignment in bibliography HOT 9
- Multiplication of matrix expression and variables leads to stack overflow and matmul error HOT 4
- Multiple Ranges for variables HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jump.jl.