summaryrefslogtreecommitdiffhomepage
path: root/opentrack
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2016-06-13 09:28:26 +0200
committerStanislaw Halik <sthalik@misaki.pl>2016-06-14 18:14:46 +0200
commit4ce3ce22c5d50dd3bd92223e43182d4efdfe4ef8 (patch)
treedd73fd052fd42b1827db3997907857e8fd330d3c /opentrack
parentab67bc751ae713f9dbfe408eaf266e6dc0318449 (diff)
api/simple-mat: allow for vector -> const double* conversion
Diffstat (limited to 'opentrack')
-rw-r--r--opentrack/simple-mat.hpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/opentrack/simple-mat.hpp b/opentrack/simple-mat.hpp
index 864f0e49..2855ad0e 100644
--- a/opentrack/simple-mat.hpp
+++ b/opentrack/simple-mat.hpp
@@ -206,6 +206,14 @@ public:
Mat(num* mem) : Mat(const_cast<const num*>(mem)) {}
+ template<int h = h_,
+ int w = w_,
+ typename = typename std::enable_if<h == 1 || w == 1>::type>
+ operator const double*() const
+ {
+ return reinterpret_cast<const double*>(data);
+ }
+
// XXX add more operators as needed, third-party dependencies mostly
// not needed merely for matrix algebra -sh 20141030