Skip to content

Order of terms in Add #2406

Open
Open
@certik

Description

@certik

For performance reasons, I think the only way is to let the order be in any order (implementation and platform specific), so that we have the freedom to change the internal representation (such as change the hash function), and it is also more robust. The order is deterministic (the same code ran twice on the same platform will produce the same result), however the order can depend on the platform, compiler options and also on the order of which terms are being put into the hash table, so in principle x+y and y+x might return a different order, if x and y had the same hash.

However, if a given order is required, then let's provide a function in SymEngine, that takes a list of expressions, and returns a list that is ordered in some way (say lexicographically).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions