# [Trilinos-Users] troubles on setting anasazi problem

Pavel Jiránek pavel.jiranek at gmail.com
Thu Dec 27 08:04:16 MST 2012

```Hello SungHwan,

You need to set the number of requested eigenvalues using the method
setNEV() before calling setProblem().

Cheers,
Pavel Jiranek

2012/12/27 SungHwan Choi <sunghwanchoi91 at gmail.com>

> Hello,
> I have little trouble with anasazi. reffering example in didasko, I have
> written my own code but I have troubles. I think this is really easy to
> someone who are familiar to anasazi and Teuchos package. unfortunatly not
> me. Do you know how to solve the problem?
>
> here is my code, kinetic_matrix is defined as Epetra_CrsMatrix*
> kinetic_matrix
>
>
>
>
>
>     Teuchos::RCP<Epetra_CrsMatrix> matrix = Teuchos::rcp( kinetic_matrix ,
> false);
>     // Create an Anasazi MultiVector, based on Epetra MultiVector
>     const Epetra_Map * Map = &(kinetic_matrix->RowMap());
>     Teuchos::RCP<Epetra_MultiVector> ivec = Teuchos::rcp( new
> Epetra_MultiVector(*Map,1) );
>     //Teuchos::RCP<Epetra_MultiVector> ivec = Teuchos::rcp(  );
>     // Fill it with random numbers
>     ivec->Random();
>     // Setup the eigenproblem, with the matrix A and the initial vectors
> ivec
>     Teuchos::RCP< Anasazi::BasicEigenproblem<double,MV,OP> > MyProblem =
> Teuchos::rcp( new Anasazi::BasicEigenproblem<double,MV,OP>(matrix, ivec) );
>     MyProblem->setHermitian(true);
>     bool ierr = MyProblem->setProblem();
>     cout << ierr << endl;
>
> results is 0 which means that setting problem has problem. Do you have any
> hints to my trouble?
>
> Happy new year~
> _______________________________________________
> Trilinos-Users mailing list
> Trilinos-Users at software.sandia.gov
> http://software.sandia.gov/mailman/listinfo/trilinos-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://software.sandia.gov/pipermail/trilinos-users/attachments/20121227/b7c6dcf4/attachment.html
```