From: Chris S. <san...@us...> - 2005-11-10 08:57:24
|
Update of /cvsroot/stack/stack-1-0/scripts/maxima In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28377/scripts/maxima Modified Files: stackmaxima.mac Log Message: Index: stackmaxima.mac =================================================================== RCS file: /cvsroot/stack/stack-1-0/scripts/maxima/stackmaxima.mac,v retrieving revision 1.45 retrieving revision 1.46 diff -C2 -d -r1.45 -r1.46 *** stackmaxima.mac 9 Nov 2005 13:53:08 -0000 1.45 --- stackmaxima.mac 10 Nov 2005 08:57:16 -0000 1.46 *************** *** 506,527 **** )$ - Stack_Matrix_Test(SA,SB) := - block([KEEPFLOAT,TRIGEXPAND,SAr,SAc,SBr,SBc,ZM], - SAr : length(SA), - SAc : length(SA[1]), - SBr : length(SB), - SBc : length(SB[1]), - TRIGEXPAND:TRUE, /* See pg 80 */ - LOGEXPAND:SUPER, - KEEPFLOAT:TRUE, /* See pg 23 */ - if matrixp(SA)#TRUE then return(FALSE), - if matrixp(SB)#TRUE then return(FALSE), - if (SAr#SBr) THEN return(FALSE), - if (SAc#SBc) THEN return(FALSE), - ev(ZM:MATRIXMAP(trigreduce,(SA-SB)),simp,nouns,fullratsimp), - if (ZM = ZEROMATRIX(SBr,SBc)) then return(TRUE), - return(FALSE) - )$ - /* An answer test based on two lists for SA and SB */ ATList(SA,SB):= --- 506,509 ---- *************** *** 548,555 **** ) ), ! print(AddFeedBack), ! if AddFeedBack=true then ret[3]:concat("(","ATList_wrongentries",ret[3],")"), ! ret[4]:concat(StackAddFeedback("","ATList_wrongentries",StackDISP(SA,"\$\$")),ret[4]), return(ret) )$ --- 530,537 ---- ) ), ! if AddFeedBack=true then block( ret[3]:concat("(","ATList_wrongentries",ret[3],")"), ! ret[4]:concat(StackAddFeedback("","ATList_wrongentries",StackDISP(SA,"\$\$")),ret[4]) ! ), return(ret) )$ *************** *** 581,585 **** /* An answer test based on two matrices for SA and SB */ ATMatrix(SA,SB):= ! block([RawMark,FeedBack,AnswerNote,str,SAr,SAc,SBr,SBc,ZM], RawMark:1, FeedBack:"", AnswerNote:"", /* Get sizes of matrices */ --- 563,567 ---- /* An answer test based on two matrices for SA and SB */ ATMatrix(SA,SB):= ! block([RawMark,FeedBack,AnswerNote,str,SAr,SAc,SBr,SBc,k,AddFeedBack], RawMark:1, FeedBack:"", AnswerNote:"", /* Get sizes of matrices */ *************** *** 595,606 **** FeedBack:"", /* Check they are equal */ ! ZM:ev(matrixmap(trigreduce,(SA-SB)),simp,fullratsimp), ! if (ZM = zeromatrix(SBr,SBc)) then ! return([true,1,AnswerNote,FeedBack]), ! /* Can we give feedback on which are wrong */ ! /* StackDISP(expr,st) */ ! ev(for SAr:1 thru SBr do for SAc:1 thru SBc do if ZM[SAr,SAc]#0 then SA[SAr,SAc]:texcolor("red",SA[SAr,SAc]),simp), ! FeedBack:StackAddFeedback("","ATMatrix_wrongentries",StackDISP(SA,"$$")), ! return([true,0,"ATMatrix_wrongentries",FeedBack]) )$ --- 577,598 ---- FeedBack:"", /* Check they are equal */ ! ret:[true,1,"",""], ! AddFeedBack:false, ! for k:1 thru SAr do block( ! retnew:ATAlgEquivfun(SA[k],SB[k]), ! ret[1]:ret[1] and retnew[1], ! ret[2]:ret[2]*retnew[2], ! ret[3]:concat(ret[3]," ",retnew[3]), ! if retnew[2]=0 then block( ! ret[4]:concat(ret[4],retnew[4]), ! SA[k]:texcolor("red",SA[k]), ! AddFeedBack:true ! ) ! ), ! if AddFeedBack=true then block( ! ret[3]:concat("(","ATMatrix_wrongentries",ret[3],")"), ! ret[4]:concat(StackAddFeedback("","ATMatrix_wrongentries",StackDISP(SA,"\$\$")),ret[4]) ! ), ! return(ret) )$ |