version 1.6, 2019/01/01 07:17:52 |
version 1.7, 2019/01/01 11:06:10 |
|
|
/* phc6.c , yama:1999/sm1-prog/phc6.c */ |
/* phc6.c , yama:1999/sm1-prog/phc6.c */ |
/* $OpenXM: OpenXM/src/phc/phc6.c,v 1.5 2002/05/02 11:54:33 takayama Exp $ */ |
/* $OpenXM: OpenXM/src/phc/phc6.c,v 1.6 2019/01/01 07:17:52 takayama Exp $ */ |
/* This is a simple C interface to the black-box solver of phc. |
/* This is a simple C interface to the black-box solver of phc. |
** Requirements: |
** Requirements: |
** 1) executable version of phc will be searched in the following order: |
** 1) executable version of phc will be searched in the following order: |
Line 280 struct phc_object phc_scan_solutions(FILE *fp, int npa |
|
Line 280 struct phc_object phc_scan_solutions(FILE *fp, int npa |
|
if (fnd==1) |
if (fnd==1) |
{ |
{ |
fgets(buf,BUFSIZE-1,fp); |
fgets(buf,BUFSIZE-1,fp); |
sscanf(buf,"%le",&res); |
sscanf(buf,"%lg",&res); |
if (phc_verbose) { |
if (phc_verbose) { |
fprintf(stderr,"res in string: %s\n",buf); |
fprintf(stderr,"res in string: %s\n",buf); |
fprintf(stderr," residual = "); fprintf(stderr,"%le\n",res); |
fprintf(stderr," residual = "); fprintf(stderr,"%le\n",res); |
Line 302 struct phc_object phc_scan_solutions(FILE *fp, int npa |
|
Line 302 struct phc_object phc_scan_solutions(FILE *fp, int npa |
|
{ |
{ |
fnd = phc_scan_for_string(fp,":"); |
fnd = phc_scan_for_string(fp,":"); |
fgets(buf,BUFSIZE-1,fp); |
fgets(buf,BUFSIZE-1,fp); |
sscanf(buf,"%le %le",&realpart,&imagpart); |
sscanf(buf,"%lf %lf",&realpart,&imagpart); |
if (phc_verbose) fprintf(stderr,"sols in string: %s\n",buf); |
if (phc_verbose) fprintf(stderr,"sols in string: %s\n",buf); |
/*fscanf(fp,"%le",&realpart); |
/*fscanf(fp,"%le",&realpart); |
fscanf(fp,"%le",&imagpart);*/ |
fscanf(fp,"%le",&imagpart);*/ |
Line 455 void phc_printObject(FILE *fp,struct phc_object ob) |
|
Line 455 void phc_printObject(FILE *fp,struct phc_object ob) |
|
}else if (ob.tag == SlongdoubleComplex) { |
}else if (ob.tag == SlongdoubleComplex) { |
/* Try your favorite way to print complex numbers. */ |
/* Try your favorite way to print complex numbers. */ |
/*fprintf(fp,"(%20.14le)+I*(%20.14le)",ob.lc.longdouble,ob.rc.longdouble);*/ |
/*fprintf(fp,"(%20.14le)+I*(%20.14le)",ob.lc.longdouble,ob.rc.longdouble);*/ |
fprintf(fp,"[%lf , %lf]",ob.lc.longdouble,ob.rc.longdouble); |
fprintf(fp,"[%.16lg , %.16lg]",ob.lc.longdouble,ob.rc.longdouble); |
}else{ |
}else{ |
fprintf(stderr,"Unknown phc_object tag %d",ob.tag); |
fprintf(stderr,"Unknown phc_object tag %d",ob.tag); |
} |
} |