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
It appears that the asymptotics for a few operations are worse that they can and should be.
For example:
insert:: (Ordr, Ordc) =>r->c->a->Tablerca->Tablerca
insert r c a (Table (rm, cm, _)) = fromMaps' r c rm' cm'
where
rm' =Map.alter f r rm
cm' =Map.alter g c cm
f =Just.maybe (Map.singleton c a) (Map.insert c a)
g =Just.maybe (Map.singleton r a) (Map.insert r a)
Kind of looks fine, and should be O(ln(c) · ln(r)) or something, but, the size' function called in fromMaps' clearly looks at every key in one of the maps.
So it's actually more like O(r)
I think this could be pretty easily fixed by using insertLookup and alterF.
The text was updated successfully, but these errors were encountered:
I was just having a look and noticed this.
It appears that the asymptotics for a few operations are worse that they can and should be.
For example:
Kind of looks fine, and should be
O(ln(c) · ln(r))
or something, but, thesize'
function called infromMaps'
clearly looks at every key in one of the maps.So it's actually more like
O(r)
I think this could be pretty easily fixed by using
insertLookup
andalterF
.The text was updated successfully, but these errors were encountered: