=================================================================== RCS file: /home/cvs/OpenXM_contrib2/asir2018/parse/puref.c,v retrieving revision 1.2 retrieving revision 1.4 diff -u -p -r1.2 -r1.4 --- OpenXM_contrib2/asir2018/parse/puref.c 2018/09/28 08:20:29 1.2 +++ OpenXM_contrib2/asir2018/parse/puref.c 2020/10/06 06:31:20 1.4 @@ -45,7 +45,7 @@ * DEVELOPER SHALL HAVE NO LIABILITY IN CONNECTION WITH THE USE, * PERFORMANCE OR NON-PERFORMANCE OF THE SOFTWARE. * - * $OpenXM: OpenXM_contrib2/asir2018/parse/puref.c,v 1.1 2018/09/19 05:45:08 noro Exp $ + * $OpenXM: OpenXM_contrib2/asir2018/parse/puref.c,v 1.3 2019/11/12 10:53:23 kondoh Exp $ */ #include "ca.h" #include "parse.h" @@ -89,8 +89,13 @@ void searchc(char *name,FUNC *fp) *fp = 0; } +#if defined(INTERVAL) void mkpf(char *name,Obj body,int argc,V *args, + int (*parif)(),double (*libmf)(), int (*simp)(), void (**intervalfunc)(), PF *pfp) +#else +void mkpf(char *name,Obj body,int argc,V *args, int (*parif)(),double (*libmf)(), int (*simp)(),PF *pfp) +#endif { PF pf; NODE node; @@ -98,6 +103,9 @@ void mkpf(char *name,Obj body,int argc,V *args, NEWPF(pf); pf->name = name; pf->body = body; pf->argc = argc; pf->args = args; pf->pari = parif; pf->simplify = simp; pf->libm = libmf; +#if defined(INTERVAL) + pf->intervalfunc = intervalfunc; +#endif for ( node = pflist; node; node = NEXT(node) ) if ( !strcmp(((PF)BDY(node))->name,name) ) break; @@ -314,8 +322,10 @@ int obj_is_dependent(Obj a,V v) else if ( OID(a) == O_P ) return poly_is_dependent((P)a,v); else if ( OID(a) == O_R ) return poly_is_dependent(NM((R)a),v) || poly_is_dependent(DN((R)a),v); - else + else { error("obj_is_dependent : not implemented"); + return 0; + } } int poly_is_dependent(P p,V v) @@ -724,6 +734,12 @@ void simplify_abs_ins(PFINS ins,Obj *rp) } else if ( !ad[0].d && BIGFLOAT(a) ) { arg0.body = (pointer)a; arg0.next = 0; mp_abs(&arg0,(Num *)rp); +#if defined(INTERVAL) + } else if ( !ad[0].d && ITVD(a) ) { + absintvald((IntervalDouble)a,(IntervalDouble*)rp); + } else if ( !ad[0].d && ITVF(a) ) { + absintvalp((Itv)a,(Itv*)rp); +#endif } else simplify_elemfunc_ins(ins,rp); }