Refine SetSize and remove some immediate methods#6347
Refine SetSize and remove some immediate methods#6347
SetSize and remove some immediate methods#6347Conversation
The removed methods mostly were already obsolete due to the custom SetSize. Only the "non emptiness" was not recorded right, which the new code in `SetSize` now handles.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #6347 +/- ##
=======================================
Coverage 78.62% 78.62%
=======================================
Files 684 684
Lines 292701 292691 -10
Branches 8686 8660 -26
=======================================
- Hits 230147 230142 -5
+ Misses 60744 60741 -3
+ Partials 1810 1808 -2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
SetSize and remove some immediate methods
| InstallImmediateMethod( IsFinite, | ||
| IsFreeLeftModule and HasIsFiniteDimensional, 0, | ||
| function( V ) | ||
| if not IsFiniteDimensional( V ) then | ||
| return false; | ||
| else | ||
| TryNextMethod(); | ||
| fi; | ||
| end ); | ||
|
|
There was a problem hiding this comment.
This removal might be considered somewhat borderline, because it triggers on HasIsFiniteDimensional, not on HasDimension (were our SetDimension already took care). But realistically, the set of code that does SetIsFiniteDimensional(V, false) and also relies on this kind of IsFinite immediate method is hopefully empty. (And besides, why not use SetDimension(V, infinity) instead and solve this and more in one go)
ThomasBreuer
left a comment
There was a problem hiding this comment.
Looks good.
(First I stumbled over the different handling for the filters IsTrivial, IsNonTrivial, but this is fine because of the logical implications that connect them.)
I would say that immediate methods are problematic in particular because one can switch them off. Thus one cannot rely on that they will do what one expects.
The removed methods mostly were already obsolete due to the custom
SetSize. Only the "non emptiness" was not recorded right, which the new code inSetSizenow handles.Immediate methods are always a bit problematic because they slow down things. We added the custom
SetSize(andSetDimension) precisely to reduce the need for some of these, but it seems we then did not remove all the now obsolete methods.