// // Copyright (C) 2020 Gareth Jones, Glysade LLC // // @@ All Rights Reserved @@ // This file is part of the RDKit. // The contents are covered by the terms of the BSD license // which is included in the file license.txt, found at the root // of the RDKit source tree. // %include "std_vector.i" %{ #include #include #include #include %} %include %include %ignore RDKit::RascalMCES::RascalResult::getMcesMol; %include %ignore RDKit::RascalMCES::rascalCluster; %ignore RDKit::RascalMCES::rascalButinaCluster; %include // The extra functions in extend_std_vector.i do not play well with RascalResult %ignore std::vector::equals; %ignore std::vector::vector(size_type); %template(RascalResult_Vect) std::vector; %template(Unsigned_Vect_Vect) std::vector>; // The Rascal code uses std::shared_ptr rather than boost::shared_ptr %extend RDKit::RascalMCES::RascalResult { RDKit::ROMol *getMCESMol() { auto shared_ptr = ($self)->getMcesMol(); return shared_ptr.get(); } } %inline %{ namespace RDKit { namespace RascalMCES { class RascalApp { }; } } %} %extend RDKit::RascalMCES::RascalApp { static std::vector > RascalCluster(const std::vector >& mols, const RDKit::RascalMCES::RascalClusterOptions& clusterOptions=RascalClusterOptions()) { std::vector > rascalMolecules; for (auto molIn: mols) { rascalMolecules.emplace_back(new RDKit::ROMol(*molIn)); } return RDKit::RascalMCES::rascalCluster(rascalMolecules, clusterOptions); } static std::vector > RascalButinaCluster(const std::vector >& mols, const RDKit::RascalMCES::RascalClusterOptions& clusterOptions=RascalClusterOptions()) { std::vector > rascalMolecules; for (auto molIn: mols) { rascalMolecules.emplace_back(new RDKit::ROMol(*molIn)); } return RDKit::RascalMCES::rascalButinaCluster(rascalMolecules, clusterOptions); } }