Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Break Up Moore Penrose Test Into Smaller Tests For Clarity and Ease of Debugging #284

Merged
merged 17 commits into from
Jun 30, 2022

Conversation

hemalvarambhia
Copy link
Contributor

@hemalvarambhia hemalvarambhia commented Jun 29, 2022

Issue: #279

I have started by trying to improve clarity in the tests by breaking the test up into well named smaller ones. I hypothesise that it will pin point which scenario is failing.

@hemalvarambhia
Copy link
Contributor Author

hemalvarambhia commented Jun 29, 2022

@olekscode @SergeStinckwich We may have discovered the source of the problem:

#testMoorePenroseInverseRepeatedly 😌

I am unsure of the purpose of this test to be honest, and I propose removing the loop and changing the purpose of the test.

a := PMMatrix rows: 3 columns: 3 random: 1.0.
self assert: (a mpInverse closeTo: a inverse).
a := PMSymmetricMatrix new: 4 random: 1.0.
self assert: (a mpInverse closeTo: a inverse) ]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am seeking a mathematician to help me in understand the needs of this test.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It appears, after splitting the testMoorePenroseInverse test up, this part was the source of the random test failure. I infer from the repetition that this may be some kind of exhaustive data-driven test. I've changed this so as to get a more deterministic test.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work Hemal !

| identityMatrix |
"These two assertions are what define a pseudoinverse. They are known as
the Moore–Penrose conditions of which there are four, but here we have two. The other two
are that (A * A+) and A+ * A are Hermitian.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Asserting that A x A+ is Hermitian failed, sadly.

a := PMMatrix rows: 3 columns: 3 random: 1.0.
self assert: (a mpInverse closeTo: a inverse).
a := PMSymmetricMatrix new: 4 random: 1.0.
self assert: (a mpInverse closeTo: a inverse) ]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work Hemal !

@SergeStinckwich SergeStinckwich merged commit 7c07cd5 into master Jun 30, 2022
@SergeStinckwich SergeStinckwich added this to the v1.0.5 milestone Jul 11, 2022
@hemalvarambhia hemalvarambhia deleted the fix-mp-inverse branch July 31, 2022 18:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants