[Trilinos-Users] Trouble with Teuchos Epetra_CrsMatrix

SungHwan Choi sunghwanchoi91 at gmail.com
Wed Mar 6 04:42:01 MST 2013


Dear all,

I'm confusing how to use teuchos epetra_crsmatrix in the following case.
(using c++)

------------------------------------------------------------------------------------------------------
class A{
  Teuchos::RCP<Epetra_CrsMatrix> matrix;
  A::A(){
    matrix=Teuchos::rcp(new Epetra_CrsMatrix(blah, blah, ...));
    B* b=new B();
    B->compute(matrix);
    xxxxx
    xxxxx
  }
}

class B{
  void B::compute(Teuchos::RCP<Epetra_CrsMatrix> matrix){
    matrix->InsertGlobalValues(blah, blah, ...);
  }
}
------------------------------------------------------------------------------------------------------

I declare "Teuchos::RCP<Epetra_CrsMatrix> matrix" in class A, and insert
values of matrix using the function in class B.
Also, xxxxx in class A, I want to calculate something with "matrix" (For
example, calculate another value with "matrix").
The above description is right or wrong?
Thank you.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://software.sandia.gov/pipermail/trilinos-users/attachments/20130306/6d70b49e/attachment.html 


More information about the Trilinos-Users mailing list