Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F119998835
hdf5_eigen.cpp
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Tue, Jul 1, 05:00
Size
857 B
Mime Type
text/x-c
Expires
Thu, Jul 3, 05:00 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
27123757
Attached To
rSPECMICP SpecMiCP / ReactMiCP
hdf5_eigen.cpp
View Options
#include "catch.hpp"
#include "utils/io/hdf5_eigen.hpp"
using namespace specmicp::io;
TEST_CASE("HDF5_eigen", "[io],[hdf5],[eigen]")
{
SECTION("Simple case") {
Eigen::Matrix2d mat;
mat << 1, 2, 3, 4;
HDF5File file("test_eigen_simple_case", HDF5_OpenMode::CreateTruncate);
auto matrix_group = file.create_group("/matrix");
save_eigen_matrix(file, "Double 2x2 matrix", "/matrix", mat);
Eigen::Matrix4i mat2;
mat2 << 1, 2, 3, 4,
5, 6, 7, 8,
1, 2, 3, 4,
5, 6, 7, 8;
save_eigen_matrix(file, "Integer 4x4 matrix", "/matrix", mat2);
Eigen::VectorXd vec1(6);
vec1 << 1, 2, 3, 4, 5, 6;
auto vector_group = file.create_group("/vector");
save_eigen_matrix(file, "double 6x1 vector", "/vector", vec1);
}
}
Event Timeline
Log In to Comment