Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
""" compressed_jac_store ------
Functions to deal with compressed storage matrices. Note: compressed here has nothing to do with data compression, but since the banded callbacks were already using "packed" as a term, compressed was used. """
print_function, unicode_literals)
""" Turns a dense matrix (n*N)*(n*N) into a packed storage of block diagonal submatrices (column major order) followed by sub diagonal data (sequential starting with diagonals closest to main diagonal), followed by super diagonal data.
Parameters ---------- A: 2-dimensional square matrix n: int sub-block dimension N: int number of super-blocks ndiag: int number of sub diagonals (also implies number of super diagonals) cmaj: bool column major ordering in diagonal blocks.
Raises ------ ValueError on mismatch of A.shape and n*N """ raise ValueError("Shape of A != (n*N, n*N)") else: B[idx] = A[bi*n+imaj, bi*n+imin] |