=================================================================== RCS file: /home/cvs/OpenXM_contrib2/asir2018/builtin/print.c,v retrieving revision 1.4 retrieving revision 1.6 diff -u -p -r1.4 -r1.6 --- OpenXM_contrib2/asir2018/builtin/print.c 2020/10/06 06:31:19 1.4 +++ OpenXM_contrib2/asir2018/builtin/print.c 2021/03/11 11:47:25 1.6 @@ -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/builtin/print.c,v 1.3 2020/02/22 06:23:35 noro Exp $ + * $OpenXM: OpenXM_contrib2/asir2018/builtin/print.c,v 1.5 2021/03/11 03:41:13 noro Exp $ */ #include "ca.h" #include "parse.h" @@ -164,7 +164,7 @@ void Peval_variables_in_quote(NODE arg,QUOTE *rp) void fnodetotree(FNODE f,VS vs,LIST *rp) { LIST a1,a2,a3; - NODE n,t,t0; + NODE n,t,t0,t1; STRING head,op,str; char *opname; @@ -329,6 +329,16 @@ void fnodetotree(FNODE f,VS vs,LIST *rp) MKLIST(*rp,n); break; + /* partial derivative of function */ + case I_PFDERIV: + MKSTR(head,"derivative"); + MKSTR(op,((FUNC)FA0(f))->fullname); + fnodetotree((FNODE)FA1(f),vs,&a1); + fnodetotree((FNODE)FA2(f),vs,&a2); + n = mknode(4,head,op,a1,a2); + MKLIST(*rp,n); + break; + case I_STR: MKSTR(head,"internal"); MKSTR(str,FA0(f)); @@ -481,6 +491,11 @@ FNODE subst_in_fnode(FNODE f,V v,FNODE g) case I_FUNC: a1 = subst_in_fnode((FNODE)FA1(f),v,g); return mkfnode(2,f->id,FA0(f),a1); + break; + /* derivative */ + case I_PFDERIV: + a1 = subst_in_fnode((FNODE)FA1(f),v,g); + return mkfnode(3,f->id,FA0(f),a1,FA2(f)); break; case I_CAR: case I_CDR: a1 = subst_in_fnode((FNODE)FA0(f),v,g);