LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 06-26-2011, 01:18 AM   #1
shitij90
LQ Newbie
 
Registered: Jun 2011
Distribution: Ubuntu 11.04
Posts: 15

Rep: Reputation: Disabled
ARPACK++ error "Matrix data contains inconsistencies"


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:
#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:efineMatrix.
-> 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 ?--I am asking this because ARPACK++ uses CCS, not CSR), 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 !!
 
Old 06-26-2011, 11:55 PM   #2
shitij90
LQ Newbie
 
Registered: Jun 2011
Distribution: Ubuntu 11.04
Posts: 15

Original Poster
Rep: Reputation: Disabled
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Sendmail Error - Rejected after DATA: could not verify "From:" header address" soslinux Linux - Server 2 07-22-2010 07:09 AM
"internal data stream error " for flv from youtube in totem sumeet inani Linux - Newbie 9 06-24-2010 03:06 AM
How to get the "data type" of an "unknown variable" in "C Language" ? Affair Programming 8 06-20-2009 12:30 PM
RPC Error-"118.418448784591" contained trailing data?? suliman_shah Programming 0 09-17-2007 02:37 AM
"Undeleting" data using grep, but get "grep: memory exhausted" error SammyK Linux - Software 2 03-13-2004 03:11 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 07:31 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration