Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

gen.h

Go to the documentation of this file.
00001 /* -*- mode: C++; c-file-style: "stroustrup"; c-basic-offset: 4; indent-tabs-mode: nil; -*- */
00002 /*********************************************************************
00003  *
00004  * Filename : gen.h (dbm)
00005  * C header.
00006  * 
00007  * Generation of DBMs and points.
00008  *
00009  * This file is a part of the UPPAAL toolkit.
00010  * Copyright (c) 1995 - 2003, Uppsala University and Aalborg University.
00011  * All right reserved.
00012  *
00013  * $Id: gen.h,v 1.1 2005/04/22 15:20:10 adavid Exp $
00014  *
00015  **********************************************************************/
00016 
00017 #ifndef INCLUDE_DBM_GEN_H
00018 #define INCLUDE_DBM_GEN_H
00019 
00020 #include "dbm/constraints.h"
00021 
00022 #ifdef __cplusplus
00023 extern "C" {
00024 #endif
00025 
00026 /** Generate a random closed and non empty DBM.
00027  * @param dbm: where to write the DBM.
00028  * @param dim: dimension.
00029  * @param range: approximate range for the values.
00030  * @return TRUE if it is a non trivial one (sometimes
00031  * the generation may fail and fall back to a trivial
00032  * DBM). A trivial DBM is created by dbm_init.
00033  * @pre dbm is a raw_t[dim*dim]
00034  */
00035 BOOL dbm_generate(raw_t *dbm, cindex_t dim, raw_t range);
00036 
00037 
00038 /** Generate a random closed and non empty DBM
00039  * that satisfy a number of constraints.
00040  * @param dbm: where to write the DBM.
00041  * @param dim: dimension.
00042  * @param range: approximate range for the values.
00043  * @param constraints,n: the n constraints the DBM
00044  * has to satisfy.
00045  * @pre constraints[n] do not result in an empty DBM
00046  * dbm is a raw_t[dim*dim], dim > 0
00047  * @post the result is non empty
00048  * @return TRUE if generation succeeded, FALSE if it failed.
00049  */
00050 BOOL dbm_generateConstrained(raw_t *dbm, cindex_t dim, raw_t range,
00051                              const constraint_t *constraints, size_t n);
00052 
00053 
00054 /** Constrain randomly an already constrained DBM.
00055  * @param dbm,dim: DBM of dimension dim to constrain.
00056  * @param range: maximal range for the generated valued.
00057  * @param bitMatrix: bit matrix marking the constraints that
00058  * should be kept.
00059  * @pre dbm is closed and non empty, dim > 0.
00060  * @post dbm is closed and non empty.
00061  */
00062 void dbm_generatePreConstrained(raw_t *dbm, cindex_t dim, raw_t range,
00063                                 const uint32_t *bitMatrix);
00064 
00065 
00066 /** Generate 2nd DBM argument for intersection/substraction
00067  * with a first DBM.
00068  * @param dbm,dim: first DBM of dimension dim to generate
00069  * a second DBM argument from.
00070  * @param arg: where to generate a DBM of dimension dim
00071  * to test for intersection or substraction.
00072  * @pre dbm closed and not empty, arg is a raw_t[dim*dim]
00073  * @post arg is closed and not empty
00074  */
00075 void dbm_generateArgDBM(raw_t *arg, const raw_t *dbm, cindex_t dim);
00076 
00077 
00078 /** Generate a superset DBM.
00079  * @param src: the original DBM.
00080  * @param dst: where to write superset.
00081  * @param dim: dimension.
00082  * @pre
00083  * - src and dst are raw_t[dim*dim]
00084  * - src is non empty and closed
00085  * @post
00086  * - dst is non empty and closed
00087  * - dst >= src
00088  */
00089 void dbm_generateSuperset(raw_t *dst, const raw_t *src, cindex_t dim);
00090 
00091 
00092 /** Generate a subset DBM.
00093  * @param src: the original DBM.
00094  * @param dst: where to write subset.
00095  * @param dim: dimension.
00096  * @pre
00097  * - src and dst are raw_t[dim*dim]
00098  * - src is non empty and closed
00099  * @post
00100  * - dst is non empty and closed
00101  * - dst >= src
00102  * @return TRUE if the subset is strict
00103  */
00104 BOOL dbm_generateSubset(raw_t *dst, const raw_t *src, cindex_t dim);
00105 
00106 
00107 /** Generate a random discrete point that belongs to the zone.
00108  * @param pt: memory where to write the point (x0,x1,x2..)
00109  * @param dbm: DBM.
00110  * @param dim: dimension.
00111  * @pre
00112  * - dbm is a raw_t[dim*dim] and ptr is a int32_t[dim]
00113  * - dbm is closed and non empty, dim > 0
00114  * @return TRUE if generated point is included in the DBM.
00115  */
00116 BOOL dbm_generatePoint(int32_t *pt, const raw_t *dbm, cindex_t dim);
00117 
00118 
00119 /** Generate a random real point that belongs to the zone.
00120  * Always succeeds if zone is not empty (pre-condition).
00121  * @param pt: memory where to write the point (x0,x1,x2..)
00122  * @param dbm: DBM.
00123  * @param dim: dimension.
00124  * @pre
00125  * - dbm is a raw_t[dim*dim] and ptr is a int32_t[dim]
00126  * - dbm is closed and non empty, dim > 0
00127  * @return TRUE if generation succeeded
00128  * @post pt is valid only if the generation succeeded
00129  */
00130 BOOL dbm_generateRealPoint(double *pt, const raw_t *dbm, cindex_t dim);
00131 
00132 
00133 #ifdef __cplusplus
00134 }
00135 #endif
00136 
00137 #endif /* INCLUDE_DBM_GEN_H */

Generated on Fri Jun 30 00:02:45 2006 for Module dbm by  doxygen 1.4.2