2023-09-26 12:58:34 +08:00
|
|
|
# include <eigen3/Eigen/Dense>
|
|
|
|
# include <zpp_bits.h>
|
|
|
|
# include <span>
|
|
|
|
# include <iostream>
|
2023-09-26 18:54:11 +08:00
|
|
|
# include <vector>
|
2023-09-26 12:58:34 +08:00
|
|
|
|
|
|
|
namespace Eigen
|
|
|
|
{
|
|
|
|
constexpr auto serialize(auto & archive, Eigen::Matrix3d& matrix)
|
|
|
|
{
|
|
|
|
return archive(std::span<double, 9>(matrix.data(), 9));
|
|
|
|
}
|
|
|
|
constexpr auto serialize(auto & archive, const Eigen::Matrix3d& matrix)
|
|
|
|
{
|
|
|
|
return archive(std::span<const double, 9>(matrix.data(), 9));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
int main()
|
|
|
|
{
|
|
|
|
auto [data, in, out] = zpp::bits::data_in_out();
|
2023-09-26 18:54:11 +08:00
|
|
|
std::vector<Eigen::Matrix3d> PrimativeCell = { Eigen::Matrix3d::Identity() };
|
|
|
|
out(PrimativeCell).or_throw();
|
|
|
|
std::vector<Eigen::Matrix3d> PrimativeCell2;
|
|
|
|
in(PrimativeCell2).or_throw();
|
|
|
|
std::cout << PrimativeCell2[0] << std::endl;
|
2023-09-26 12:58:34 +08:00
|
|
|
}
|