Mathematica 9 is now available
Student Support Forum
-----
Student Support Forum: 'speed of ReplaceAll. command in inequalities' topicStudent Support Forum > General > "speed of ReplaceAll. command in inequalities"

< Previous Comment | Next Comment >Help | Reply To Comment | Reply To Topic
Author Comment/Response
yehuda
11/11/12 02:57am

This is not a real question, but maybe a clarification would help

ReplaceAll works on the expression. Expressions in Mathematica can be represented as trees so to scan a tree and replace subparts, DFS is used. This, plus the fact that you do not define types, is more time consuming that using assumptions about variable types in Compile
There is no other way (beside searching, you can define BFS yourself, but this would be much slower)

If you need to do that operation many times on large expressions, Compile is worth the effort of additional programming, otherwise the common sense is just to use ReplaceAll

yehdua


URL: ,

Subject (listing for 'speed of ReplaceAll. command in inequalities')
Author Date Posted
speed of ReplaceAll. command in inequalities PhysicsGuy 11/09/12 11:01pm
Re: speed of ReplaceAll. command in inequalities yehuda 11/11/12 02:57am
Re: Re: speed of ReplaceAll. command in inequa... PhysicsGuy 12/05/12 9:44pm
Re: speed of ReplaceAll. command in inequalities yehuda 12/08/12 2:03pm
Re: speed of ReplaceAll. command in inequalities Michael 12/10/12 2:39pm
Re: Re: speed of ReplaceAll. command in inequa... PhysicsGuy 12/11/12 12:31pm
< Previous Comment | Next Comment >Help | Reply To Comment | Reply To Topic