You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@lukeolson I think we do this in every strength measure, scale rows by largest entry, at the very end.
The question is how to "elegantly" extend this to scale symmetrically. For SA, rootnode, and the new CF_rootnode_solver in Carlo's branch, we always store the "symmetry" flag as A.symmetry. The Ruge-Stuben solver does not have a symmetry flag.
So, we could rename scale_rows_by_largest_entry(..) as symmetrically_scale_rows_by_largest_entry(..) and then do something like
D <-- largest entry in a row
D_inv = 1.0 / D # be careful about zeros on diag
if hasattr(A, 'symmetry'):
#scale symmetrically
if symmetric or hermitian
new_A = scale_rows(A, np.sqrt(D_inv), copy=True)
new_A = scale_columns(new_A, np.sqrt(D_inv), copy=False)
return new_A
#Do what we already do, and nonsymmetrically scale and return
Luckily, scale_rows_by_largest_entry(..) is only used by strength routines. So...I think we would need to update
strength.py :: call new symmetric function instead for scaling
util/utils.py :: redefine scale_rows_by_largest_entry as symmetrically_scale_rows_by_largest_entry
util/tests/test_utils.py :: update unit tests
If
A
is symmetric, then scale strengthS
symmetrically:https://github.com/pyamg/pyamg/blob/main/pyamg/strength.py#L315
The text was updated successfully, but these errors were encountered: