00001 /* Copyright (C) 1997-2004 The CDG Team <cdg@nats.informatik.uni-hamburg.de> 00002 * 00003 * This file is free software; as a special exception the author gives 00004 * unlimited permission to copy and/or distribute it, with or without 00005 * modifications, as long as this notice is preserved. 00006 * 00007 * This program is distributed in the hope that it will be useful, but 00008 * WITHOUT ANY WARRANTY, to the extent permitted by law; without even the 00009 * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 00010 * 00011 * $Id: scache.h,v 1.17 2004/02/25 14:28:03 micha Exp $ 00012 */ 00013 00014 /* --------------------------------------------------------------------------- 00015 * @addtogroup Scache 00016 * @{ 00017 */ 00018 00019 #ifndef SCACHE_H 00020 #define SCACHE_H 00021 00022 /* ---------------------------------------------------------------------- */ 00023 #include "cdg.h" 00024 #include "levelvalue.h" 00025 00026 /* -- TYPEDEFINITIONS ---------------------------------------------------- */ 00027 00028 #ifndef SWIG 00029 00030 /* --------------------------------------------------------------------------- 00031 * This structure administers a score for each pair of LVs in a 00032 * constraint net. 00033 */ 00034 typedef struct { 00035 int hits; /**< holds the number of successful requests 00036 to the cache. */ 00037 int count; /**< holds the total number of LVs registered 00038 in the cache */ 00039 int size; /**< maximum used capacity */ 00040 int capacity; /**< currently available capacity */ 00041 Number *data; /**< points to the underlying vector of 00042 Numbers */ 00043 } ScoreCacheStruct; 00044 /** Pointer to ScoreCacheStruct */ 00045 typedef ScoreCacheStruct *ScoreCache; 00046 #endif 00047 00048 /* -- VARIABLES --------------------------------------------------------- */ 00049 00050 extern Boolean scUseCache; 00051 00052 /* -- FUNCTIONS --------------------------------------------------------- */ 00053 00054 #ifndef SWIG 00055 extern ScoreCache scNew(int size); 00056 extern void scDelete(ScoreCache cache); 00057 extern Number scGetScore(ScoreCache cache, LevelValue a, LevelValue b); 00058 extern void scSetScore(ScoreCache cache, LevelValue a, LevelValue b, 00059 Number score); 00060 extern void scInitialize(); 00061 #endif 00062 00063 /* ---------------------------------------------------------------------- */ 00064 #endif /* don't insert anything after this #endif */ 00065 /**@} */