From: mgsloan <mg...@gm...> - 2007-04-15 00:13:42
|
> Sorry, I managed to leave an 's' off: > Compute the all the left and right derivatives on the edge and if they > are sufficiently equal, the curves are sufficiently equal. Ahah, that would make more sense! I think I'll still leave it to you though - might want to factor the order of the derivative into the error equation. > The nice thing about having a periodic class like this is that you can > > control what can be done with periodics - you can't perform an operation > on > > two periodics (might have nearly irrational period ratios), you can't > cast > > periodics to anything else. All it can do is render itself useful to > > something finite. There are still problems though. Lets say, pw + > > periodic. Outside the pw's intended domain, the periodicity will > dissapear. > > Whereas lazy pws are always mergable. I suppose that is true. However, as far as I know it would be hard for most lazy languages to do what we want. The problem is that in most, all data types are a known size - multi size things like lists comes from nesting. There are no pointers. So, everything must be 'based' from some point. This creates huge problems for structures that go infinitely both ways. The best solution is to pick an arbitrary split point, and have two lists. Binary trees won't make any sense, because where do you pick a split when the domain is infinite? I suppose some wonky logarithmic binary tree might work. Anyway, the point is that it'd have to be some custom, new-style laziness. The true solution is to have a class for every operation, which extends the class that the operation would normally return. Then all of the methods would be overloaded to figure out what they need to know to be performed, check the memo cache, and ask for anything unknown. Operations built on top of the atomic ones would essentially construct operation trees. This would all be quite cool, in a horrifyingly convoluted sort of way. I almost want to implement it, but rationality holds me back. -mgsloan |