# Inverse with destination?

**URL:** <https://discourse.julialang.org/t/inverse-with-destination/2267>\
**Category:** General Usage\
**Created:** [February 24, 2017, 7:51am UTC](https://discourse.julialang.org/t/inverse-with-destination/2267 "2017-02-24T07:51:59Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![Andrea\_Pagnani](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/andrea_pagnani/32/3136_2.png) [@Andrea\_Pagnani](https://discourse.julialang.org/u/Andrea_Pagnani)\
**Post date:** [February 25, 2017, 2:16pm UTC](https://discourse.julialang.org/t/inverse-with-destination/2267/6 "2017-02-25T14:16:07Z")

</div>

As the matrix to be inverted is posdef the following (thanks to @carlobaldassi)

> function inplaceinverse!(dest,source)  
> copy!(dest, source)  
> Base.LinAlg.inv!(cholfact!(dest))  
> end

suits my needs. Thanks to @stevengj for his suggestion but unfortunately I need the diagonal of the inverse of a posdef matrix. Maybe, but this is a question on linear algebra, there is a smarter strategy to obtain the diagonal of the inverse of a posdef matrix in a faster and less memory requiring way.

---

_[View the full topic](https://discourse.julialang.org/t/inverse-with-destination/2267)._
