从Eigen库使用SVD时抛出错误的分配异常 [英] Bad alloc exception thrown when using SVD from Eigen library

查看:465
本文介绍了从Eigen库使用SVD时抛出错误的分配异常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的应用程序中,我想从具有 double 项的给定数据矩阵中获得左奇异矢量,这在代码中以

In my application, I want to obtain the left singular vectors from a given data matrix with double entries, which is given in the code as

Eigen :: MatrixXd m;

,尺寸为 45 x 904140 。现在,我将构造函数用于Eigen库中的SVD分解,如下所示:

and has dimensions 45 x 904140. Now I use the constructor for the SVD decomposition in the Eigen library as below

Eigen :: BDCSVD< Eigen :: MatrixXd> svd(m,Eigen :: ComputeFullU | Eigen :: ComputeFullV);

在那里,抛出了一个错误的alloc异常,更确切地说是:

and there, a bad alloc exception is thrown, more precisely:

Unhandled exception at 0x00007FFA058850D8: Microsoft C++ exception: std::bad_alloc at memory location


推荐答案

错误 std :: bad_alloc 通常意味着没有足够的内存来完成您的操作任务。

The error std::bad_alloc usually means there is not enough memory to complete your task.

您可能无法计算需要在计算机上使用904140 x 904140的矩阵。

You might not be able to compute the matrix that requires a 904140 x 904140 on your machine.

这篇关于从Eigen库使用SVD时抛出错误的分配异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆