Loading...
Searching...
No Matches
ira_sofi.hpp
Go to the documentation of this file.
1#ifndef SEAMS_IRA_SOFI_H_
2#define SEAMS_IRA_SOFI_H_
3
4#include <Eigen/Core>
5#include <string>
6#include <vector>
7
8// IRA (Gunde, Salles, Hemeryck, Martin-Samos, JCIM 2021,
9// 10.1021/acs.jcim.1c00567) solves rotation + translation + permutation.
10// SOFI (Gunde, Salles, Grisanti, Hemeryck, Martin-Samos, JCP 2024,
11// 10.1063/5.0215689) returns the degenerate self-matches as the point group.
12// Both live in libira. A build without the library still compiles these
13// declarations; match and pointGroup then return 1.
14
15namespace ira {
16
17struct Match {
18 Eigen::Matrix3d rotation = Eigen::Matrix3d::Identity();
19 Eigen::Vector3d translation = Eigen::Vector3d::Zero();
20 std::vector<int> assignment;
21 std::vector<double> quat;
22 double hausdorff = 0.0;
23 double rmsd = 0.0;
24};
25
26bool available();
27
28// Overlay target onto ref. Both are n x 3 (or m x 3). Equal size is the
29// cage/prism case; unequal size is a fragment match. Returns 0 on success.
30[[nodiscard]] int match(const Eigen::MatrixXd &ref,
31 const Eigen::MatrixXd &target, Match &out,
32 double kmaxFactor = 1.8);
33
34// Point-group operations of a centered n x 3 cloud. Returns 0 on success.
35struct PointGroup {
36 std::string symbol;
37 int nOperations = 0;
38 std::vector<Eigen::Matrix3d> operations;
39};
40
41[[nodiscard]] int pointGroup(const Eigen::MatrixXd &coords, PointGroup &out,
42 double symThr = 0.05);
43
44// Horn-shaped result for callers that already store quat + rmsd.
45// Returns true when IRA produced a match.
46bool orient(const Eigen::MatrixXd &ref, const Eigen::MatrixXd &target,
47 std::vector<double> &quat, double &rmsd);
48
49} // namespace ira
50
51#endif // SEAMS_IRA_SOFI_H_
bool available()
bool orient(const Eigen::MatrixXd &ref, const Eigen::MatrixXd &target, std::vector< double > &quat, double &rmsd)
int pointGroup(const Eigen::MatrixXd &coords, PointGroup &out, double symThr=0.05)
std::vector< double > quat
Definition ira_sofi.hpp:21
Eigen::Matrix3d rotation
Definition ira_sofi.hpp:18
std::vector< int > assignment
Definition ira_sofi.hpp:20
Eigen::Vector3d translation
Definition ira_sofi.hpp:19
double rmsd
Definition ira_sofi.hpp:23
double hausdorff
Definition ira_sofi.hpp:22
std::vector< Eigen::Matrix3d > operations
Definition ira_sofi.hpp:38
std::string symbol
Definition ira_sofi.hpp:36