aboutsummaryrefslogtreecommitdiff
path: root/redist/minimal_opencvtest.c
diff options
context:
space:
mode:
authorJustin Berger <jdavidberger@gmail.com>2018-06-21 16:22:24 +0000
committerJustin Berger <jdavidberger@gmail.com>2018-06-21 16:22:24 +0000
commita7a44dc9cc0f4a74adbc22ff86ad081ecf2383ba (patch)
tree47aa348281c9250548a830007b8abdd7076dfebc /redist/minimal_opencvtest.c
parentfcf3528bfeba5e4646dbb0626a87c297d940a787 (diff)
downloadlibsurvive-a7a44dc9cc0f4a74adbc22ff86ad081ecf2383ba.tar.gz
libsurvive-a7a44dc9cc0f4a74adbc22ff86ad081ecf2383ba.tar.bz2
Expanded minimal opencv functionality to properly use transpose flags
Diffstat (limited to 'redist/minimal_opencvtest.c')
-rw-r--r--redist/minimal_opencvtest.c39
1 files changed, 39 insertions, 0 deletions
diff --git a/redist/minimal_opencvtest.c b/redist/minimal_opencvtest.c
new file mode 100644
index 0000000..6320a27
--- /dev/null
+++ b/redist/minimal_opencvtest.c
@@ -0,0 +1,39 @@
+#include "minimal_opencv.h"
+#include <assert.h>
+#include <math.h>
+#include <stdbool.h>
+#include <stdio.h>
+
+void print_mat(const CvMat *M) {}
+
+void test_gemm() {
+ double _2x3[2*3] = {1, 2, 3, 4, 5, 6};
+ CvMat m2x3 = cvMat(2, 3, CV_64F, _2x3);
+
+ double _3x2[2*3] = {1, 2, 3, 4, 5, 6};
+ CvMat m3x2 = cvMat(3, 2, CV_64F, _3x2);
+
+ double _2x2[2*2] = {1, 2, 3, 4};
+ CvMat m2x2 = cvMat(2, 2, CV_64F, _2x2);
+
+ double _3x3[3*3] = {1, 2, 3, 4, 5, 6, 7, 8, 9};
+ CvMat m3x3 = cvMat(3, 3, CV_64F, _3x3);
+
+ cvGEMM(&m2x3, &m3x2, 1, 0, 0, &m2x2, 0);
+ cvGEMM(&m3x2, &m2x3, 1, 0, 0, &m3x3, 0);
+
+ cvGEMM(&m2x3, &m2x3, 1, 0, 0, &m3x3, GEMM_1_T);
+ cvGEMM(&m2x3, &m2x3, 1, 0, 0, &m2x2, GEMM_2_T);
+
+ cvGEMM(&m2x3, &m3x2, 1, 0, 0, &m3x3, GEMM_1_T | GEMM_2_T);
+ // cvGEMM(&m3x2, &m2x3, 1, 0, 0, &m2x2, GEMM_1_T | GEMM_2_T);
+
+}
+
+int main()
+{
+ test_gemm();
+
+ return 0;
+}
+