bandrv ============================================== Purpose ---------------- Creates a symmetric banded matrix, given its compact form. Format ---------------- .. function:: y = bandrv(a) :param a: :type a: KxN compact form matrix :return y: :rtype y: KxK symmetric banded matrix Examples ---------------- Create a diagonal matrix +++++++++++++++++++++++++++ :: v = { 1, 9, 6 }; v_mat = bandrv(v); After the above code, ``v_mat`` will equal: :: 1 0 0 0 9 0 0 0 6 Create a symmetric banded matrix ++++++++++++++++++++++++++++++++++ :: x = { 1 2 0 0, 2 8 1 0, 0 1 5 2, 0 0 2 3 }; // Create a version of 'x' in band format a = band(x, 1); // Expand the banded version of 'x' back to a full matrix y = bandrv(a); After the code above: :: 0 1 1 2 0 0 1 2 0 0 a = 2 8 x = 2 8 1 0 y = 2 8 1 0 1 5 0 1 5 2 0 1 5 2 2 3 0 0 2 3 0 0 2 3 Remarks ------- *a* is the compact form of a symmetric banded matrix, as generated by :func:`band`. *a* stores subdiagonals right to left, with the principal diagonal in the rightmost (Nth) column. The upper left corner of *a* is unused. :func:`bandchol` expects a matrix of this form. *y* is the fully expanded form of *a*, a KxK matrix with N-1 subdiagonals. .. seealso:: Functions :func:`band`, :func:`bandchol`, :func:`bandcholsol`, :func:`bandltsol`, :func:`bandsolpd`