Re: Redefine Power
- To: mathgroup at smc.vnet.net
- Subject: [mg65856] Re: Redefine Power
- From: "Jens-Peer Kuska" <kuska at informatik.uni-leipzig.de>
- Date: Wed, 19 Apr 2006 04:54:04 -0400 (EDT)
- Organization: Uni Leipzig
- References: <e1vf2m$9e8$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Hi, Power[] has the attribute Listable and this comes before any rule like yours apply. So to do that, you must remove the Listable attribute from Power[]. Regards Jens "suchaneck" <greenux at gmx.de> schrieb im Newsbeitrag news:e1vf2m$9e8$1 at smc.vnet.net... | hi, | i want to redefine the Power function for matrices like that: | Power[A_?MatrixQ,n_]:=mppower[A,n]; | If n is a number, then it should execute the function mppower[], elseif | Head[n]=symbol, it should return the matrix with exp n as symbol | without execution. How can I prevent the recursion of the Power-Function? | Thanks. |