fixed optional args processing in SVD::compute()

This commit is contained in:
Rostislav Vasilikhin 2016-09-06 14:09:44 +03:00
parent 0a3a2df433
commit cb52d249fe

View File

@ -1560,18 +1560,18 @@ static void _SVDcompute( InputArray _aarr, OutputArray _w,
JacobiSVD(temp_a.ptr<double>(), temp_u.step, temp_w.ptr<double>(),
temp_v.ptr<double>(), temp_v.step, m, n, compute_uv ? urows : 0);
}
temp_w.copyTo(_w);
if(_w.needed()) temp_w.copyTo(_w);
if( compute_uv )
{
if( !at )
{
transpose(temp_u, _u);
temp_v.copyTo(_vt);
if(_u.needed()) transpose(temp_u, _u);
if(_vt.needed()) temp_v.copyTo(_vt);
}
else
{
transpose(temp_v, _u);
temp_u.copyTo(_vt);
if(_u.needed()) transpose(temp_v, _u);
if(_vt.needed()) temp_u.copyTo(_vt);
}
}
}