Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Community » Coffee corner » Quiz #5
Re: Quiz #5 [message #57913 is a reply to message #57912] Tue, 28 December 2021 03:04 Go to previous messageGo to previous message
Lance is currently offline  Lance
Messages: 527
Registered: March 2007
Contributor
It's good to understand the logic the system used to order Ctrls. So I copy the Predicate here
bool RectLess(const Rect& a, const Rect& b)
{
	int d = min(a.bottom, b.bottom) - max(a.top, b.top);
	int w = min(a.GetHeight(), b.GetHeight());
	return d > w / 2 ? a.left < b.left : a.top < b.top;
}

If the height of common vertical part is over half of height of the shorter ctrs, compare horizontally, otherwise , compare vertically.

Given any two Ctrls, the predicate is deterministic. Is this predicate not transitive, ie. a<b, b<c doesn't imply a<c? What if we pass the predicate to a quicksort like algorithm?

[Updated on: Tue, 28 December 2021 03:05]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Some Experiment with Size of Upp Executable
Next Topic: lua binding of Ultimate++
Goto Forum:
  


Current Time: Mon May 13 13:55:02 CEST 2024

Total time taken to generate the page: 0.01865 seconds