# Devise a compact storage mode

I am writing a code for solving a symmetric band matrix by Cholesky decomposition. I need to store the matrix by defining only the non-zero diagonals of the matrix not the full matrix with band size $$n$$. How can one do that?

• What about SparseArray? – Henrik Schumacher Jan 25 '19 at 19:23
• I am not allowed to use it as my professor asked to create the code from blank!! – strange world Jan 25 '19 at 19:52
• Then what about storing the diagonals of the matrix in conventional arrays? – Henrik Schumacher Jan 25 '19 at 20:36
• I tried taking the Cholesky decomposition on a couple of symmetric band matrices, but it didn't work because they were not "sufficiently positive definite". Would be good to know some examples of band matrices one can experiment with. – C. E. Jan 25 '19 at 21:08
• Hilbert matrix of n=5 is trivial case of a band matrix – strange world Jan 25 '19 at 21:15