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
{{ message }}
This repository was archived by the owner on Nov 19, 2020. It is now read-only.
Currently IsSymmetric() is implemented as a generic method on IComparable. It would be good if it accepted a tolerance. For large symmetric matrices, it feels restrictive if a tiny floating point error caused this to return false.
Will need to be a T4 template job (or just a few special cases like double and float) as IComparable does not allow difference comparisons (AFAIK). I imagine it is faster if it's not generic. Proposed API:
/// Some lovely comments.../// param isRelative: whether matrix is symmetric based on the relative or absolute errorpublicstaticdoubleIsSymmetric(thisdouble[,]a,doubletol=0,boolisRelativeError=false)
so you could say, M[i,j] cannot be different to M[j,i] by more than 0.0001% or maybe 1e-12 etc.
Question
@cesarsouza Is this useful or am I being paranoid (I want it for #832)? Can you envisage any scenario where a matrix that should be symmetric is not exactly symmetric because of tiny rounding errors? if you can, assign this to me, if you can't, feel free to close this issue.