10 Eigen::VectorXd baseVector = Eigen::VectorXd::LinSpaced(11,0,10);
11 f[
"/Vector"] = baseVector;
14 Eigen::VectorXd tempVector = f[
"/Vector"].head(2);
16 std::cout << tempVector.transpose() <<
"\nvs\n"
17 << baseVector.head(2).transpose() << std::endl << std::endl;
20 tempVector = f[
"/Vector"].segment(2,3);
22 std::cout << tempVector.transpose() <<
"\nvs\n"
23 << baseVector.segment(2,3).transpose() << std::endl << std::endl;
26 std::cout <<
"Old vector = "
27 << f[
"/Vector"].eval().transpose() << std::endl;
29 f[
"/Vector"].segment(3,2) = Eigen::VectorXd::Zero(2).eval();
31 std::cout <<
"New vector = "
32 << f[
"/Vector"].eval().transpose() << std::endl << std::endl;
36 f[
"/Matrix"] = (baseVector*baseVector.transpose()).eval();
39 std::cout <<
"4x5 matrix block = \n" << f[
"/Matrix"].block(2,3,4,5).eval() << std::endl;
H5Object OpenFile(std::string const &filename)
Open an HDF5 file and return the root object.