RMeli / irc

Transfrormation between Cartesian coordinates and redundant internal coordinates
MIT License
22 stars 8 forks source link

User-defined bonds, angles and dihedrals might be redundant #22

Closed RMeli closed 6 years ago

RMeli commented 6 years ago

User-defined bond are added to the list of bonds, angles and dihedrals obtained from the connectivity of the molecule and therefore might be redundant.

The same problem will arise with constraints: an added constraint can or can not correspond to a bond, angle or dihedral that is obtained from the connectivity.

RMeli commented 6 years ago

Look at std::unordered_set for storage of bonds, angles and dihedrals.

RMeli commented 6 years ago

Hash function using std::hash.

If two elements have the same hash, then the comparison operator is used.

RMeli commented 6 years ago

Check if std::unordered_set can give problems when constraints are added. The constraint matrix must have the same order of Wilson's B matrix.

RMeli commented 6 years ago

Added comparison functions to bonds, angles and dihedrals.

Added ordering on indices (stored internally). Order the indices is necessary in order to create an hash function using boost::hash_combine.

RMeli commented 6 years ago

The cost of checking if an element is present in a std::vector is acceptable for the time being, therefore this issue is solved with the function add_without_duplicates.