This forum has been archived. All content is frozen. Please use KDE Discuss instead.

ARPACK++ error "Matrix data contains inconsistencies"

Tags: None
(comma "," separated)
hypernova
Registered Member
Posts
3
Karma
0
Hi !!

In the following code, I am trying to define a matrix in CCS (which is equivalent to CSR for a symmetric matrix, right ?) in ARPACK++.
I have installed and patched ARPACK++.
(The matrix is not sparse, but still it should not give an error)

Code: Select all
#include <iostream>
#include "arlsmat.h"//matrix class is here
#define N 3

using namespace std;

double acsr[]={7,1,1,
          1,2,3,
          1,3,6};//array with non-zero values
//actually, this is the whole matrix (there are no zero values !)

int ja[]={0,1,2,0,1,2,0,1,2};//column indices
int ia[]={0,3,6,9};//row indices

int main()
{
   
   ARluSymMatrix<double> arr(N, 9, acsr, ja, ia); //default value of  last parameter, uplo='L' (store lower triangle)
   
return 0;
}


This code gives me the error -
Arpack error in ARluSymMatrix::DefineMatrix.
-> Matrix data contain inconsistencies.

Why is this so ? I have checked the values of ia and ja by running intel MKl on the matrix to find the CSR (again, CSR=CCS for symmetric matrix, right ?), and the values are the same.

Is this some problem of 0 and 1 indexing ? Does ARPACK++ use 1 indexing ?


Thank you for your help in advance !!
hypernova
Registered Member
Posts
3
Karma
0
Never mind, got it.

For someone else who might get stuck,

1. The function requires only non zero elements from the lower/upper triangle, instead of the whole matrix.

2. So, to get CCS considering the lower triangle, consider the upper triangle and calculate the CSR (CCS=CSR of transposed) and vice versa.
Then feed this into the function and it should be fine.


Bookmarks



Who is online

Registered users: bartoloni, Bing [Bot], Evergrowing, Google [Bot]