# How to convert Cholesky {Float64,Array{Float64,2}} to Array{Float64,2} in julia

**URL:** <https://discourse.julialang.org/t/how-to-convert-cholesky-float64-array-float64-2-to-array-float64-2-in-julia/29536>\
**Category:** General Usage\
**Tags:** question\
**Created:** [October 5, 2019, 10:43pm UTC](https://discourse.julialang.org/t/how-to-convert-cholesky-float64-array-float64-2-to-array-float64-2-in-julia/29536 "2019-10-05T22:43:19Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![shiva](https://avatars.discourse-cdn.com/v4/letter/s/85e7bf/32.png) [@shiva](https://discourse.julialang.org/u/shiva)\
**Post date:** [October 5, 2019, 10:43pm UTC](https://discourse.julialang.org/t/how-to-convert-cholesky-float64-array-float64-2-to-array-float64-2-in-julia/29536/1 "2019-10-05T22:43:19Z")

</div>

Hello,  
I am using Julia 1.0.4 to do a cholesky decomposition I wrote the following code:  
using LinearAlgebra  
A=[1 0 1; 0 2 0; 1 0 3];  
BB=cholesky(A);

and the result is:

BB=Cholesky{Float64,Array{Float64,2}}([1.0 0.0 1.0; 0.0 1.41421 0.0; 1.0 0.0 1.41421], ‘U’, 0)

and I am not able to do further calculations on my BB matrix because of its format.  
My question is how to convert the output of cholesky decomposition with Cholesky{Float64,Array{Float64,2}} format to Array{Float64,2}

Utimately, I need my BB=[1.0 0.0 1.0; 0.0 1.41421 0.0; 1.0 0.0 1.41421]

---

<div class="post-metadata">

**Author:** ![elsuizo](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/elsuizo/32/89_2.png) [@elsuizo](https://discourse.julialang.org/u/elsuizo)\
**Post date:** [October 6, 2019, 12:11am UTC](https://discourse.julialang.org/t/how-to-convert-cholesky-float64-array-float64-2-to-array-float64-2-in-julia/29536/2 "2019-10-06T00:11:03Z")

</div>

maybe: `convert(Matrix, BB.UL)`

---

<div class="post-metadata">

**Author:** ![carstenbauer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/carstenbauer/32/4981_2.png) [@carstenbauer](https://discourse.julialang.org/u/carstenbauer)\
**Post date:** [October 6, 2019, 7:25am UTC](https://discourse.julialang.org/t/how-to-convert-cholesky-float64-array-float64-2-to-array-float64-2-in-julia/29536/3 "2019-10-06T07:25:46Z")

</div>

`Matrix(BB)` gives you what you want.

Also, for better readability you should use triple quotes ```` <code goes here> ```` to indicate blocks of code here on discourse.

---

<div class="post-metadata">

**Author:** ![shiva](https://avatars.discourse-cdn.com/v4/letter/s/85e7bf/32.png) [@shiva](https://discourse.julialang.org/u/shiva)\
**Post date:** [October 7, 2019, 7:03pm UTC](https://discourse.julialang.org/t/how-to-convert-cholesky-float64-array-float64-2-to-array-float64-2-in-julia/29536/4 "2019-10-07T19:03:37Z")

</div>

Thanks it worked

---

<div class="post-metadata">

**Author:** ![shiva](https://avatars.discourse-cdn.com/v4/letter/s/85e7bf/32.png) [@shiva](https://discourse.julialang.org/u/shiva)\
**Post date:** [October 7, 2019, 7:05pm UTC](https://discourse.julialang.org/t/how-to-convert-cholesky-float64-array-float64-2-to-array-float64-2-in-julia/29536/5 "2019-10-07T19:05:52Z")

</div>

Thanks for your guidance, but `<Matrix(BB)>` gave me my original Matrix, matrix `<A>`, that I decomposed.
