[Trilinos-Users] [EXTERNAL] Anasazi getSolusion

Thornquist, Heidi K hkthorn at sandia.gov
Mon Mar 25 13:57:26 MDT 2013


Hi Sunghwan,

The Eigensolution object is a container that has the eigenvalues and eigenvectors that were computed by the eigensolver.
Since you are using Epetra for the linear algebra, the eigenvectors are returned to you as a reference counted pointer (Teuchos::RCP) to an Epetra_Multivector. The reference counted pointer is used to help ensure that memory is not leaked, so this object avoids copying the Epetra_Multivector object containing the eigenvectors and instead counts the number of objects that refer to it.  What that means is that in the example below, evecs will still have a valid pointer to the Epetra_Multivector object containing the eigenvectors even if the Anasazi::Eigenproblem and Anasazi::SolverManager are deleted.

Anasazi::Eigensolution<double,Epetra_Multivector> sol = MyProblem->getSolution();
std::vector<Anasazi::Value<double> > evals = sol.Evals;
Teuchos::RCP<Epetra_Multivector> evecs = sol.Evecs;

If, for some reason, you need to copy the Epetra_Multivector you can use the copy constructor for *evecs:

Epetra_MultiVector<http://trilinos.sandia.gov/packages/docs/r11.0/packages/epetra/doc/html/classEpetra__MultiVector.html#ab30d44b8a9a960ea5ab5297e30319290> (const Epetra_MultiVector<http://trilinos.sandia.gov/packages/docs/r11.0/packages/epetra/doc/html/classEpetra__MultiVector.html> &Source)


Thanks,
Heidi


________________________________
From: trilinos-users-bounces at software.sandia.gov [trilinos-users-bounces at software.sandia.gov] on behalf of Sunghwan Choi [sunghwanchoi91 at gmail.com]
Sent: Monday, March 25, 2013 8:16 AM
To: trilinos-users at software.sandia.gov
Subject: [EXTERNAL] [Trilinos-Users] Anasazi getSolusion

Hi,
I want to get eigenvector from the class which contains eigensolver.

If I put Teuchos::RCP<Epetra_MultiVector> as argument and do below codes

////////make object of solution class
Anasazi::Eigensolution<double, Epetra_MultiVector> sol = MyProblem->getSolution();
//////// eigenvector is argument of this function
eigenvector =  (sol.Evecs);

Epetra_MultiVector is not copied as far as I tested. I don’t know how to copy eigenvector to other class

Please let me know or give me a piece of advices

Sunghwan Choi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://software.sandia.gov/pipermail/trilinos-users/attachments/20130325/5b884824/attachment.html 


More information about the Trilinos-Users mailing list