time | Calls | line |
---|
| | 1 | function A = get_blkdiag(A,Q,block_pattern,tol)
|
| | 2 | % assume A belongs to the *-algebra G, and U is an orthogonal matrix such
|
| | 3 | % that U'MU is a block-diagonal matrix for every M in G
|
| | 4 |
|
| | 5 | % this function computes U'AU and remove the small entires whose absolute
|
| | 6 | % value is less than tol, and entries not in block_pattern
|
| | 7 |
|
258.937 | 3759 | 8 | A = Q'*A*Q; % exposing vector for symmetry reduced program
|
38.128 | 3759 | 9 | A = (A+A')/2; % symmetrize Wbar
|
30.891 | 3759 | 10 | A(~block_pattern) = 0; % remove the zero-entries based on block-pattern
|
32.404 | 3759 | 11 | A(abs(A)<tol) = 0; % remove the small entries (important)
|
| | 12 |
|
0.021 | 3759 | 13 | end
|