Hi,

there is any way to calculate the determinant of a matrix in CSR3AC or COO format?

Thanks.

For more complete information about compiler optimizations, see our Optimization Notice.

I want to get the determinant of a sparse matrix, but I only have found the functions:

mkl_dcsrsm

mkl_dcoosm

where I can assign *alpha = 1* and *B = to theidentity matrix* in order to get the inverse of the matrix A. But the documentation of these functions does not say anything about what happens when the determinant of A is zero. That is the reason I was looking for a function to get the determinant.

I did not know about PARDISO to obtain the inverse. Is this the best option for the type of matrices I am working with?

Thanks

You do not need to compute the determinant to establish whether the matrix is singular. The routines used for matrix factorization will return with a suitable error code when singularity (to a user specified tolerance) is detected.

Please state what you propose to do with the inverse. Quite often, if the solution of sparse systems of linear equations with multiple right hand sides is needed, that can be obtained without using the inverse. In fact, there are many reasons why the inverse should not be explicitly formed, except in a small number of special cases.

I need the inverse for the next operation:

M = -inv(A)*B

where A is of size NxN and B is of size NxM. A and B are sparse matrices with less than 20% of elements diferent from zero.

A is a submatrix from a sparse matrix C of size NxK (K>N). WhenA is singular, I have to obtain another submatrix from C, and try again.

Thanks

Fair enough. The singularity of A, if true, will manifest itself during the factorization of A. Note that B is not involved in this question at all. The inverse of A should not be sought. Here is a sketch of the algorithm:

1. Choose a submatrix of C as A.

2. Attempt the sparse factorization of A.

3. If Step-2 fails,

3a. Go to Step-1, choosing a different submatrix.

else

3b. Solve A X = B using the factors of A formed in Step-2.

-- done --

Thanks for your response mecej4,

I am testing with pardiso algorithm.

I execute the phases 11, 22, and 33. When the matrix A is singular,

the phase 33 returns the values IND in the array X.

But, how can I know in the phase 22 if the matrix A is singular?

Hi,

this is a code where I obtain the values IND in the solution vector:

[cpp]#include #include using std::cout; using std::endl; int main() { //Solver internal data address pointer int *pt = new int[64]; for(int i=0; i<64; i++) pt[i] = 0; //Maximal number of factors with identical nonzero sparsity structure int maxfct = 1; //Actual matrix for the solution phase: 1 <= mnum <= maxfct int mnum = 1; //Defines the matrix type //11: real and unsymmetric matrix int mtype = 11; //Controls the execution of the solver int phase = 11; //Number of equations int n = 2; //Non-zero values of the coefficient matrix A //3 1 = A //0 0 double *a = new double[3]; a[0] = 3.0; a[1] = 1.0; a[2] = 0.0; //Row Index int *ia = new int[n+1]; ia[0] = 1; ia[1] = 3; ia[2] = 4; //Columns int *ja = new int[2]; ja[0] = 1; ja[1] = 2; ja[2] = 1; //Permutation vector of size n int *perm = new int[n]; for(int i=0; i

The matrix A is singular:

3 1

00

Respect to your question, always exist a submatrix of C that is not singular.

Thanks

Hi,I've reproduced your issue, I will try to resolve it asap.With best regards,Alexander Kalinkin

--Gennady

Rate Us