2 Copyright by Matthias Hoechsmann (C) 2002
3 =====================================
4 You may use, copy and distribute this file freely as long as you
5 - do not change the file,
6 - leave this copyright notice in the file,
7 - do not make any profit with the distribution of this file
8 - give credit where credit is due
9 You are not allowed to copy or distribute this file otherwise
10 The commercial usage and distribution of this file is prohibited
11 Please report bugs and suggestions to <mhoechsm@TechFak.Uni-Bielefeld.DE>
14 #ifndef _PPFORESTSZ_T_CPP_
15 #define _PPFORESTSZ_T_CPP_
20 #include "ppforestsz.h"
26 PPForestSZ<L>::PPForestSZ(Uint nrOfNodes)
29 m_lml=new Uint[nrOfNodes];
30 m_lb=new L[nrOfNodes];
31 m_keyroot=new bool[nrOfNodes];
35 PPForestSZ<L>::PPForestSZ(const PPForestSZ<L> &ppf)
39 m_lml=new Uint[ppf.size()];
40 m_lb=new L[ppf.size()];
41 m_keyroot=new bool[ppf.size()];
43 memcpy(m_lml,ppf.m_lml,sizeof(Uint)*m_size);
44 memcpy(m_keyroot,ppf.m_keyroot,sizeof(bool)*m_size);
46 for(Uint i=0;i<m_size;i++)
51 PPForestSZ<L>::~PPForestSZ()
55 DELETE_ARRAY(m_keyroot);
59 void PPForestSZ<L>::calcKeyroots()
61 std::map<Uint,Uint> keyrootMap;
63 for(Uint i=0;i<m_size;i++)
69 std::map<Uint,Uint>::const_iterator it;
70 for(it=keyrootMap.begin();it!=keyrootMap.end();it++)
72 m_keyroot[it->second]=true;