inline void load(std::ifstream& ifs, MatD& params){ Real val = 0.0; for (int i = 0; i < params.cols(); ++i){ for (int j = 0; j < params.rows(); ++j){ ifs.read((char*)&val, sizeof(Real)); params.coeffRef(j, i) = val; } } }
inline void save(std::ofstream& ofs, const MatD& params){ Real val = 0.0; for (int i = 0; i < params.cols(); ++i){ for (int j = 0; j < params.rows(); ++j){ val = params.coeff(j, i); ofs.write((char*)&val, sizeof(Real)); } } }