matrix manipulation of a large diagonally symmetric matrix to reduce computational time

1 view (last 30 days)
Hi there, Given a large square matrix (maybe up to 20k X 20k). I would like to reduce computational time for calculating special functions (elliptic integrals). When I image up this matrix it is diagonally symmetric as shown below. This diagonal symmetric behaviour is as expected I've shown 3 cases below.
What is the most efficient approach to reduce computational time for a matrix with this symmetry? Perhaps remove half the matrix then do computation then replicate using repmat? If this can be done it will greatly reduce the computational time. Any suggestions will be very helpful
Thanks
case 1
case 2
case 3
  7 Comments
Joseph
Joseph on 30 Apr 2015
Edited: Joseph on 30 Apr 2015
Thanks James, you are right I don't need the line that removes the zeros..
Actually my final result is thankfully only scalar so there is no need to reconstruct the matrix. I simply take the result and multiply the final scalar by 2 to account for the symmetry. I'll now try allocating using the method you suggested above. It maybe just easier for to pass you function .m file.
Joseph
Joseph on 30 Apr 2015
I should add that my matrix size can range between 1x1 - 20k+20k+. Since I'm running the function through optimization.

Sign in to comment.

Answers (0)

Categories

Find more on Operating on Diagonal Matrices in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!