namespace rgpot::types::adapt::eigen¶
Overview¶
namespace eigen {
// global functions
AtomMatrix convertToAtomMatrix(const Eigen::MatrixXd& matrix);
Eigen::MatrixXd convertToEigen(const AtomMatrix& atomMatrix);
template <typename T>
std::vector<T> convertToVector(const Eigen::VectorX<T>& vector);
std::array<std::array<double, 3>, 3> convertToEigen3d(const Eigen::Matrix3d& matrix);
} // namespace eigen
Detailed Documentation¶
Global Functions¶
AtomMatrix convertToAtomMatrix(const Eigen::MatrixXd& matrix)
Converts an Eigen matrix to a native AtomMatrix.
Parameters:
matrix |
The source Eigen matrix. |
Returns:
An AtomMatrix instance with copied data.
Eigen::MatrixXd convertToEigen(const AtomMatrix& atomMatrix)
Converts a native AtomMatrix to an Eigen matrix.
Note
This uses Eigen::Map for zero-copy access where possible.
Parameters:
atomMatrix |
The source native matrix. |
Returns:
An Eigen::MatrixXd mapped to the original data.
template <typename T>
std::vector<T> convertToVector(const Eigen::VectorX<T>& vector)
Converts an Eigen vector to a standard vector.
Parameters:
vector |
The source Eigen vector. |
Returns:
A std::vector containing the data.
std::array<std::array<double, 3>, 3> convertToEigen3d(const Eigen::Matrix3d& matrix)
Converts a 3x3 Eigen matrix to a nested standard array.
Parameters:
matrix |
The 3x3 Eigen matrix. |
Returns:
A std::array of arrays representing the matrix.