// save params in binary format, save at least max_examples // columns for each parameter matrix void save_params(FILE* ofile, int max_examples) { if (max_examples > (int) n_examples) max_examples = n_examples; //cout << " max_examples" << max_examples << endl; for(auto w : param_matrices) { arma::mat sub_w = w->cols(0, max_examples-1); LOG(trace) << "save one param matrix"; save_mat(ofile, sub_w); } }
void SpinAdapted::Save(const Matrix& a, std::ofstream &ofs) { boost::archive::binary_oarchive save_mat(ofs); save_mat << a; }