78 static char rcsid[]
DD_UNUSED =
"$Id: cuddHarwell.c,v 1.9 2004/08/13 18:04:49 fabio Exp $";
144 DdNode *cubex, *cubey, *minterm1;
145 int u, v, err, i, j, nv;
147 DdNode **lx = NULL, **ly = NULL, **lxn = NULL, **lyn = NULL;
149 char title[73],
key[9], mxtype[4], rhstyp[4];
150 int totcrd, ptrcrd, indcrd, valcrd, rhscrd,
151 nrow, ncol, nnzero, neltvl,
153 int *colptr, *rowind;
156 int *rhsptr, *rhsind;
159 if (*nx < 0 || *ny < 0)
return(0);
165 err = fscanf(fp,
"%72c %8c", title, key);
168 }
else if (err != 2) {
171 title[72] = (char) 0;
174 err = fscanf(fp,
"%d %d %d %d %d", &totcrd, &ptrcrd, &indcrd,
178 }
else if (err != 5) {
182 err = fscanf(fp,
"%3s %d %d %d %d", mxtype, &nrow, &ncol,
186 }
else if (err != 5) {
192 err = fscanf(fp,
"%*s %*s %*s \n");
194 err = fscanf(fp,
"%*s %*s %*s %*s \n");
198 }
else if (err != 0) {
204 (void) fprintf(dd->
out,
"%s: type %s, %d rows, %d columns, %d entries\n", key,
205 mxtype, nrow, ncol, nnzero);
206 if (pr>1) (void) fprintf(dd->
out,
"%s\n", title);
210 if (mxtype[0] !=
'R' || mxtype[1] !=
'U' || mxtype[2] !=
'A') {
211 (void) fprintf(dd->
err,
"%s: Illegal matrix type: %s\n",
215 if (neltvl != 0)
return(0);
219 err = fscanf(fp,
"%3c %d %d", rhstyp, &nrhs, &nrhsix);
222 }
else if (err != 3) {
225 rhstyp[3] = (char) 0;
226 if (rhstyp[0] !=
'F') {
227 (void) fprintf(dd->
err,
228 "%s: Sparse right-hand side not yet supported\n", key);
231 if (pr>0) (void) fprintf(dd->
out,
"%d right-hand side(s)\n", nrhs);
240 for (i=0; u > 0; i++) {
247 v = 2* (
ddMax(ncol, nrhs) - 1);
249 for (i=0; v > 0; i++) {
270 }
else if (lnx > *nx) {
300 }
else if (lny > *ny) {
317 for (i= *nx,nv=bx+(*nx)*sx; i < lnx; i++,nv+=sx) {
322 if (lx[i] == NULL)
return(0);
328 if (lxn[i] == NULL)
return(0);
331 for (i= *ny,nv=by+(*ny)*sy; i < lny; i++,nv+=sy) {
336 if (ly[i] == NULL)
return(0);
342 if (lyn[i] == NULL)
return(0);
353 *n = (1 << (lny - 1)) + nrhs;
358 if (colptr == NULL) {
363 if (rowind == NULL) {
368 for (i=0; i<ncol+1; i++) {
369 err = fscanf(fp,
" %d ", &u);
374 }
else if (err != 1) {
381 if (colptr[0] != 0) {
382 (void) fprintf(dd->
err,
"%s: Unexpected colptr[0] (%d)\n",
388 for (i=0; i<nnzero; i++) {
389 err = fscanf(fp,
" %d ", &u);
394 }
else if (err != 1) {
404 for (j=0; j<ncol; j++) {
407 for (nv = lny - 1; nv>=0; nv--) {
424 for (i=colptr[j]; i<colptr[j+1]; i++) {
426 err = fscanf(fp,
" %lf ", &val);
427 if (err == EOF || err != 1){
443 for (nv = lnx - 1; nv>=0; nv--) {
462 if (minterm1 == NULL) {
489 for (j=0; j<nrhs; j++) {
490 v = j + (1<< (lny-1));
492 for (nv = lny - 1; nv>=0; nv--) {
507 for (i=0; i<nrow; i++) {
509 err = fscanf(fp,
" %lf ", &val);
510 if (err == EOF || err != 1){
515 if (val == (
double) 0.0)
continue;
523 for (nv = lnx - 1; nv>=0; nv--) {
540 if (minterm1 == NULL) {
static ABC_NAMESPACE_IMPL_START char rcsid[] DD_UNUSED
void Cudd_RecursiveDeref(DdManager *table, DdNode *n)
DdNode * cuddUniqueConst(DdManager *unique, CUDD_VALUE_TYPE value)
#define ABC_REALLOC(type, obj, num)
#define ABC_ALLOC(type, num)
DdNode * Cudd_addApply(DdManager *dd, DdNode *(*)(DdManager *, DdNode **, DdNode **), DdNode *f, DdNode *g)
int Cudd_addHarwell(FILE *fp, DdManager *dd, DdNode **E, DdNode ***x, DdNode ***y, DdNode ***xn, DdNode ***yn_, int *nx, int *ny, int *m, int *n, int bx, int sx, int by, int sy, int pr)
DdNode * Cudd_addPlus(DdManager *dd, DdNode **f, DdNode **g)
#define ABC_NAMESPACE_IMPL_END
#define ABC_NAMESPACE_IMPL_START
DdNode * Cudd_addTimes(DdManager *dd, DdNode **f, DdNode **g)
DdNode * cuddUniqueInter(DdManager *unique, int index, DdNode *T, DdNode *E)