diff --git a/cmake/FindLibR.cmake b/cmake/FindR.cmake similarity index 100% rename from cmake/FindLibR.cmake rename to cmake/FindR.cmake diff --git a/cmake/cudd.cmake b/cmake/cudd.cmake index ab7f16879..952d3ee98 100644 --- a/cmake/cudd.cmake +++ b/cmake/cudd.cmake @@ -14,14 +14,14 @@ find_package(CUDD) if (CUDD_FOUND) set( CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} ${CUDD_INCLUDE_DIR} ) -check_include_files( "stdio.h;cudd.h" HAVE_CTYPE_HUDD_H ) - -check_include_files( "stdio.h;cuddI.h" HAVE_CUDD_H ) -check_include_files( "cudd.h;cuddInt.h" HAVE_CUDDINT_H ) +check_include_files( "stdio.h;cudd.h" HAVE_CUDD_H ) +check_include_files( "stdio.h;cuddInt.h" HAVE_CUDDINT_H ) check_include_files( "stdio.h;cudd/cudd.h" HAVE_CUDD_CUDD_H ) check_include_files( "stdio.h;cudd/cuddInt.h" HAVE_CUDD_CUDDINT_H ) configure_file (cmake/cudd_config.h.cmake "${CMAKE_CURRENT_BINARY_DIR}/cudd_config.h" ) + configure_file (cmake/cudd_config.h.cmake + "${CMAKE_BINARY_DIR}/packages/cplint/config,config.h" ) endif (CUDD_FOUND) diff --git a/cudd_config.h b/cudd_config.h deleted file mode 100644 index 5b5ede1b2..000000000 --- a/cudd_config.h +++ /dev/null @@ -1,43 +0,0 @@ -// cmake template file - -/* Define to 1 if you have the header file. */ -#ifndef HAVE_CUDD_H -/* #undef HAVE_CUDD_H */ -#endif - -/* Define to 1 if you have the header file. */ -#ifndef HAVE_CUDD_CUDD_H -#define HAVE_CUDD_CUDD_H 1 -#endif - -/* Define to 1 if you have the header file. */ -#ifndef HAVE_CUDDINT_H -/* #undef HAVE_CUDDINT_H */ -#endif - -/* Define to 1 if you have the header file. */ -#ifndef HAVE_CUDD_CUDDINT_H -#define HAVE_CUDD_CUDDINT_H 1 -#endif - - -/* Define to 1 if you have the header file. */ -#ifndef HAVE_CUDDOBJ_HH -/* #undef HAVE_CUDDOBJ_HH */ -#endif - -/* Define to 1 if you have the header file. */ -#ifndef HAVE_CUDD_CUDDOBJ_HH -/* #undef HAVE_CUDD_CUDDOBJ_HH */ -#endif - - -/* Define to 1 if you have the header file. */ -#ifndef HAVE_DDDMPINT_H -/* #undef HAVE_DDDMPINT_H */ -#endif - -/* Define to 1 if you have the header file. */ -#ifndef HAVE_CUDD_CUDDINT_H -/* #undef HAVE_CUDD_DDDMPINT_H */ -#endif diff --git a/packages/cplint/cplint.h b/packages/cplint/cplint.h index 97f3ce4eb..430d80c64 100644 --- a/packages/cplint/cplint.h +++ b/packages/cplint/cplint.h @@ -7,79 +7,67 @@ This package uses the library cudd, see http://vlsi.colorado.edu/~fabio/CUDD/ for the relative license. */ -#include #include "config.h" #include "cudd_config.h" -#if HAVE_CUDD_CUDD_H -#include "cudd/cudd.h" -#include "cudd/mtr.h" -#elif HAVE_CUDD_H -#include "cudd.h" -#include "mtr.h" +#include +#if HAVE_CUDDINT_H +#include "cuddInt.h" +#elif HAVE_CUDD_CUDDINT_H +#include "cudd/cuddInt.h" #endif -#include "YapInterface.h" - -typedef struct -{ - int var,value; -} factor; -typedef struct -{ +#include "YapInterface.h" + +typedef struct { int var, value; } factor; + +typedef struct { int nFact; - factor * factors; + factor *factors; } term; -typedef struct -{ +typedef struct { int nTerms; - term * terms; + term *terms; } expr; -typedef struct -{ - int nVal,nBit; - double * probabilities; - DdNode * * booleanVars; +typedef struct { + int nVal, nBit; + double *probabilities; + DdNode **booleanVars; } variable; -typedef struct -{ +typedef struct { int nVar; int nBVar; - variable * varar; - int * bVar2mVar; + variable *varar; + int *bVar2mVar; } variables; -typedef struct -{ +typedef struct { DdNode *key; double value; } rowel; -typedef struct -{ +typedef struct { int cnt; rowel *row; } tablerow; -variables createVars(YAP_Term t,DdManager * mgr, int create_dot, - char inames[1000][20]); +variables createVars(YAP_Term t, DdManager *mgr, int create_dot, + char inames[1000][20]); expr createExpression(YAP_Term t); void init_my_predicates(void); -DdNode * retFunction(DdManager * mgr, expr expression,variables v); -DdNode * retTerm(DdManager * mgr,term t,variables v); -DdNode * retFactor(DdManager * mgr, factor f, variables v); +DdNode *retFunction(DdManager *mgr, expr expression, variables v); +DdNode *retTerm(DdManager *mgr, term t, variables v); +DdNode *retFactor(DdManager *mgr, factor f, variables v); -double Prob(DdNode *node, variables vars,tablerow * nodes); +double Prob(DdNode *node, variables vars, tablerow *nodes); -double ProbBool(DdNode *node, int bits, int nBit,int posBVar,variable v, - int mVarIndex, - variables vars,tablerow * nodes, int comp); +double ProbBool(DdNode *node, int bits, int nBit, int posBVar, variable v, + int mVarIndex, variables vars, tablerow *nodes, int comp); -tablerow* init_table(int nbvars); -double * get_value(tablerow *tab, DdNode *node); +tablerow *init_table(int nbvars); +double *get_value(tablerow *tab, DdNode *node); void add_node(tablerow *tab, DdNode *node, double value); void destroy_table(tablerow *tab, int nbvars); -