I have an entity in 3D, which is defined by a std::vector of points. Each point is an std::vector containing three values :, X, Y and Z.
So it's really a vector< vector< int > >.
I want to find the geometrical center of the 3D entity. To do this, I think I have to find the minimum X and maximum X, and take the value in-between, repeat for Y, repeat for Z; those three values are the center.
I could of course proceed with a bunch of for loops but this is tedious. To find maximum and minimum values, I could more easily use the sort algorithm of the STL. I'm a bit clueless at how I would implement this, though. Yes generally speaking I know how to implement a functor for an algorithm but in this case my brain refuses to cooperate.
Nothing is stopping you from continuing with your testing cadence.
If updates are released every 2 weeks instead of 4, and you test once every 4 weeks, the exact same amount of patches will still be available for you in those 4 weeks.
For example:
Before
4th week - patch 1, 2, 3, 4
After
2nd week - patch 1 and 2
4th week - patch 3 and 4
Still the same amount after 4.
Everyone else has said it. I'm gonna say it - you don't know what you're talking about.
I do. I have two laptops. One work, one personal. I have access to two more laptops - both personal. At home I manually update my personal laptop when I see on Neowin that there is an update - I carry on and only apply the updates when I am ready. My work one only updates when my workplace decides to send it - I carry on and only apply the updates (when they actually arrive, which is usually days after the release) when I switch off the laptop at the end of the day as usual. The two other personal laptops only get updated when I get to it which is rarely - the people who own them carry on using them until I get to it and update them.
All of the browsers on all laptops are configured to restore the tabs when launched.
Google and Microsoft have changed from 6 weeks to 4, and it looks like it's going to move to 2. None of these changes affect how any of these browsers on the laptops are used. Not one jot.
My advice to you is stop panicking whenever you see an update. Just carry on with what you're doing. This even benefits you in a way - from your comment you sound like you don't like the changes or the frivolous new features - great - then carry on as before!
Question
Andre S. Veteran
Hello,
I have an entity in 3D, which is defined by a std::vector of points. Each point is an std::vector containing three values :, X, Y and Z.
So it's really a vector< vector< int > >.
I want to find the geometrical center of the 3D entity. To do this, I think I have to find the minimum X and maximum X, and take the value in-between, repeat for Y, repeat for Z; those three values are the center.
I could of course proceed with a bunch of for loops but this is tedious. To find maximum and minimum values, I could more easily use the sort algorithm of the STL. I'm a bit clueless at how I would implement this, though. Yes generally speaking I know how to implement a functor for an algorithm but in this case my brain refuses to cooperate.
Any help is appreciated.
Link to comment
https://www.neowin.net/forum/topic/700528-c-sorting-a-vector-of-vectors/Share on other sites
4 answers to this question
Recommended Posts