MCPcopy Create free account
hub / github.com/NGSolve/ngsolve / archive_matrix

Function archive_matrix

fem/tensorcoefficient.cpp:62–79  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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);

Callers 1

DoArchiveMethod · 0.85

Calls 4

HeightMethod · 0.45
WidthMethod · 0.45
AsVectorMethod · 0.45
SetSizeMethod · 0.45

Tested by

no test coverage detected