/* Copyright by Matthias Hoechsmann (C) 2002 ===================================== You may use, copy and distribute this file freely as long as you - do not change the file, - leave this copyright notice in the file, - do not make any profit with the distribution of this file - give credit where credit is due You are not allowed to copy or distribute this file otherwise The commercial usage and distribution of this file is prohibited Please report bugs and suggestions to */ #ifndef _PPFORESTSZ_T_CPP_ #define _PPFORESTSZ_T_CPP_ #include #include "misc.h" #include "ppforestsz.h" // PPForest template PPForestSZ::PPForestSZ(Uint nrOfNodes) : m_size(nrOfNodes) { m_lml=new Uint[nrOfNodes]; m_lb=new L[nrOfNodes]; m_keyroot=new bool[nrOfNodes]; } template PPForestSZ::PPForestSZ(const PPForestSZ &ppf) { m_size=ppf.size(); m_lml=new Uint[ppf.size()]; m_lb=new L[ppf.size()]; m_keyroot=new bool[ppf.size()]; memcpy(m_lml,ppf.m_lml,sizeof(Uint)*m_size); memcpy(m_keyroot,ppf.m_keyroot,sizeof(bool)*m_size); for(Uint i=0;i PPForestSZ::~PPForestSZ() { DELETE_ARRAY(m_lml); DELETE_ARRAY(m_lb); DELETE_ARRAY(m_keyroot); } template void PPForestSZ::calcKeyroots() { std::map keyrootMap; for(Uint i=0;i::const_iterator it; for(it=keyrootMap.begin();it!=keyrootMap.end();it++) { m_keyroot[it->second]=true; } } #endif