namespace rgpot::types::adapt::xtensor¶
Overview¶
namespace xtensor {
// global functions
AtomMatrix convertToAtomMatrix(const xt::xtensor<double, 2>& matrix);
xt::xtensor<double, 2> convertToXtensor(const AtomMatrix& atomMatrix);
template <typename T>
std::vector<T> convertToVector(const xt::xtensor<T, 1>& vector);
std::array<std::array<double, 3>, 3> convertToArray3x3(const xt::xtensor<double, 2>& matrix);
} // namespace xtensor
Detailed Documentation¶
Global Functions¶
AtomMatrix convertToAtomMatrix(const xt::xtensor<double, 2>& matrix)
Converts an xtensor array to a native AtomMatrix.
Parameters:
matrix |
The source 2D xtensor array. |
Returns:
An AtomMatrix containing the copied data.
xt::xtensor<double, 2> convertToXtensor(const AtomMatrix& atomMatrix)
Converts a native AtomMatrix to an xtensor array.
Parameters:
atomMatrix |
The source native matrix. |
Returns:
A 2D xt::xtensor containing the data.
template <typename T>
std::vector<T> convertToVector(const xt::xtensor<T, 1>& vector)
Converts a 1D xtensor to a standard vector.
Parameters:
vector |
The source 1D xtensor. |
Returns:
A std::vector containing the data.
std::array<std::array<double, 3>, 3> convertToArray3x3(const xt::xtensor<double, 2>& matrix)
Converts a 3x3 xtensor to a nested standard array.
Parameters:
matrix |
The 3x3 xtensor array. |
Returns:
A nested std::array representing the matrix.