6 * $Date: 2012-07-06 15:04:28 +0200 (Fr, 06. Jul 2012) $
7 ***************************************************************/
10 * \brief Declaration of class LinearQuadtreeExpansion.
12 * \author Martin Gronemann
15 * This file is part of the Open Graph Drawing Framework (OGDF).
19 * See README.txt in the root directory of the OGDF installation for details.
22 * This program is free software; you can redistribute it and/or
23 * modify it under the terms of the GNU General Public License
24 * Version 2 or 3 as published by the Free Software Foundation;
25 * see the file LICENSE.txt included in the packaging of this file
29 * This program is distributed in the hope that it will be useful,
30 * but WITHOUT ANY WARRANTY; without even the implied warranty of
31 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
32 * GNU General Public License for more details.
35 * You should have received a copy of the GNU General Public
36 * License along with this program; if not, write to the Free
37 * Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
38 * Boston, MA 02110-1301, USA.
40 * \see http://www.gnu.org/copyleft/gpl.html
41 ***************************************************************/
43 #ifndef OGDF_LINEAR_QUADTREE_EXPANSION_H
44 #define OGDF_LINEAR_QUADTREE_EXPANSION_H
46 #include "LinearQuadtree.h"
50 class LinearQuadtreeExpansion
54 LinearQuadtreeExpansion(__uint32 precision
, const LinearQuadtree
& tree
);
57 ~LinearQuadtreeExpansion(void);
59 //! adds a point with the given charge to the receiver expansion
60 void P2M(__uint32 point
, __uint32 receiver
);
62 //! shifts the source multipole coefficient to the center of the receiver and adds them
63 void M2M(__uint32 source
, __uint32 receiver
);
65 //! converts the source multipole coefficient in to a local coefficients at the center of the receiver and adds them
66 void M2L(__uint32 source
, __uint32 receiver
);
68 //! shifts the source local coefficient to the center of the receiver and adds them
69 void L2L(__uint32 source
, __uint32 receiver
);
71 //! evaluates the derivate of the local expansion at the point and adds the forces to fx fy
72 void L2P(__uint32 source
, __uint32 point
, float& fx
, float& fy
);
74 //! returns the size in bytes
75 __uint32
sizeInBytes() const { return m_numExp
*m_numCoeff
*sizeof(double)*4; }
77 //! returns the array with multipole coefficients
78 inline double* multiExp() const { return m_multiExp
; }
80 //! returns the array with local coefficients
81 inline double* localExp() const { return m_localExp
; }
83 //! number of coefficients per expansions
84 inline __uint32
numCoeff() const { return m_numCoeff
; }
87 const LinearQuadtree
& tree() { return m_tree
; }
90 //! allocates the space for the coeffs
93 //! releases the memory for the coeffs
96 //! the Quadtree reference
97 const LinearQuadtree
& m_tree
;
99 //! the big multipole expansione coeff array
102 //! the big local expansion coeff array
106 //! the number of multipole (locale) expansions
109 //! the number of coeff per expansions
112 BinCoeff
<double> binCoef
;
116 } // end of namespace ogdf