#include <node.h>
Inheritance diagram for node:
Public Member Functions | |
void | clear_node () |
void | node_init () |
void | node_set_stories (bool use_stories) |
void | node_set_hbase (hbpfp the_hbpfp) |
void | node_set_sbase (sbpfp the_sbpfp) |
node (hbpfp the_hbpfp=new_hydrobase, sbpfp the_sbpfp=new_starbase, bool use_stories=true) | |
Default node constructor includes minimal star and hydro support. | |
void | rmstory () |
Delete the star story. | |
void | rmstarbase () |
Delete the star base. | |
void | rmhydrobase () |
Delete the hydro base. | |
virtual | ~node () |
bool | is_valid () const |
Test the node's "magic number" to check validity. | |
void | set_invalid () |
Flag the node as invalid. | |
void | set_label (int number) |
Set the node ID label. | |
void | set_label (char *a_string) |
Set the node ID label. | |
void | set_index (int number) |
Set the node ID label (alternate name). | |
void | set_name (char *a_string) |
Set the node ID label (alternate name). | |
void | clear_name () |
Delete the node ID label. | |
void | clear_label () |
Delete the node ID label. | |
void | set_mass (const real new_mass) |
Set the node mass. | |
void | set_parent (node *b) |
Set the parent pointer. | |
void | set_oldest_daughter (node *b) |
Set the oldest daughter pointer. | |
void | set_elder_sister (node *b) |
Set the elder sister pointer. | |
void | set_younger_sister (node *b) |
Set the younger sister pointer. | |
void | set_log_story (story *s) |
void | set_dyn_story (story *s) |
void | log_comment (char *) |
Add a comment to the log story. | |
void | log_history (int, char **) |
Add the argument list to the log story. | |
void | inc_mass (const real d_mass) |
Increment the mass by the specified amount. | |
void | scale_mass (const real scale_factor) |
Scale the mass by the specified factor. | |
int | get_index () const |
char * | get_name () const |
real | get_mass () const |
node * | get_parent () const |
node * | get_oldest_daughter () const |
node * | get_younger_sister () const |
node * | get_elder_sister () const |
node * | get_top_level_node () const |
Return the top-level node of this node. | |
void | set_root (node *b=NULL) |
Set or find the root node pointer. | |
node * | get_root () const |
Return (possibly find and return) the root node pointer. | |
node * | get_binary_sister () |
Find the binary sister of this node. | |
void | set_hydrobase (hydrobase *hb) |
void | set_starbase (starbase *sb) |
hydrobase * | get_hydrobase () const |
starbase * | get_starbase () const |
story * | get_log_story () const |
story * | get_dyn_story () const |
story * | get_hydro_story () const |
story * | get_star_story () const |
virtual void | null_pointers () |
Clear story and base pointers (dangerous!). | |
virtual void | print_static (ostream &s=cerr) |
Print the static members of this class. | |
istream & | scan_log_story (istream &, char *) |
Read the log story from a stream. | |
istream & | scan_hydro_story (istream &) |
Read the hydro story from a stream. | |
virtual istream & | scan_star_story (istream &, int level=0) |
Read the star story from a stream. | |
virtual istream & | scan_dyn_story (istream &) |
Read the dyn story from a stream. | |
virtual bool | check_and_correct_node (bool verbose=false) |
Repair tree structure. | |
ostream & | print_log_story (ostream &s=cout) |
Write the log story to a stream. | |
ostream & | print_hydro_story (ostream &s=cout) |
Write the hydro story to a stream. | |
ostream & | print_star_story (ostream &s=cout, int short_output=0) |
Write the star story to a stream. | |
virtual ostream & | print_dyn_story (ostream &s=cout, bool print_xreal=true, int short_output=0) |
Write the dyn story to a stream. | |
bool | is_isolated () const |
Is this a solo node? | |
bool | is_root () const |
Is this the root node? | |
bool | is_leaf () const |
Is this a leaf node? | |
bool | is_top_level_node () const |
Is this a top-level node? | |
bool | is_top_level_leaf () const |
Is this a top-level leaf? | |
bool | is_low_level_node () const |
Is this a low-level node? | |
bool | is_low_level_leaf () const |
Is this a low-level leaf? | |
bool | is_parent () const |
Is this a parent node? | |
bool | is_grandparent () const |
Is this a grandparent node? | |
node * | next_node (node *) |
Getthe next node in a tree-traversal loop. | |
node * | orig_next_node (node *) |
bool | name_is (char *) const |
Is this the name of this node? | |
char * | format_label () const |
Return the label (index or name) of this node. | |
void | print_label (ostream &) const |
Print the label (index or name) of this node. | |
void | pretty_print_node (ostream &s=cerr) const |
Pretty-print the label (index or name) of this node. | |
void | pretty_print_tree (ostream &s=cerr, int level=0) |
Recursively pretty-print the label of this node and thise below it. | |
int | n_leaves () const |
Compute the number of leaves under this node. | |
int | n_daughters () const |
Compute the number of daughters of this node. | |
Protected Attributes | |
long int | node_flag |
"Magic number" identifying valid node. | |
int | index |
Nodes can be numbered. | |
char * | name |
Or nodes can receive individual names. | |
real | mass |
Node mass (= sum of daughter masses). | |
node * | parent |
node * | oldest_daughter |
node * | elder_sister |
node * | younger_sister |
hydrobase * | hbase |
Class underlying all hydrodynamic classes. | |
starbase * | sbase |
Class underlying all stellar classes. | |
story * | log_story |
story * | dyn_story |
Static Protected Attributes | |
static node * | root |
Address of the root node. |
Nodes have a name and a mass, together with pointers defining the data tree describing the N-body system, starbase and hydrobase pointers allowing extension to stellar and hydrodynamical applications, and log and dyn stories for additional run-time variables.
Definition at line 40 of file node.h.