OverviewFilesCommitsIssuesDocsReleasesPeers

opencog-CompactHash / HashFactory / perfectHash.hm

103 lines · hm ref:
/* Copyright 2013-14.  Los Alamos National Security, LLC. This material was produced
 * under U.S. Government contract DE-AC52-06NA25396 for Los Alamos National 
 * Laboratory (LANL), which is operated by Los Alamos National Security, LLC
 * for the U.S. Department of Energy. The U.S. Government has rights to use,
 * reproduce, and distribute this software.  NEITHER THE GOVERNMENT NOR LOS
 * ALAMOS NATIONAL SECURITY, LLC MAKES ANY WARRANTY, EXPRESS OR IMPLIED, OR
 * ASSUMES ANY LIABILITY FOR THE USE OF THIS SOFTWARE.  If software is modified
 * to produce derivative works, such modified software should be clearly marked,
 * so as not to confuse it with the version available from LANL.   
 *
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
 * use this file except in compliance with the License. You may obtain a copy
 * of the License at 
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software distributed
 * under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
 * CONDITIONS OF ANY KIND, either express or implied. See the License for the
 * specific language governing permissions and limitations under the License.
 *
 * Under this license, it is required to include a reference to this work. We
 * request that each derivative work contain a reference to LANL Copyright 
 * Disclosure C14043/LA-CC-14-003 so that this work's impact can be roughly
 * measured. In addition, it is requested that a modifier is included as in
 * the following example:
 *
 * //<Uses | improves on | modified from> LANL Copyright Disclosure C14043/LA-CC-14-003
 *
 * This is LANL Copyright Disclosure C14043/LA-CC-14-003
 */

#undef UNDECLARED
#ifdef UNDECLARED
/**
 * @file   perfectHash.hm
 * @author Peter Ahrens
 * @date   Thu Jun 6 2013 
 */
#endif
#include "baseHash.hm"

#define PERFECT_HASH_DECLARE(NAME, MODIFIER, KEY_TYPE, VALUE_TYPE)\
  \
  BASE_HASH_DECLARE(NAME, MODIFIER##Perfect, KEY_TYPE, VALUE_TYPE)\
\

#define IDENTITY_PERFECT_HASH_DECLARE(NAME, KEY_TYPE, VALUE_TYPE)\
  \
  PERFECT_HASH_DECLARE(NAME, Identity, KEY_TYPE, VALUE_TYPE)\
\

#define PERFECT_CL_HASH_DECLARE(NAME, MODIFIER, KEY_TYPE, VALUE_TYPE)\
  \
  CL_HASH_DECLARE(NAME, MODIFIER##Perfect, KEY_TYPE, VALUE_TYPE)\
\

#define IDENTITY_PERFECT_CL_HASH_DECLARE(NAME, KEY_TYPE, VALUE_TYPE)\
  \
  PERFECT_CL_HASH_DECLARE(NAME, Identity, KEY_TYPE, VALUE_TYPE)\
\

#define PERFECT_OPENMP_HASH_DECLARE(NAME, MODIFIER, KEY_TYPE, VALUE_TYPE)\
  \
  OPENMP_HASH_DECLARE(NAME, MODIFIER##Perfect, KEY_TYPE, VALUE_TYPE)\
\

#define IDENTITY_PERFECT_OPENMP_HASH_DECLARE(NAME, KEY_TYPE, VALUE_TYPE)\
  \
  PERFECT_OPENMP_HASH_DECLARE(NAME, Identity, KEY_TYPE, VALUE_TYPE)\
\

#define SENTINEL_PERFECT_HASH_DECLARE(NAME, MODIFIER, KEY_TYPE, VALUE_TYPE)\
  \
  BASE_HASH_DECLARE(NAME, MODIFIER##SentinelPerfect, KEY_TYPE, VALUE_TYPE)\
\

#define IDENTITY_SENTINEL_PERFECT_HASH_DECLARE(NAME, KEY_TYPE, VALUE_TYPE)\
  \
  SENTINEL_PERFECT_HASH_DECLARE(NAME, Identity, KEY_TYPE, VALUE_TYPE)\
\

#define SENTINEL_PERFECT_CL_HASH_DECLARE(NAME, MODIFIER, KEY_TYPE, VALUE_TYPE)\
  \
  CL_HASH_DECLARE(NAME, MODIFIER##SentinelPerfect, KEY_TYPE, VALUE_TYPE)\
\

#define IDENTITY_SENTINEL_PERFECT_CL_HASH_DECLARE(NAME, KEY_TYPE, VALUE_TYPE)\
  \
  SENTINEL_PERFECT_CL_HASH_DECLARE(NAME, Identity, KEY_TYPE, VALUE_TYPE)\
\

#define SENTINEL_PERFECT_OPENMP_HASH_DECLARE(NAME, MODIFIER, KEY_TYPE, VALUE_TYPE)\
  \
  OPENMP_HASH_DECLARE(NAME, MODIFIER##SentinelPerfect, KEY_TYPE, VALUE_TYPE)\
\

#define IDENTITY_SENTINEL_PERFECT_OPENMP_HASH_DECLARE(NAME, KEY_TYPE, VALUE_TYPE)\
  \
  SENTINEL_PERFECT_OPENMP_HASH_DECLARE(NAME, Identity, KEY_TYPE, VALUE_TYPE)\
\