Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2006
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2006

[Date Index] [Thread Index] [Author Index]

Search the Archive

efficient term collection algorithm

  • To: mathgroup at smc.vnet.net
  • Subject: [mg69155] efficient term collection algorithm
  • From: Blake Laing <laing at nhn.ou.edu>
  • Date: Thu, 31 Aug 2006 04:39:14 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

Dear Math Group

I wish to combine terms in a expression which share a denominator, such 
as in the following simple case:

In[1]:=
a/i+b/j+c/i//.Plus[Times[A_.,Power[denom_,-1]],Times[B_.,Power[denom_,-1]]]:>
      Factor[Plus[A,B]Power[denom,-1]]//InputForm
Out[1]//InputForm=
(a + c)/i + b/j

The actual expression I am working with contains thousands of terms, and 
a pairwise algorithm such as this is wholly inadequate. Will one of you 
please suggest a more efficient way to combine each additive term in a 
large expression with a shared denominator?

Thanks,

Blake Laing
physics grad student
University of Oklahoma
 


  • Prev by Date: Re: General--Difficulties in Understanding Mathematica Syntax
  • Next by Date: Re: transforming a rule of lists to a list of rules
  • Previous by thread: RE: transforming a rule of lists to a list of rules
  • Next by thread: Unexpected "Invalid comparison" error when plotting function defined with a Condition pattern