提交 d60b1f2f 编写于 作者: V Vadim Pisarevsky

fixed bug #2106; added test

上级 73ce3ef8
...@@ -1491,7 +1491,9 @@ void MatOp_GEMM::multiply(const MatExpr& e, double s, MatExpr& res) const ...@@ -1491,7 +1491,9 @@ void MatOp_GEMM::multiply(const MatExpr& e, double s, MatExpr& res) const
void MatOp_GEMM::transpose(const MatExpr& e, MatExpr& res) const void MatOp_GEMM::transpose(const MatExpr& e, MatExpr& res) const
{ {
res = e; res = e;
res.flags ^= CV_GEMM_A_T | CV_GEMM_B_T | CV_GEMM_C_T; res.flags = (!(e.flags & CV_GEMM_A_T) ? CV_GEMM_B_T : 0) |
(!(e.flags & CV_GEMM_B_T) ? CV_GEMM_A_T : 0) |
(!(e.flags & CV_GEMM_C_T) ? CV_GEMM_C_T : 0);
swap(res.a, res.b); swap(res.a, res.b);
} }
......
...@@ -758,6 +758,13 @@ bool CV_OperationsTest::TestTemplateMat() ...@@ -758,6 +758,13 @@ bool CV_OperationsTest::TestTemplateMat()
split(mf2, mvf2); split(mf2, mvf2);
CV_Assert( norm(mvf2[0], mvf[0], CV_C) == 0 && CV_Assert( norm(mvf2[0], mvf[0], CV_C) == 0 &&
norm(mvf2[1], mvf[1], CV_C) == 0 ); norm(mvf2[1], mvf[1], CV_C) == 0 );
{
Mat a(2,2,CV_32F,1.f);
Mat b(1,2,CV_32F,1.f);
Mat c = (a*b.t()).t();
CV_Assert( norm(c, CV_L1) == 4. );
}
} }
catch (const test_excep& e) catch (const test_excep& e)
{ {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册