MCPcopy Create free account
hub / github.com/creatale/node-dv / eigen

Method eigen

deps/opencv/modules/core/src/lapack.cpp:1466–1494  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1464/////////////////// finding eigenvalues and eigenvectors of a symmetric matrix ///////////////
1465
1466bool cv::eigen( InputArray _src, bool computeEvects, OutputArray _evals, OutputArray _evects )
1467{
1468 Mat src = _src.getMat();
1469 int type = src.type();
1470 int n = src.rows;
1471
1472 CV_Assert( src.rows == src.cols );
1473 CV_Assert (type == CV_32F || type == CV_64F);
1474
1475 Mat v;
1476 if( computeEvects )
1477 {
1478 _evects.create(n, n, type);
1479 v = _evects.getMat();
1480 }
1481
1482 size_t elemSize = src.elemSize(), astep = alignSize(n*elemSize, 16);
1483 AutoBuffer<uchar> buf(n*astep + n*5*elemSize + 32);
1484 uchar* ptr = alignPtr((uchar*)buf, 16);
1485 Mat a(n, n, type, ptr, astep), w(n, 1, type, ptr + astep*n);
1486 ptr += astep*n + elemSize*n;
1487 src.copyTo(a);
1488 bool ok = type == CV_32F ?
1489 Jacobi(a.ptr<float>(), a.step, w.ptr<float>(), v.ptr<float>(), v.step, n, ptr) :
1490 Jacobi(a.ptr<double>(), a.step, w.ptr<double>(), v.ptr<double>(), v.step, n, ptr);
1491
1492 w.copyTo(_evals);
1493 return ok;
1494}
1495
1496bool cv::eigen( InputArray src, OutputArray evals, int, int )
1497{

Callers

nothing calls this directly

Calls 9

alignSizeFunction · 0.85
alignPtrFunction · 0.85
JacobiFunction · 0.85
noArrayFunction · 0.85
getMatMethod · 0.45
typeMethod · 0.45
createMethod · 0.45
elemSizeMethod · 0.45
copyToMethod · 0.45

Tested by

no test coverage detected