axkr / symja_android_library

:coffee: Symja - computer algebra language & symbolic math library. A collection of popular algorithms implemented in pure Java.
https://matheclipse.org/
GNU General Public License v3.0
380 stars 85 forks source link

Use RRB-Tree from Paguro #334

Closed axkr closed 2 years ago

axkr commented 2 years ago

Use RRB-Tree from Paguro for IAST structure with "number of arguments" greater than 32.

For big Expand or ÈxpandAll expressions the memory management should be improved by this change because of the structure sharing of the RBB-Tree.

See:

...
import org.organicdesign.fp.StaticImports;
import org.organicdesign.fp.collections.RrbTree;
import org.organicdesign.fp.collections.RrbTree.MutRrbt;
...

...
public class ASTRRBTree extends AbstractAST implements IASTAppendable, Externalizable, RandomAccess {

  /** The underlying RRB Tree */
  protected RrbTree<IExpr> rrbTree;
...
axkr commented 2 years ago

The current Paguro implementation will be released in 2.0.0. Especially the Expand function was speed up for big expressions.