[Date Index] [Thread Index] [Author Index]
Re: Extended Expand and ExpandAll.
Of course! I'm just getting familiar with UpValues. This answers my question nicely, along with a few that I've not asked yet. Thanks :) Joe On Tue, Feb 08, 2005 at 07:55:21AM -0500, Bob Hanlon wrote: > f /: Expand[f[a_+b_]] := f[a]+f[b]; > f /: ExpandAll[f[a_+b_]] := f[a]+f[b]; > > f[a+b]//Expand > > f[a] + f[b] > > f[a+b]//ExpandAll > > f[a] + f[b] > > > Bob Hanlon > > > > > From: Josef Karthauser <joe at tao.org.uk> To: mathgroup at smc.vnet.net > > Date: 2005/02/08 Tue AM 05:30:57 EST > > To: mathgroup at smc.vnet.net > > Subject: [mg54061] [mg54022] Extended Expand and ExpandAll. > > > > > > ExpandAll is a very useful function. It doesn't however know how to > > expand arbitary functions. Imagine that I've got an F[a + b] which I > > know is distributive and so, > > > > F[a_ + b_] -> F[a] + F[b]. > > > > Is there any way of letting Expand/ExpandAll know that it can also > > expand F objects? > > > > Joe > > -- > > Josef Karthauser (joe at tao.org.uk) http://www.josef-k.net/ > > FreeBSD (cvs meister, admin and hacker) http://www.uk.FreeBSD.org/ > > Physics Particle Theory (student) http://www.pact.cpes.sussex.ac.uk/ > > ================ An eclectic mix of fact and theory. ================= > > > >