00001 /* -*- mode: C++; c-file-style: "stroustrup"; c-basic-offset: 4; indent-tabs-mode: nil; -*- */ 00002 /********************************************************************* 00003 * 00004 * Filename : dbm.h -- private API 00005 * 00006 * This file is a part of the UPPAAL toolkit. 00007 * Copyright (c) 1995 - 2003, Uppsala University and Aalborg University. 00008 * All right reserved. 00009 * 00010 * $Id: dbm.h,v 1.3 2005/11/22 12:18:59 adavid Exp $ 00011 * 00012 **********************************************************************/ 00013 00014 #ifndef DBM_DBM_H 00015 #define DBM_DBM_H 00016 00017 #include "base/inttypes.h" 00018 00019 #ifdef __cplusplus 00020 extern "C" { 00021 #endif 00022 00023 /** Internal function: compute redirection tables 00024 * table and cols (for update of DBM). 00025 * @see dbm_shrinkExpand for table 00026 * cols redirects indices from the source DBM to the 00027 * destination DBM for copy purposes: 00028 * copy row i to destination[i] from source[cols[i]] 00029 * @param bitSrc: source array bits 00030 * @param bitDst: destination array bits 00031 * @param bitSize: size of the arrays 00032 * @param table, cols: tables to compute 00033 * @return dimension of the new DBM 00034 */ 00035 cindex_t dbm_computeTables(const uint32_t *bitSrc, 00036 const uint32_t *bitDst, 00037 size_t bitSize, 00038 cindex_t *table, 00039 cindex_t *cols); 00040 00041 00042 /** Internal function: update a DBM (copy & and insert new rows). 00043 * @param dbmDst, dimDst: destination DBM of dimension dimDst 00044 * @param dbmSrc, dimSrc: source DBM of dimension dimSrc 00045 * @param cols: indirection table to copy the DBM, ie, 00046 * copy row i to destination[i] from source[cols[i]] 00047 * @pre cols computed from ext_computeTables, 1st element 00048 * of dbmDst is written 00049 */ 00050 void dbm_updateDBM(raw_t *dbmDst, const raw_t *dbmSrc, 00051 cindex_t dimDst, cindex_t dimSrc, 00052 const cindex_t *cols); 00053 00054 00055 #ifndef NCLOSELU 00056 00057 /** Specialized close for extrapolation: can skip 00058 * outer loop k if lower[k] == upper[k] == infinity. 00059 */ 00060 void dbm_closeLU(raw_t *dbm, cindex_t dim, const int32_t *lower, const int32_t *upper); 00061 00062 #endif 00063 00064 /* Add bits of constraints, skip the 00065 * case of infinity. Used to compute the 00066 * range of bits needed (32/16 bits). 00067 */ 00068 #define ADD_BITS(BITS, VALUE) \ 00069 if ((VALUE) != dbm_LS_INFINITY) \ 00070 { \ 00071 BITS |= base_absNot(VALUE); \ 00072 } 00073 00074 #ifdef __cplusplus 00075 } 00076 #endif 00077 00078 #endif