Appending to Dispatch tables
- To: mathgroup at smc.vnet.net
- Subject: [mg119393] Appending to Dispatch tables
- From: Szabolcs Horvát <szhorvat at gmail.com>
- Date: Wed, 1 Jun 2011 06:57:14 -0400 (EDT)
Is there an efficient way to add more rules to a Dispatch table? I
see that it contains a HashTable object, but the format of HashTable is
Adding new DownValues for a symbol is much more efficient than
extracting the rule-list from a Dispatch, adding to it, and re-building
the Dispatch table, however Dispatch is more convenient for certain
applications than a symbol with DownValues (save for the limitation of
adding new values).
Is there any inherent reason why it's not possible to efficiently add to
a Dispatch, possibly by modifying the HashTable object contained within?
One reason I could imagine is that this type of modification would
involve appending to lists (both the rule list and the HashTable within
Dispatch), and appending is quadratically slow (because of the need to
re-allocate the list).
Do Dispatch and symbols w DownValues use the same code in the background?
Any pointers on the topic are most welcome!
Prev by Date:
Re: FixedPoint[Cos, 1.0]
Next by Date:
Previous by thread:
Re: NDSolve issues with initial and boundary conditions (corrected characters)
Next by thread:
Re: what is the command to output superfunction?