Hi !!<br><br>I have just started using SLEPc/PETSc.<br><br>The problem that I am trying to solve is that I have some routines calculating one row at a time of a matrix, which I want to insert in some sparse matrix representation, and then find the next row, insert it, and so on. (This is being done to avoid the need to have one big NxN matrix in memory).The matrix is also symmetric, so the row that the subroutines produce is such that any non-zero element can be present only in that part of the row corresponding to the upper triangle of the matrix. (all others are zero). After I have the matrix in sparse format, I want to find all the eigenvalues and eigenvectors.<br>
<br>Till now I have been using the SeqAij matrix and MatSetValues method with preallocation set appropriately, but I am not satisfied with its performance (the way I am doing it). When one row is produced, I insert it into the AIJ matrix, so there are total of N calls to MatSetValues. Also even though the matrix is symmetric, i have to enter the full matrix, as otherwise the eigensolver doesnt seem to produce the right answer (Why ? I set the problem type to EPS_HEP, but still it requires me to store the full matrix ? It is written in documentation that problem type should always be specified so that the eigensolver can take advantage of it (symmetry in this case), but considering that I still have to store the full matrix, it meant 'advantage' only in time, not memory ?....when I set the problem type to EPS_HEP, it means that it will take only the upper or lower triangle right ? why should it require both ? Is this because the matrix type is not symmetric, unlike SBAIJ ?)<br>
<br>So, if I use SBAIJ and say, enter some bs rows at a time into the SBAIJ matrix, will it be faster ? Also, in that case would I still have to enter both upper and lower triangle or only one (I hope only one, otherwise the 'S' doesnt make sense to me, but in that case, which one ? The eigensolver doesnt give me an option to specify if the upper or lower triangle is stored in the matrix in case the problem type is EPS_HEP). Will the eigensolver produce the right answers in this case ? (say, storing only upper triangle in SBAIJ, instead of both)<br>
<br>Otherwise, while using AIJ, if I insert multiple rows at a time instead of just one (thus reducing the number of calls to MatSetValues, at the cost of more memory), will this be much beneficial ? (Please note that the matrix is not very sparse)<br>
<br><br><br>Thank you very much in advance !!!<br><br><br>Shitij<br>