Wolfram ResearchPRODUCTSPURCHASEFOR USERSCOMPANYOUR SITES
THIS IS DOCUMENTATION FOR AN OBSOLETE PRODUCT.
SEE THE DOCUMENTATION CENTER FOR THE LATEST INFORMATION.

Dispatch

Usage
Notes
Further Examples

Evaluate all of the following cells to generate timings for your computer.

Here is a list of  rules.

In[1]:=  

Here are the first  rules of ordinaryrules.

In[2]:=  

Out[2]=

This sets up a dispatch table that makes these rules faster to use.

In[3]:=  

You can apply either ordinaryrules or dispatchrules using the slash-dot operator /. (ReplaceAll).

In[4]:=  

Out[4]=

The dispatch rules go through all the rules significantly faster.

In[5]:=  

In[6]:=  

This makes the table of rules four times as long and again sets up the corresponding dispatch table.

In[7]:=  

The time using dispatchrules is not very different, while the time to do replacements with ordinaryrules increases significantly.

In[8]:=  

In[9]:=  

In[10]:=  

See also the Further Examples for Complement.


Any questions about topics on this page? Click here to get an individual response.Buy NowFree TrialMore Information



 © 2009 Wolfram Research, Inc.  Terms of Use  Privacy Policy |
Sign up for our newsletter: