cgma
IntegerHash.hpp
Go to the documentation of this file.
00001 /*
00002  *
00003  *
00004  * Copyright (C) 2004 Sandia Corporation.  Under the terms of Contract DE-AC04-94AL85000
00005  * with Sandia Corporation, the U.S. Government retains certain rights in this software.
00006  *
00007  * This file is part of facetbool--contact via [email protected]
00008  *
00009  * This library is free software; you can redistribute it and/or
00010  * modify it under the terms of the GNU Lesser General Public
00011  * License as published by the Free Software Foundation; either
00012  * version 2.1 of the License, or (at your option) any later version.
00013  *
00014  * This library is distributed in the hope that it will be useful,
00015  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00016  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00017  * Lesser General Public License for more details.
00018  *
00019  * You should have received a copy of the GNU Lesser General Public
00020  * License along with this library; if not, write to the Free Software
00021  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00022  *
00023  *
00024  *
00025  */
00026 
00027 #ifndef _HASHBOOL
00028 #define _HASHBOOL
00029 #include <memory.h>
00030 
00031 class IntegerHash
00032 {
00033 
00034 public:
00035 
00036     IntegerHash(int nBins = 101, int binSizeIncr = 100);
00037     ~IntegerHash();
00038     void getNumberofBins(int *numBins) const;
00039     int *getHashBin(int hashValue, int *binSize);
00040     void addtoHashList(int hashValue, int value);
00041 private:
00042     int numberofBins;
00043     int binSizeIncrement;
00044     int **binArray;
00045     int *binSize, *maxBinSize, hashIndex;
00046     void allocateMoreHash(int index);
00047  
00048 };
00049 
00050 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines