Open
Graph Drawing
Framework

 v.2007.11
 

NMM.h

Go to the documentation of this file.
00001 /*
00002  * $Revision: 1.2 $
00003  * 
00004  * last checkin:
00005  *   $Author: gutwenger $ 
00006  *   $Date: 2007-11-09 12:12:41 +0100 (Fr, 09 Nov 2007) $ 
00007  ***************************************************************/
00008  
00051 #ifdef _MSC_VER
00052 #pragma once
00053 #endif
00054 
00055 #ifndef NMM_H
00056 #define NMM_H
00057 
00058 #include <complex>
00059 
00060 #include <ogdf/basic/Graph.h>
00061 #include <ogdf/basic/List.h>
00062 #include <ogdf/basic/Array2D.h>
00063 #include <ogdf/basic/geometry.h>
00064 #include <ogdf/internal/energybased/NodeAttributes.h>
00065 #include <ogdf/internal/energybased/EdgeAttributes.h>
00066 #include <ogdf/internal/energybased/QuadTreeNM.h>
00067 #include <ogdf/internal/energybased/ParticleInfo.h>
00068 #include <ogdf/internal/energybased/FruchtermanReingold.h>
00069 
00070 namespace ogdf {
00071 
00072 class NMM 
00073 {
00074    
00075    
00076    public:
00077       NMM();          //constructor
00078       ~NMM();         //destructor
00079 
00080       //Calculate rep. forces for each node.
00081       void calculate_repulsive_forces(const Graph &G,NodeArray<NodeAttributes>& A,
00082                                       NodeArray<DPoint>& F_rep);
00083 
00084       //Make all initialisations that are needed for New Multipole Method (NMM)
00085       void make_initialisations (const Graph &G,NodeArray<NodeAttributes>& A,
00086                                  NodeArray<DPoint>& F_rep, double boxlength,
00087                  DPoint down_left_corner,int particles_in_leaves,
00088                  int precision,int tree_construction_way,
00089                  int find_small_cell);
00090 
00091       //Dynamically allocated memory is freed here.
00092       void deallocate_memory();
00093 
00094       //Import updated information of the drawing area.
00095       void update_boxlength_and_cornercoordinate(double b_l,DPoint d_l_c);
00096         
00097    private:
00098 
00099        int MIN_NODE_NUMBER; //The minimum number of nodes for which the forces are
00100                             //calculated using NMM (for lower values the exact 
00101                             //calculation is used).
00102        bool using_NMM; //Indicates whether the exact method or NMM is used for force
00103                        //calculation (value depends on MIN_NODE_NUMBER)
00104        FruchtermanReingold ExactMethod; //needed in case that using_NMM == false
00105  
00106        int _tree_construction_way;//1 = pathwise;2 = subtreewise
00107        int _find_small_cell;//0 = iterative; 1= Aluru
00108        int _particles_in_leaves;//max. number of particles for leaves of the quadtree
00109        int _precision;  //precision for p-term multipole expansion
00110     
00111        double boxlength;//length of drawing box
00112        DPoint down_left_corner;//down left corner of drawing box
00113 
00114        int* power_of_2;//holds the powers of 2 (for speed reasons to calculate the
00115                        //maximal boxindex (index is from 0 to max_power_of_2_index)
00116        int max_power_of_2_index;//holds max. index for power_of_2 (= 30) 
00117        double ** BK; //holds the binominal coefficients
00118        List<DPoint> rep_forces;   //stores the rep. forces of the last iteration 
00119                                   //(needed for error calculation)
00120 
00121       //private helping functions
00122 
00123       //The array power_of_2 is calculated for values from 0 to max_power_of_2_index
00124       //which is set here to 30.
00125       void init_power_of_2_array(void);
00126 
00127       //The space of power_of_2 is freed.
00128       void free_power_of_2_array();     
00129 
00130       //Returns power_of_2[i] for values <= max_power_of_2_index else it returns 
00131       //pow(2,i).
00132       int power_of_two(int i);  
00133     
00134       //Returns the maximal index of a box in level i.
00135       int maxboxindex (int level);
00136 
00137       //Use NMM for force calculation (useded for large Graphs (|V| > MIN_NODE_NUMBER)).
00138       void  calculate_repulsive_forces_by_NMM(const Graph &G, NodeArray 
00139                   <NodeAttributes>& A ,NodeArray<DPoint>& F_rep);
00140                     
00141       //Use the exact method for force calculation (used for small Graphs (|V| <=
00142       //MIN_NODE_NUMBER) for speed reasons).
00143       void  calculate_repulsive_forces_by_exact_method(const Graph &G, NodeArray 
00144                   <NodeAttributes>& A ,NodeArray<DPoint>& F_rep);
00145 
00146       // *********Functions needed for path by path tree construction***********
00147    
00148       //The reduced quadtree is build up path by path (the Lists LE,ME, the
00149       //centers, D1, D2, M, and quad_tree_leaves are not calculated here.
00150       void  build_up_red_quad_tree_path_by_path(const Graph& G, NodeArray
00151                            <NodeAttributes>& A,QuadTreeNM& T);
00152 
00153       //Makes L_x(y)_copy a copy of L_x(y)_orig and sets p.copy_item for each element in 
00154       //L_x(y)_orig to the ListIterator of the corresponding element in L_x(y)_copy;
00155       //Furthermore, the p.cross_ref_items in L_x(y)_copy are set and p.subList_ptr and
00156       //p.tmp_cross_ref_item is reset to NULL in both lists.
00157       void make_copy_and_init_Lists(List<ParticleInfo>& L_x_orig,List<ParticleInfo>& 
00158                    L_x_copy,List<ParticleInfo>& L_y_orig,List
00159                    <ParticleInfo>& L_y_copy);
00160 
00161       //The root node of T is constructed.
00162       void build_up_root_node(const Graph& G,NodeArray<NodeAttributes>& A,QuadTreeNM& T);
00163 
00164       //The sorted and linked Lists L_x and L_y for the root node are created.
00165       void create_sorted_coordinate_Lists(const Graph& G,NodeArray<NodeAttributes>& A, 
00166                    List<ParticleInfo>& L_x,List<ParticleInfo>& L_y);
00167 
00168       //T is extended by a subtree T1 rooted at the T.get_act_node().  
00169       //The boxlength and down_left_corner of the actaul node is reduced if it is
00170       //not the minimal subquad that containes all the particles in the represented area.
00171       void  decompose_subtreenode(QuadTreeNM& T,List<ParticleInfo>& act_x_List_copy,
00172                   List<ParticleInfo>& act_y_List_copy,List<QuadTreeNodeNM*>& 
00173                   new_leaf_List);
00174 
00175       //The extreme coordinates of the particles conatined in *act_ptr are calculated. 
00176       void calculate_boundaries_of_act_node(QuadTreeNodeNM* act_ptr,double& x_min,
00177                        double& x_max,double& y_min,double& y_max);
00178 
00179       //Returns true if the rectangle defined by x_min,...,y_max lies within the
00180       //left(right)_top(bottom) quad of the small cell of *act_ptr.
00181       bool in_lt_quad(QuadTreeNodeNM* act_ptr,double x_min,double x_max, double y_min,
00182               double y_max);
00183       bool in_rt_quad(QuadTreeNodeNM* act_ptr,double x_min,double x_max, double y_min,
00184               double y_max);
00185       bool in_lb_quad(QuadTreeNodeNM* act_ptr,double x_min,double x_max, double y_min,
00186               double y_max);
00187       bool in_rb_quad(QuadTreeNodeNM* act_ptr,double x_min,double x_max, double y_min,
00188               double y_max);
00189 
00190       //The Lists *act_ptr->get_x(y)_List_ptr() are split into two sublists containing
00191       //the particles in the left and right half of the actual quad. The list that is 
00192       //larger is constructed from *act_ptr->get_x(y)_List_ptr() by deleting the other
00193       //elements; The smaller List stays empty at this point, but the corresponding
00194       //elements in L_x(y)_copy contain a pointer to the x(y) List, where they belong to.
00195       void split_in_x_direction(QuadTreeNodeNM* act_ptr,List<ParticleInfo>& L_x_copy,
00196                 List<ParticleInfo>& L_y_copy,List<ParticleInfo>*& 
00197                 L_x_left_ptr,List <ParticleInfo>*& L_y_left_ptr,List
00198                 <ParticleInfo>*& L_x_right_ptr,List <ParticleInfo>*& 
00199                 L_y_right_ptr);
00200       
00201       //The Lists *act_ptr->get_x(y)_List_ptr() are split into two subLists containing
00202       //the particles in the top /bottom half ...
00203       void split_in_y_direction(QuadTreeNodeNM* act_ptr,List<ParticleInfo>& L_x_copy,
00204                 List<ParticleInfo>&L_y_copy,List<ParticleInfo>*& 
00205                 L_x_bottom_ptr,List <ParticleInfo>*& L_y_bottom_ptr,List
00206                 <ParticleInfo>*& L_x_top_ptr,List <ParticleInfo>*& 
00207                 L_y_top_ptr);
00208       
00209       
00210       //The Lists *L_x(y)_left_ptr are constructed from *act_ptr->get_x(y)_List_ptr()
00211       //by deleting all elements right from last_left_item in *act_ptr->get_x_List_ptr()
00212       //the corresponding values in  *act_ptr->get_y_List_ptr() are deleted as well.
00213       //The corresponding List-elements of the deleted elements in the Lists L_x(y)_copy
00214       //hold the information, that they belong to the Lists *L_x(y)_left_ptr.
00215       void x_delete_right_subLists(QuadTreeNodeNM* act_ptr,List<ParticleInfo>& L_x_copy,
00216                    List<ParticleInfo>&L_y_copy,List<ParticleInfo>*& 
00217                    L_x_left_ptr,List <ParticleInfo>*& L_y_left_ptr,List
00218                    <ParticleInfo>*& L_x_right_ptr,List <ParticleInfo>*& 
00219                    L_y_right_ptr,ListIterator<ParticleInfo> 
00220                    last_left_item);
00221       
00222       //Analogue as above.
00223       void x_delete_left_subLists(QuadTreeNodeNM* act_ptr,List<ParticleInfo>& L_x_copy,
00224                   List<ParticleInfo>&L_y_copy,List<ParticleInfo>*& 
00225                   L_x_left_ptr,List <ParticleInfo>*& L_y_left_ptr,List
00226                   <ParticleInfo>*& L_x_right_ptr,List <ParticleInfo>*& 
00227                   L_y_right_ptr,ListIterator<ParticleInfo> 
00228                   last_left_item); 
00229       
00230       //The Lists *L_x(y)_left_ptr are constructed from *act_ptr->get_x(y)_List_ptr()
00231       //by deleting all elements right from last_left_item in *act_ptr->get_y_List_ptr()
00232       //the ... 
00233       void y_delete_right_subLists(QuadTreeNodeNM* act_ptr,List<ParticleInfo>& L_x_copy,
00234                    List<ParticleInfo>&L_y_copy,List<ParticleInfo>*& 
00235                    L_x_left_ptr,List <ParticleInfo>*& L_y_left_ptr,List
00236                    <ParticleInfo>*& L_x_right_ptr,List <ParticleInfo>*& 
00237                    L_y_right_ptr,ListIterator<ParticleInfo> 
00238                    last_left_item);
00239       
00240       //Analogue as above.
00241       void y_delete_left_subLists(QuadTreeNodeNM* act_ptr,List<ParticleInfo>& L_x_copy,
00242                   List<ParticleInfo>&L_y_copy,List<ParticleInfo>*& 
00243                   L_x_left_ptr,List <ParticleInfo>*& L_y_left_ptr,List
00244                   <ParticleInfo>*& L_x_right_ptr,List <ParticleInfo>*& 
00245                   L_y_right_ptr,ListIterator<ParticleInfo> 
00246                   last_left_item); 
00247       
00248       
00249       //The Lists *L_x(y)_b_ptr and *L_x(y)_t_ptr are constructed from the Lists 
00250       // *L_x(y)_ptr.
00251       void split_in_y_direction(QuadTreeNodeNM* act_ptr,List<ParticleInfo>*& L_x_ptr,
00252                 List <ParticleInfo>*& L_x_b_ptr,List<ParticleInfo>*& 
00253                 L_x_t_ptr,List<ParticleInfo>*& L_y_ptr,List 
00254                 <ParticleInfo>*& L_y_b_ptr,List<ParticleInfo>*& 
00255                 L_y_t_ptr);
00256       
00257       //The Lists *L_x(y)_b(t)_ptr are constructed from the Lists *L_x(y)_ptr by 
00258       //moving all List elements from *L_x(y)_ptr that belong to *L_x(y)_l_ptr 
00259       //to this List. the L_x(y)_right_ptr point  to the reduced Lists L_x(y)_ptr 
00260       //afterwards.      
00261       void y_move_left_subLists(List<ParticleInfo>*& L_x_ptr,List<ParticleInfo>*& 
00262                 L_x_b_ptr,List<ParticleInfo>*& L_x_t_ptr,List
00263                 <ParticleInfo>*& L_y_ptr,List <ParticleInfo>*& 
00264                 L_y_b_ptr,List<ParticleInfo>*& 
00265                 L_y_t_ptr,ListIterator<ParticleInfo> last_left_item);
00266       
00267       //Same as above but the elements that belong to *&L_x(y)_right_ptr are moved.
00268       void y_move_right_subLists(List<ParticleInfo>*& L_x_ptr,List<ParticleInfo>*&
00269                  L_x_b_ptr,List<ParticleInfo>*& L_x_t_ptr,List
00270                  <ParticleInfo>*&L_y_ptr,List <ParticleInfo>*& 
00271                  L_y_b_ptr,List<ParticleInfo>*& 
00272                  L_y_t_ptr,ListIterator<ParticleInfo> last_left_item);
00273       
00274       //The sorted subLists, that can be accesssed by the entries in L_x(y)_copy->
00275       //get_subList_ptr() are constructed.
00276       void build_up_sorted_subLists(List<ParticleInfo>& L_x_copy,List<ParticleInfo>&
00277                     act_y_List_copy);   
00278      
00279       // ************functions needed for subtree by subtree tree construction **********
00280      
00281       //The reduced quadtree is build up subtree by subtree (the lists LE, ME the
00282       //centers, D1, D2, M, quad_tree_leaves are not calculated here.
00283       void  build_up_red_quad_tree_subtree_by_subtree(const Graph& G, NodeArray
00284                               <NodeAttributes>& A,QuadTreeNM& T);
00285      
00286       //The root node ot T is constructed and contained_nodes is set to the list of
00287       //all nodes of G.
00288       void build_up_root_vertex(const Graph&G,QuadTreeNM& T);
00289       
00290       //The reduced subtree of T rooted at *subtree_root_ptr containing all the particles
00291       //of subtree_root_ptr->get_contained_nodes() is constructed; Pointers to leaves 
00292       //of the subtree that contain more than particles_in_leaves() particles in their
00293       //contained_nodes() lists are added to new_subtree_root_List_ptr; The lists 
00294       //contained_nodes() are nonempty only for the (actual) leaves of T.
00295       void construct_subtree(NodeArray<NodeAttributes>& A,QuadTreeNM& T,QuadTreeNodeNM* 
00296                  subtree_root_ptr,List<QuadTreeNodeNM*>& 
00297                  new_subtree_root_List);
00298       
00299       //A complete subtree of T and of depth subtree_depth, rooted at *T.get_act_ptr() is
00300       //constructed. Furthermore leaf_ptr[i][j] points to a leaf node of the suptree
00301       //that represents the quadratic subregion of *T.get_act_ptr() at subtree_depth
00302       //and position [i][j] i,j in 0,...,maxindex;act_depth(x_index,y_index) are
00303       //helping variables for recursive calls.
00304       void construct_complete_subtree(QuadTreeNM& T,int subtree_depth,
00305                       Array2D<QuadTreeNodeNM*>& leaf_ptr,
00306                       int act_depth,int 
00307                       act_x_index,int act_y_index);
00308       
00309       //The particles in subtree_root_ptr->get_contained_nodes() are assigned to 
00310       //the the contained_nodes lists of the leaves of the subtree by using the 
00311       //information of A,leaf_ptr and maxindex. Afterwards contained_nodes of 
00312       // *subtree_root_ptr is empty.
00313       void set_contained_nodes_for_leaves(NodeArray<NodeAttributes>& A,QuadTreeNM& T,
00314                       QuadTreeNodeNM* subtree_root_ptr,Array2D
00315                       <QuadTreeNodeNM*>& leaf_ptr,int  maxindex);
00316       
00317       //The subtree of T rooted at *T.get_act_ptr() is traversed bottom up, such that
00318       //the subtreeparticlenumber of every node in this subtree is set correctly.
00319       void set_particlenumber_in_subtree_entries(QuadTreeNM& T);
00320       
00321       //The reduced subtree rooted at *T.get_act_ptr() is calculated ; A pointer to 
00322       //every leaf of this subtree that contains more then particles_in_leaves() 
00323       //particles is added to new_subtree_root_List; The lists contained_nodes are 
00324       //empty for all but the leaves.
00325       void construct_reduced_subtree(NodeArray<NodeAttributes>& A,QuadTreeNM& T,List
00326                      <QuadTreeNodeNM*>& new_subtree_root_List);
00327       
00328       //All subtrees of *T.get_act_ptr() that have a child c of *T.get_act_ptr() as root
00329       //and c.get_particlenumber_in_subtree() == 0 are deleted.
00330       void delete_empty_subtrees(QuadTreeNM& T);
00331       
00332       //If *T.get_act_ptr() is a degenerated node (has only one child c) *T.get_act_ptr()
00333       //is deleted from T and the child c is linked with the father of *T.get_act_ptr()
00334       //if *T.get_act_ptr() is the root of T than c is set to the new root of T
00335       //T.get_act_ptr() points to c afterwards; Furthermore true is returned if
00336       // *T.get_act_ptr() has been degenerated, else false is returned.
00337       bool check_and_delete_degenerated_node(QuadTreeNM& T);
00338       
00339       //The subtree rooted at new_leaf_ptr is deleted, *new_leaf_ptr is a leaf 
00340       //of T and new_leaf_ptr->get_contained_nodes() containes all the particles
00341       //contained in the leaves of the deleted subtree; Precondition: T.get_act_ptr() is
00342       //new_leaf_ptr.
00343       void delete_sparse_subtree(QuadTreeNM& T,QuadTreeNodeNM* new_leaf_ptr);
00344       
00345       //new_leaf_ptr->get_contained_nodes() containes all the particles contained in 
00346       //the leaves of its subtree afterwards; Precondition: T.get_act_ptr() is
00347       //new_leaf_ptr
00348       void collect_contained_nodes(QuadTreeNM& T,QuadTreeNodeNM* new_leaf_ptr);
00349       
00350       //If all nodes in T.get_act_ptr()->get_contained_nodes() have the same position
00351       //false is returned. Else true is returned and
00352       //the boxlength, down_left_corner and level of *T.get_act_ptr() is updated
00353       //such that this values are minimal (i.e. the smallest quad that contains all
00354       //the particles of T.get_act_ptr()->get_contained_nodes(); If all this particles
00355       //are placed at a point nothing is done.
00356       bool find_smallest_quad(NodeArray<NodeAttributes>& A,QuadTreeNM& T);
00357       
00358       // *********functions needed for subtree by subtree tree construction(end) ********
00359       
00360       //Finds the small cell of the actual Node of T iteratively,and updates 
00361       //Sm_downleftcorner, Sm_boxlength, and level of *act_ptr. 
00362       void find_small_cell_iteratively(QuadTreeNodeNM* act_ptr,double x_min,double x_max,
00363                        double y_min,double y_max);
00364       
00365       //Finds the small cell of the actual Node of T by Alurus Formula, and updates 
00366       //Sm_downleftcorner, Sm_boxlength, and level of *act_ptr. 
00367       void find_small_cell_by_formula(QuadTreeNodeNM* act_ptr,double x_min,double x_max,
00368                       double y_min,double y_max);
00369       
00370       //The reduced quad tree is deleted; Furthermore the treenode_number is calculated.
00371       void delete_red_quad_tree_and_count_treenodes(QuadTreeNM& T);
00372       
00373       //The multipole expansion terms ME are calculated for all nodes of T ( centers are
00374       //initialized for each cell and quad_tree_leaves stores pointers to leaves of T).
00375       void form_multipole_expansions(NodeArray<NodeAttributes>& A,QuadTreeNM& T,List
00376                      <QuadTreeNodeNM*>& quad_tree_leaves);
00377       
00378       //The multiplole expansion List ME for the tree rooted at T.get_act_ptr() is 
00379       //recursively calculated. 
00380       void form_multipole_expansion_of_subtree(NodeArray<NodeAttributes>& A,QuadTreeNM& 
00381                            T, List<QuadTreeNodeNM*>& 
00382                            quad_tree_leaves);
00383       
00384       //The Lists ME and LE are both initialized to zero entries for *act_ptr.
00385       void init_expansion_Lists(QuadTreeNodeNM* act_ptr);
00386       
00387       //The center of the box of *act_ptr is initialized.  
00388       void set_center(NodeArray<NodeAttributes>& A,QuadTreeNodeNM* act_ptr);
00389       
00390       //Calculate List ME for *act_ptr Precondition: *act_ptr is a leaf.
00391       void form_multipole_expansion_of_leaf_node(NodeArray<NodeAttributes>& A,
00392                           QuadTreeNodeNM* act_ptr);
00393       
00394       //Add the shifted ME Lists of *act_ptr to act_ptr->get_father_ptr() ; precondition
00395       // *act_ptr has a father_node.
00396       void add_shifted_expansion_to_father_expansion(QuadTreeNodeNM* act_ptr);
00397       
00398       //According to NMM T is traversed recursively top-down starting from act_node_ptr 
00399       //== T.get_root_ptr() and thereby the lists D1, D2, M and LE are calculated for all
00400       //treenodes. 
00401       void calculate_local_expansions_and_WSPRLS(NodeArray<NodeAttributes>&A,
00402                          QuadTreeNodeNM* act_node_ptr);
00403       
00404       //If the small cell of ptr_1 and ptr_2 are well seperated true is returned (else 
00405       //false).
00406       bool well_seperated(QuadTreeNodeNM* ptr_1,QuadTreeNodeNM* ptr_2);
00407       
00408       //If ptr_1 and ptr_2 are nonequal and bordering true is returned; else false.
00409       bool bordering(QuadTreeNodeNM* ptr_1,QuadTreeNodeNM* ptr_2);
00410       
00411       //The shifted local expansion of the father of node_ptr is added to the local
00412       //expansion of node_ptr;precondition: node_ptr is not the root of T.
00413       void add_shifted_local_exp_of_parent(QuadTreeNodeNM* node_ptr);  
00414       
00415       //The multipole expansion of *ptr_1 is transformed into a local expansion around
00416       //the center of *ptr_2 and added to *ptr_2 s local expansion list.
00417       void add_local_expansion(QuadTreeNodeNM* ptr_1,QuadTreeNodeNM* ptr_2);
00418       
00419       //The multipole expansion for every particle of leaf_ptr->contained_nodes 
00420       //(1,0,...) is transformed into a local expansion around the center of *ptr_2 and 
00421       //added to *ptr_2 s local expansion List;precondition: *leaf_ptr is a leaf.
00422       void add_local_expansion_of_leaf(NodeArray<NodeAttributes>&A,QuadTreeNodeNM*
00423                     leaf_ptr,QuadTreeNodeNM* act_ptr);
00424       
00425       //For each leaf v in quad_tree_leaves the force contribution defined by 
00426       //v.get_local_exp() is calculated and stored in F_local_exp.
00427       void transform_local_exp_to_forces(NodeArray <NodeAttributes>&A, 
00428                      List<QuadTreeNodeNM*>& quad_tree_leaves,
00429                      NodeArray<DPoint>& F_local_exp);
00430       
00431       //For each leaf v in quad_tree_leaves the force contribution defined by all nodes
00432       //in v.get_M() is calculated and stored in F_multipole_exp.
00433       void transform_multipole_exp_to_forces(NodeArray<NodeAttributes>& A,
00434                          List<QuadTreeNodeNM*>& quad_tree_leaves, 
00435                          NodeArray<DPoint>& F_multipole_exp);
00436       
00437       //For each leaf v in quad_tree_leaves the force contributions from all leaves in
00438       //v.get_D1() and v.get_D2() are calculated.
00439       void calculate_neighbourcell_forces(const Graph& G, NodeArray<NodeAttributes>& 
00440                       A,List<QuadTreeNodeNM*>& quad_tree_leaves,
00441                       NodeArray<DPoint>& F_direct);
00442       
00443       //Add repulsive force contributions for each node.
00444       void add_rep_forces(const Graph& G,NodeArray<DPoint>& F_direct,NodeArray<DPoint>& 
00445               F_multipole_exp,NodeArray<DPoint>& F_local_exp,
00446               NodeArray<DPoint>& F_rep);
00447       
00448       //Returns the repulsing force_function_value of scalar d. 
00449       double f_rep_scalar (double d);
00450       
00451       //Init BK -matrix for values n, k in 0 to t.
00452       void init_binko(int t);    
00453       
00454       //Free space for BK.
00455       void free_binko();
00456       
00457       //Returns n over k.
00458       double binko(int n, int k);
00459       
00460       //The way to construct the reduced tree (0) = level by level (1) path by path 
00461       //(2) subtree by subtree
00462       int tree_construction_way() const {return _tree_construction_way;}
00463       void tree_construction_way(int a) { _tree_construction_way= 
00464                         (((0<=a)&&(a<=2)) ? a : 0);}
00465       
00466       //(0) means that the smallest quadratic cell that surrounds a node of the 
00467       //quadtree is calculated iteratively in constant time (1) means that it is 
00468       //calculated by the formula of Aluru et al. in constsnt time
00469       int find_sm_cell() const {return _find_small_cell;}
00470       void find_sm_cell(int a) { _find_small_cell = 
00471                    (((0<=a)&&(a<=1)) ? a : 0);}    
00472       
00473       //Max. number of particles that are contained in a leaf of the red. quadtree.
00474       void particles_in_leaves (int b) { _particles_in_leaves = ((b>= 1)? b : 1);}
00475       int particles_in_leaves () const { return _particles_in_leaves;}  
00476       
00477       //The precision p for the p-term multipole expansions.
00478       void precision (int p) { _precision  = ((p >= 1 ) ? p : 1);}
00479       int  precision () const {return _precision;}
00480       
00481 };
00482 }//namespace ogdf
00483 #endif
00484 
00485   


© 1999-2007 by oreas GmbH, © 2005-2007 by University Dortmund and University Cologne.

Generated on Thu Nov 22 19:40:02 2007 by doxygen 1.5.4.