Thread overview | |||||
---|---|---|---|---|---|
|
July 30, 2012 Re: sorting failed error | ||||
---|---|---|---|---|
| ||||
On Monday, July 30, 2012 14:36:07 maarten van damme wrote: > I have no idea what is wrong with my code and the error is not very informative. Does anyone have any idea as to what the problem could be? My first guess would be that your sorting function is not antisymmetric. I ran into such an issue recently: http://d.puremagic.com/issues/show_bug.cgi?id=8469 - Jonathan M Davis |
July 30, 2012 Re: sorting failed error | ||||
---|---|---|---|---|
| ||||
On Monday, July 30, 2012 14:36:07 maarten van damme wrote: > I have no idea what is wrong with my code and the error is not very informative. Does anyone have any idea as to what the problem could be? My first guess would be that your sorting function is not antisymmetric. I ran into such an issue recently: http://d.puremagic.com/issues/show_bug.cgi?id=8469 - Jonathan M Davis |
July 30, 2012 Re: sorting failed error | ||||
---|---|---|---|---|
| ||||
About float not beeing deterministic, would this behavior also exist when I use doubles? I've changed everything to use doubles now and the same error comes up. My sorting function used < so I guess it can never return on (a,b) when (b,a) was true. But on the other hand, it can return false twice. Is it antisymmetric then? I have a struct that encapsulates an array. Shouldn't that struct get passed by value? Because right now the array inside that struct get's passed by reference. How can I circumvent this? I thought I had the problem at the line city[] cities=victim.dna I later on modified cities so it should've been victim.dna.dpu. This didn't solve the problem however... |
Copyright © 1999-2021 by the D Language Foundation