summaryrefslogtreecommitdiffhomepage
path: root/compat
diff options
context:
space:
mode:
Diffstat (limited to 'compat')
-rw-r--r--compat/simple-mat.hpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/compat/simple-mat.hpp b/compat/simple-mat.hpp
index 01af1c99..e697f76a 100644
--- a/compat/simple-mat.hpp
+++ b/compat/simple-mat.hpp
@@ -244,6 +244,13 @@ public:
data[j][i] = mem[i*H+j];
}
+ constexpr Mat(const Mat<num, H, W>& x)
+ {
+ for (int j = 0; j < H; j++)
+ for (int i = 0; i < W; i++)
+ data[j][i] = x(j, i);
+ }
+
constexpr operator num*() & { return (num*)data; }
constexpr operator const num*() const& { return (const num*)data; }