This reverts commit 040bdb61c7.
During testing of using this as a replacement for portions of
getTheFrags in getMolFrags, several issues came up regarding
how copies should actually work in practice. These are being
corrected in a new pr: https://github.com/rdkit/rdkit/pull/8811
Co-authored-by: Brian Kelley <bkelley@glysade.com>
* Create a function to extract some specified atoms from a ROMol as a new ROMol by creating new graph (#8742)
This adds a new api, `RDKit::MolOps::ExtractMolFragment`, to allow efficient
extractions of mol fragments from large mols. Compared to the approach where
we delete "unwanted" atoms/bonds from the input mol, this api is faster for
small mols (about 2x faster) and at least 3x faster for big mols
(was 10x faster for "CCC"*1000).
* clang-format
* review comments
* cleanup
* review comments
* fix build failure
---------
Co-authored-by: Your Name <you@example.com>
* [WIP-ENH]: Support greater use of `findAtomEnvironmentOfRadiusN()`
This PR is the feature support for PR 4262. I am not so confident when coding the C++ as it is my first time hands-on experience
There are still many thing that should be done but I still need several support
* Update MolOps.cpp
* Fix build error
Fix according to this? https://www.boost.org/doc/libs/1_42_0/libs/python/doc/v2/object.html#object-spec-ctors
* Fix build error
* Fix test2.cpp
* Fix `include` issue
* Fixed as requested
* Update Subgraphs.cpp
* Update Subgraphs.cpp
* Update Subgraphs.cpp
* Fix reported error, correct doc
* Update MolOps.cpp
* Update test and fix error
* Fix default argument
* Fix duplication
* Update Subgraphs.cpp
* Fix test bug
* Updated a test and fix reported error
* Update Subgraphs.cpp
* Fix reported error
* Update test2.cpp
* Fix reported error of memleak and introduce new function
* Fix incorrect variable
* Update test2.cpp
* Update test2.cpp
* Update MolOps.cpp
* Update MolOps.cpp
* Fix algorithm & Add test docs
* Update test2.cpp
* Update Subgraphs.cpp
* New argument `bondDist` - Optimize the `FindAtomEnvFromMToN`
Documentation is syncronized the meaning between C++ and Python
- New argument `bondDist`
- `findAtomEnvironmentOfRadiusMToN()` now called once instead of twice due to the introduction of `bondDist`
* Update Subgraphs.cpp
* Update test2.cpp
* Fix casting
* Correct the test
* Update Subgraphs.cpp
* Remove buggy function and replace argument position
* Update Subgraphs.h
* Fix build failed
* Optimization
Reduce graph expansion if it is the last radius
* Adjust codebase based on review
- Update Copyright
- Add doc to prove optimization
* suggested changes
Co-authored-by: greg landrum <greg.landrum@gmail.com>
* run clang-tidy with modernize-use-default-member-init
* results from modernize-use-emplace
* one uniform initialization per line
otherwise SWIG is unhappy
Co-authored-by: Brian Kelley <fustigator@gmail.com>
* run clang-tidy with readability-braces-around-statements
clang-format the results
clean up all the parts that clang-tidy-8 broke
* fix problem on windows
* Removes ATOM/BOND_SPTR in boost::graph in favor of raw pointers
* Actually delete atoms and bonds...
* RWMol::clear now calls destroy to handle atom/bond deletion
* Changes broken Atom lookup for windows/gcc
* Adds tests for running with valgrind
* Adds test designed for valgrind and molecule deletions
* Removes RNG, actually tests bond deletions
* update swig wrappers
* deal with most recent changes on the main branch
instead of using the property map interface.
A nice side-effect is that the wart of having to use property maps to loop over bonds or atom neighbors
is now gone.
This potentially breaks lots of client C++ code.