Join GitHub today
Add Matrix#antisymmetric? and Matrix#reflexive? #1730
Thanks for the PR.
Would you like to amend your PR?
changed the title from
Add two methods.
Add two methods to the Matrix library.
Dec 14, 2017
antisymetric? has already been added, please remove it and keep only
pushed a commit
this pull request
Sep 20, 2018
added a commit
this pull request
Sep 21, 2018
Is "reflexive" a common word to indicate a matrix whose diagonals are all 1s?
I couldn't (easily) find such a usage by searching with "reflexive matrix" diagonal. I could find some articles including the definition by searching with "matrix is reflexive", but its hit count is just 44. I guess that the word came from "reflexive relation", but I'm unsure if it is also common for matrix.
Well, there seems to be confusion about the word "antisymmetric".
I believe the OP expected antisymmetric relation: a_ij = 0 or a_ji = 0 for all i ≠ j. However, the PR's implementation checks if a_ij != a_ji for all i ≠ j. I guess it was a bug.
Wikipedia's "Skew-symmetric matrix" says (emphasized by me):
If we have
However, I'm not sure whether the name "antisymmetric?" is best. Isn't "skew_symmetric?" better? I'm unfamiliar with math. Wolfram uses the name AntisymmetricMatrix, but it also says:
Strictly speaking, there is no actual request for the current Matrix#antisymmetric?. Is it really needed? Again, I'm unfamiliar with math.
I think that
It was my idea to implement this method, as I was taking Discrete Mathematics course in the college. You are right, the reflexive matrix is representing a reflexive relation by using 0-1 matrix. I was not sure if this method would be widely used since a general matrix can have more values than just 0 and 1.