SolveTools - Maple Programming Help

# Online Help

###### All Products    Maple    MapleSim

Home : Support : Online Help : Mathematics : Factorization and Solving Equations : SolveTools : SolveTools/SortByComplexity

SolveTools

 SortByComplexity
 sort expressions by their complexity

 Calling Sequence SortByComplexity(exprs)

Parameters

 exprs - list or set of expressions

Description

 • The SortByComplexity command sorts the list (or set) of expressions $\mathrm{exprs}$ in descending order of their complexity. The result is returned as a sorted list of expressions.
 The complexity of the expressions are compared by using SolveTools[GreaterComplexity].
 • This function is part of the SolveTools package, and so it can be used in the form SortByComplexity(..) only after executing the command with(SolveTools). However, it can always be accessed through the long form of the command by using SolveTools[SortByComplexity](..).

Examples

 > $\mathrm{with}\left(\mathrm{SolveTools}\right):$
 > $\mathrm{SortByComplexity}\left(\left\{x,y,\frac{x\cdot 3}{y},{ⅇ}^{x}\right\}\right)$
 $\left[{{ⅇ}}^{{x}}{,}\frac{{3}{}{x}}{{y}}{,}{x}{,}{y}\right]$ (1)
 > $\mathrm{SortByComplexity}\left(\left[ab\mathrm{RootOf}\left({x}^{2}+1\right),\mathrm{sin}\left(\mathrm{log}\left({ⅇ}^{x}\right)\right),{x}^{3}+{x}^{2}+5x-1\right]\right)$
 $\left[{\mathrm{sin}}{}\left({\mathrm{ln}}{}\left({{ⅇ}}^{{x}}\right)\right){,}{a}{}{b}{}{\mathrm{RootOf}}{}\left({{\mathrm{_Z}}}^{{2}}{+}{1}\right){,}{{x}}^{{3}}{+}{{x}}^{{2}}{+}{5}{}{x}{-}{1}\right]$ (2)

 See Also

## Was this information helpful?

 Please add your Comment (Optional) E-mail Address (Optional) What is ? This question helps us to combat spam