4.2 Test TreeManip

(Linux version)

< 4.1 | 4.2 | 5.0 >

Test tree creation using the new TreeManip class.

Modify your main.cpp file to look like this:

#include &lt;iostream&gt;	
#include "node.hpp"
#include "tree.hpp"
#include "tree_manip.hpp"

using namespace strom;

const double Node::_smallest_edge_length = 1.0e-12;

int main(int argc, const char * argv[]) {
    std::cout &lt;&lt; "Starting..." &lt;&lt; std::endl;
    TreeManip tm;
    tm.createTestTree();
    std::cout &lt;&lt; "\nFinished!" &lt;&lt; std::endl;

    return 0;
}	

All we’ve done differently is to create a TreeManip object and call its createTestTree() function, whereas previously we constructed a Tree object that called Tree::createTestTree() function in its constructor.

Try compiling and running the program now. The output is the same as before, except for two additional lines generated by the TreeManip constructor and destructor.

< 4.1 | 4.2 | 5.0 >