我在BDCSVD计算过程中得到以下断言:
/root/GitSyte/eigen3/Eigen/src/Core/DenseCoeffsBase.h:180: Eigen::DenseCoeffsBase<Derived, 0>::CoeffReturnType Eigen::DenseCoeffsBase<Derived, 0>::operator()(Eigen::Index) const [with Derived = Eigen::Ref<Eigen::Array<long int, 1, -1> >; Eigen::DenseCoeffsBase<Derived, 0>::CoeffReturnType = const long int&; Eigen::Index = long int]: Assertion `index >= 0 && index < size()' failed.
它位于callstack深处:
#0 0x00007ffff6a0bc37 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#1 0x00007ffff6a0f028 in __GI_abort () at abort.c:89
#2 0x00007ffff6a04bf6 in __assert_fail_base (fmt=0x7ffff6b59018 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n",assertion=assertion@entry=0x7c0e0f "index >= 0 && index < size()",file=file@entry=0x7c0af8 "/root/GitSyte/eigen3/Eigen/src/Core/DenseCoeffsBase.h", line=line@entry=180,function=function@entry=0x7ec2e0 <Eigen::DenseCoeffsBase<Eigen::Ref<Eigen::Array<long, 1, -1, 1, 1, -1>, 0, Eigen::InnerStride<1> >, 0>::operator()(long) const::__PRETTY_FUNCTION__> "Eigen::DenseCoeffsBase<Derived, 0>::CoeffReturnType Eigen::DenseCoeffsBase<Derived, 0>::operator()(Eigen::Index) const [with Derived = Eigen::Ref<Eigen::Array<long int, 1, -1> >; Eigen::DenseCoeffsBas"...)at assert.c:92
#3 0x00007ffff6a04ca2 in __GI___assert_fail (assertion=0x7c0e0f "index >= 0 && index < size()",file=0x7c0af8 "/root/GitSyte/eigen3/Eigen/src/Core/DenseCoeffsBase.h", line=180,function=0x7ec2e0 <Eigen::DenseCoeffsBase<Eigen::Ref<Eigen::Array<long, 1, -1, 1, 1, -1>, 0, Eigen::InnerStride<1> >, 0>::operator()(long) const::__PRETTY_FUNCTION__> "Eigen::DenseCoeffsBase<Derived, 0>::CoeffReturnType Eigen::DenseCoeffsBase<Derived, 0>::operator()(Eigen::Index) const [with Derived = Eigen::Ref<Eigen::Array<long int, 1, -1> >; Eigen::DenseCoeffsBas"...) at assert.c:101
#4 0x000000000070d046 in Eigen::DenseCoeffsBase<Eigen::Ref<Eigen::Array<long, 1, -1, 1, 1, -1>, 0, Eigen::InnerStride<1> >, 0>::operator() (this=0x7fffffffbc00, index=-1) at /root/GitSyte/eigen3/Eigen/src/Core/DenseCoeffsBase.h:180
#5 0x00000000007032d7 in Eigen::BDCSVD<Eigen::Matrix<float, -1, -1, 0, -1, -1> >::perturbCol0 (this=0x7fffffffe270, col0=...,diag=..., perm=..., singVals=..., shifts=..., mus=..., zhat=...) at /root/GitSyte/eigen3/Eigen/src/SVD/BDCSVD.h:909
#6 0x00000000006fc300 in Eigen::BDCSVD<Eigen::Matrix<float, -1, -1, 0, -1, -1> >::computeSVDofM (this=0x7fffffffe270,firstCol=2062, n=34, U=..., singVals=..., V=...) at /root/GitSyte/eigen3/Eigen/src/SVD/BDCSVD.h:638
#7 0x00000000006f6569 in Eigen::BDCSVD<Eigen::Matrix<float, -1, -1, 0, -1, -1> >::divide (this=0x7fffffffe270, firstCol=2060,lastCol=2093, firstRowW=2060, firstColW=2062, shift=2) at /root/GitSyte/eigen3/Eigen/src/SVD/BDCSVD.h:534
#8 0x00000000006f579e in Eigen::BDCSVD<Eigen::Matrix<float, -1, -1, 0, -1, -1> >::divide (this=0x7fffffffe270, firstCol=2060, lastCol=2127, firstRowW=2060, firstColW=2061, shift=1) at /root/GitSyte/eigen3/Eigen/src/SVD/BDCSVD.h:430
#9 0x00000000006f579e in Eigen::BDCSVD<Eigen::Matrix<float, -1, -1, 0, -1, -1> >::divide (this=0x7fffffffe270, firstCol=2060, lastCol=2195, firstRowW=2060, firstColW=2060, shift=0) at /root/GitSyte/eigen3/Eigen/src/SVD/BDCSVD.h:430
#10 0x00000000006f5749 in Eigen::BDCSVD<Eigen::Matrix<float, -1, -1, 0, -1, -1> >::divide (this=0x7fffffffe270, firstCol=1923, lastCol=2195, firstRowW=1923, firstColW=1923, shift=0) at /root/GitSyte/eigen3/Eigen/src/SVD/BDCSVD.h:429
#11 0x00000000006f5749 in Eigen::BDCSVD<Eigen::Matrix<float, -1, -1, 0, -1, -1> >::divide (this=0x7fffffffe270, firstCol=1648, lastCol=2195, firstRowW=1648, firstColW=1648, shift=0) at /root/GitSyte/eigen3/Eigen/src/SVD/BDCSVD.h:429
#12 0x00000000006f5749 in Eigen::BDCSVD<Eigen::Matrix<float, -1, -1, 0, -1, -1> >::divide (this=0x7fffffffe270, firstCol=1099, lastCol=2195, firstRowW=1099, firstColW=1099, shift=0) at /root/GitSyte/eigen3/Eigen/src/SVD/BDCSVD.h:429
#13 0x00000000006f5749 in Eigen::BDCSVD<Eigen::Matrix<float, -1, -1, 0, -1, -1> >::divide (this=0x7fffffffe270, firstCol=0, lastCol=2195, firstRowW=0, firstColW=0, shift=0) at /root/GitSyte/eigen3/Eigen/src/SVD/BDCSVD.h:429
#14 0x00000000006f35bc in Eigen::BDCSVD<Eigen::Matrix<float, -1, -1, 0, -1, -1> >::compute (this=0x7fffffffe270, matrix=..., computationOptions=4) at /root/GitSyte/eigen3/Eigen/src/SVD/BDCSVD.h:278
#15 0x00000000006f23c2 in Eigen::BDCSVD<Eigen::Matrix<float, -1, -1, 0, -1, -1> >::BDCSVD (this=0x7fffffffe270, matrix=..., computationOptions=4) at /root/GitSyte/eigen3/Eigen/src/SVD/BDCSVD.h:137
#16 0x00000000006ef0a4 in main (argc=3, argv=0x7fffffffe468) at /code/KMeansFeatureClustering/PCA.cpp:67
最初的电话是:
BDCSVD<MatrixXf> svd(originalDataset.transpose(), ComputeFullU);
originalDataset:2196X4096 originalDataset是特征向量的数据集。
我已经在60000X4096尺寸的矩阵上运行了它。
本征3.3.4
操作系统 - Ubuntu 14.04
编译器 - GCC 4.8.5