简体   繁体   中英

Sparse svd in Armadillo (C++)

According to, http://arma.sourceforge.net/docs.html#part_c , Armadillo has support for following functions:

eig_sym
eig_gen
eigs_sym
eigs_gen
svd
svd_econ

But there does not seem to be a function like "svds_econ", which operates on "sparse" matrix and returns singular values and vectors.

Is there a way to achieve this functionality in Armadillo?

从5.0版开始,犰狳具有svds()函数,用于获取有限数量的奇异值和奇异矢量。

The sparse SVD can be computed indirectly. For example, first calculate X'*X or X*X' , and then pass the resultant matrix to eigs_sym(). Another way is to first construct a sparse matrix like [zeros(m,m) X; X' zeros(n,n)] , where m and n indicate the number of rows and columns in X .

You may also want to scale X by its 1-norm beforehand, to increase stability.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM