Casey's section talked a bit about recursive gridding, which is applied in this set. Interested students are encouraged to check out this page for more details of how more efficient N-body gravity algorithms work.

Classes are a/the powerful underpinning of object oriented programming. There are non-class based ways to do this week's set. They are not recommended. A class is an object with structure. It can have unique methods and private data best kept hidden from the rest of the program and other programmers. C++ also has classes, here is some documentation. Wikipedia also has a good summary of their characteristics.

An efficient way to write the gridding routine is to use a class to represent a quad, and have its children present as pointers. You could also pass by reference using some intuitive naming scheme, that is less likely to explode at run time. Pointers are extremely powerful and can also go catastrophically wrong.

 
22.4.txt · Last modified: 2013/01/07 16:19 by chandmer
 
Except where otherwise noted, content on this wiki is licensed under the following license:CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki