| 60 | |
| 61 | template <typename T> |
| 62 | void archive_matrix(Archive& ar, T& matrix) { |
| 63 | // TODO: streamline implementation / implement somewhere else |
| 64 | if(ar.Output()) { |
| 65 | ar << matrix.Height(); |
| 66 | ar << matrix.Width(); |
| 67 | auto vec = matrix.AsVector(); |
| 68 | for (auto& item : vec) |
| 69 | ar & item; |
| 70 | } |
| 71 | else { |
| 72 | size_t h, w; |
| 73 | ar & h & w; |
| 74 | matrix.SetSize(h, w); |
| 75 | auto vec = matrix.AsVector(); |
| 76 | for (auto& item : vec) |
| 77 | ar & item; |
| 78 | } |
| 79 | } |
| 80 | |
| 81 | bool get_option(const map<string, bool> &options, string key, bool or_val) { |
| 82 | auto found = options.find(key); |