Eigen SVD with very large matrix - eigen

I need to calculate the SVD with a very large matrix of complex numbers.
The matrix dimensions are [260000][570].
By using the EIGEN libs I have defined:
MatrixXcf Lop_tmp
(even if MatrixXcd would be better).
However, I'm able to instantiate Lop_tmp but the SVD crashed (bad alloc) when invoked in this way:
Eigen::BDCSVD<Eigen::MatrixXcf> svd(Lop_tmp.transpose(), Eigen::ComputeThinU | Eigen::ComputeThinV);
Supposing not to partitiong the algoritm, is there a way to compute the Eigen SVD with this Lop_tmp?
Thank you!

Related

Is there a fast way to inverse a quasi-diagonal matrix in Eigen?

I want to inverse a quasi-diagonal matrix with Eigen, of course I can use inverse(), but I wonder if inverse() will check if the matrix if (quasi)diagonal. Is there a faster function to do this?

how to convert UMFpack sparse matrix to Eigen sparse matrix?

I have a code that was written to use UMFpack sparse matrix solver but need to convert it to Eigen sparse matrix but I am running into memory problems.
I have Ai (row pointers), Ap (column pointers) and Ax (array). Trying to solve Ax=b. How can I pass these pointers and Ax or change them for Eigen?

compute determinant of complex matrix fortran90

I need to compute the determinant of complex matrix which is symmetric. Size of matrix ranges from 500*500 to 2000*2000. Is there any subroutine for me to call? By the way, I use ifort to compile.
The easiest way would be to do an LU-decomposition as described here. I would suggest using LAPACK for this task...
This article has some code in C doing that for a real-valued symmetric matrix, so you need to exchange dspsv by zspsv to handle double-precision complex matrices.

Armadillo c++: Is there a specific way for creating efficiently triangular or symmetric matrix

I am using armadillo mostly for symmetric and triangular matrices. I wanted to be efficient in terms of memory storage. However, it seems there is no other way than to create a new mat and fill with zeros(for triangular) or with duplicates(for symmetric) the lower/upper part of the matrix.
Is there a more efficient way of using triangular/symmetric matrices using Armadillo?
Thanks,
Antoine
There is no specific support for triangular or banded matrices in Armadillo. However, since version 3.4 support for sparse matrices has gradually been added. Depending on what Armadillo functions you need, and the sparsity of your matrix, you might gain from using SpMat<type> which implements the compressed sparse column (CSC) format. For each nonzero value in your matrix the CSC format stores the row index along with the value so you would likely not save much memory for a triangular matrix. A banded diagonal matrix should however consume significantly less memory.
symmatu()/symmatl() and trimatu()/trimatl()
may be what you are looking for:
http://arma.sourceforge.net/docs.html

How do I make a diagonal matrix in eigen with a dynamic size?

I want to make a diagonal matrix with the C++ linear algebra library eigen, but I do not know the size of the matrix during compile time. Hence,
DiagonalMatrix<Scalar, SizeAtCompileTime> diag1(size);
will not work. The values along the diagonal also differ. Help?
You need to instantiate the template parameter with what is relevant for you:
DiagonalMatrix<double,Eigen::Dynamic> diag1(size);

Resources