# Efficient linear algebra for large-scale problems in JuMP

**URL:** <https://discourse.julialang.org/t/efficient-linear-algebra-for-large-scale-problems-in-jump/10715>\
**Category:** Optimization (Mathematical)\
**Tags:** jump, linearalgebra, optimization\
**Created:** [May 4, 2018, 8:39pm UTC](https://discourse.julialang.org/t/efficient-linear-algebra-for-large-scale-problems-in-jump/10715 "2018-05-04T20:39:35Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![ExpandingMan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/expandingman/32/866_2.png) [@ExpandingMan](https://discourse.julialang.org/u/ExpandingMan)\
**Post date:** [May 5, 2018, 6:41pm UTC](https://discourse.julialang.org/t/efficient-linear-algebra-for-large-scale-problems-in-jump/10715/3 "2018-05-05T18:41:39Z")

</div>

Ah, that explains a lot thanks. In particular, I was missing two huge pieces of the picture:

- I was missing the significance of `sizehint!`, it seems that it can drastically improve performants in many of the worst cases. By the way, is there some reason there is no size hint in `_dot`, I kept looking at that function and kept thinking that nothing else had it either.
- Having seen all of the operator overloading, I didn’t think that the macros were really doing anything most of the time.

I know this is a bit of a loaded question, but could you perhaps give a very brief description of what extra steps are happening in the macros that _don’t_ just come from the operator overloading (your YouTube talk actually made it seem like most of what you’d do in the macro is implemented in the operator overloading)? As a concrete example, I often have problems where I need to do something like

```julia
A*x*B

```

where `A<:AbstractMatrix{<:Number}`, `B<:AbstractMatrix{<:Number}`, `x<:AbstractSparseMatrix{JuMP.Variable}`. I usually wind up writing an explicit function to make these tractable, but I’ve always timed it against operations I do _outside_ of macros. Would something different happen in an expression like this within a macro? (It’s just so much harder for me to understand the macro code than the operator code, so I don’t think I understand what’s going on there at all.)

---

_[View the full topic](https://discourse.julialang.org/t/efficient-linear-algebra-for-large-scale-problems-in-jump/10715)._
