00001 /*@HEADER 00002 // *********************************************************************** 00003 // 00004 // Ifpack: Object-Oriented Algebraic Preconditioner Package 00005 // Copyright (2009) Sandia Corporation 00006 // 00007 // Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive 00008 // license for use of this work by or on behalf of the U.S. Government. 00009 // 00010 // This library is free software; you can redistribute it and/or modify 00011 // it under the terms of the GNU Lesser General Public License as 00012 // published by the Free Software Foundation; either version 2.1 of the 00013 // License, or (at your option) any later version. 00014 // 00015 // This library is distributed in the hope that it will be useful, but 00016 // WITHOUT ANY WARRANTY; without even the implied warranty of 00017 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00018 // Lesser General Public License for more details. 00019 // 00020 // You should have received a copy of the GNU Lesser General Public 00021 // License along with this library; if not, write to the Free Software 00022 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 00023 // USA 00024 // Questions? Contact Michael A. Heroux (maherou@sandia.gov) 00025 // 00026 // *********************************************************************** 00027 //@HEADER 00028 */ 00029 00030 /* This is similar to the Hash_i_dh class (woe, for a lack 00031 of templates); this this class is for hashing data 00032 consisting of single, non-negative integers. 00033 */ 00034 00035 00036 #ifndef HASH_I_DH 00037 #define HASH_I_DH 00038 00039 #include "euclid_common.h" 00040 00041 00042 #ifdef __cplusplus 00043 extern "C" 00044 { 00045 #endif 00046 00047 /* 00048 class methods 00049 note: all parameters are inputs; the only output 00050 is the "int" returned by Hash_i_dhLookup. 00051 */ 00052 extern void Hash_i_dhCreate (Hash_i_dh * h, int size); 00053 /* For proper operation, "size," which is the minimal 00054 size of the hash table, must be a power of 2. 00055 Or, pass "-1" to use the default. 00056 */ 00057 00058 00059 extern void Hash_i_dhDestroy (Hash_i_dh h); 00060 extern void Hash_i_dhReset (Hash_i_dh h); 00061 00062 extern void Hash_i_dhInsert (Hash_i_dh h, int key, int data); 00063 /* throws error if <data, data> is already inserted; 00064 grows hash table if out of space. 00065 */ 00066 00067 extern int Hash_i_dhLookup (Hash_i_dh h, int key); 00068 /* returns "data" associated with "key," 00069 or -1 if "key" is not found. 00070 */ 00071 00072 #ifdef __cplusplus 00073 } 00074 #endif 00075 #endif
1.7.6.1