|
SOLUTIONS
|
Search for all pages containing Share
BUILT-IN MATHEMATICA SYMBOL
Share
Share[expr]
changes the way expr is stored internally, to try and minimize the amount of memory used.
Share[]
tries to minimize the memory used to store all expressions.
DetailsDetails
- Share works by sharing the storage of common subexpressions between different parts of an expression, or different expressions.
- Using Share will never affect the results you get from Mathematica. It may, however, reduce the amount of memory used, and in many cases also the amount of time taken.
- Share returns the number of bytes freed as a result of sharing, as determined by MemoryInUse.
ExamplesExamplesopen allclose all
Basic Examples (2)Basic Examples (2)
Try to minimize memory used in all expressions:
| In[1]:= |
| Out[1]= |
Use shared memory for parts of an expression that are the same:
| In[1]:= |
| Out[1]= |
| In[2]:= |
| Out[2]= |
This is effectively the same as creating the expression using shared parts:
| In[3]:= |
| Out[3]= |
For this expression, Share is not able to save any more memory:
| In[4]:= |
| Out[4]= |
New in 1
Mathematica 9 is now available!
New to Mathematica?
Find your learning path »
Have a question?
Ask support »
