#include "mdd.h"
Go to the source code of this file.
Functions | |
mdd_t * | mdd_func1c (mdd_manager *mgr, int mvar1, int constant, boolean(*func2)(int, int)) |
mdd_t* mdd_func1c | ( | mdd_manager * | mgr, | |
int | mvar1, | |||
int | constant, | |||
boolean(*)(int, int) | func2 | |||
) |
Definition at line 19 of file mdd_func1c.c.
00024 { 00025 mvar_type x; 00026 array_t *child_list_x; 00027 int i; 00028 mdd_t *tx; 00029 array_t *mvar_list = mdd_ret_mvar_list(mgr); 00030 mdd_t *zero, *one; 00031 00032 zero = mdd_zero(mgr); 00033 one = mdd_one(mgr); 00034 x = array_fetch(mvar_type, mvar_list, mvar1); 00035 if (x.status == MDD_BUNDLED) 00036 printf("\nWarning: mdd_func1c, bundled variable %s is used\n", x.name); 00037 00038 child_list_x = array_alloc(mdd_t *, x.values); 00039 for (i=0; i<x.values; i++) { 00040 if (func2(i,constant)) 00041 array_insert_last(mdd_t *, child_list_x, one); 00042 else 00043 array_insert_last(mdd_t *, child_list_x, zero); 00044 } 00045 tx = mdd_case(mgr, mvar1, child_list_x); 00046 array_free(child_list_x); 00047 00048 mdd_free(one); 00049 mdd_free(zero); 00050 00051 return tx; 00052 }